@sheetxl/utils-react 0.7.20 → 0.7.21

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/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.20
2
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.21
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.
@@ -12,8 +12,8 @@ import { mergeRefs as L } from "react-merge-refs";
12
12
  import { useMeasure as M } from "react-use";
13
13
  import T from "clsx";
14
14
  import { createRoot as C } from "react-dom/client";
15
- import { unstable_batchedUpdates as k, createPortal as P } from "react-dom";
16
- const D = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, z = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, A = { BackSpace: 8, Tab: 9, Clear: 12, Enter: 13, Shift: 16, Control: 17, Alt: 18, Pause: 19, CapsLock: 20, Escape: 27, Space: 32, PageUp: 33, PageDown: 34, End: 35, Home: 36, Left: 37, Up: 38, Right: 39, Down: 40, Insert: 45, Delete: 46, Digit_8: 56, Y: 89, Z: 90, Meta: 91, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NumLock: 144, ScrollLock: 145, BackSlash: 220, Slash: 191, BracketRight: 221, BracketLeft: 219 }, B = { Left: 1, Middle: 2, Right: 3 };
15
+ import { unstable_batchedUpdates as k, createPortal as D } from "react-dom";
16
+ const P = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, z = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, A = { BackSpace: 8, Tab: 9, Clear: 12, Enter: 13, Shift: 16, Control: 17, Alt: 18, Pause: 19, CapsLock: 20, Escape: 27, Space: 32, PageUp: 33, PageDown: 34, End: 35, Home: 36, Left: 37, Up: 38, Right: 39, Down: 40, Insert: 45, Delete: 46, Digit_8: 56, Y: 89, Z: 90, Meta: 91, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NumLock: 144, ScrollLock: 145, BackSlash: 220, Slash: 191, BracketRight: 221, BracketLeft: 219, Composition: 229 }, B = { Left: 1, Middle: 2, Right: 3 };
17
17
  class $ {
18
18
  constructor(t2, e2, n2, o2) {
19
19
  this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = t2, this._target = e2, this._applyProps(n2 || {}), this._callback = o2, void 0 === o2 && (this._callback = () => {
@@ -654,19 +654,19 @@ kt || (kt = (t2, e2, n2 = {}) => {
654
654
  }), []), n3;
655
655
  };
656
656
  });
