@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.
- package/browser/cjs/{BL4s9szmq3x4oxSh.cjs → BA9O-cekHrH5qrOm.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{kV2Jq18kvUd9pmz5.mjs → DTq8GPy7DLZm2D6S.mjs} +1 -1
- package/browser/esm/index.mjs +79 -76
- package/node/esm/{DIUtMpFEGWd4fFvO.mjs → 4mSSJ5fhNdMhHCE6.mjs} +1 -1
- package/node/esm/index.mjs +46 -43
- package/package.json +2 -2
- package/types/index.d.ts +61 -59
package/browser/esm/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("._fullscreen-portal-root_1mjsr_4{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_1mjsr_4>*{pointer-events:auto}:root{--icon-size-sm: calc(var(--icon-size, 1rem), * .875);--icon-size-md: var(--icon-size, 1rem);--icon-size-lg: calc(var(--icon-size, 1rem) * 1.25);--icon-size-xl: calc(var(--icon-size, 1rem) * 1.5)}._Icon_17dpm_10{font-size:var(--icon-size, var(--icon-size-md));min-width:var(--icon-size, var(--icon-size-md));min-height:var(--icon-size, var(--icon-size-md));--icon-stroke-em: .085em;--icon-color: currentColor;--icon-secondary-color: color-mix(in oklab, currentColor 65%, transparent);--icon-tertiary-color: color-mix(in oklab, currentColor 40%, transparent);--icon-line-color: currentColor;--icon-main-opacity: 1;--icon-secondary-opacity: .45;--icon-tertiary-opacity: .25;--icon-line-opacity: 1;--icon-filter: none;filter:var(--icon-filter);display:inline-flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle;flex:0 0 auto}._Icon_17dpm_10 .sm{--font-size: var(--icon-size-sm)}._Icon_17dpm_10 .md{--font-size: var(--icon-size-md)}._Icon_17dpm_10 .lg{--font-size: var(--icon-size-lg)}._Icon_17dpm_10 .xl{--font-size: var(--icon-size-xl)}._Icon_17dpm_10>svg{width:var(--icon-size);height:var(--icon-size)}._Icon_17dpm_10>img{aspect-ratio:1 / 1;display:block;line-height:1}._Icon_17dpm_10 .fill,._Icon_17dpm_10 .line{--layer-color: var(--icon-color);--layer-opacity: var(--icon-main-opacity)}._Icon_17dpm_10 .secondary{--layer-color: var(--icon-secondary-color)}._Icon_17dpm_10 .tertiary{--layer-color: var(--icon-tertiary-color)}._Icon_17dpm_10 .primary{--layer-color: var(--sxl-app-color-primary, var(--icon-primary, #595b5e))}._Icon_17dpm_10 .secondary{--layer-color: var(--sxl-app-color-secondary, #9c27b0)}._Icon_17dpm_10 .secondary.light{--layer-color: var(--sxl-app-color-secondary-light, #a060ac)}._Icon_17dpm_10 .success{--layer-color: var(--sxl-app-color-success, #22c55e)}._Icon_17dpm_10 .success.light{--layer-color: var(--sxl-app-color-success-light, #22c55e)}._Icon_17dpm_10 .info{--layer-color: var(--sxl-app-color-info, #3b82f6)}._Icon_17dpm_10 .warn{--layer-color: var(--sxl-app-color-warn, #f59e0b)}._Icon_17dpm_10 .error{--layer-color: var(--sxl-app-color-error, #ef4444)}._Icon_17dpm_10 .error.light{--layer-color: var(--sxl-app-color-error-light, #f87171)}._Icon_17dpm_10 .grey{--layer-color: var(--sxl-app-color-grey, #cccccc)}._Icon_17dpm_10 .shadow{--layer-color: var(--sxl-app-color-shadow, #cccccc)}._Icon_17dpm_10 .fill:not(.fixed):not([fill]){fill:var(--layer-color);opacity:var(--layer-opacity);stroke:none}._Icon_17dpm_10 .line:not(.fixed):not([stroke]){fill:none;stroke:var(--layer-color, var(--icon-line-color));stroke-width:var(--icon-stroke-em);opacity:var(--layer-opacity, var(--icon-line-opacity));vector-effect:non-scaling-stroke;pointer-events:none;stroke-linecap:var(--icon-linecap, round);stroke-linejoin:var(--icon-linejoin, round);stroke-miterlimit:var(--icon-miter, 4)}@media (prefers-color-scheme: dark){._Icon_17dpm_10 .invert-dark{filter:invert(1) hue-rotate(180deg)}}._Icon_17dpm_10 .muted{opacity:calc(var(--layer-opacity, 1) * .6)}@keyframes _sxl-walk_17dpm_1{to{stroke-dashoffset:0}}.icon.walking .walkable.line{stroke-dasharray:var(--walk-dash-length, 5px) var(--walk-dash-gap, 2px);stroke-dashoffset:calc(var(--walk-dash-length, 5px) + var(--walk-dash-gap, 2px));animation:_sxl-walk_17dpm_1 var(--walk-duration, .96s) linear infinite;will-change:stroke-dashoffset}:root{--scrollbar-track-color: rgba(0,0,0,.06);--scrollbar-thumb-color: rgba(0,0,0,.35);--scrollbar-button-color: var(--scrollbar-thumb-color);--scrollbar-active-color: rgba(0,0,0,.55);--scrollbar-corner-color: transparent;--scrollbar-border-color: transparent}:root .has-touch-thumb,:root .has-touch-thumb *{--scrollbar-size: 4px;--scrollbar-border-width: 0px;--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size)}:root{--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size);--scrollbar-border-radius: 9999px;--scrollbar-border-width: 2px;--scrollbar-min-thumb-size: 24px}._scrollbar_gqxsx_24 ::-webkit-scrollbar-button{background:transparent}._scrollbar_gqxsx_24{display:flex;flex:1 1 100%;overflow:hidden;border-radius:var(--scrollbar-border-radius);align-items:center;border:var(--scrollbar-border-width) solid transparent}._scrollbar_gqxsx_24 ._track_gqxsx_35{background:var(--scrollbar-track-color);border-radius:var(--scrollbar-border-radius);position:relative;flex:1 1 100%;border:var(--scrollbar-border-width) solid transparent;touch-action:none;box-sizing:border-box;overflow:hidden}._scrollbar_gqxsx_24 ._thumb_gqxsx_47{background:var(--scrollbar-thumb-color);border-radius:var(--scrollbar-border-radius);transition:background .12s;touch-action:none}._scrollbar_gqxsx_24 ._thumb_gqxsx_47:hover{background:var(--scrollbar-active-color)}._scrollbar_gqxsx_24.vertical{flex-direction:column;min-width:var(--scrollbar-width, 0px);max-width:var(--scrollbar-width, 100%)}._scrollbar_gqxsx_24.vertical ._thumb_gqxsx_47{min-height:var(--scrollbar-min-thumb-size)}._scrollbar_gqxsx_24.vertical ._track_gqxsx_35{width:100%}._scrollbar_gqxsx_24.horizontal{flex-direction:row;min-height:var(--scrollbar-height, 0px);max-height:var(--scrollbar-height, 100%)}._scrollbar_gqxsx_24.horizontal ._thumb_gqxsx_47{min-width:var(--scrollbar-min-thumb-size)}._scrollbar_gqxsx_24.horizontal ._track_gqxsx_35{height:100%}._scrollbar_gqxsx_24.dragging ._thumb_gqxsx_47{background:var(--scrollbar-active-color)}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89{display:flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89>*{fill:var(--scrollbar-button-color);transition:fill .12s ease}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89:hover:not([disabled])>*{fill:var(--scrollbar-active-color)}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89[disabled]>*{fill:var(--scrollbar-button-color);opacity:.5}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89.vertical{width:var(--scrollbar-width)}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89.horizontal{height:var(--scrollbar-height)}._touch-thumb_gqxsx_124{position:absolute;cursor:grab;pointer-events:all;transition-property:opacity;border-radius:9999px;will-change:opacity;opacity:.7}._touch-thumb_gqxsx_124:hover,._touch-thumb_gqxsx_124.dragging{opacity:1}._scrollpane_1fbi8_2{position:relative;display:flex}._vertical-container_1fbi8_7{display:flex;flex:0}._horizontal-corner-container_1fbi8_12{display:flex;flex:none;flex-direction:row;align-items:stretch;justify-content:center}._horizontal-container_1fbi8_20{display:flex;flex:1 1 100%;flex-direction:column}._scrollbar-sizer_1fbi8_26{display:flex;flex:1 1 100%;align-items:stretch;justify-content:stretch}._scrollpane-content_1fbi8_34{position:relative;width:100%;flex:1 1 100%;display:flex;flex-direction:column;box-sizing:border-box}._scrollpane-content-element_1fbi8_43{display:flex;flex:1 1 100%;overflow:hidden}")),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
import { CommonUtils as te, DefaultNotifier as vn, Notifier as xe, InternalClipboard as
|
|
2
|
+
import { CommonUtils as te, DefaultNotifier as vn, Notifier as xe, InternalClipboard as rt, ClipboardUtils as pt, MimeType as ft } from "@sheetxl/utils";
|
|
3
3
|
import ae, { useRef as K, useReducer as Yt, useMemo as R, useEffect as W, useState as q, version as bn, memo as _e, forwardRef as Me, useCallback as U, useLayoutEffect as Lt, createContext as Gt, useContext as qt, createElement as wn, useImperativeHandle as xn, Component as Sn } from "react";
|
|
4
4
|
import { jsx as P, jsxs as fe, Fragment as me } from "react/jsx-runtime";
|
|
5
5
|
import { createRoot as En } from "react-dom/client";
|
|
6
6
|
import { unstable_batchedUpdates as Mn, createPortal as Ln } from "react-dom";
|
|
7
7
|
/**
|
|
8
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
8
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.21
|
|
9
9
|
*
|
|
10
10
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
11
11
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
12
12
|
*/
|
|
13
|
-
const $o = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, Q = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, Ko = { 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 }, No = { Left: 1, Middle: 2, Right: 3 };
|
|
13
|
+
const $o = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, Q = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, Ko = { 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 }, No = { Left: 1, Middle: 2, Right: 3 };
|
|
14
14
|
class bt {
|
|
15
15
|
constructor(e, t, n, r) {
|
|
16
16
|
this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = e, this._target = t, this._applyProps(n || {}), this._callback = r, r === void 0 && (this._callback = () => {
|
|
@@ -136,7 +136,7 @@ const An = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: wt
|
|
|
136
136
|
function Ke() {
|
|
137
137
|
return An;
|
|
138
138
|
}
|
|
139
|
-
const nn = (o) => o === "BracketLeft" ? "[" : o === "BracketRight" ? "]" : te.camelToPrettyCase(o),
|
|
139
|
+
const nn = (o) => o === "BracketLeft" ? "[" : o === "BracketRight" ? "]" : te.camelToPrettyCase(o), tt = (o, e) => {
|
|
140
140
|
let t = !1, n = !1;
|
|
141
141
|
const r = { nativeEvent: o, currentTarget: e || o.currentTarget, target: o.target, bubbles: o.bubbles, cancelable: o.cancelable, defaultPrevented: o.defaultPrevented, eventPhase: o.eventPhase, isTrusted: o.isTrusted, preventDefault: () => {
|
|
142
142
|
t = !0, o.preventDefault();
|
|
@@ -148,7 +148,7 @@ const nn = (o) => o === "BracketLeft" ? "[" : o === "BracketRight" ? "]" : te.ca
|
|
|
148
148
|
return r;
|
|
149
149
|
}, Ro = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: tn, boundPixel: function(o, e = !1, t = 0) {
|
|
150
150
|
return o;
|
|
151
|
-
}, createSyntheticEvent:
|
|
151
|
+
}, createSyntheticEvent: tt, detectIt: Ke, focusableNodeNames: Bn, toPrettyKeyCode: nn }, Symbol.toStringTag, { value: "Module" }));
|
|
152
152
|
class on {
|
|
153
153
|
constructor(e, t) {
|
|
154
154
|
this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = te.uuidV4(), this._target = e, this._groupKey = t ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(t, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
|
|
@@ -333,7 +333,7 @@ function Ho(o, e = null) {
|
|
|
333
333
|
};
|
|
334
334
|
}, [o]), n;
|
|
335
335
|
}
|
|
336
|
-
const
|
|
336
|
+
const Ze = (o, e) => {
|
|
337
337
|
if (!e || !o || e.length === 0) return te.EmptyArray;
|
|
338
338
|
const t = e.length, n = new Array(t);
|
|
339
339
|
for (let r = 0; r < t; r++) {
|
|
@@ -345,17 +345,17 @@ const Je = (o, e) => {
|
|
|
345
345
|
function Wo(o, e = null, t = null, n) {
|
|
346
346
|
const r = K(t);
|
|
347
347
|
r.current = t, e && !Array.isArray(e) && (e = [e]);
|
|
348
|
-
const [i, a] = q(
|
|
348
|
+
const [i, a] = q(Ze(o, e)), u = n ? [...n, o] : [o];
|
|
349
349
|
return W(() => {
|
|
350
350
|
const l = { onGroupChange: () => {
|
|
351
|
-
const d =
|
|
351
|
+
const d = Ze(o, e);
|
|
352
352
|
a(d), r.current?.onChange?.(this);
|
|
353
353
|
} };
|
|
354
354
|
let s;
|
|
355
355
|
e && e.length > 0 && (s = { keys: e }, l.onCommandChange = (d, f) => {
|
|
356
|
-
r.current?.onChange?.(o), a(
|
|
356
|
+
r.current?.onChange?.(o), a(Ze(o, e));
|
|
357
357
|
});
|
|
358
|
-
const c = o?.addListener(l, s), h =
|
|
358
|
+
const c = o?.addListener(l, s), h = Ze(o, e);
|
|
359
359
|
return a(h), r.current?.onChange && r.current?.onChange(o), () => {
|
|
360
360
|
c?.();
|
|
361
361
|
};
|
|
@@ -576,7 +576,7 @@ function qo(o, e, t) {
|
|
|
576
576
|
};
|
|
577
577
|
}, [o]);
|
|
578
578
|
}
|
|
579
|
-
let
|
|
579
|
+
let Je = 0;
|
|
580
580
|
function Fn() {
|
|
581
581
|
const [o, e] = q(!!document.fullscreenElement), t = U(() => {
|
|
582
582
|
const n = document.fullscreenElement;
|
|
@@ -589,10 +589,10 @@ function Fn() {
|
|
|
589
589
|
let i = r.querySelector(".fullscreen-portal-root");
|
|
590
590
|
i || (i = document.createElement("div"), i.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", r.appendChild(i));
|
|
591
591
|
}
|
|
592
|
-
return
|
|
593
|
-
document.removeEventListener("fullscreenchange", n),
|
|
592
|
+
return Je++, n(), document.addEventListener("fullscreenchange", n), () => {
|
|
593
|
+
document.removeEventListener("fullscreenchange", n), Je--, Je <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((r) => {
|
|
594
594
|
r.parentNode && r.parentNode.removeChild(r);
|
|
595
|
-
}),
|
|
595
|
+
}), Je = 0);
|
|
596
596
|
};
|
|
597
597
|
}, []), { getPortalContainer: t, isFullscreen: o };
|
|
598
598
|
}
|
|
@@ -604,7 +604,7 @@ function ln(o) {
|
|
|
604
604
|
p.current = setTimeout(() => {
|
|
605
605
|
window.requestAnimationFrame(() => {
|
|
606
606
|
if (s.current === !1) return;
|
|
607
|
-
const C = f.current, E = d.current, $ =
|
|
607
|
+
const C = f.current, E = d.current, $ = tt(C, E.currentTarget);
|
|
608
608
|
l?.($, m.current, E);
|
|
609
609
|
}), L(h);
|
|
610
610
|
}, b ?? c);
|
|
@@ -616,7 +616,7 @@ function ln(o) {
|
|
|
616
616
|
document.removeEventListener(`${y}move`, O), document.removeEventListener(`${y}up`, v), document.removeEventListener("keydown", I), document.removeEventListener("keyup", M), document.removeEventListener("touchstart", _, { capture: !0 }), document.removeEventListener("touchmove", _, { capture: !0 }), window.removeEventListener("blur", B), x(), window.requestAnimationFrame(() => {
|
|
617
617
|
if (s.current === !1) return;
|
|
618
618
|
s.current = !1;
|
|
619
|
-
const C = b, E = d.current, $ =
|
|
619
|
+
const C = b, E = d.current, $ = tt(C, E.currentTarget);
|
|
620
620
|
u?.($, m.current, E), m.current = null;
|
|
621
621
|
});
|
|
622
622
|
}, []), B = U(() => {
|
|
@@ -624,7 +624,7 @@ function ln(o) {
|
|
|
624
624
|
}, []), S = k(() => {
|
|
625
625
|
x(), L(h), window.requestAnimationFrame(() => {
|
|
626
626
|
if (s.current === !1) return;
|
|
627
|
-
const b = f.current, C = d.current, E =
|
|
627
|
+
const b = f.current, C = d.current, E = tt(b, C.currentTarget);
|
|
628
628
|
l?.(E, m.current, C);
|
|
629
629
|
});
|
|
630
630
|
}, [h]), O = k((b) => {
|
|
@@ -654,28 +654,28 @@ const jn = ({ initValue: o, useHookBody: e, applyStateChange: t }) => {
|
|
|
654
654
|
console && console.warn && console.warn(o);
|
|
655
655
|
}, yt = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0;
|
|
656
656
|
let Un = 1, St = !1, an = !1;
|
|
657
|
-
const
|
|
657
|
+
const nt = [], De = [], it = () => {
|
|
658
658
|
De.forEach((o) => o());
|
|
659
659
|
}, Xn = ({ automaticContainerInternalUseOnly: o }) => {
|
|
660
660
|
const [e, t] = q([]), n = K([]);
|
|
661
661
|
return n.current = e, o || St !== !1 || (an = !0), W(() => {
|
|
662
662
|
let r = !0;
|
|
663
663
|
function i() {
|
|
664
|
-
if (r) return De[0] !== i ? (o || St !== !0 || xt("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void t((a) => [])) : void t([...
|
|
664
|
+
if (r) return De[0] !== i ? (o || St !== !0 || xt("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void t((a) => [])) : void t([...nt]);
|
|
665
665
|
}
|
|
666
|
-
return De.push(i),
|
|
667
|
-
r = !1, n.current?.length > 0 && xt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), De.splice(De.indexOf(i), 1),
|
|
666
|
+
return De.push(i), it(), () => {
|
|
667
|
+
r = !1, n.current?.length > 0 && xt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), De.splice(De.indexOf(i), 1), it();
|
|
668
668
|
};
|
|
669
669
|
}, [o]), P(me, { children: e.map(({ hook: r, key: i }) => wn(jn, { ...r, key: i })) });
|
|
670
670
|
}, Yn = (o) => {
|
|
671
671
|
const e = Un++;
|
|
672
|
-
return
|
|
672
|
+
return nt.push({ hook: o, key: e }), De.length === 0 && an === !1 && (St = !0, ((t) => {
|
|
673
673
|
if (yt.document && yt.document.createElement) {
|
|
674
674
|
const n = yt.document.createElement("div");
|
|
675
675
|
En(n).render(P(t, { automaticContainerInternalUseOnly: !0 }));
|
|
676
676
|
} else xt("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
|
|
677
|
-
})(Xn)),
|
|
678
|
-
|
|
677
|
+
})(Xn)), it(), () => {
|
|
678
|
+
nt.splice(nt.findIndex((t) => t.key === e), 1), it();
|
|
679
679
|
};
|
|
680
680
|
};
|
|
681
681
|
let Et = null;
|
|
@@ -705,8 +705,8 @@ const Gn = cn(null, () => {
|
|
|
705
705
|
}, getMode: () => o }), [o]);
|
|
706
706
|
}, qn = cn({ setClipboard: (o) => {
|
|
707
707
|
throw new Error("This is only available via the useClipboard.");
|
|
708
|
-
}, getClipboard: () =>
|
|
709
|
-
const [o, e] = q(
|
|
708
|
+
}, getClipboard: () => rt.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
|
|
709
|
+
const [o, e] = q(rt.Global);
|
|
710
710
|
return { setClipboard: (t) => e(t), getClipboard: () => o, refNativeCopy: K(null), refNativeLastKey: K(null) };
|
|
711
711
|
}), Qo = (o) => {
|
|
712
712
|
const { source: e, target: t, onPaste: n, onClipboardUpdate: r, commands: i } = o, a = lt(), u = k(r, [r]), l = k(n, [n]), { getClipboard: s, refNativeCopy: c } = qn(), h = s();
|
|
@@ -787,9 +787,9 @@ const Gn = cn(null, () => {
|
|
|
787
787
|
const S = await h.readReference();
|
|
788
788
|
u?.(S);
|
|
789
789
|
}, _ = (B) => {
|
|
790
|
-
a.showMessage?.(
|
|
790
|
+
a.showMessage?.(rt.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
|
|
791
791
|
}, v = (B) => {
|
|
792
|
-
a.showMessage?.(
|
|
792
|
+
a.showMessage?.(rt.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
|
|
793
793
|
};
|
|
794
794
|
return h.addEventListener("clipboardchange", y), h.addEventListener("clipboarderrorread", _), h.addEventListener("clipboarderrorwrite", v), () => {
|
|
795
795
|
h.removeEventListener("clipboardchange", y), h.removeEventListener("clipboarderrorread", _), h.removeEventListener("clipboarderrorwrite", v);
|
|
@@ -924,15 +924,15 @@ function G() {
|
|
|
924
924
|
return n;
|
|
925
925
|
}
|
|
926
926
|
const oo = {}, ro = (o) => {
|
|
927
|
-
const { onPointerDown: e, style: t, splitDirection: n, paddingBefore: r = 0, paddingAfter: i = 0, disabled: a, key: u,
|
|
927
|
+
const { onPointerDown: e, style: t, splitDirection: n, paddingBefore: r = 0, paddingAfter: i = 0, disabled: a, key: u, propsHitArea: l = oo, ...s } = o, c = n === "row", { style: h, className: d, ...f } = l;
|
|
928
928
|
return P("div", { style: { ...t, position: "relative" }, ...s, children: P("div", { className: G("hit-box", d), style: { left: (c ? -r : 0) + "px", width: `calc(100% + ${c ? r + i : 0}px)`, top: (c ? 0 : -r) + "px", height: `calc(100% + ${c ? 0 : r + i}px)`, position: "absolute", ...h }, onPointerDown: a ? void 0 : e, ...f }) }, u);
|
|
929
|
-
},
|
|
929
|
+
}, Qe = {}, we = (o, e, t = !0) => o === null ? null : o.pixels !== null ? t ? o.pixels : e - o.pixels : (t ? o.percent : 100 - o.percent) / 100 * e, et = (o, e = !0) => o?.percent ? `${e ? o.percent : 100 - o.percent}%` : o?.pixels ? `${o.pixels}px` : void 0, he = (o, e) => {
|
|
930
930
|
if (o == null) return null;
|
|
931
931
|
const t = { percent: null, pixels: null };
|
|
932
932
|
let n = e;
|
|
933
933
|
return typeof o == "string" && ((o = o.trim().toLowerCase()).endsWith("px") ? (o = o.substring(0, o.length - 2), n = !1) : o.endsWith("%") && (o = o.substring(0, o.length - 1), n = !0), o = parseFloat(o)), n ? t.percent = o : t.pixels = o, Object.freeze(t);
|
|
934
934
|
}, io = _e(Me((o, e) => {
|
|
935
|
-
const { elementBefore: t, elementAfter: n, splitDirection: r = "row", fixedPane: i = null, position: a, onPositionChange: u, minBefore: l, maxBefore: s, minAfter: c, maxAfter: h, children: d, className: f, style: m, disabled: p = !1, onDragStart: x, onDragResize: L, onDragFinish: y,
|
|
935
|
+
const { elementBefore: t, elementAfter: n, splitDirection: r = "row", fixedPane: i = null, position: a, onPositionChange: u, minBefore: l, maxBefore: s, minAfter: c, maxAfter: h, children: d, className: f, style: m, disabled: p = !1, onDragStart: x, onDragResize: L, onDragFinish: y, propsResizer: _ = Qe, propsPane: v = Qe, propsPaneBefore: B = Qe, propsPaneAfter: S = Qe, renderResizer: O = ro } = o;
|
|
936
936
|
if (d) throw new Error("Use elementBefore and elementAfter instead of children.");
|
|
937
937
|
const I = R(() => ae.isValidElement(n) && ae.isValidElement(t), [n, t]), M = R(() => {
|
|
938
938
|
let A = null;
|
|
@@ -945,12 +945,12 @@ const oo = {}, ro = (o) => {
|
|
|
945
945
|
}, [a, i]);
|
|
946
946
|
const [$, { width: T, height: g }] = Ee(), [z, { width: H, height: X }] = Ee(), D = r === "row" ? H : X, F = r === "row" ? T : g, V = R(() => ((A, j, oe, J) => {
|
|
947
947
|
const ce = [null, null], le = [null, null];
|
|
948
|
-
if (A || (A = { percent: J.fixedPaneOffset === null ? 50 : null, pixels: J.fixedPaneOffset === null ? null : 0 }), j === 0) return A?.pixels != null ? J.fixedPaneOffset !== 1 ? (ce[0] = A?.pixels, le[1] = 100) : (ce[1] = A?.pixels - oe, le[0] = 100) : A?.percent != null && (J.fixedPaneOffset !== 1 ? (le[0] = A?.percent, le[1] = 100 - A?.percent) : (le[1] = A?.percent, le[0] = 100 - A?.percent)), { percents: le, pixels: ce, minBefore:
|
|
949
|
-
let ue = we(A, j, J.fixedPaneOffset !== 1), ie = j - oe, kt = we(J.minBefore, ie, !0) ?? 0, gn = we(J.maxBefore, ie, !0) ?? ie,
|
|
950
|
-
|
|
948
|
+
if (A || (A = { percent: J.fixedPaneOffset === null ? 50 : null, pixels: J.fixedPaneOffset === null ? null : 0 }), j === 0) return A?.pixels != null ? J.fixedPaneOffset !== 1 ? (ce[0] = A?.pixels, le[1] = 100) : (ce[1] = A?.pixels - oe, le[0] = 100) : A?.percent != null && (J.fixedPaneOffset !== 1 ? (le[0] = A?.percent, le[1] = 100 - A?.percent) : (le[1] = A?.percent, le[0] = 100 - A?.percent)), { percents: le, pixels: ce, minBefore: et(J.minBefore, !0), maxBefore: et(J.maxBefore, !0), minAfter: et(J.minAfter), maxAfter: et(J.maxAfter) };
|
|
949
|
+
let ue = we(A, j, J.fixedPaneOffset !== 1), ie = j - oe, kt = we(J.minBefore, ie, !0) ?? 0, gn = we(J.maxBefore, ie, !0) ?? ie, qe = 0, dt = 0, Pt = 0, Dt = ie;
|
|
950
|
+
qe = (we(J.maxAfter, j, !1) ?? oe) - oe, dt = we(J.minAfter, j, !1) ?? j, Pt = Math.max(kt, qe), Dt = Math.min(gn, dt), ue = Math.max(Pt, Math.min(ue, Dt)), dt = Math.min(ie - ue, we(J.maxAfter, ie - ue, !0) ?? ie), qe = Math.min(ie - ue, we(J.minAfter, ie - ue, !0) ?? ie), ce[0] = ue, ce[1] = ie - ce[0];
|
|
951
951
|
const yn = Math.max(0, Math.min(100, ue / ie * 100));
|
|
952
|
-
return le[0] = yn, le[1] = 100 - le[0], { percents: le, pixels: ce, minBefore: `${kt}px`, minAfter: `${
|
|
953
|
-
})(C, F, D, M), [M, C, F, D, r]), [Y, ee] = q(!1), Le = k(x, [x]), ge = k(L, [L]), Ce = k(y, [y]), ye = K(null), at = K(null),
|
|
952
|
+
return le[0] = yn, le[1] = 100 - le[0], { percents: le, pixels: ce, minBefore: `${kt}px`, minAfter: `${qe}px`, maxBefore: `${ce[0]}px`, maxAfter: `${ce[1]}px` };
|
|
953
|
+
})(C, F, D, M), [M, C, F, D, r]), [Y, ee] = q(!1), Le = k(x, [x]), ge = k(L, [L]), Ce = k(y, [y]), ye = K(null), at = K(null), Ne = K(null), { style: ct, className: Re, ...He } = v, We = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...ct }, { className: ut, style: Ve, ...Fe } = B, { className: je, style: Ue, ...Te } = S, Be = { flex: "1 1 100%", width: "100%", ...m, flexDirection: r, display: "flex" }, { className: se, style: ke, onPointerDown: Xe, ...Ye } = _, Oe = k((A) => {
|
|
954
954
|
const j = he(A, i === null);
|
|
955
955
|
E(j);
|
|
956
956
|
}, [i]), w = k((A) => {
|
|
@@ -967,17 +967,17 @@ const oo = {}, ro = (o) => {
|
|
|
967
967
|
A.stopPropagation(), A.preventDefault();
|
|
968
968
|
}
|
|
969
969
|
}, [C, Y, a, i, F]), Z = k((A) => {
|
|
970
|
-
|
|
971
|
-
}, [
|
|
970
|
+
Xe?.(A), A.defaultPrevented || p || Y || (ee(!0), Le(), document.addEventListener("pointermove", w, { passive: !1 }), document.addEventListener("touchmove", w, { passive: !1 }), document.addEventListener("pointerup", N, { passive: !1 }));
|
|
971
|
+
}, [Xe]), ve = Tt(e, () => ({ setPosition: Oe, isSplitPane: () => !0 }), []), Pe = R(() => I ? O?.({ key: "resizer", ref: Ae([z, at]), className: G("resizer", se), onPointerDownCapture: Z, style: { cursor: p ? void 0 : r === "row" ? "ew-resize" : "ns-resize", minWidth: r === "row" ? "2px" : void 0, minHeight: r !== "row" ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...ke }, splitDirection: r, disabled: p, ...Ye }) : null, [I, se, Ye, r, ke, p]), be = r === "row" ? "Width" : "Height", ht = R(() => {
|
|
972
972
|
if (!t) return null;
|
|
973
|
-
const A = { ...
|
|
974
|
-
return P("div", { ref: ye, className: G("before",
|
|
975
|
-
}, [t, v, B, M, V]),
|
|
973
|
+
const A = { ...We, ...Ve, flex: M.fixedPaneOffset === 0 && V?.pixels[0] !== null ? `0 0 ${Math.round(V?.pixels[0])}px` : `1 1 ${Math.round(V?.percents[0] ?? 100)}%`, [`min${be}`]: V?.minBefore, [`max${be}`]: n ? V?.maxBefore : "100%" };
|
|
974
|
+
return P("div", { ref: ye, className: G("before", Re, ut), style: A, ...He, ...Fe, children: t }, "before");
|
|
975
|
+
}, [t, v, B, M, V]), Ge = R(() => {
|
|
976
976
|
if (!n) return null;
|
|
977
|
-
const A = { ...
|
|
978
|
-
return P("div", { ref:
|
|
977
|
+
const A = { ...We, ...Ue, flex: M.fixedPaneOffset === 1 && V?.pixels[1] !== null ? `0 0 ${Math.round(V?.pixels[1])}px` : `1 1 ${Math.round(V?.percents[1] ?? 100)}%`, [`min${be}`]: V?.minAfter, [`max${be}`]: t ? V?.maxAfter : "100%" };
|
|
978
|
+
return P("div", { ref: Ne, className: G("after", Re, je), style: A, ...He, ...Te, children: n }, "after");
|
|
979
979
|
}, [n, v, S, M, V]);
|
|
980
|
-
return fe("div", { ref: Ae([$, ve]), className: G("splitPane", r === "row" ? "vertical" : "horizontal", { dragging: Y }, f), style: Be, children: [ht, Pe,
|
|
980
|
+
return fe("div", { ref: Ae([$, ve]), className: G("splitPane", r === "row" ? "vertical" : "horizontal", { dragging: Y }, f), style: Be, children: [ht, Pe, Ge] });
|
|
981
981
|
}));
|
|
982
982
|
function so(o) {
|
|
983
983
|
if (typeof o == "function") return o;
|
|
@@ -1206,21 +1206,21 @@ function lo() {
|
|
|
1206
1206
|
} };
|
|
1207
1207
|
}
|
|
1208
1208
|
io.displayName = "SplitPane";
|
|
1209
|
-
const
|
|
1210
|
-
|
|
1209
|
+
const ot = lo();
|
|
1210
|
+
ot.register("base", () => import("./DTq8GPy7DLZm2D6S.mjs"));
|
|
1211
1211
|
const Ft = (o) => P("svg", { ...o, children: P("path", {}) }), ao = { Icon: "_Icon_17dpm_10" }, co = _e((o) => {
|
|
1212
|
-
const { iconKey: e, packKey: t, className: n, style: r, role: i, title: a, size: u, ariaHidden: l,
|
|
1212
|
+
const { iconKey: e, packKey: t, className: n, style: r, role: i, title: a, size: u, ariaHidden: l, propsSource: s, children: c, ...h } = o, [d, f] = ae.useState(null);
|
|
1213
1213
|
ae.useEffect(() => {
|
|
1214
1214
|
let E = !0, $ = t, T = e;
|
|
1215
1215
|
if (!T) {
|
|
1216
|
-
const g =
|
|
1217
|
-
return void f({ glyph: g ? { svg: te.EmptyArray } : void 0, pack: g ?? void 0, packKey: $ ??
|
|
1216
|
+
const g = ot.getPack($);
|
|
1217
|
+
return void f({ glyph: g ? { svg: te.EmptyArray } : void 0, pack: g ?? void 0, packKey: $ ?? ot.getActive() });
|
|
1218
1218
|
}
|
|
1219
1219
|
if (T.includes(":")) {
|
|
1220
1220
|
const [g, z] = T.split(":");
|
|
1221
1221
|
$ = g, T = z;
|
|
1222
1222
|
}
|
|
1223
|
-
return
|
|
1223
|
+
return ot.resolve(T, { packKey: $ }).then((g) => {
|
|
1224
1224
|
E && f(g);
|
|
1225
1225
|
}), () => {
|
|
1226
1226
|
E = !1;
|
|
@@ -1408,12 +1408,12 @@ const ne = { Horizontal: "horizontal", Vertical: "vertical" }, Se = { scrollbar:
|
|
|
1408
1408
|
}));
|
|
1409
1409
|
_n.displayName = "TouchThumbHandle";
|
|
1410
1410
|
const yo = 24, vo = _e(Me((o, e) => {
|
|
1411
|
-
const { offset: t = 0, totalSize: n = 0, viewportSize: r = 0, style: i, className: a, orientation: u = ne.Vertical, onScrollOffset: l, onScroll: s, showCustomScrollButtons: c, scrollButtonIncrement: h = 200, scrollButtonInitialRepeatDelay: d = 260, scrollButtonAdditionalRepeatDelay: f = 120, minThumbSize: m = yo, maxThumbSize: p,
|
|
1411
|
+
const { offset: t = 0, totalSize: n = 0, viewportSize: r = 0, style: i, className: a, orientation: u = ne.Vertical, onScrollOffset: l, onScroll: s, showCustomScrollButtons: c, scrollButtonIncrement: h = 200, scrollButtonInitialRepeatDelay: d = 260, scrollButtonAdditionalRepeatDelay: f = 120, minThumbSize: m = yo, maxThumbSize: p, renderScrollButtonStart: x = mo, renderScrollButtonEnd: L = _o, propsTouchThumb: y, propsThumb: _, onMouseDown: v, ...B } = o, S = Ke().primaryInput === "touch", O = c ?? !S;
|
|
1412
1412
|
k(s, [s]);
|
|
1413
1413
|
const [I, M] = q({ offset: 0, length: 0, disabled: !1 }), b = K(-1), C = u === ne.Vertical, [E, { width: $, height: T }] = Ee(), g = C ? T : $, z = k((w, N, Z) => {
|
|
1414
1414
|
if (N === 0 || Z === 0) {
|
|
1415
|
-
const
|
|
1416
|
-
return M(
|
|
1415
|
+
const Ge = { offset: 0, length: m, disabled: !0 };
|
|
1416
|
+
return M(Ge), Ge;
|
|
1417
1417
|
}
|
|
1418
1418
|
if (N >= Z) return { offset: 0, length: g, disabled: !0 };
|
|
1419
1419
|
const ve = Z / g, Pe = N / ve, be = Math.min(Math.max(m, Pe), Math.min(g, p ?? Number.MAX_SAFE_INTEGER)), ht = w / ve;
|
|
@@ -1439,55 +1439,55 @@ const yo = 24, vo = _e(Me((o, e) => {
|
|
|
1439
1439
|
H(Z);
|
|
1440
1440
|
}, [F, C]), at = k((w) => {
|
|
1441
1441
|
ye(w);
|
|
1442
|
-
}, []),
|
|
1442
|
+
}, []), Ne = k((w) => {
|
|
1443
1443
|
V(!1);
|
|
1444
1444
|
}, []), ct = k((w) => {
|
|
1445
1445
|
try {
|
|
1446
1446
|
w.currentTarget.releasePointerCapture(w.pointerId);
|
|
1447
1447
|
} catch {
|
|
1448
1448
|
}
|
|
1449
|
-
|
|
1450
|
-
}, []),
|
|
1449
|
+
Ne(w);
|
|
1450
|
+
}, []), Re = k((w) => {
|
|
1451
1451
|
if (!w.currentTarget) return;
|
|
1452
1452
|
const N = w.currentTarget.getBoundingClientRect(), Z = C ? w.clientY - N.top : w.clientX - N.left;
|
|
1453
1453
|
H(Z);
|
|
1454
|
-
}, [C, I, r, n]),
|
|
1454
|
+
}, [C, I, r, n]), He = k((w) => {
|
|
1455
1455
|
const N = Math.max(1, Math.floor(0.9 * r));
|
|
1456
1456
|
C ? (w.key === "ArrowDown" && H(Math.min(D, t + 1)), w.key === "ArrowUp" && H(Math.max(0, t - 1)), w.key === "PageDown" && H(Math.min(D, t + N)), w.key === "PageUp" && H(Math.max(0, t - N)), w.key === "Home" && H(0), w.key === "End" && H(D)) : (w.key === "ArrowRight" && H(Math.min(D, t + 1)), w.key === "ArrowLeft" && H(Math.max(0, t - 1)), w.key === "PageDown" && H(Math.min(D, t + N)), w.key === "PageUp" && H(Math.max(0, t - N)), w.key === "Home" && H(0), w.key === "End" && H(D));
|
|
1457
|
-
}, [C, r, n, t, D]),
|
|
1457
|
+
}, [C, r, n, t, D]), We = K(null), ut = R(() => {
|
|
1458
1458
|
const w = I.disabled;
|
|
1459
1459
|
if (w) return null;
|
|
1460
|
-
const N = P("div", { ..._, className: G(Se.thumb, { disabled: w }), ref:
|
|
1461
|
-
return !S || w ? N : fe(me, { children: [N, P(_n, { ...y, offset: I.offset, orientation: C ? ne.Vertical : ne.Horizontal, onPointerDown: ge, onPointerMove: ye, onPointerUp:
|
|
1462
|
-
}, [I, m, D, t, C, S, v, y, _]), [
|
|
1460
|
+
const N = P("div", { ..._, className: G(Se.thumb, { disabled: w }), ref: We, role: "slider", "aria-label": C ? "Rows" : "Columns", "aria-orientation": C ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": D, "aria-valuenow": t, tabIndex: 0, style: { ..._?.style, position: "relative", [C ? "height" : "width"]: `${I.length}px`, [C ? "width" : "height"]: "100%", transform: C ? `translateY(${I.offset}px)` : `translateX(${I.offset}px)`, [C ? "minHeight" : "minWidth"]: `${m}px` }, onMouseDown: v, onPointerDown: Ce, onPointerMove: at, onPointerUp: ct });
|
|
1461
|
+
return !S || w ? N : fe(me, { children: [N, P(_n, { ...y, offset: I.offset, orientation: C ? ne.Vertical : ne.Horizontal, onPointerDown: ge, onPointerMove: ye, onPointerUp: Ne })] });
|
|
1462
|
+
}, [I, m, D, t, C, S, v, y, _]), [Ve, Fe] = q(null), je = k(() => {
|
|
1463
1463
|
let w;
|
|
1464
1464
|
w = typeof h == "function" ? h(t, r, n) : t - h;
|
|
1465
1465
|
const N = Math.max(0, w);
|
|
1466
|
-
return X(N),
|
|
1467
|
-
}, [h, t, r, n]),
|
|
1466
|
+
return X(N), Fe(N), N;
|
|
1467
|
+
}, [h, t, r, n]), Ue = k(() => {
|
|
1468
1468
|
let w;
|
|
1469
1469
|
w = typeof h == "function" ? h(t, r, n) : t + h;
|
|
1470
1470
|
const N = Math.min(D, w);
|
|
1471
|
-
return X(N),
|
|
1471
|
+
return X(N), Fe(N), N;
|
|
1472
1472
|
}, [h, t, D, r, n]), Te = K(null), Be = K(null), se = U(() => {
|
|
1473
1473
|
Te.current && (clearTimeout(Te.current), Te.current = null, Be.current = null);
|
|
1474
1474
|
}, []), ke = U((w, N, Z, ve = d) => {
|
|
1475
1475
|
Be.current = w, Te.current = setTimeout(() => {
|
|
1476
|
-
const Pe = Z ?
|
|
1476
|
+
const Pe = Z ? je() : Ue();
|
|
1477
1477
|
Pe !== Be.current ? ke(Pe, !1, Z, f) : se();
|
|
1478
1478
|
}, N ? 0 : ve);
|
|
1479
|
-
}, [
|
|
1479
|
+
}, [je, Ue, se]);
|
|
1480
1480
|
W(() => () => se(), [se]);
|
|
1481
|
-
const
|
|
1481
|
+
const Xe = R(() => {
|
|
1482
1482
|
if (!O) return null;
|
|
1483
1483
|
const w = { orientation: u, disabled: t <= 0, onMouseUp: se, onMouseLeave: se, onMouseDown: () => ke(t, !0, !0) };
|
|
1484
1484
|
return x?.(w);
|
|
1485
|
-
}, [O, u, t,
|
|
1485
|
+
}, [O, u, t, Ve]), Ye = R(() => {
|
|
1486
1486
|
if (!O) return null;
|
|
1487
1487
|
const w = { orientation: u, disabled: t >= D, onMouseUp: se, onMouseLeave: se, onMouseDown: () => ke(t, !0, !1) };
|
|
1488
1488
|
return L?.(w);
|
|
1489
|
-
}, [O, u, t, D,
|
|
1490
|
-
return fe("div", { ref: Ae([Le, e]), className: G(a, Se.scrollbar, Oe, { dragging: F, "has-touch-thumb": S }), style: i, ...B, children: [
|
|
1489
|
+
}, [O, u, t, D, Ve]), Oe = C ? "vertical" : "horizontal";
|
|
1490
|
+
return fe("div", { ref: Ae([Le, e]), className: G(a, Se.scrollbar, Oe, { dragging: F, "has-touch-thumb": S }), style: i, ...B, children: [Xe, P("div", { ref: E, role: "scrollbar", "aria-orientation": Oe, "aria-valuemin": 0, "aria-valuemax": D, "aria-valuenow": t, tabIndex: 0, className: G(Se.track, "track", Oe), onMouseDown: v, onPointerDown: Re, onKeyDown: He, children: ut }), Ye] });
|
|
1491
1491
|
}));
|
|
1492
1492
|
let jt = Date.now, Ut = 1e3, pe = {}, bo = 1;
|
|
1493
1493
|
const $e = (o) => {
|
|
@@ -1680,7 +1680,7 @@ class So {
|
|
|
1680
1680
|
}
|
|
1681
1681
|
}
|
|
1682
1682
|
}
|
|
1683
|
-
const
|
|
1683
|
+
const st = (o) => P(vo, { ...o }), hr = Object.freeze(Object.defineProperty({ __proto__: null, defaultRenderScrollbar: st, getScrollTo: (o, e, t, n, r = 0) => {
|
|
1684
1684
|
for (let i = 0; i < t.length; i++) {
|
|
1685
1685
|
const a = t[i].getBoundingClientRect();
|
|
1686
1686
|
let u = a.left - e, l = u + a.width;
|
|
@@ -1689,8 +1689,11 @@ const Ne = (o, e) => P(vo, { ...o, ref: e }), hr = Object.freeze(Object.definePr
|
|
|
1689
1689
|
} else if (Math.ceil(l) > Math.ceil(o) + 2) return l;
|
|
1690
1690
|
}
|
|
1691
1691
|
return r;
|
|
1692
|
-
} }, Symbol.toStringTag, { value: "Module" })), de = { 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" }, Eo = (
|
|
1693
|
-
const
|
|
1692
|
+
} }, Symbol.toStringTag, { value: "Module" })), de = { 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" }, Eo = (o) => {
|
|
1693
|
+
const e = o?.width, t = o?.height;
|
|
1694
|
+
return P("div", { className: "corner", style: { minWidth: `${e}px`, width: `${e}px`, minHeight: `${t}px`, height: `${t}px` } });
|
|
1695
|
+
}, Mo = _e(Me((o, e) => {
|
|
1696
|
+
const { children: t, viewport: n, onScrollViewport: r, showHorizontalScrollbar: i = !0, showVerticalScrollbar: a = !0, createScrollCorner: u = Eo, renderScrollbarHorizontal: l = st, renderScrollbarVertical: s = st, style: c, className: h, touchElement: d, disableTouch: f, ...m } = o, p = i && l, x = a && s, L = k(r, [r]), y = Tt(e, () => ({ isScrollPane: () => !0 }), []), _ = K(null);
|
|
1694
1697
|
W(() => {
|
|
1695
1698
|
_.current && (_.current.__scrollTop === n?.top && _.current.__scrollLeft === n?.left || _.current.__isDecelerating || _.current?.scrollTo(n?.left, n?.top, !1));
|
|
1696
1699
|
}, [n?.left, n?.top, d]);
|
|
@@ -1735,7 +1738,7 @@ const Ne = (o, e) => P(vo, { ...o, ref: e }), hr = Object.freeze(Object.definePr
|
|
|
1735
1738
|
}));
|
|
1736
1739
|
Mo.displayName = "ScrollPane";
|
|
1737
1740
|
const Lo = 300, Co = 100, To = 1e6, ko = 100, Po = 50, Do = _e(Me((o, e) => {
|
|
1738
|
-
const { offset: t = 0, viewportSize: n = 0, totalSize: r = 0, minSize: i = 0, endGap: a = Lo, endScrollIncrement: u = Co, style: l = tn, onMouseDown: s, onScrollOffset: c, onScroll: h, scaleLimit: d = To, scaleFactor: f = ko, precisionFactor: m = Po,
|
|
1741
|
+
const { offset: t = 0, viewportSize: n = 0, totalSize: r = 0, minSize: i = 0, endGap: a = Lo, endScrollIncrement: u = Co, style: l = tn, onMouseDown: s, onScrollOffset: c, onScroll: h, scaleLimit: d = To, scaleFactor: f = ko, precisionFactor: m = Po, renderScrollbar: p = st, ...x } = o;
|
|
1739
1742
|
h && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
|
|
1740
1743
|
const L = k(s, [s]), [y, _] = q(!1), v = R(() => {
|
|
1741
1744
|
const M = d === 0 ? r : Math.min(r ?? 0, Math.max(i ?? 0, (t ?? 0) + (n ?? 0)) + (a ?? 0)), b = d !== 0 && M > d ? f : 1, C = b / m, E = Math.ceil(M / b);
|
|
@@ -1749,14 +1752,14 @@ const Lo = 300, Co = 100, To = 1e6, ko = 100, Po = 50, Do = _e(Me((o, e) => {
|
|
|
1749
1752
|
}, []), I = U((M) => {
|
|
1750
1753
|
_(!0), L?.(M), document.addEventListener("mousemove", S, { passive: !0 }), document.addEventListener("mouseup", O, { passive: !0 });
|
|
1751
1754
|
}, [S, O]);
|
|
1752
|
-
return
|
|
1755
|
+
return p({ style: l, ...x, offset: v.offset, totalSize: v.totalSize, viewportSize: v.viewportSize, onMouseDown: I, onScrollOffset: B, ref: e });
|
|
1753
1756
|
}));
|
|
1754
1757
|
Do.displayName = "VirtualScrollbar";
|
|
1755
1758
|
export {
|
|
1756
1759
|
bt as Command,
|
|
1757
1760
|
Vo as CommandButtonType,
|
|
1758
1761
|
on as CommandGroup,
|
|
1759
|
-
|
|
1762
|
+
ot as DefaultDynamicIconService,
|
|
1760
1763
|
Nn as DefaultReactNotifier,
|
|
1761
1764
|
co as DynamicIcon,
|
|
1762
1765
|
ir as ErrorTestPanel,
|
|
@@ -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.
|