@sheetxl/utils-react 0.7.19 → 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.
- package/browser/cjs/{CLRMmhKU4QmUR8pR.cjs → BA9O-cekHrH5qrOm.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{jq-rVm4UcR4Fif2C.mjs → DTq8GPy7DLZm2D6S.mjs} +1 -1
- package/browser/esm/index.mjs +282 -279
- package/node/esm/{CTZ4-ofCPbWO-0YG.mjs → 4mSSJ5fhNdMhHCE6.mjs} +1 -1
- package/node/esm/index.mjs +74 -71
- package/package.json +2 -2
- package/types/index.d.ts +129 -67
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
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.
|
package/node/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
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
|
|
16
|
-
const
|
|
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 = () => {
|
|
@@ -239,7 +239,7 @@ class V {
|
|
|
239
239
|
}
|
|
240
240
|
findCommandByEvent(t2) {
|
|
241
241
|
const e2 = [];
|
|
242
|
-
t2.altKey && e2.push(
|
|
242
|
+
t2.altKey && e2.push(z.Alt), t2.shiftKey && e2.push(z.Shift), t2.ctrlKey && e2.push(z.Ctrl), t2.metaKey && e2.push(z.Meta);
|
|
243
243
|
let n2 = X({ key: t2.code, modifiers: e2 });
|
|
244
244
|
const o2 = this._commandsByShortcut;
|
|
245
245
|
let r2 = o2.get(n2);
|
|
@@ -306,7 +306,7 @@ const F = t.getOS() === t.OSType.MacOS || t.getOS() === t.OSType.IOS ? "Cmd" : "
|
|
|
306
306
|
const n2 = {};
|
|
307
307
|
for (let e3 = 0; t2.modifiers && e3 < t2.modifiers.length; e3++) n2[t2.modifiers[e3]] = true;
|
|
308
308
|
let o2 = "";
|
|
309
|
-
return (n2?.[
|
|
309
|
+
return (n2?.[z.Ctrl] || n2?.[z.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? j : F)), n2?.[z.Alt] && (o2 += e2 ? "⌥" : "Alt"), n2?.[z.Shift] && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? "⇧" : "Shift")), o2 += (o2.length > 0 ? "+" : "") + H(t2.key), o2;
|
|
310
310
|
};
|
|
311
311
|
function Y(e2, n2 = null) {
|
|
312
312
|
const o2 = a(n2);
|
|
@@ -654,19 +654,19 @@ kt || (kt = (t2, e2, n2 = {}) => {
|
|
|
654
654
|
}), []), n3;
|
|
655
655
|
};
|
|
656
656
|
});
|
|
657
|
-
const
|
|
658
|
-
let
|
|
657
|
+
const Dt = kt;
|
|
658
|
+
let Pt = () => {
|
|
659
659
|
console.warn("You must call useEditMode before setting its state.");
|
|
660
660
|
};
|
|
661
|
-
const
|
|
661
|
+
const zt = Dt(null, () => {
|
|
662
662
|
const [t2, e2] = d(null);
|
|
663
|
-
return
|
|
664
|
-
}),
|
|
665
|
-
const t2 =
|
|
663
|
+
return Pt = e2, t2;
|
|
664
|
+
}), At = () => {
|
|
665
|
+
const t2 = zt();
|
|
666
666
|
return h(() => ({ setMode: (t3) => {
|
|
667
|
-
|
|
667
|
+
Pt((e2) => ("function" == typeof t3 && (t3 = t3(e2)), t3?.onModeChange?.(t3 ?? null), t3));
|
|
668
668
|
}, getMode: () => t2 }), [t2]);
|
|
669
|
-
}, Bt =
|
|
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);
|
|
@@ -676,7 +676,7 @@ const At = Pt(null, () => {
|
|
|
676
676
|
h(() => {
|
|
677
677
|
const t2 = n2?.element, e3 = s2?.element ?? n2?.element;
|
|
678
678
|
if (!c2) return;
|
|
679
|
-
const o2 = [new K("cut", t2, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", icon: "cut", shortcut: { key: "X", modifiers: [
|
|
679
|
+
const o2 = [new K("cut", t2, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", icon: "cut", shortcut: { key: "X", modifiers: [z.Ctrl] } }), new K("copy", t2, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", icon: "copy", shortcut: { key: "C", modifiers: [z.Ctrl] } }), new K("paste", e3, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste.yellow", shortcut: [{ key: "V", modifiers: [z.Ctrl] }, { key: "F8", modifiers: [z.Ctrl] }] })];
|
|
680
680
|
c2?.addCommands(o2, true);
|
|
681
681
|
}, [c2]);
|
|
682
682
|
const v2 = ht(async (t2) => {
|
|
@@ -814,7 +814,7 @@ const jt = "Undo the last action.", Xt = "Repeat the last action or undo the red
|
|
|
814
814
|
return h(() => {
|
|
815
815
|
if (!e2) return;
|
|
816
816
|
const t3 = { contains: (t4) => true, focus() {
|
|
817
|
-
} }, n3 = [new $("undo", t3, { label: "Undo", description: jt, shortcut: { key: "z", modifiers: [
|
|
817
|
+
} }, n3 = [new $("undo", t3, { label: "Undo", description: jt, shortcut: { key: "z", modifiers: [z.Ctrl] }, disabled: true }, r2), new $("redo", t3, { label: "Redo", description: Xt, shortcut: [{ key: "y", modifiers: [z.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [z.Alt] }], disabled: true }, i2)];
|
|
818
818
|
e2?.addCommands(n3, true);
|
|
819
819
|
}, [e2]), u(() => {
|
|
820
820
|
if (!e2) return;
|
|
@@ -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,
|
|
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,
|
|
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 } =
|
|
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) => {
|
|
@@ -919,15 +919,15 @@ const Jt = ({ children: t2 }) => {
|
|
|
919
919
|
t3.stopPropagation(), t3.preventDefault();
|
|
920
920
|
}, [O2, U2, s2, i2, X2]), bt2 = ht((t3) => {
|
|
921
921
|
_t2?.(t3), t3.defaultPrevented || w2 || U2 || (G2(true), q2(), document.addEventListener("pointermove", vt2, { passive: false }), document.addEventListener("touchmove", vt2, { passive: false }), document.addEventListener("pointerup", wt2, { passive: false }));
|
|
922
|
-
}, [_t2]), xt2 = Ft(e2, () => ({ setPosition: yt2, isSplitPane: () => true }), []), St2 = h(() => B2 ?
|
|
922
|
+
}, [_t2]), xt2 = Ft(e2, () => ({ setPosition: yt2, isSplitPane: () => true }), []), St2 = h(() => B2 ? A2?.({ key: "resizer", ref: L([W2, tt2]), className: T("resizer", mt2), onPointerDownCapture: bt2, style: { cursor: w2 ? void 0 : "row" === r2 ? "ew-resize" : "ns-resize", minWidth: "row" === r2 ? "2px" : void 0, minHeight: "row" !== r2 ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...ft2 }, splitDirection: r2, disabled: w2, ...gt2 }) : null, [B2, mt2, gt2, r2, ft2, w2]), Et2 = "row" === r2 ? "Width" : "Height", Lt2 = h(() => {
|
|
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,
|
|
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,
|
|
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("./
|
|
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,
|
|
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
|
|
1194
|
+
const D2 = { viewBox: w2?.viewBox ?? g2?.meta.defaultViewBox ?? "0 0 24 24" };
|
|
1195
1195
|
if ("function" == typeof w2) {
|
|
1196
|
-
return k2(w2(
|
|
1196
|
+
return k2(w2(D2) ?? x(me, { ...D2 }));
|
|
1197
1197
|
}
|
|
1198
|
-
if (!w2) return k2(x(me, { ...
|
|
1199
|
-
const
|
|
1200
|
-
return k2(x("svg", { ...
|
|
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,39 +1336,39 @@ 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",
|
|
1340
|
-
const { style: e2, orientation: n2 = Te.Vertical, disabled: o2, ...r2 } = t2, i2 = n2 === Te.Vertical ? ke :
|
|
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
|
-
},
|
|
1343
|
-
const { style: e2, orientation: n2 = Te.Vertical, disabled: o2, ...r2 } = t2, i2 = n2 === Te.Vertical ? ke :
|
|
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:
|
|
1342
|
+
}, Ae = (t2) => {
|
|
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]),
|
|
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),
|
|
1356
|
+
B2(false), P2?.(n3), t3.preventDefault(), t3.stopPropagation();
|
|
1357
1357
|
} }), [])), K2 = h(() => {
|
|
1358
1358
|
const t3 = s2 / 2 + i2 / 2 + 6;
|
|
1359
|
-
return { x:
|
|
1360
|
-
}, [
|
|
1359
|
+
return { x: z2 ? -t3 : g2 + s2, y: z2 ? g2 + s2 : -t3, width: 0, height: 0 };
|
|
1360
|
+
}, [z2, g2, s2]), [O2, { y: I2, x: N2 }] = ct(), H2 = a(null), { getPortalContainer: R2, isFullscreen: W2 } = ft(), [V2, F2] = d(null);
|
|
1361
1361
|
return u(() => {
|
|
1362
1362
|
const t3 = H2.current?.getBoundingClientRect();
|
|
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(
|
|
1367
|
-
}, [I2,
|
|
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
|
+
}, [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,
|
|
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
|
-
}, [
|
|
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", { ...
|
|
1421
|
-
return !
|
|
1422
|
-
}, [$2, v2, Y2, n2, I2,
|
|
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
|
+
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, 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":
|
|
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
|
|
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,20 +1653,23 @@ 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_1fbi8_2",
|
|
1657
|
-
const
|
|
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);
|
|
1669
|
-
}, []),
|
|
1672
|
+
}, []), A2 = f(({ containerWidth: t3, containerHeight: e3, totalWidth: n3, totalHeight: o3 }) => {
|
|
1670
1673
|
C2.current.setDimensions(t3, e3, n3, o3);
|
|
1671
1674
|
}, []);
|
|
1672
1675
|
u(() => {
|
|
@@ -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",
|
|
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",
|
|
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(() => {
|
|
@@ -1687,19 +1690,19 @@ const Ue = (t2, e2) => x(Ie, { ...t2, ref: e2 }), Ge = Object.freeze(Object.defi
|
|
|
1687
1690
|
const t3 = d2({ orientation: Te.Vertical, offset: o2?.top, viewportSize: o2?.height, totalSize: o2?.totalHeight, onScrollOffset: (t4) => {
|
|
1688
1691
|
b2?.({ top: t4 });
|
|
1689
1692
|
} });
|
|
1690
|
-
return x("div", { className: T("vertical-container",
|
|
1693
|
+
return x("div", { className: T("vertical-container", qe["vertical-container"]), ref: B2, children: t3 });
|
|
1691
1694
|
}, [d2, o2?.top, o2?.height, o2?.totalHeight]), H2 = h(() => {
|
|
1692
1695
|
if (!v2) return null;
|
|
1693
1696
|
const t3 = c2({ orientation: Te.Horizontal, offset: o2?.left, viewportSize: o2?.width, totalSize: o2?.totalWidth, onScrollOffset: (t4) => {
|
|
1694
1697
|
b2?.({ left: t4 });
|
|
1695
1698
|
} });
|
|
1696
|
-
return S("div", { className: T("horizontal-corner-container",
|
|
1699
|
+
return S("div", { className: T("horizontal-corner-container", qe["horizontal-corner-container"]), children: [x("div", { className: T("horizontal-sizer", qe["horizontal-sizer"]), style: { width: `calc(100% - ${$2}px)` }, children: x("div", { ref: K2, className: T("scrollbar-sizer", qe["scrollbar-sizer"]), children: t3 }) }), w2 ? l2({ width: $2, height: O2 }) : x(E, {})] });
|
|
1697
1700
|
}, [c2, o2?.left, o2?.width, o2?.totalWidth, w2, l2, $2, O2]);
|
|
1698
|
-
return x("div", { className: T(m2, "scrollpane", qe), style: { minWidth: w2 ? `${$2}px` : void 0, minHeight: v2 ? `${O2}px` : void 0, ...p2 }, ...y2, ref: L2, children: S("div", { className: T("scrollpane-content",
|
|
1701
|
+
return x("div", { className: T(m2, "scrollpane", qe.scrollpane), style: { minWidth: w2 ? `${$2}px` : void 0, minHeight: v2 ? `${O2}px` : void 0, ...p2 }, ...y2, ref: L2, children: S("div", { className: T("scrollpane-content", qe["scrollpane-content"]), children: [S("div", { className: T("scrollpane-content-element", qe["scrollpane-content-element"]), children: [x("div", { className: T("scrollpane-content-element", qe["scrollpane-content-element"]), children: n2 }), w2 ? I2 : x(E, {})] }), v2 ? H2 : x(E, {})] }) });
|
|
1699
1702
|
}));
|
|
1700
|
-
|
|
1701
|
-
const
|
|
1702
|
-
const { offset: n2 = 0, viewportSize: o2 = 0, totalSize: r2 = 0, minSize: i2 = 0, endGap: s2 =
|
|
1703
|
+
Je.displayName = "ScrollPane";
|
|
1704
|
+
const Qe = 300, tn = 100, en = 1e6, nn = 100, on = 50, rn = p(m((t2, e2) => {
|
|
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,9 +1716,9 @@ const sn = 300, ln = 100, an = 1e6, cn = 100, hn = 50, un = 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
|
|
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 {
|
|
1720
1723
|
$ as Command,
|
|
1721
1724
|
q as CommandButtonType,
|
|
@@ -1725,10 +1728,10 @@ export {
|
|
|
1725
1728
|
_e as DynamicIcon,
|
|
1726
1729
|
Qt as ErrorTestPanel,
|
|
1727
1730
|
J as FocusKeyNavigation,
|
|
1728
|
-
|
|
1731
|
+
P as HorizontalAlignment,
|
|
1729
1732
|
ye as InMemoryStore,
|
|
1730
|
-
|
|
1731
|
-
|
|
1733
|
+
A as KeyCodes,
|
|
1734
|
+
z as KeyModifiers,
|
|
1732
1735
|
Me as LocalStorageStore,
|
|
1733
1736
|
B as MouseButtonCodes,
|
|
1734
1737
|
ot as NotifierProvider,
|
|
@@ -1737,7 +1740,7 @@ export {
|
|
|
1737
1740
|
qt as ReactErrorBoundary,
|
|
1738
1741
|
W as ReactUtils,
|
|
1739
1742
|
Q as RoundedTab,
|
|
1740
|
-
|
|
1743
|
+
Je as ScrollPane,
|
|
1741
1744
|
Ge as ScrollUtils,
|
|
1742
1745
|
Ie as Scrollbar,
|
|
1743
1746
|
Te as ScrollbarOrientation,
|
|
@@ -1746,13 +1749,13 @@ export {
|
|
|
1746
1749
|
ee as SplitPaneResizer,
|
|
1747
1750
|
Z as ToolTipPlacement,
|
|
1748
1751
|
Jt as UncaughtErrorBoundary,
|
|
1749
|
-
|
|
1752
|
+
rn as VirtualScrollbar,
|
|
1750
1753
|
ge as WalkingIcon,
|
|
1751
1754
|
de as createDynamicIconService,
|
|
1752
|
-
|
|
1755
|
+
Ze as defaultCreateScrollCorner,
|
|
1753
1756
|
Be as defaultCreateScrollEdgeButton,
|
|
1754
|
-
|
|
1755
|
-
|
|
1757
|
+
Ae as defaultCreateScrollEndButton,
|
|
1758
|
+
ze as defaultCreateScrollStartButton,
|
|
1756
1759
|
dt as getDevicePixelRatio,
|
|
1757
1760
|
X as toShortcutString,
|
|
1758
1761
|
ct as useAnimatedMeasure,
|
|
@@ -1761,7 +1764,7 @@ export {
|
|
|
1761
1764
|
G as useCommands,
|
|
1762
1765
|
$t as useCopyPaste,
|
|
1763
1766
|
ut as useDevicePixelRatio,
|
|
1764
|
-
|
|
1767
|
+
At as useEditMode,
|
|
1765
1768
|
ft as useFullscreenPortal,
|
|
1766
1769
|
Bt as useGlobalClipboard,
|
|
1767
1770
|
Wt as useId,
|
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.
|
|
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.
|
|
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",
|