657
- const Pt = kt;
658
- let Dt = () => {
657
+ const Dt = kt;
658
+ let Pt = () => {
659
659
  console.warn("You must call useEditMode before setting its state.");
660
660
  };
661
- const zt = Pt(null, () => {
661
+ const zt = Dt(null, () => {
662
662
  const [t2, e2] = d(null);
663
- return Dt = e2, t2;
663
+ return Pt = e2, t2;
664
664
  }), At = () => {
665
665
  const t2 = zt();
666
666
  return h(() => ({ setMode: (t3) => {
667
- Dt((e2) => ("function" == typeof t3 && (t3 = t3(e2)), t3?.onModeChange?.(t3 ?? null), t3));
667
+ Pt((e2) => ("function" == typeof t3 && (t3 = t3(e2)), t3?.onModeChange?.(t3 ?? null), t3));
668
668
  }, getMode: () => t2 }), [t2]);
669
- }, Bt = Pt({ setClipboard: (t2) => {
669
+ }, Bt = Dt({ setClipboard: (t2) => {
670
670
  throw new Error("This is only available via the useClipboard.");
671
671
  }, getClipboard: () => o.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
672
672
  const [t2, e2] = d(o.Global);
@@ -874,7 +874,7 @@ const Jt = ({ children: t2 }) => {
874
874
  };
875
875
  }, [e2]), x(E, { children: t2 });
876
876
  }, Qt = () => null, te = {}, ee = (t2) => {
877
- const { onPointerDown: e2, style: n2, splitDirection: o2, paddingBefore: r2 = 0, paddingAfter: i2 = 0, disabled: s2, key: l2, hitAreaProps: a2 = te, ...c2 } = t2, h2 = "row" === o2, { style: u2, className: d2, ...p2 } = a2;
877
+ const { onPointerDown: e2, style: n2, splitDirection: o2, paddingBefore: r2 = 0, paddingAfter: i2 = 0, disabled: s2, key: l2, propsHitArea: a2 = te, ...c2 } = t2, h2 = "row" === o2, { style: u2, className: d2, ...p2 } = a2;
878
878
  return x("div", { style: { ...n2, position: "relative" }, ...c2, children: x("div", { className: T("hit-box", d2), style: { left: (h2 ? -r2 : 0) + "px", width: `calc(100% + ${h2 ? r2 + i2 : 0}px)`, top: (h2 ? 0 : -r2) + "px", height: `calc(100% + ${h2 ? 0 : r2 + i2}px)`, position: "absolute", ...u2 }, onPointerDown: s2 ? void 0 : e2, ...p2 }) }, l2);
879
879
  }, ne = {}, oe = (t2, e2, n2 = true) => null === t2 ? null : null !== t2.pixels ? n2 ? t2.pixels : e2 - t2.pixels : (n2 ? t2.percent : 100 - t2.percent) / 100 * e2, re = (t2, e2 = true) => t2?.percent ? `${e2 ? t2.percent : 100 - t2.percent}%` : t2?.pixels ? `${t2.pixels}px` : void 0, ie = (t2, e2) => {
880
880
  if (null == t2) return null;
@@ -882,7 +882,7 @@ const Jt = ({ children: t2 }) => {
882
882
  let o2 = e2;
883
883
  return "string" == typeof t2 && ((t2 = t2.trim().toLowerCase()).endsWith("px") ? (t2 = t2.substring(0, t2.length - 2), o2 = false) : t2.endsWith("%") && (t2 = t2.substring(0, t2.length - 1), o2 = true), t2 = parseFloat(t2)), o2 ? n2.percent = t2 : n2.pixels = t2, Object.freeze(n2);
884
884
  }, se = p(m((t2, e2) => {
885
- const { elementBefore: n2, elementAfter: o2, splitDirection: r2 = "row", fixedPane: i2 = null, position: s2, onPositionChange: c2, minBefore: p2, maxBefore: m2, minAfter: f2, maxAfter: _2, children: g2, className: y2, style: v2, disabled: w2 = false, onDragStart: b2, onDragResize: E2, onDragFinish: C2, resizerProps: k2 = ne, paneProps: P2 = ne, paneBeforeProps: D2 = ne, paneAfterProps: z2 = ne, createResizer: A2 = ee } = t2;
885
+ const { elementBefore: n2, elementAfter: o2, splitDirection: r2 = "row", fixedPane: i2 = null, position: s2, onPositionChange: c2, minBefore: p2, maxBefore: m2, minAfter: f2, maxAfter: _2, children: g2, className: y2, style: v2, disabled: w2 = false, onDragStart: b2, onDragResize: E2, onDragFinish: C2, propsResizer: k2 = ne, propsPane: D2 = ne, propsPaneBefore: P2 = ne, propsPaneAfter: z2 = ne, renderResizer: A2 = ee } = t2;
886
886
  if (g2) throw new Error("Use elementBefore and elementAfter instead of children.");
887
887
  const B2 = h(() => l.isValidElement(o2) && l.isValidElement(n2), [o2, n2]), $2 = h(() => {
888
888
  let t3 = null;
@@ -900,7 +900,7 @@ const Jt = ({ children: t2 }) => {
900
900
  h2 = (oe(o3.maxAfter, e3, false) ?? n3) - n3, u2 = oe(o3.minAfter, e3, false) ?? e3, d2 = Math.max(a2, h2), p3 = Math.min(c3, u2), s3 = Math.max(d2, Math.min(s3, p3)), u2 = Math.min(l2 - s3, oe(o3.maxAfter, l2 - s3, true) ?? l2), h2 = Math.min(l2 - s3, oe(o3.minAfter, l2 - s3, true) ?? l2), r3[0] = s3, r3[1] = l2 - r3[0];
901
901
  const m3 = Math.max(0, Math.min(100, s3 / l2 * 100));
902
902
  return i3[0] = m3, i3[1] = 100 - i3[0], { percents: i3, pixels: r3, minBefore: `${a2}px`, minAfter: `${h2}px`, maxBefore: `${r3[0]}px`, maxAfter: `${r3[1]}px` };
903
- })(O2, X2, j2, $2), [$2, O2, X2, j2, r2]), [U2, G2] = d(false), q2 = ht(b2, [b2]), Z2 = ht(E2, [E2]), J2 = ht(C2, [C2]), Q2 = a(null), tt2 = a(null), et2 = a(null), { style: nt2, className: ot2, ...rt2 } = P2, it2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...nt2 }, { className: st2, style: lt2, ...at2 } = D2, { className: ct2, style: ut2, ...dt2 } = z2, pt2 = { flex: "1 1 100%", width: "100%", ...v2, flexDirection: r2, display: "flex" }, { className: mt2, style: ft2, onPointerDown: _t2, ...gt2 } = k2, yt2 = ht((t3) => {
903
+ })(O2, X2, j2, $2), [$2, O2, X2, j2, r2]), [U2, G2] = d(false), q2 = ht(b2, [b2]), Z2 = ht(E2, [E2]), J2 = ht(C2, [C2]), Q2 = a(null), tt2 = a(null), et2 = a(null), { style: nt2, className: ot2, ...rt2 } = D2, it2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...nt2 }, { className: st2, style: lt2, ...at2 } = P2, { className: ct2, style: ut2, ...dt2 } = z2, pt2 = { flex: "1 1 100%", width: "100%", ...v2, flexDirection: r2, display: "flex" }, { className: mt2, style: ft2, onPointerDown: _t2, ...gt2 } = k2, yt2 = ht((t3) => {
904
904
  const e3 = ie(t3, null === i2);
905
905
  I2(e3);
906
906
  }, [i2]), vt2 = ht((t3) => {
@@ -923,11 +923,11 @@ const Jt = ({ children: t2 }) => {
923
923
  if (!n2) return null;
924
924
  const t3 = { ...it2, ...lt2, flex: 0 === $2.fixedPaneOffset && null !== Y2?.pixels[0] ? `0 0 ${Math.round(Y2?.pixels[0])}px` : `1 1 ${Math.round(Y2?.percents[0] ?? 100)}%`, [`min${Et2}`]: Y2?.minBefore, [`max${Et2}`]: o2 ? Y2?.maxBefore : "100%" };
925
925
  return x("div", { ref: Q2, className: T("before", ot2, st2), style: t3, ...rt2, ...at2, children: n2 }, "before");
926
- }, [n2, P2, D2, $2, Y2]), Mt2 = h(() => {
926
+ }, [n2, D2, P2, $2, Y2]), Mt2 = h(() => {
927
927
  if (!o2) return null;
928
928
  const t3 = { ...it2, ...ut2, flex: 1 === $2.fixedPaneOffset && null !== Y2?.pixels[1] ? `0 0 ${Math.round(Y2?.pixels[1])}px` : `1 1 ${Math.round(Y2?.percents[1] ?? 100)}%`, [`min${Et2}`]: Y2?.minAfter, [`max${Et2}`]: n2 ? Y2?.maxAfter : "100%" };
929
929
  return x("div", { ref: et2, className: T("after", ot2, ct2), style: t3, ...rt2, ...dt2, children: o2 }, "after");
930
- }, [o2, P2, z2, $2, Y2]);
930
+ }, [o2, D2, z2, $2, Y2]);
931
931
  return S("div", { ref: L([N2, xt2]), className: T("splitPane", "row" === r2 ? "vertical" : "horizontal", { dragging: U2 }, y2), style: pt2, children: [Lt2, St2, Mt2] });
932
932
  }));
933
933
  function le(t2) {
@@ -1159,9 +1159,9 @@ function de() {
1159
1159
  }
1160
1160
  se.displayName = "SplitPane";
1161
1161
  const pe = de();
1162
- pe.register("base", () => import("./DIUtMpFEGWd4fFvO.mjs"));
1162
+ pe.register("base", () => import("./4mSSJ5fhNdMhHCE6.mjs"));
1163
1163
  const me = (t2) => x("svg", { ...t2, children: x("path", {}) }), fe = { Icon: "_Icon_17dpm_10" }, _e = p((e2) => {
1164
- const { iconKey: n2, packKey: o2, className: r2, style: i2, role: s2, title: a2, size: c2, ariaHidden: u2, sourceProps: d2, children: p2, ...m2 } = e2, [f2, _2] = l.useState(null);
1164
+ const { iconKey: n2, packKey: o2, className: r2, style: i2, role: s2, title: a2, size: c2, ariaHidden: u2, propsSource: d2, children: p2, ...m2 } = e2, [f2, _2] = l.useState(null);
1165
1165
  l.useEffect(() => {
1166
1166
  let e3 = true, r3 = o2, i3 = n2;
1167
1167
  if (!i3) {
@@ -1191,13 +1191,13 @@ const me = (t2) => x("svg", { ...t2, children: x("path", {}) }), fe = { Icon: "_
1191
1191
  const t2 = y2.react, e3 = { className: L2, style: M2, role: T2, "aria-hidden": C2, title: a2, ...m2, ...d2 };
1192
1192
  return k2(x(t2, { ...e3 }));
1193
1193
  }
1194
- const P2 = { viewBox: w2?.viewBox ?? g2?.meta.defaultViewBox ?? "0 0 24 24" };
1194
+ const D2 = { viewBox: w2?.viewBox ?? g2?.meta.defaultViewBox ?? "0 0 24 24" };
1195
1195
  if ("function" == typeof w2) {
1196
- return k2(w2(P2) ?? x(me, { ...P2 }));
1196
+ return k2(w2(D2) ?? x(me, { ...D2 }));
1197
1197
  }
1198
- if (!w2) return k2(x(me, { ...P2 }));
1199
- const D2 = w2.paths;
1200
- return k2(x("svg", { ...P2, children: D2 ? D2.map((t2, e3) => x("path", { d: t2.d, className: t2.className, fill: t2.fill, stroke: t2.stroke, opacity: t2.opacity, fillRule: t2.fillRule, clipRule: t2.clipRule }, e3)) : null }));
1198
+ if (!w2) return k2(x(me, { ...D2 }));
1199
+ const P2 = w2.paths;
1200
+ return k2(x("svg", { ...D2, children: P2 ? P2.map((t2, e3) => x("path", { d: t2.d, className: t2.className, fill: t2.fill, stroke: t2.stroke, opacity: t2.opacity, fillRule: t2.fillRule, clipRule: t2.clipRule }, e3)) : null }));
1201
1201
  });
1202
1202
  function ge(t2) {
1203
1203
  const { isWalking: e2 = false, themedType: n2 = "info", speed: o2 = 120, dashGap: r2 = 3, dashLength: i2 = 5, iconKey: s2, packKey: l2, style: a2, className: c2, ...u2 } = t2, d2 = h(() => {
@@ -1336,24 +1336,24 @@ class Me {
1336
1336
  return window.addEventListener("storage", e2), () => window.removeEventListener("storage", e2);
1337
1337
  }
1338
1338
  }
1339
- const Te = { Horizontal: "horizontal", Vertical: "vertical" }, Ce = { scrollbar: "_scrollbar_gqxsx_24", track: "_track_gqxsx_35", thumb: "_thumb_gqxsx_47", "scrollbar-button": "_scrollbar-button_gqxsx_89", "touch-thumb": "_touch-thumb_gqxsx_124" }, ke = "M 5.4951012,0.62494002 7.1746358,3.4734472 8.8557603,6.3226744 c 0.13425,0.2277477 0.18228,0.4945506 0.1356,0.7535218 -0.04665,0.2589712 -0.18504,0.4935661 -0.3908099,0.6625402 C 8.3948254,7.9076371 8.1348905,8.0001761 7.8664506,7.9999997 H 1.1503225 c -0.30278993,0 -0.59312985,-0.117841 -0.80720983,-0.3275159 -0.2140799,-0.2097042 -0.3343649,-0.4941244 -0.3343649,-0.7907107 -4.5e-4,-0.1955399 0.05205,-0.3876855 0.152205,-0.55688 L 1.8390472,3.4734031 3.5178618,0.62488125 C 3.7217717,0.27898385 4.0986166,0.0658413 4.5064365,0.0658413 c 0.4078199,0 0.7846648,0.21314255 0.9885747,0.55903995 z", Pe = "M 0.6632643,3.5136438 3.5117715,1.8341092 6.3609987,0.15298466 c 0.2277477,-0.13425 0.4945506,-0.18228 0.7535218,-0.1356 0.2589712,0.04665 0.4935661,0.18504 0.6625402,0.3908099 0.1689007,0.205725 0.2614397,0.4656599 0.2612633,0.73409984 v 6.7161281 c 0,0.3027899 -0.117841,0.5931298 -0.3275159,0.8072098 -0.2097042,0.2140799 -0.4941244,0.3343649 -0.7907107,0.3343649 -0.1955399,4.5e-4 -0.3876855,-0.05205 -0.55688,-0.152205 L 3.5117274,7.1696978 0.6632056,5.4908832 C 0.31730817,5.2869733 0.10416562,4.9101284 0.10416562,4.5023085 c 0,-0.4078199 0.21314255,-0.7846648 0.55903998,-0.9885747 z", De = { transform: "rotate(180deg)" }, ze = (t2) => {
1340
- const { style: e2, orientation: n2 = Te.Vertical, disabled: o2, ...r2 } = t2, i2 = n2 === Te.Vertical ? ke : Pe;
1339
+ const Te = { Horizontal: "horizontal", Vertical: "vertical" }, Ce = { scrollbar: "_scrollbar_gqxsx_24", track: "_track_gqxsx_35", thumb: "_thumb_gqxsx_47", "scrollbar-button": "_scrollbar-button_gqxsx_89", "touch-thumb": "_touch-thumb_gqxsx_124" }, ke = "M 5.4951012,0.62494002 7.1746358,3.4734472 8.8557603,6.3226744 c 0.13425,0.2277477 0.18228,0.4945506 0.1356,0.7535218 -0.04665,0.2589712 -0.18504,0.4935661 -0.3908099,0.6625402 C 8.3948254,7.9076371 8.1348905,8.0001761 7.8664506,7.9999997 H 1.1503225 c -0.30278993,0 -0.59312985,-0.117841 -0.80720983,-0.3275159 -0.2140799,-0.2097042 -0.3343649,-0.4941244 -0.3343649,-0.7907107 -4.5e-4,-0.1955399 0.05205,-0.3876855 0.152205,-0.55688 L 1.8390472,3.4734031 3.5178618,0.62488125 C 3.7217717,0.27898385 4.0986166,0.0658413 4.5064365,0.0658413 c 0.4078199,0 0.7846648,0.21314255 0.9885747,0.55903995 z", De = "M 0.6632643,3.5136438 3.5117715,1.8341092 6.3609987,0.15298466 c 0.2277477,-0.13425 0.4945506,-0.18228 0.7535218,-0.1356 0.2589712,0.04665 0.4935661,0.18504 0.6625402,0.3908099 0.1689007,0.205725 0.2614397,0.4656599 0.2612633,0.73409984 v 6.7161281 c 0,0.3027899 -0.117841,0.5931298 -0.3275159,0.8072098 -0.2097042,0.2140799 -0.4941244,0.3343649 -0.7907107,0.3343649 -0.1955399,4.5e-4 -0.3876855,-0.05205 -0.55688,-0.152205 L 3.5117274,7.1696978 0.6632056,5.4908832 C 0.31730817,5.2869733 0.10416562,4.9101284 0.10416562,4.5023085 c 0,-0.4078199 0.21314255,-0.7846648 0.55903998,-0.9885747 z", Pe = { transform: "rotate(180deg)" }, ze = (t2) => {
1340
+ const { style: e2, orientation: n2 = Te.Vertical, disabled: o2, ...r2 } = t2, i2 = n2 === Te.Vertical ? ke : De;
1341
1341
  return x("button", { style: e2, className: T(Ce["scrollbar-button"], n2, "scroll-button"), disabled: o2, ...r2, children: x("svg", { width: "9", height: "9", viewBox: "0 0 9 9", children: x("path", { d: i2 }) }) });
1342
1342
  }, Ae = (t2) => {
1343
- const { style: e2, orientation: n2 = Te.Vertical, disabled: o2, ...r2 } = t2, i2 = n2 === Te.Vertical ? ke : Pe;
1344
- return x("button", { style: e2, className: T(Ce["scrollbar-button"], n2, "scroll-button"), disabled: o2, ...r2, children: x("svg", { width: "9", height: "9", viewBox: "0 0 9 9", style: De, children: x("path", { d: i2 }) }) });
1343
+ const { style: e2, orientation: n2 = Te.Vertical, disabled: o2, ...r2 } = t2, i2 = n2 === Te.Vertical ? ke : De;
1344
+ return x("button", { style: e2, className: T(Ce["scrollbar-button"], n2, "scroll-button"), disabled: o2, ...r2, children: x("svg", { width: "9", height: "9", viewBox: "0 0 9 9", style: Pe, children: x("path", { d: i2 }) }) });
1345
1345
  }, Be = (t2) => {
1346
1346
  const { style: e2, orientation: n2 = Te.Vertical, ...o2 } = t2, r2 = n2 === Te.Vertical;
1347
1347
  return x("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...e2 }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} edge`, ...o2, children: x("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: r2 ? "rotate(90) " : "", children: x("path", { style: { transition: "opacity 240ms ease 0s", opacity: t2.disabled ? 0 : 1 }, d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }) }) });
1348
1348
  }, $e = N().supportsTouchEvents, Ke = p(m((t2, e2) => {
1349
1349
  const { borderColor: n2 = "var(--sxl-app-color-primary, rgb(33, 115, 70))", backgroundColor: o2 = "var(--sxl-app-color-background, white)", fillColor: r2 = "var(--sxl-app-color-grey, grey)", borderWidth: i2 = 3, size: s2 = 22, style: l2, className: c2, onPointerDown: p2, onPointerMove: m2, onPointerUp: f2, orientation: _2 = Te.Vertical, offset: g2 = 0, currentTouchAnchor: y2, elementParent: v2, elementRoot: w2, key: b2, ...M2 } = t2;
1350
1350
  if (!$e) return null;
1351
- const C2 = ht(p2, [p2]), k2 = ht(m2, [m2]), D2 = ht(f2, [f2]), z2 = _2 === Te.Vertical, [A2, B2] = d(false), $2 = _t(h(() => ({ processTouch: true, consumeTouch: true, onPointerDown: (t3, e3) => {
1351
+ const C2 = ht(p2, [p2]), k2 = ht(m2, [m2]), P2 = ht(f2, [f2]), z2 = _2 === Te.Vertical, [A2, B2] = d(false), $2 = _t(h(() => ({ processTouch: true, consumeTouch: true, onPointerDown: (t3, e3) => {
1352
1352
  B2(true), C2?.(t3), t3.preventDefault(), t3.stopPropagation();
1353
1353
  }, onPointerMoveOrWait: (t3, e3, n3) => {
1354
1354
  k2?.(t3);
1355
1355
  }, onPointerUp: (t3, e3, n3) => {
1356
- B2(false), D2?.(n3), t3.preventDefault(), t3.stopPropagation();
1356
+ B2(false), P2?.(n3), t3.preventDefault(), t3.stopPropagation();
1357
1357
  } }), [])), K2 = h(() => {
1358
1358
  const t3 = s2 / 2 + i2 / 2 + 6;
1359
1359
  return { x: z2 ? -t3 : g2 + s2, y: z2 ? g2 + s2 : -t3, width: 0, height: 0 };
@@ -1363,12 +1363,12 @@ const Te = { Horizontal: "horizontal", Vertical: "vertical" }, Ce = { scrollbar:
1363
1363
  if (!t3) return void F2(null);
1364
1364
  let a2 = 0, h2 = 0, u2 = v2;
1365
1365
  for (; u2; ) a2 += u2.scrollLeft, h2 += u2.scrollTop, u2 = w2 && u2 === w2.parentElement ? null : u2.parentElement;
1366
- F2(P(x("div", { className: T("touch-thumb", Ce["touch-thumb"], c2, Ce, { dragging: A2 }), ref: e2, style: { left: a2 + (t3?.x ?? 0) - (s2 + i2) / 2, top: h2 + (t3?.y ?? 0) - (s2 + i2) / 2, width: z2 ? s2 : 1.8 * s2, height: z2 ? 1.8 * s2 : s2, borderWidth: `${i2}px`, boxShadow: A2 ? `${o2} 0px 0px 0px 1.5px` : void 0, borderStyle: "solid", borderColor: n2, backgroundColor: o2, opacity: y2 ? 0 : void 0, transitionDuration: "160ms", backgroundImage: `url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${r2}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center center", ...l2 }, tabIndex: -1, onPointerDown: $2, ...M2 }), w2 ?? R2(), b2));
1366
+ F2(D(x("div", { className: T("touch-thumb", Ce["touch-thumb"], c2, Ce, { dragging: A2 }), ref: e2, style: { left: a2 + (t3?.x ?? 0) - (s2 + i2) / 2, top: h2 + (t3?.y ?? 0) - (s2 + i2) / 2, width: z2 ? s2 : 1.8 * s2, height: z2 ? 1.8 * s2 : s2, borderWidth: `${i2}px`, boxShadow: A2 ? `${o2} 0px 0px 0px 1.5px` : void 0, borderStyle: "solid", borderColor: n2, backgroundColor: o2, opacity: y2 ? 0 : void 0, transitionDuration: "160ms", backgroundImage: `url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${r2}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center center", ...l2 }, tabIndex: -1, onPointerDown: $2, ...M2 }), w2 ?? R2(), b2));
1367
1367
  }, [I2, A2, n2, o2, r2, N2, K2?.x, K2?.y, K2?.width, K2?.height, c2, y2, o2, s2, i2, n2, v2, W2, b2]), K2 ? S(E, { children: [x("div", { ref: L([O2, H2]), style: { position: "absolute", left: K2.x, top: K2.y, opacity: 0 } }), V2] }) : null;
1368
1368
  }));
1369
1369
  Ke.displayName = "TouchThumbHandle";
1370
1370
  const Oe = 24, Ie = p(m((t2, e2) => {
1371
- const { offset: n2 = 0, totalSize: o2 = 0, viewportSize: r2 = 0, style: i2, className: s2, orientation: l2 = Te.Vertical, onScrollOffset: c2, onScroll: p2, showCustomScrollButtons: m2, scrollButtonIncrement: _2 = 200, scrollButtonInitialRepeatDelay: g2 = 260, scrollButtonAdditionalRepeatDelay: y2 = 120, minThumbSize: v2 = Oe, maxThumbSize: w2, createScrollStartButton: b2 = ze, createScrollEndButton: C2 = Ae, touchThumbProps: k2, thumbProps: P2, onMouseDown: D2, ...z2 } = t2, A2 = "touch" === N().primaryInput, B2 = m2 ?? !A2;
1371
+ const { offset: n2 = 0, totalSize: o2 = 0, viewportSize: r2 = 0, style: i2, className: s2, orientation: l2 = Te.Vertical, onScrollOffset: c2, onScroll: p2, showCustomScrollButtons: m2, scrollButtonIncrement: _2 = 200, scrollButtonInitialRepeatDelay: g2 = 260, scrollButtonAdditionalRepeatDelay: y2 = 120, minThumbSize: v2 = Oe, maxThumbSize: w2, renderScrollButtonStart: b2 = ze, renderScrollButtonEnd: C2 = Ae, propsTouchThumb: k2, propsThumb: D2, onMouseDown: P2, ...z2 } = t2, A2 = "touch" === N().primaryInput, B2 = m2 ?? !A2;
1372
1372
  ht(p2, [p2]);
1373
1373
  const [$2, K2] = d({ offset: 0, length: 0, disabled: false }), O2 = a(-1), I2 = l2 === Te.Vertical, [H2, { width: R2, height: W2 }] = M(), V2 = I2 ? W2 : R2, F2 = ht((t3, e3, n3) => {
1374
1374
  if (0 === e3 || 0 === n3) {
@@ -1393,7 +1393,7 @@ const Oe = 24, Ie = p(m((t2, e2) => {
1393
1393
  G2(true), q2.current = I2 ? t3.clientY : t3.clientX, Z2.current = $2.offset;
1394
1394
  }, [I2, $2]), tt2 = ht((t3) => {
1395
1395
  t3.currentTarget.setPointerCapture(t3.pointerId), Q2(t3), t3.stopPropagation();
1396
- }, [D2]), et2 = ht((t3) => {
1396
+ }, [P2]), et2 = ht((t3) => {
1397
1397
  if (!U2) return;
1398
1398
  const e3 = (I2 ? t3.clientY : t3.clientX) - q2.current, n3 = Z2.current + e3;
1399
1399
  j2(n3);
@@ -1417,9 +1417,9 @@ const Oe = 24, Ie = p(m((t2, e2) => {
1417
1417
  }, [I2, r2, o2, n2, Y2]), lt2 = a(null), at2 = h(() => {
1418
1418
  const t3 = $2.disabled;
1419
1419
  if (t3) return null;
1420
- const e3 = x("div", { ...P2, className: T(Ce.thumb, { disabled: t3 }), ref: lt2, role: "slider", "aria-label": I2 ? "Rows" : "Columns", "aria-orientation": I2 ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": Y2, "aria-valuenow": n2, tabIndex: 0, style: { ...P2?.style, position: "relative", [I2 ? "height" : "width"]: `${$2.length}px`, [I2 ? "width" : "height"]: "100%", transform: I2 ? `translateY(${$2.offset}px)` : `translateX(${$2.offset}px)`, [I2 ? "minHeight" : "minWidth"]: `${v2}px` }, onMouseDown: D2, onPointerDown: tt2, onPointerMove: nt2, onPointerUp: rt2 });
1420
+ const e3 = x("div", { ...D2, className: T(Ce.thumb, { disabled: t3 }), ref: lt2, role: "slider", "aria-label": I2 ? "Rows" : "Columns", "aria-orientation": I2 ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": Y2, "aria-valuenow": n2, tabIndex: 0, style: { ...D2?.style, position: "relative", [I2 ? "height" : "width"]: `${$2.length}px`, [I2 ? "width" : "height"]: "100%", transform: I2 ? `translateY(${$2.offset}px)` : `translateX(${$2.offset}px)`, [I2 ? "minHeight" : "minWidth"]: `${v2}px` }, onMouseDown: P2, onPointerDown: tt2, onPointerMove: nt2, onPointerUp: rt2 });
1421
1421
  return !A2 || t3 ? e3 : S(E, { children: [e3, x(Ke, { ...k2, offset: $2.offset, orientation: I2 ? Te.Vertical : Te.Horizontal, onPointerDown: Q2, onPointerMove: et2, onPointerUp: ot2 })] });
1422
- }, [$2, v2, Y2, n2, I2, A2, D2, k2, P2]), [ct2, ut2] = d(null), dt2 = ht(() => {
1422
+ }, [$2, v2, Y2, n2, I2, A2, P2, k2, D2]), [ct2, ut2] = d(null), dt2 = ht(() => {
1423
1423
  let t3;
1424
1424
  t3 = "function" == typeof _2 ? _2(n2, r2, o2) : n2 - _2;
1425
1425
  const e3 = Math.max(0, t3);
@@ -1447,7 +1447,7 @@ const Oe = 24, Ie = p(m((t2, e2) => {
1447
1447
  const t3 = { orientation: l2, disabled: n2 >= Y2, onMouseUp: _t2, onMouseLeave: _t2, onMouseDown: () => gt2(n2, true, false) };
1448
1448
  return C2?.(t3);
1449
1449
  }, [B2, l2, n2, Y2, ct2]), wt2 = I2 ? "vertical" : "horizontal";
1450
- return S("div", { ref: L([J2, e2]), className: T(s2, Ce.scrollbar, wt2, { dragging: U2, "has-touch-thumb": A2 }), style: i2, ...z2, children: [yt2, x("div", { ref: H2, role: "scrollbar", "aria-orientation": wt2, "aria-valuemin": 0, "aria-valuemax": Y2, "aria-valuenow": n2, tabIndex: 0, className: T(Ce.track, "track", wt2), onMouseDown: D2, onPointerDown: it2, onKeyDown: st2, children: at2 }), vt2] });
1450
+ return S("div", { ref: L([J2, e2]), className: T(s2, Ce.scrollbar, wt2, { dragging: U2, "has-touch-thumb": A2 }), style: i2, ...z2, children: [yt2, x("div", { ref: H2, role: "scrollbar", "aria-orientation": wt2, "aria-valuemin": 0, "aria-valuemax": Y2, "aria-valuenow": n2, tabIndex: 0, className: T(Ce.track, "track", wt2), onMouseDown: P2, onPointerDown: it2, onKeyDown: st2, children: at2 }), vt2] });
1451
1451
  }));
1452
1452
  let Ne = Date.now, He = 1e3, Re = {}, We = 1;
1453
1453
  const Ve = (t2) => {
@@ -1644,7 +1644,7 @@ class Ye {
1644
1644
  }
1645
1645
  }
1646
1646
  }
1647
- const Ue = (t2, e2) => x(Ie, { ...t2, ref: e2 }), Ge = Object.freeze(Object.defineProperty({ __proto__: null, defaultCreateScrollbar: Ue, getScrollTo: (t2, e2, n2, o2, r2 = 0) => {
1647
+ const Ue = (t2) => x(Ie, { ...t2 }), Ge = Object.freeze(Object.defineProperty({ __proto__: null, defaultRenderScrollbar: Ue, getScrollTo: (t2, e2, n2, o2, r2 = 0) => {
1648
1648
  for (let r3 = 0; r3 < n2.length; r3++) {
1649
1649
  const i2 = n2[r3].getBoundingClientRect();
1650
1650
  let s2 = i2.left - e2, l2 = s2 + i2.width;
@@ -1653,16 +1653,19 @@ const Ue = (t2, e2) => x(Ie, { ...t2, ref: e2 }), Ge = Object.freeze(Object.defi
1653
1653
  } else if (Math.ceil(l2) > Math.ceil(t2) + 2) return l2;
1654
1654
  }
1655
1655
  return r2;
1656
- } }, Symbol.toStringTag, { value: "Module" })), qe = { scrollpane: "_scrollpane_1fbi8_2", "vertical-container": "_vertical-container_1fbi8_7", "horizontal-corner-container": "_horizontal-corner-container_1fbi8_12", "scrollbar-sizer": "_scrollbar-sizer_1fbi8_26", "scrollpane-content": "_scrollpane-content_1fbi8_34", "scrollpane-content-element": "_scrollpane-content-element_1fbi8_43" }, Ze = ({ width: t2, height: e2 }) => x("div", { className: "corner", style: { minWidth: `${t2}px`, width: `${t2}px`, minHeight: `${e2}px`, height: `${e2}px` } }), Je = p(m((t2, e2) => {
1657
- const { children: n2, viewport: o2, onScrollViewport: r2, showHorizontalScrollbar: i2 = true, showVerticalScrollbar: s2 = true, createScrollCorner: l2 = Ze, createHorizontalScrollbar: c2 = Ue, createVerticalScrollbar: d2 = Ue, style: p2, className: m2, touchElement: _2, disableTouch: g2, ...y2 } = t2, v2 = i2 && c2, w2 = s2 && d2, b2 = ht(r2, [r2]), L2 = Ft(e2, () => ({ isScrollPane: () => true }), []), C2 = a(null);
1656
+ } }, Symbol.toStringTag, { value: "Module" })), qe = { scrollpane: "_scrollpane_1fbi8_2", "vertical-container": "_vertical-container_1fbi8_7", "horizontal-corner-container": "_horizontal-corner-container_1fbi8_12", "scrollbar-sizer": "_scrollbar-sizer_1fbi8_26", "scrollpane-content": "_scrollpane-content_1fbi8_34", "scrollpane-content-element": "_scrollpane-content-element_1fbi8_43" }, Ze = (t2) => {
1657
+ const e2 = t2?.width, n2 = t2?.height;
1658
+ return x("div", { className: "corner", style: { minWidth: `${e2}px`, width: `${e2}px`, minHeight: `${n2}px`, height: `${n2}px` } });
1659
+ }, Je = p(m((t2, e2) => {
1660
+ const { children: n2, viewport: o2, onScrollViewport: r2, showHorizontalScrollbar: i2 = true, showVerticalScrollbar: s2 = true, createScrollCorner: l2 = Ze, renderScrollbarHorizontal: c2 = Ue, renderScrollbarVertical: d2 = Ue, style: p2, className: m2, touchElement: _2, disableTouch: g2, ...y2 } = t2, v2 = i2 && c2, w2 = s2 && d2, b2 = ht(r2, [r2]), L2 = Ft(e2, () => ({ isScrollPane: () => true }), []), C2 = a(null);
1658
1661
  u(() => {
1659
1662
  C2.current && (C2.current.__scrollTop === o2?.top && C2.current.__scrollLeft === o2?.left || C2.current.__isDecelerating || C2.current?.scrollTo(o2?.left, o2?.top, false));
1660
1663
  }, [o2?.left, o2?.top, _2]);
1661
1664
  const k2 = f((t3, e3) => {
1662
1665
  b2?.({ left: t3, top: e3 });
1663
- }, []), P2 = f((t3) => {
1664
- C2.current?.doTouchStart(t3.touches, t3.timeStamp);
1665
1666
  }, []), D2 = f((t3) => {
1667
+ C2.current?.doTouchStart(t3.touches, t3.timeStamp);
1668
+ }, []), P2 = f((t3) => {
1666
1669
  t3.preventDefault(), C2.current?.doTouchMove(t3.touches, t3.timeStamp);
1667
1670
  }, []), z2 = f((t3) => {
1668
1671
  C2.current?.doTouchEnd(t3.timeStamp);
@@ -1676,10 +1679,10 @@ const Ue = (t2, e2) => x(Ie, { ...t2, ref: e2 }), Ge = Object.freeze(Object.defi
1676
1679
  const t4 = { scrollingX: true, scrollingY: true, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
1677
1680
  C2.current = new Ye(k2, t4);
1678
1681
  }
1679
- N().supportsTouchEvents && (t3.addEventListener("touchstart", P2), t3.addEventListener("touchend", z2), t3.addEventListener("touchmove", D2)), A2({ containerWidth: o2?.width, containerHeight: o2?.height, totalWidth: o2?.totalWidth, totalHeight: o2?.totalHeight });
1682
+ N().supportsTouchEvents && (t3.addEventListener("touchstart", D2), t3.addEventListener("touchend", z2), t3.addEventListener("touchmove", P2)), A2({ containerWidth: o2?.width, containerHeight: o2?.height, totalWidth: o2?.totalWidth, totalHeight: o2?.totalHeight });
1680
1683
  }
1681
1684
  return () => {
1682
- t3?.removeEventListener("touchstart", P2), t3?.removeEventListener("touchend", z2), t3?.removeEventListener("touchmove", D2);
1685
+ t3?.removeEventListener("touchstart", D2), t3?.removeEventListener("touchend", z2), t3?.removeEventListener("touchmove", P2);
1683
1686
  };
1684
1687
  }, [o2?.width, o2?.height, o2?.totalWidth, o2?.totalHeight, g2, _2]);
1685
1688
  const [B2, { width: $2 }] = M(), [K2, { height: O2 }] = M(), I2 = h(() => {
@@ -1699,7 +1702,7 @@ const Ue = (t2, e2) => x(Ie, { ...t2, ref: e2 }), Ge = Object.freeze(Object.defi
1699
1702
  }));
1700
1703
  Je.displayName = "ScrollPane";
1701
1704
  const Qe = 300, tn = 100, en = 1e6, nn = 100, on = 50, rn = p(m((t2, e2) => {
1702
- const { offset: n2 = 0, viewportSize: o2 = 0, totalSize: r2 = 0, minSize: i2 = 0, endGap: s2 = Qe, endScrollIncrement: l2 = tn, style: a2 = I, onMouseDown: c2, onScrollOffset: u2, onScroll: p2, scaleLimit: m2 = en, scaleFactor: _2 = nn, precisionFactor: g2 = on, createScrollbar: y2 = Ue, ...v2 } = t2;
1705
+ const { offset: n2 = 0, viewportSize: o2 = 0, totalSize: r2 = 0, minSize: i2 = 0, endGap: s2 = Qe, endScrollIncrement: l2 = tn, style: a2 = I, onMouseDown: c2, onScrollOffset: u2, onScroll: p2, scaleLimit: m2 = en, scaleFactor: _2 = nn, precisionFactor: g2 = on, renderScrollbar: y2 = Ue, ...v2 } = t2;
1703
1706
  p2 && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
1704
1707
  const w2 = ht(c2, [c2]), [b2, x2] = d(false), S2 = h(() => {
1705
1708
  const t3 = 0 === m2 ? r2 : Math.min(r2 ?? 0, Math.max(i2 ?? 0, (n2 ?? 0) + (o2 ?? 0)) + (s2 ?? 0)), e3 = 0 !== m2 && t3 > m2 ? _2 : 1, l3 = e3 / g2, a3 = Math.ceil(t3 / e3);
@@ -1713,7 +1716,7 @@ const Qe = 300, tn = 100, en = 1e6, nn = 100, on = 50, rn = p(m((t2, e2) => {
1713
1716
  }, []), T2 = f((t3) => {
1714
1717
  x2(true), w2?.(t3), document.addEventListener("mousemove", L2, { passive: true }), document.addEventListener("mouseup", M2, { passive: true });
1715
1718
  }, [L2, M2]);
1716
- return Ue({ style: a2, ...v2, offset: S2.offset, totalSize: S2.totalSize, viewportSize: S2.viewportSize, onMouseDown: T2, onScrollOffset: E2 }, e2);
1719
+ return y2({ style: a2, ...v2, offset: S2.offset, totalSize: S2.totalSize, viewportSize: S2.viewportSize, onMouseDown: T2, onScrollOffset: E2, ref: e2 });
1717
1720
  }));
1718
1721
  rn.displayName = "VirtualScrollbar";
1719
1722
  export {
@@ -1725,7 +1728,7 @@ export {
1725
1728
  _e as DynamicIcon,
1726
1729
  Qt as ErrorTestPanel,
1727
1730
  J as FocusKeyNavigation,
1728
- D as HorizontalAlignment,
1731
+ P as HorizontalAlignment,
1729
1732
  ye as InMemoryStore,
1730
1733
  A as KeyCodes,
1731
1734
  z as KeyModifiers,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/utils-react",
3
3
  "description": "Utils React - Utilities for React capabilities needed for all SheetXL components.",
4
- "version": "0.7.20",
4
+ "version": "0.7.21",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "type": "module",
7
7
  "exports": {
@@ -40,7 +40,7 @@
40
40
  "react"
41
41
  ],
42
42
  "dependencies": {
43
- "@sheetxl/utils": "^0.7.20",
43
+ "@sheetxl/utils": "^0.7.21",
44
44
  "clsx": "^2.1.1",
45
45
  "detect-it": "^4.0.1",
46
46
  "react-merge-refs": "^3.0.2",
package/types/index.d.ts CHANGED
@@ -23,25 +23,6 @@ declare function boundPixel(cssPoint: number, _increase?: boolean, _absOffset?:
23
23
 
24
24
  export declare type CellFinder = (activeCoords: CellCoords, isContentfulCell: IsContentfulCell | undefined, hiddenAt: HiddenHeadersAt | undefined, direction: Direction, first: boolean, limit: number) => number;
25
25
 
26
- export declare interface CellLayout {
27
- /**
28
- * Returns the offset given an index.
29
- */
30
- getColOffset: ItemSizer;
31
- /**
32
- * Returns the index given an offset.
33
- */
34
- getColIndex: ItemSizer;
35
- /**
36
- * Returns the offset given an index.
37
- */
38
- getRowOffset: ItemSizer;
39
- /**
40
- * Returns the index given an offset.
41
- */
42
- getRowIndex: ItemSizer;
43
- }
44
-
45
26
  export declare type ClickOrFocusAwayListener = (event: globalThis.MouseEvent | globalThis.KeyboardEvent) => void;
46
27
 
47
28
  export declare interface ClickOrFocusAwayOptions {
@@ -118,7 +99,7 @@ export declare interface CommandButtonOptions<STATE = any, CONTEXT = any> extend
118
99
  * Tooltip properties. If this is specified then the tooltips are used.
119
100
  * Do not provide a child as this component will be the child.
120
101
  */
121
- tooltipProps?: any;
102
+ propsTooltip?: any;
122
103
  /**
123
104
  * How the button will be styles.
124
105
  * @defaultValue CommandButtonType.Toolbar
@@ -291,12 +272,7 @@ export declare function createDynamicIconService(): {
291
272
  */
292
273
  declare const createSyntheticEvent: <T extends Element, E extends Event, R extends React.SyntheticEvent<T, E>>(event: E, currentTarget?: EventTarget & T) => R;
293
274
 
294
- declare const defaultCreateScrollbar: (props: ScrollbarProps, ref?: React.Ref<HTMLDivElement>) => JSX.Element;
295
-
296
- export declare const defaultCreateScrollCorner: ({ width, height }: {
297
- width: any;
298
- height: any;
299
- }) => JSX.Element;
275
+ export declare const defaultCreateScrollCorner: (size: Size) => JSX.Element;
300
276
 
301
277
  /**
302
278
  * TODO - implement styling support similar to other scroll buttons. Currently hardcoded
@@ -350,6 +326,8 @@ export declare class DefaultReactNotifier extends DefaultNotifier implements IRe
350
326
  showInput(options: ShowInputOptions): Promise<InputResults>;
351
327
  }
352
328
 
329
+ declare const defaultRenderScrollbar: (props: ScrollbarProps) => JSX.Element;
330
+
353
331
  /**
354
332
  * Re-export detectIt.
355
333
  *
@@ -400,7 +378,7 @@ export declare interface DynamicIconProps extends default_2.HTMLAttributes<HTMLE
400
378
  role?: 'img' | 'presentation' | string;
401
379
  ariaHidden?: boolean;
402
380
  /** Extra props forwarded to React glyphs (if the glyph is of type `react`) */
403
- sourceProps?: unknown;
381
+ propsSource?: unknown;
404
382
  }
405
383
 
406
384
  declare type DynamicValue<T, CONTEXT> = T | ((context?: DynamicContext<CONTEXT>) => T);
@@ -528,6 +506,25 @@ export declare const HorizontalAlignment: {
528
506
 
529
507
  export declare type HorizontalAlignment = typeof HorizontalAlignment[keyof typeof HorizontalAlignment];
530
508
 
509
+ export declare interface ICellLayout {
510
+ /**
511
+ * Returns the offset given an index.
512
+ */
513
+ getColOffset: ItemSizer;
514
+ /**
515
+ * Returns the index given an offset.
516
+ */
517
+ getColIndex: ItemSizer;
518
+ /**
519
+ * Returns the offset given an index.
520
+ */
521
+ getRowOffset: ItemSizer;
522
+ /**
523
+ * Returns the index given an offset.
524
+ */
525
+ getRowIndex: ItemSizer;
526
+ }
527
+
531
528
  export declare interface ICommand<STATE extends any = any, CONTEXT extends any = void> {
532
529
  /**
533
530
  * A unique key for the command. This is how the command is identified
@@ -997,6 +994,8 @@ export declare const KeyCodes: {
997
994
  readonly Slash: 191;
998
995
  readonly BracketRight: 221;
999
996
  readonly BracketLeft: 219;
997
+ /** Android/IME composition key - used when virtual keyboards send composite input */
998
+ readonly Composition: 229;
1000
999
  };
1001
1000
 
1002
1001
  export declare type KeyCodes = typeof KeyCodes[keyof typeof KeyCodes];
@@ -1283,7 +1282,7 @@ export declare type ScrollableViewport = {
1283
1282
  totalHeight: number;
1284
1283
  };
1285
1284
 
1286
- export declare const Scrollbar: default_2.NamedExoticComponent<ScrollbarProps & default_2.RefAttributes<IScrollbarElement>>;
1285
+ export declare const Scrollbar: default_2.NamedExoticComponent<Omit<ScrollbarProps, "ref"> & default_2.RefAttributes<IScrollbarElement>>;
1287
1286
 
1288
1287
  export declare const ScrollbarOrientation: {
1289
1288
  readonly Horizontal: "horizontal";
@@ -1329,20 +1328,24 @@ export declare interface ScrollbarProps extends default_2.HTMLAttributes<HTMLEle
1329
1328
  scrollButtonIncrement?: number | ((offset: number, viewport: number, totalSize: number) => number);
1330
1329
  scrollButtonInitialRepeatDelay?: number;
1331
1330
  scrollButtonAdditionalRepeatDelay?: number;
1332
- createScrollStartButton?: (props: ScrollButtonProps) => default_2.ReactElement;
1333
- createScrollEndButton?: (props: ScrollButtonProps) => default_2.ReactElement;
1334
- touchThumbProps?: Partial<TouchThumbHandleProps>;
1335
- thumbProps?: default_2.HTMLAttributes<HTMLElement>;
1331
+ renderScrollButtonStart?: (props: ScrollButtonProps) => default_2.ReactElement;
1332
+ renderScrollButtonEnd?: (props: ScrollButtonProps) => default_2.ReactElement;
1333
+ propsTouchThumb?: Partial<TouchThumbHandleProps>;
1334
+ propsThumb?: default_2.HTMLAttributes<HTMLElement>;
1335
+ /**
1336
+ * Reference to the underling element
1337
+ */
1338
+ ref?: default_2.Ref<IScrollbarElement>;
1336
1339
  }
1337
1340
 
1338
- export declare interface ScrollButtonProps {
1339
- style?: default_2.CSSProperties;
1341
+ export declare interface ScrollButtonProps extends default_2.HTMLAttributes<any> {
1340
1342
  orientation?: ScrollbarOrientation;
1341
1343
  disabled?: boolean;
1342
- onMouseUp: (e: default_2.MouseEvent<HTMLElement>) => void;
1343
- onMouseLeave: (e: default_2.MouseEvent<HTMLElement>) => void;
1344
- onMouseDown: (e: default_2.MouseEvent<HTMLElement>) => void;
1345
- onClick?: (e: default_2.MouseEvent<HTMLElement>) => void;
1344
+ onMouseUp: (e: default_2.MouseEvent<any>) => void;
1345
+ onMouseLeave: (e: default_2.MouseEvent<any>) => void;
1346
+ onMouseDown: (e: default_2.MouseEvent<any>) => void;
1347
+ onClick?: (e: default_2.MouseEvent<any>) => void;
1348
+ ref?: default_2.Ref<any>;
1346
1349
  }
1347
1350
 
1348
1351
  export declare const ScrollPane: default_2.NamedExoticComponent<Omit<ScrollPaneProps, "ref"> & default_2.RefAttributes<IScrollPaneElement>>;
@@ -1356,8 +1359,8 @@ export declare interface ScrollPaneProps extends React.HTMLAttributes<HTMLDivEle
1356
1359
  showHorizontalScrollbar?: boolean;
1357
1360
  showVerticalScrollbar?: boolean;
1358
1361
  createScrollCorner?: (size: Size) => React.ReactNode;
1359
- createHorizontalScrollbar?: (props: ScrollbarProps, ref?: React.Ref<HTMLDivElement>) => React.ReactNode;
1360
- createVerticalScrollbar?: (props: ScrollbarProps, ref?: React.Ref<HTMLDivElement>) => React.ReactNode;
1362
+ renderScrollbarHorizontal?: (props: ScrollbarProps) => React.ReactNode;
1363
+ renderScrollbarVertical?: (props: ScrollbarProps) => React.ReactNode;
1361
1364
  /**
1362
1365
  * By default the ScrollPane will listen for events on all of the children of the ScrollPane but this
1363
1366
  * allows for a custom element to be specified. Useful when the ScrollPane has some elements
@@ -1383,7 +1386,7 @@ export declare interface ScrollState extends TopLeft {
1383
1386
  export declare namespace ScrollUtils {
1384
1387
  export {
1385
1388
  getScrollTo,
1386
- defaultCreateScrollbar
1389
+ defaultRenderScrollbar
1387
1390
  }
1388
1391
  }
1389
1392
 
@@ -1395,7 +1398,7 @@ export declare interface ShowInputOptions<T = string, C = any> extends ShowOptio
1395
1398
  /**
1396
1399
  * Css style for input
1397
1400
  */
1398
- inputProps?: default_2.HTMLAttributes<HTMLInputElement | HTMLTextAreaElement>;
1401
+ propsInput?: default_2.HTMLAttributes<HTMLInputElement | HTMLTextAreaElement>;
1399
1402
  inputLabel?: string;
1400
1403
  inputType?: 'text' | 'password' | 'email' | 'number' | 'search' | 'tel' | 'url';
1401
1404
  inputPlaceHolder?: string;
@@ -1507,9 +1510,7 @@ export declare class SimpleCommand extends Command<void, void> {
1507
1510
  * Because this component measures the elements (both panes and the resizer) it is important
1508
1511
  * that none of these have margins or paddings. If these are required then use a nested element.
1509
1512
  */
1510
- export declare const SplitPane: default_2.FC<SplitPaneProps & {
1511
- ref?: default_2.Ref<ISplitPaneElement>;
1512
- }>;
1513
+ export declare const SplitPane: default_2.NamedExoticComponent<Omit<SplitPaneProps, "ref"> & default_2.RefAttributes<ISplitPaneElement>>;
1513
1514
 
1514
1515
  export declare interface SplitPaneAttributes {
1515
1516
  /**
@@ -1576,28 +1577,29 @@ export declare interface SplitPaneProps extends default_2.HTMLAttributes<HTMLDiv
1576
1577
  */
1577
1578
  splitDirection?: 'row' | 'column';
1578
1579
  disabled?: boolean;
1579
- resizerProps?: SplitPaneResizerProps;
1580
- paneProps?: default_2.HTMLAttributes<HTMLElement>;
1581
- paneBeforeProps?: default_2.HTMLAttributes<HTMLElement>;
1582
- paneAfterProps?: default_2.HTMLAttributes<HTMLElement>;
1580
+ propsResizer?: SplitPaneResizerProps;
1581
+ propsPane?: default_2.HTMLAttributes<HTMLElement>;
1582
+ propsPaneBefore?: default_2.HTMLAttributes<HTMLElement>;
1583
+ propsPaneAfter?: default_2.HTMLAttributes<HTMLElement>;
1583
1584
  onDragStart?: () => void;
1584
1585
  onDragResize?: (position: number) => void;
1585
1586
  onDragFinish?: (position: number) => void;
1586
- createResizer?: (props: SplitPaneResizerProps & default_2.Attributes & {
1587
- ref?: default_2.Ref<HTMLDivElement>;
1588
- }) => default_2.ReactElement;
1587
+ renderResizer?: (props: SplitPaneResizerProps) => default_2.ReactElement;
1588
+ /**
1589
+ * A ref that points to the HTMLDivElement.
1590
+ */
1591
+ ref?: default_2.Ref<ISplitPaneElement>;
1589
1592
  }
1590
1593
 
1591
- export declare const SplitPaneResizer: (props: SplitPaneResizerProps & default_2.Attributes & {
1592
- ref?: default_2.Ref<HTMLDivElement>;
1593
- }) => default_2.ReactElement;
1594
+ export declare const SplitPaneResizer: (props: SplitPaneResizerProps) => default_2.ReactElement;
1594
1595
 
1595
- export declare interface SplitPaneResizerProps extends default_2.HTMLAttributes<HTMLDivElement> {
1596
+ export declare interface SplitPaneResizerProps extends default_2.HTMLAttributes<HTMLDivElement>, default_2.Attributes {
1596
1597
  splitDirection?: 'row' | 'column';
1597
1598
  disabled?: boolean;
1598
1599
  paddingBefore?: number;
1599
1600
  paddingAfter?: number;
1600
- hitAreaProps?: default_2.HTMLAttributes<HTMLDivElement>;
1601
+ propsHitArea?: default_2.HTMLAttributes<HTMLDivElement>;
1602
+ ref?: default_2.Ref<HTMLDivElement>;
1601
1603
  }
1602
1604
 
1603
1605
  export declare interface Style {
@@ -1905,7 +1907,7 @@ export declare const useUndoManager: ({ manager, commands: commandsParent, disab
1905
1907
  * Because of the virtual nature of the scrollbar the onScroll method is disabled
1906
1908
  * and onScrollOffset must be used.
1907
1909
  */
1908
- export declare const VirtualScrollbar: default_2.NamedExoticComponent<VirtualScrollbarProps & default_2.RefAttributes<HTMLDivElement>>;
1910
+ export declare const VirtualScrollbar: default_2.NamedExoticComponent<Omit<VirtualScrollbarProps, "ref"> & default_2.RefAttributes<IScrollbarElement>>;
1909
1911
 
1910
1912
  export declare interface VirtualScrollbarProps extends Omit<ScrollbarProps, "onScroll"> {
1911
1913
  /**
@@ -1939,7 +1941,7 @@ export declare interface VirtualScrollbarProps extends Omit<ScrollbarProps, "onS
1939
1941
  * @defaultValue 50
1940
1942
  */
1941
1943
  precisionFactor?: number;
1942
- createScrollbar?: (props: ScrollbarProps, ref?: default_2.Ref<HTMLElement>) => default_2.ReactNode;
1944
+ renderScrollbar?: (props: ScrollbarProps) => default_2.ReactNode;
1943
1945
  }
1944
1946
 
1945
1947
  export declare function WalkingIcon(props: WalkingIconProps): JSX.Element;