solid-baseui 0.1.0-alpha.1 → 0.1.0-alpha.2
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/CHANGELOG.md +42 -0
- package/README.md +51 -20
- package/dist/lib/client/DialogHandle-DluOK_7u.js +521 -0
- package/dist/lib/client/DialogPopup-CfEb3F54.js +138 -0
- package/dist/lib/client/FieldControl-eDe-Jnp9.js +142 -0
- package/dist/lib/client/{FieldRootContext-izCEh80D.js → FieldRootContext-D3fuVjs3.js} +1 -1
- package/dist/lib/client/{FocusManager-NP1uPXTi.js → FocusManager-q7z7PMV1.js} +92 -89
- package/dist/lib/client/{InternalBackdrop-cSK13gaM.js → InternalBackdrop-B8_lfUvf.js} +1 -1
- package/dist/lib/client/{MenuSubmenuTrigger-yfncqM-D.js → MenuSubmenuTrigger-DMb5CwTF.js} +386 -386
- package/dist/lib/client/{PopupHandle-CQI6Om1Z.js → PopupHandle-DyX5gY1e.js} +17 -11
- package/dist/lib/client/{PopupStore-Du0O57fL.js → PopupStore-BjRwcvbG.js} +91 -88
- package/dist/lib/client/PopupViewport-BanYHrD-.js +154 -0
- package/dist/lib/client/{TriggerFocusGuards-Cs8LVBj5.js → TriggerFocusGuards-Fzspp3Y1.js} +2 -2
- package/dist/lib/client/accordion/index.js +1 -1
- package/dist/lib/client/{accordion-BFeZFpJZ.js → accordion-CA2DfX67.js} +144 -144
- package/dist/lib/client/alert-dialog/index.js +1 -1
- package/dist/lib/client/{alert-dialog-BxGUF8_Q.js → alert-dialog-Bup88Dpx.js} +2 -2
- package/dist/lib/client/autocomplete/index.js +1 -1
- package/dist/lib/client/{autocomplete-C9QA98XD.js → autocomplete-oyy_uRpU.js} +2 -2
- package/dist/lib/client/avatar/index.js +1 -1
- package/dist/lib/client/avatar-DNZ4fnBd.js +191 -0
- package/dist/lib/client/button/index.js +1 -1
- package/dist/lib/client/button-BJZYmCVv.js +88 -0
- package/dist/lib/client/checkbox/index.js +1 -1
- package/dist/lib/client/checkbox-group/index.js +1 -1
- package/dist/lib/client/{checkbox-group-CwMDoSTK.js → checkbox-group-DGyrciZJ.js} +1 -1
- package/dist/lib/client/checkbox-sQHYTbpB.js +425 -0
- package/dist/lib/client/collapsible/index.js +1 -1
- package/dist/lib/client/collapsible-BENbFFCc.js +230 -0
- package/dist/lib/client/combobox/index.js +1 -1
- package/dist/lib/client/{combobox-6DhOdzit.js → combobox-BGH8QLXH.js} +143 -141
- package/dist/lib/client/compositeNavigation-DCt1sQon.js +82 -0
- package/dist/lib/client/{constants-cOVxAoxB.js → constants-ByOMFJAe.js} +100 -100
- package/dist/lib/client/context-menu/index.js +1 -1
- package/dist/lib/client/context-menu-xQ1sBCET.js +220 -0
- package/dist/lib/client/{createAnchorPositioning-D96gu-Dz.js → createAnchorPositioning-DCXIApS1.js} +1 -1
- package/dist/lib/client/{createAnchoredPopupScrollLock-Cx0cbh1_.js → createAnchoredPopupScrollLock-BxKpJbCE.js} +2 -2
- package/dist/lib/client/{createClickInteraction-CTaIFBiV.js → createClickInteraction-BeBsTqtY.js} +1 -1
- package/dist/lib/client/{createFocusInteraction--s9_qBf3.js → createFocusInteraction-DQPWkZe2.js} +7 -7
- package/dist/lib/client/{createPopupAutoResize-Dn-stj-8.js → createPopupAutoResize-CSNpMz5v.js} +3 -3
- package/dist/lib/client/dialog/index.js +1 -1
- package/dist/lib/client/{dialog-B9tR9X48.js → dialog-C0EF0a5u.js} +2 -2
- package/dist/lib/client/{dom-BEAeQ9Eb.js → dom-lDdayFF_.js} +25 -15
- package/dist/lib/client/drawer/index.js +1 -1
- package/dist/lib/client/{drawer-dyr3_sKQ.js → drawer-uKoNBwDU.js} +519 -518
- package/dist/lib/client/field/index.js +1 -1
- package/dist/lib/client/{field-CjUAjp1m.js → field-DIMrgpBW.js} +144 -144
- package/dist/lib/client/form/index.js +1 -1
- package/dist/lib/client/form-Bqq8wSLY.js +109 -0
- package/dist/lib/client/index.js +34 -34
- package/dist/lib/client/input/index.js +1 -1
- package/dist/lib/client/{input-_QHvSSqM.js → input-YthuKwIE.js} +1 -1
- package/dist/lib/client/internals/composeEventHandlers.js +14 -8
- package/dist/lib/client/internals/field-root-context/index.js +2 -2
- package/dist/lib/client/{mergeStyleValue-DhTA9Nwe.js → isSolidAccessor-BH_FevwH.js} +1 -12
- package/dist/lib/client/menu/index.js +1 -1
- package/dist/lib/client/{menu-DLqUBmMK.js → menu-4rNLN6aX.js} +79 -79
- package/dist/lib/client/menubar/index.js +1 -1
- package/dist/lib/client/menubar-nFQGtNmY.js +163 -0
- package/dist/lib/client/mergeStyleValue-Dcd36yxZ.js +12 -0
- package/dist/lib/client/navigation-menu/index.js +1 -1
- package/dist/lib/client/{navigation-menu-mVHV41Ky.js → navigation-menu-BbRyun3a.js} +284 -284
- package/dist/lib/client/number-field/index.js +1 -1
- package/dist/lib/client/{number-field-DusLw_0X.js → number-field-hT_H0hVu.js} +356 -356
- package/dist/lib/client/otp-field/index.js +1 -1
- package/dist/lib/client/otp-field-lsy2iGID.js +584 -0
- package/dist/lib/client/popover/index.js +1 -1
- package/dist/lib/client/{popover-Cv7xn0nW.js → popover-Cmvmuf1L.js} +250 -248
- package/dist/lib/client/{popupStateMapping-C6jQ_LKo.js → popupStateMapping-nhukB8NK.js} +51 -51
- package/dist/lib/client/preview-card/index.js +1 -1
- package/dist/lib/client/{preview-card-FTN_aafM.js → preview-card-Dtu8AnBN.js} +168 -168
- package/dist/lib/client/radio/index.js +1 -1
- package/dist/lib/client/{radio-DA_oZhQT.js → radio-CeCU-Qqi.js} +77 -77
- package/dist/lib/client/radio-group/index.js +1 -1
- package/dist/lib/client/radio-group-NbuJvjQe.js +195 -0
- package/dist/lib/client/{safePolygon-DJG0VIVo.js → safePolygon-DVAR5dQD.js} +70 -70
- package/dist/lib/client/scroll-area/index.js +1 -1
- package/dist/lib/client/scroll-area-DqbvoAd7.js +717 -0
- package/dist/lib/client/{scrollable-SRNYlhF7.js → scrollable-BVaDUXng.js} +12 -12
- package/dist/lib/client/select/index.js +1 -1
- package/dist/lib/client/{select-DSPJt7Rk.js → select-Dad51Xbn.js} +635 -634
- package/dist/lib/client/slider/index.js +1 -1
- package/dist/lib/client/slider-CLSKFq_M.js +927 -0
- package/dist/lib/client/switch/index.js +1 -1
- package/dist/lib/client/{switch-CPl7QHKI.js → switch-Bzuu5EIg.js} +61 -61
- package/dist/lib/client/tabs/index.js +1 -1
- package/dist/lib/client/{tabs-Bn4rZDyZ.js → tabs-DWiBDv8D.js} +252 -249
- package/dist/lib/client/toast/index.js +1 -1
- package/dist/lib/client/{toast-7LdqZWOs.js → toast-DmtPJW2k.js} +353 -353
- package/dist/lib/client/toggle/index.js +1 -1
- package/dist/lib/client/{toggle-CsC37e3e.js → toggle-CAe-Z8Xn.js} +33 -33
- package/dist/lib/client/toggle-group/index.js +1 -1
- package/dist/lib/client/{toggle-group-DSWb9HxN.js → toggle-group-BbQg5s-m.js} +44 -44
- package/dist/lib/client/toolbar/index.js +1 -1
- package/dist/lib/client/{toolbar-DcCi3HNp.js → toolbar-BXT_g-oX.js} +218 -218
- package/dist/lib/client/tooltip/index.js +1 -1
- package/dist/lib/client/{tooltip-D-PkGco9.js → tooltip-h2r2_Xuo.js} +250 -249
- package/dist/lib/client/{useFilteredItems-B7z2CGMV.js → useFilteredItems-BX0BEuSI.js} +850 -819
- package/dist/lib/server/{DialogHandle-nJSSy_jM.js → DialogHandle-BGIISmG7.js} +16 -16
- package/dist/lib/server/{DialogPopup-Da1aIxVA.js → DialogPopup-C2ZDGf42.js} +4 -4
- package/dist/lib/server/{FieldControl-BDeNR3ug.js → FieldControl-CDMMyvuj.js} +6 -6
- package/dist/lib/server/{FieldRootContext-IC-LWzVp.js → FieldRootContext-Bfpna6gA.js} +3 -3
- package/dist/lib/server/{FocusManager-1LfoCsya.js → FocusManager-D-xgblGs.js} +9 -3
- package/dist/lib/server/{InternalBackdrop-C_iDPVR-.js → InternalBackdrop-D_2zAWnl.js} +1 -1
- package/dist/lib/server/{MenuSubmenuTrigger-rR8ZN7YR.js → MenuSubmenuTrigger-BMQKlOvU.js} +50 -50
- package/dist/lib/server/{PopupHandle-Ct6wywmP.js → PopupHandle-QNj4mED2.js} +14 -5
- package/dist/lib/server/{PopupStore-kHjFPiQ5.js → PopupStore-evylvVnN.js} +5 -2
- package/dist/lib/server/{PopupViewport-DftN5VUp.js → PopupViewport-BDttjORN.js} +37 -27
- package/dist/lib/server/{TriggerFocusGuards-CvoGfft9.js → TriggerFocusGuards-B9GNbLrL.js} +2 -2
- package/dist/lib/server/accordion/index.js +7 -7
- package/dist/lib/server/alert-dialog/index.js +2 -2
- package/dist/lib/server/autocomplete/index.js +2 -2
- package/dist/lib/server/avatar/index.js +3 -3
- package/dist/lib/server/button/index.js +6 -6
- package/dist/lib/server/checkbox/index.js +7 -7
- package/dist/lib/server/checkbox-group/index.js +1 -1
- package/dist/lib/server/collapsible/index.js +6 -6
- package/dist/lib/server/combobox/index.js +18 -18
- package/dist/lib/server/{compositeNavigation-BRVT1C38.js → compositeNavigation-D5jKM4yk.js} +32 -1
- package/dist/lib/server/{constants-D7ciIzsV.js → constants-ByqXubhO.js} +2 -2
- package/dist/lib/server/context-menu/index.js +9 -9
- package/dist/lib/server/{createAnchorPositioning-B5Y0WEev.js → createAnchorPositioning-DrQYe7RS.js} +1 -1
- package/dist/lib/server/{createAnchoredPopupScrollLock-DFuUrykR.js → createAnchoredPopupScrollLock-q6gnOSmv.js} +2 -2
- package/dist/lib/server/{createClickInteraction-BYsMgvup.js → createClickInteraction-D7oc1Vco.js} +1 -1
- package/dist/lib/server/{createFocusInteraction-DMyKsniI.js → createFocusInteraction-DFKr4G7a.js} +1 -1
- package/dist/lib/server/{createPopupAutoResize-ImBjwdj_.js → createPopupAutoResize-Cg0-lLf4.js} +1 -1
- package/dist/lib/server/dialog/index.js +2 -2
- package/dist/lib/server/{dom-Crg_2R-j.js → dom-D8_aB1yy.js} +14 -1
- package/dist/lib/server/drawer/index.js +38 -34
- package/dist/lib/server/field/index.js +6 -6
- package/dist/lib/server/form/index.js +2 -2
- package/dist/lib/server/input/index.js +1 -1
- package/dist/lib/server/internals/composeEventHandlers.js +15 -9
- package/dist/lib/server/internals/field-root-context/index.js +1 -1
- package/dist/lib/server/{mergeStyleValue-BwJ10_X2.js → isSolidAccessor-CZpzAH5l.js} +1 -20
- package/dist/lib/server/menu/index.js +17 -17
- package/dist/lib/server/menubar/index.js +4 -4
- package/dist/lib/server/mergeStyleValue-DecVaoac.js +20 -0
- package/dist/lib/server/navigation-menu/index.js +21 -21
- package/dist/lib/server/number-field/index.js +21 -21
- package/dist/lib/server/otp-field/index.js +8 -8
- package/dist/lib/server/popover/index.js +27 -26
- package/dist/lib/server/{popupStateMapping-B2KsiiLb.js → popupStateMapping-VHqr6M4H.js} +1 -1
- package/dist/lib/server/preview-card/index.js +16 -16
- package/dist/lib/server/radio/index.js +6 -6
- package/dist/lib/server/radio-group/index.js +5 -5
- package/dist/lib/server/{safePolygon-C1GNJbKR.js → safePolygon-B8QtiIZ3.js} +1 -1
- package/dist/lib/server/scroll-area/index.js +18 -18
- package/dist/lib/server/{scrollable-CjsSxbGr.js → scrollable-C9Pgq8T5.js} +1 -1
- package/dist/lib/server/select/index.js +39 -38
- package/dist/lib/server/slider/index.js +14 -14
- package/dist/lib/server/switch/index.js +9 -9
- package/dist/lib/server/tabs/index.js +12 -8
- package/dist/lib/server/toast/index.js +32 -32
- package/dist/lib/server/toggle/index.js +7 -7
- package/dist/lib/server/toggle-group/index.js +2 -2
- package/dist/lib/server/toolbar/index.js +14 -14
- package/dist/lib/server/tooltip/index.js +32 -27
- package/dist/lib/server/{useFilteredItems-DCxq20Is.js → useFilteredItems-BmhL0nf1.js} +181 -137
- package/dist/lib/types/accordion/trigger/AccordionTrigger.d.ts +7 -7
- package/dist/lib/types/combobox/chip/ComboboxChip.d.ts +2 -0
- package/dist/lib/types/combobox/root/ComboboxRoot.d.ts +6 -1
- package/dist/lib/types/combobox/store/ComboboxStore.d.ts +1 -0
- package/dist/lib/types/combobox/utils/handleInputPress.d.ts +1 -1
- package/dist/lib/types/field/control/FieldControl.d.ts +5 -5
- package/dist/lib/types/internals/composeEventHandlers.d.ts +9 -2
- package/dist/lib/types/internals/field-root-context/FieldRootContext.d.ts +1 -0
- package/dist/lib/types/internals/overlay/dom.d.ts +2 -0
- package/dist/lib/types/number-field/input/NumberFieldInput.d.ts +5 -5
- package/dist/lib/types/slider/track/SliderTrack.d.ts +2 -2
- package/dist/lib/types/toolbar/link/ToolbarLink.d.ts +10 -3
- package/dist/lib/types/toolbar/root/ToolbarRoot.d.ts +10 -4
- package/package.json +1 -1
- package/dist/lib/client/DialogHandle-BGyIbcvg.js +0 -521
- package/dist/lib/client/DialogPopup-Df7MC358.js +0 -138
- package/dist/lib/client/FieldControl-C0PATyKV.js +0 -142
- package/dist/lib/client/PopupViewport-IS4XU03s.js +0 -152
- package/dist/lib/client/avatar-BQoEzzav.js +0 -191
- package/dist/lib/client/button-akYS6FyY.js +0 -88
- package/dist/lib/client/checkbox-DOXtzBhA.js +0 -425
- package/dist/lib/client/collapsible-t8YReaIp.js +0 -230
- package/dist/lib/client/compositeNavigation-sxniYTc7.js +0 -58
- package/dist/lib/client/context-menu-CplDpqmi.js +0 -220
- package/dist/lib/client/form-6Ne_bWQX.js +0 -109
- package/dist/lib/client/menubar-DhPRUQZ6.js +0 -163
- package/dist/lib/client/otp-field-D-B9tZzF.js +0 -584
- package/dist/lib/client/radio-group-CWtQxWDl.js +0 -195
- package/dist/lib/client/scroll-area-NCr49LkD.js +0 -717
- package/dist/lib/client/slider-CWq9hxFf.js +0 -927
|
@@ -1,717 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { t } from "./useRender-CxZ8PI-g.js";
|
|
3
|
-
import { getStateAttributesProps as n } from "./internals/getStateAttributesProps.js";
|
|
4
|
-
import { n as r, t as i } from "./resolveStyle-XcgAuaKR.js";
|
|
5
|
-
import { composeEventHandlers as a } from "./internals/composeEventHandlers.js";
|
|
6
|
-
import { n as o } from "./DirectionContext-BwMabICS.js";
|
|
7
|
-
import { n as s } from "./CSPContext-faVzToiT.js";
|
|
8
|
-
import { mergeStyles as c } from "./internals/mergeStyles.js";
|
|
9
|
-
import { createComponent as l, effect as u, getNextElement as d, isServer as f, memo as p, mergeProps as m, runHydrationEvents as h, setAttribute as g, spread as _, template as v } from "@solidjs/web";
|
|
10
|
-
import { DEV as y, Show as b, createContext as x, createEffect as S, createMemo as C, createRoot as w, createSignal as T, createUniqueId as E, getOwner as D, omit as O, onCleanup as k, onSettled as A, untrack as j, useContext as M } from "solid-js";
|
|
11
|
-
//#region src/scroll-area/utils/dom.ts
|
|
12
|
-
function N(e) {
|
|
13
|
-
let t = e.composedPath()[0] ?? e.target;
|
|
14
|
-
if (!t || typeof t.nodeType != "number") return null;
|
|
15
|
-
let n = t;
|
|
16
|
-
return n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement;
|
|
17
|
-
}
|
|
18
|
-
function P(e, t) {
|
|
19
|
-
if (!e || !t || typeof t.nodeType != "number") return !1;
|
|
20
|
-
let n = t;
|
|
21
|
-
for (; n;) {
|
|
22
|
-
if (e.contains(n)) return !0;
|
|
23
|
-
let t = n.getRootNode();
|
|
24
|
-
n = t.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in t ? t.host : null;
|
|
25
|
-
}
|
|
26
|
-
return !1;
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/scroll-area/utils/getOffset.ts
|
|
30
|
-
function F(e, t, n) {
|
|
31
|
-
if (!e) return 0;
|
|
32
|
-
let r = e.ownerDocument.defaultView?.getComputedStyle(e);
|
|
33
|
-
if (!r) return 0;
|
|
34
|
-
let i = `${t}${n === "x" ? "Inline" : "Block"}`, a = Number.parseFloat(r[`${i}Start`]) || 0;
|
|
35
|
-
return n === "x" && t === "margin" ? a * 2 : a + (Number.parseFloat(r[`${i}End`]) || 0);
|
|
36
|
-
}
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/scroll-area/root/ScrollAreaRootContext.ts
|
|
39
|
-
var I = Symbol("ScrollAreaRootContext"), L = x(I);
|
|
40
|
-
function R() {
|
|
41
|
-
let e = M(L);
|
|
42
|
-
if (e === I) throw Error("Base UI: ScrollAreaRootContext is missing. ScrollArea parts must be placed within <ScrollArea.Root>.");
|
|
43
|
-
return e;
|
|
44
|
-
}
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/scroll-area/root/stateAttributes.ts
|
|
47
|
-
var z = (e) => (t) => t ? { [e]: "" } : null, B = {
|
|
48
|
-
hasOverflowX: z("data-has-overflow-x"),
|
|
49
|
-
hasOverflowY: z("data-has-overflow-y"),
|
|
50
|
-
overflowXStart: z("data-overflow-x-start"),
|
|
51
|
-
overflowXEnd: z("data-overflow-x-end"),
|
|
52
|
-
overflowYStart: z("data-overflow-y-start"),
|
|
53
|
-
overflowYEnd: z("data-overflow-y-end"),
|
|
54
|
-
cornerHidden: () => null
|
|
55
|
-
}, V = /* @__PURE__ */ v("<div>"), H = /* @__PURE__ */ v("<style>.base-ui-disable-scrollbar{scrollbar-width:none}.base-ui-disable-scrollbar::-webkit-scrollbar{display:none}"), U = {
|
|
56
|
-
width: 0,
|
|
57
|
-
height: 0
|
|
58
|
-
}, ee = {
|
|
59
|
-
xStart: !1,
|
|
60
|
-
xEnd: !1,
|
|
61
|
-
yStart: !1,
|
|
62
|
-
yEnd: !1
|
|
63
|
-
}, te = {
|
|
64
|
-
x: !0,
|
|
65
|
-
y: !0,
|
|
66
|
-
corner: !0
|
|
67
|
-
};
|
|
68
|
-
function W(e) {
|
|
69
|
-
let o = s(), f = e, v = e, y = `base-ui-${E()}`, [b, x] = T(), [S, w] = T(), [D, A] = T(), [j, M] = T(), [N, I] = T(), [R, z] = T(), [W, G] = T(!1), [K, oe] = T(!1), [se, q] = T(!1), [ce, le] = T(!1), [ue, de] = T(!1), [fe, pe] = T(U), [me, he] = T(U), [ge, _e] = T(ee), [ve, ye] = T(te), be, J = null, xe = 0, Se = 0, Ce = 0, we = 0, Y = "vertical", Te = {
|
|
70
|
-
x: 0,
|
|
71
|
-
y: 0
|
|
72
|
-
}, X = null, Z, Q, Ee = O(v, "render", "children", "class", "onPointerDown", "onPointerEnter", "onPointerLeave", "onPointerMove", "overflowEdgeThreshold", "ref", "style"), De = C(() => ne(f.overflowEdgeThreshold)), $ = C(() => {
|
|
73
|
-
let e = ve(), t = ge();
|
|
74
|
-
return {
|
|
75
|
-
scrolling: K() || se(),
|
|
76
|
-
hasOverflowX: !e.x,
|
|
77
|
-
hasOverflowY: !e.y,
|
|
78
|
-
overflowXStart: t.xStart,
|
|
79
|
-
overflowXEnd: t.xEnd,
|
|
80
|
-
overflowYStart: t.yStart,
|
|
81
|
-
overflowYEnd: t.yEnd,
|
|
82
|
-
cornerHidden: e.corner
|
|
83
|
-
};
|
|
84
|
-
}), Oe = C(() => r(e.class, $())), ke = C(() => {
|
|
85
|
-
let t = fe(), n = i(e.style, $());
|
|
86
|
-
return typeof n == "string" ? `position:relative;--scroll-area-corner-height:${t.height}px;--scroll-area-corner-width:${t.width}px;${n}` : c({
|
|
87
|
-
position: "relative",
|
|
88
|
-
"--scroll-area-corner-height": `${t.height}px`,
|
|
89
|
-
"--scroll-area-corner-width": `${t.width}px`
|
|
90
|
-
}, n === !1 ? void 0 : n);
|
|
91
|
-
}), Ae = C(() => n($(), B));
|
|
92
|
-
function je(e) {
|
|
93
|
-
pe((t) => re(t, e) ? t : e);
|
|
94
|
-
}
|
|
95
|
-
function Me(e) {
|
|
96
|
-
he((t) => re(t, e) ? t : e);
|
|
97
|
-
}
|
|
98
|
-
function Ne(e) {
|
|
99
|
-
ye((t) => ie(t, e) ? t : e);
|
|
100
|
-
}
|
|
101
|
-
function Pe(e) {
|
|
102
|
-
_e((t) => ae(t, e) ? t : e);
|
|
103
|
-
}
|
|
104
|
-
function Fe(e) {
|
|
105
|
-
let t = e ? Q : Z;
|
|
106
|
-
t !== void 0 && clearTimeout(t), (e ? q : oe)(!0);
|
|
107
|
-
let n = setTimeout(() => {
|
|
108
|
-
(e ? q : oe)(!1);
|
|
109
|
-
}, 500);
|
|
110
|
-
e ? Q = n : Z = n;
|
|
111
|
-
}
|
|
112
|
-
function Ie(e) {
|
|
113
|
-
let t = e.x - Te.x, n = e.y - Te.y;
|
|
114
|
-
Te = e, n !== 0 && Fe(!0), t !== 0 && Fe(!1);
|
|
115
|
-
}
|
|
116
|
-
function Le() {
|
|
117
|
-
let e = b();
|
|
118
|
-
e && X === null && (X = e.style.scrollSnapType, e.style.scrollSnapType = "none");
|
|
119
|
-
}
|
|
120
|
-
function Re(e, t) {
|
|
121
|
-
if (e.button !== 0 || J !== null && (Y === "vertical" ? j() : N())?.hasPointerCapture?.(J)) return;
|
|
122
|
-
J = e.pointerId, Y = t, xe = e.clientY, Se = e.clientX;
|
|
123
|
-
let n = b();
|
|
124
|
-
n && (Ce = n.scrollTop, we = n.scrollLeft, Le()), (t === "vertical" ? j() : N())?.setPointerCapture?.(e.pointerId);
|
|
125
|
-
}
|
|
126
|
-
function ze() {
|
|
127
|
-
if (X !== null) {
|
|
128
|
-
let e = b();
|
|
129
|
-
e && (e.style.scrollSnapType = X), X = null;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
function Be(e) {
|
|
133
|
-
if (e.pointerId !== J) return;
|
|
134
|
-
J = null, (Y === "vertical" ? q : oe)(!1), ze();
|
|
135
|
-
let t = Y === "vertical" ? j() : N();
|
|
136
|
-
t?.hasPointerCapture?.(e.pointerId) && t.releasePointerCapture(e.pointerId);
|
|
137
|
-
}
|
|
138
|
-
function Ve(e) {
|
|
139
|
-
if (e.pointerId !== J) return;
|
|
140
|
-
if (!(e.buttons & 1)) {
|
|
141
|
-
Be(e);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
let t = b(), n = Y === "vertical", r = n ? j() : N(), i = n ? S() : D();
|
|
145
|
-
if (!t || !r || !i) return;
|
|
146
|
-
let a = n ? "y" : "x", o = F(i, "padding", a), s = F(r, "margin", a), c = n ? r.offsetHeight : r.offsetWidth, l = (n ? i.offsetHeight : i.offsetWidth) - c - o - s, u = n ? e.clientY - xe : e.clientX - Se, d = l <= 0 ? 0 : u / l, f = n ? t.scrollHeight : t.scrollWidth, p = n ? t.clientHeight : t.clientWidth, m = (n ? Ce : we) + d * (f - p);
|
|
147
|
-
n ? t.scrollTop = m : t.scrollLeft = m, e.preventDefault(), Fe(n);
|
|
148
|
-
}
|
|
149
|
-
function He(e) {
|
|
150
|
-
le(e.pointerType === "touch");
|
|
151
|
-
}
|
|
152
|
-
function Ue(e) {
|
|
153
|
-
He(e), e.pointerType !== "touch" && G(P(be, e.target));
|
|
154
|
-
}
|
|
155
|
-
let We = a(() => f.onPointerEnter, () => Ue), Ge = a(() => f.onPointerMove, () => Ue), Ke = a(() => f.onPointerDown, () => He), qe = a(() => f.onPointerLeave, () => () => G(!1)), Je = {
|
|
156
|
-
cornerElement: R,
|
|
157
|
-
cornerSize: fe,
|
|
158
|
-
disableViewportSnap: Le,
|
|
159
|
-
handlePointerDown: Re,
|
|
160
|
-
handlePointerMove: Ve,
|
|
161
|
-
handlePointerUp: Be,
|
|
162
|
-
handleScroll: Ie,
|
|
163
|
-
hasMeasuredScrollbar: ue,
|
|
164
|
-
hiddenState: ve,
|
|
165
|
-
hovering: W,
|
|
166
|
-
overflowEdges: ge,
|
|
167
|
-
overflowEdgeThreshold: De,
|
|
168
|
-
rootId: y,
|
|
169
|
-
scrollbarXElement: D,
|
|
170
|
-
scrollbarYElement: S,
|
|
171
|
-
scrollingX: K,
|
|
172
|
-
scrollingY: se,
|
|
173
|
-
setCornerElement: z,
|
|
174
|
-
setCornerSize: je,
|
|
175
|
-
setHasMeasuredScrollbar: de,
|
|
176
|
-
setHiddenState: Ne,
|
|
177
|
-
setHovering: G,
|
|
178
|
-
setOverflowEdges: Pe,
|
|
179
|
-
setScrollbarXElement: A,
|
|
180
|
-
setScrollbarYElement: w,
|
|
181
|
-
setThumbSize: Me,
|
|
182
|
-
setThumbXElement: I,
|
|
183
|
-
setThumbYElement: M,
|
|
184
|
-
setViewportElement: x,
|
|
185
|
-
state: $,
|
|
186
|
-
thumbSize: me,
|
|
187
|
-
thumbXElement: N,
|
|
188
|
-
thumbYElement: j,
|
|
189
|
-
touchModality: ce,
|
|
190
|
-
viewportElement: b
|
|
191
|
-
};
|
|
192
|
-
k(() => {
|
|
193
|
-
if (Z !== void 0 && clearTimeout(Z), Q !== void 0 && clearTimeout(Q), ze(), J !== null) {
|
|
194
|
-
let e = Y === "vertical" ? j() : N();
|
|
195
|
-
e?.hasPointerCapture?.(J) && e.releasePointerCapture(J);
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
let Ye = t(e, () => $(), (e) => (() => {
|
|
199
|
-
var t = d(V);
|
|
200
|
-
return _(t, e, !1), h(), t;
|
|
201
|
-
})());
|
|
202
|
-
return l(L, {
|
|
203
|
-
value: Je,
|
|
204
|
-
get children() {
|
|
205
|
-
return [p(() => p(() => !o.disableStyleElements())() && (() => {
|
|
206
|
-
var e = d(H);
|
|
207
|
-
return u(() => o.nonce(), (t) => {
|
|
208
|
-
g(e, "nonce", t);
|
|
209
|
-
}), e;
|
|
210
|
-
})()), l(Ye, m({
|
|
211
|
-
ref: [((e) => {
|
|
212
|
-
be = e;
|
|
213
|
-
}), f.ref],
|
|
214
|
-
get class() {
|
|
215
|
-
return Oe();
|
|
216
|
-
},
|
|
217
|
-
get style() {
|
|
218
|
-
return ke();
|
|
219
|
-
},
|
|
220
|
-
role: "presentation",
|
|
221
|
-
onPointerEnter: We,
|
|
222
|
-
onPointerMove: Ge,
|
|
223
|
-
onPointerDown: Ke,
|
|
224
|
-
onPointerLeave: qe
|
|
225
|
-
}, Ae, Ee, { get children() {
|
|
226
|
-
return f.children;
|
|
227
|
-
} }))];
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
function ne(e) {
|
|
232
|
-
let t = typeof e == "number" ? {
|
|
233
|
-
xStart: e,
|
|
234
|
-
xEnd: e,
|
|
235
|
-
yStart: e,
|
|
236
|
-
yEnd: e
|
|
237
|
-
} : e;
|
|
238
|
-
return {
|
|
239
|
-
xStart: Math.max(0, t?.xStart || 0),
|
|
240
|
-
xEnd: Math.max(0, t?.xEnd || 0),
|
|
241
|
-
yStart: Math.max(0, t?.yStart || 0),
|
|
242
|
-
yEnd: Math.max(0, t?.yEnd || 0)
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
function re(e, t) {
|
|
246
|
-
return e.width === t.width && e.height === t.height;
|
|
247
|
-
}
|
|
248
|
-
function ie(e, t) {
|
|
249
|
-
return e.x === t.x && e.y === t.y && e.corner === t.corner;
|
|
250
|
-
}
|
|
251
|
-
function ae(e, t) {
|
|
252
|
-
return e.xStart === t.xStart && e.xEnd === t.xEnd && e.yStart === t.yStart && e.yEnd === t.yEnd;
|
|
253
|
-
}
|
|
254
|
-
var G = !(typeof window > "u") && !!y, K = (() => void 0);
|
|
255
|
-
Object.is.bind(Object);
|
|
256
|
-
var oe = G ? (e) => D() ? k(e) : e : k;
|
|
257
|
-
//#endregion
|
|
258
|
-
//#region node_modules/@solid-primitives/event-listener/dist/eventListener.js
|
|
259
|
-
function se(e, t, n, r) {
|
|
260
|
-
return e?.addEventListener?.(t, n, r), oe(e?.removeEventListener?.bind(e, t, n, r));
|
|
261
|
-
}
|
|
262
|
-
//#endregion
|
|
263
|
-
//#region node_modules/@solid-primitives/resize-observer/dist/index.js
|
|
264
|
-
function q(e, t) {
|
|
265
|
-
if (f) return {
|
|
266
|
-
observe: K,
|
|
267
|
-
unobserve: K
|
|
268
|
-
};
|
|
269
|
-
let n = new ResizeObserver(e);
|
|
270
|
-
return k(n.disconnect.bind(n)), {
|
|
271
|
-
observe: (e) => n.observe(e, t),
|
|
272
|
-
unobserve: n.unobserve.bind(n)
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
//#endregion
|
|
276
|
-
//#region src/scroll-area/utils/scrollEdges.ts
|
|
277
|
-
var ce = 1;
|
|
278
|
-
function le(e, t) {
|
|
279
|
-
if (t <= 0) return 0;
|
|
280
|
-
let n = Math.max(0, Math.min(e, t)), r = n, i = t - n, a = r <= ce, o = i <= ce;
|
|
281
|
-
return a && o ? r <= i ? 0 : t : a ? 0 : o ? t : n;
|
|
282
|
-
}
|
|
283
|
-
//#endregion
|
|
284
|
-
//#region src/scroll-area/viewport/ScrollAreaViewportContext.ts
|
|
285
|
-
var ue = Symbol("ScrollAreaViewportContext"), de = x(ue);
|
|
286
|
-
function fe() {
|
|
287
|
-
let e = M(de);
|
|
288
|
-
if (e === ue) throw Error("Base UI: ScrollAreaViewportContext missing. ScrollAreaViewport parts must be placed within <ScrollArea.Viewport>.");
|
|
289
|
-
return e;
|
|
290
|
-
}
|
|
291
|
-
//#endregion
|
|
292
|
-
//#region src/scroll-area/viewport/ScrollAreaViewport.tsx
|
|
293
|
-
var pe = /* @__PURE__ */ v("<div>"), me = [
|
|
294
|
-
"--scroll-area-overflow-x-start",
|
|
295
|
-
"--scroll-area-overflow-x-end",
|
|
296
|
-
"--scroll-area-overflow-y-start",
|
|
297
|
-
"--scroll-area-overflow-y-end"
|
|
298
|
-
], he = !1;
|
|
299
|
-
function ge(e) {
|
|
300
|
-
let s = R(), u = o(), f = e, p = O(e, "render", "children", "class", "onKeyDown", "onPointerEnter", "onPointerMove", "onScroll", "onWheel", "ref", "style"), g = C(() => s.state()), v = C(() => ["base-ui-disable-scrollbar", r(e.class, g())]), y = C(() => {
|
|
301
|
-
let t = i(e.style, g());
|
|
302
|
-
return typeof t == "string" ? `overflow:scroll;${t}` : c({ overflow: "scroll" }, t === !1 ? void 0 : t);
|
|
303
|
-
}), b = C(() => n(g(), B)), x = [
|
|
304
|
-
NaN,
|
|
305
|
-
NaN,
|
|
306
|
-
NaN,
|
|
307
|
-
NaN
|
|
308
|
-
], w = !0, T, E, D, j = !1, M;
|
|
309
|
-
function N() {
|
|
310
|
-
let e = s.viewportElement();
|
|
311
|
-
if (!e) return;
|
|
312
|
-
let t = s.scrollbarYElement(), n = s.scrollbarXElement(), r = s.thumbYElement(), i = s.thumbXElement(), a = s.cornerElement(), o = e.scrollHeight, c = e.scrollWidth, l = e.clientHeight, d = e.clientWidth, f = e.scrollTop, p = e.scrollLeft, m = Number.isNaN(x[0]);
|
|
313
|
-
if (x[0] = l, x[1] = o, x[2] = d, x[3] = c, m && s.setHasMeasuredScrollbar(!0), o === 0 || c === 0) return;
|
|
314
|
-
let h = _e(e), g = d / c, _ = l / o, v = Math.max(0, c - d), y = Math.max(0, o - l), b = h.x ? 0 : le(u() === "rtl" ? -p : p, v), S = h.x ? 0 : v - b, C = h.y ? 0 : le(f, y), w = h.y ? 0 : y - C, T = h.x ? 0 : d, E = h.y ? 0 : l, D = 0, O = 0;
|
|
315
|
-
!h.x && !h.y && (D = t?.offsetWidth || 0, O = n?.offsetHeight || 0);
|
|
316
|
-
let k = s.cornerSize(), A = k.width === 0 && k.height === 0, j = F(n, "padding", "x"), M = F(t, "padding", "y"), N = F(i, "margin", "x"), P = F(r, "margin", "y"), I = T - j - N, L = E - M - P, R = n ? Math.min(n.offsetWidth - (A ? D : 0), I) : I, z = t ? Math.min(t.offsetHeight - (A ? O : 0), L) : L, B = Math.max(16, R * g), V = Math.max(16, z * _);
|
|
317
|
-
if (s.setThumbSize({
|
|
318
|
-
width: B,
|
|
319
|
-
height: V
|
|
320
|
-
}), t && r) {
|
|
321
|
-
let e = ve(r, "--scroll-area-thumb-height", f, y, o, V, t.offsetHeight - V - M - P);
|
|
322
|
-
r.style.transform = `translate3d(0,${e}px,0)`;
|
|
323
|
-
}
|
|
324
|
-
if (n && i) {
|
|
325
|
-
let e = n.offsetWidth - B - j - N, t = ve(i, "--scroll-area-thumb-width", u() === "rtl" ? -p : p, v, c, B, e);
|
|
326
|
-
i.style.transform = `translate3d(${u() === "rtl" ? -t : t}px,0,0)`;
|
|
327
|
-
}
|
|
328
|
-
let H = [
|
|
329
|
-
b,
|
|
330
|
-
S,
|
|
331
|
-
C,
|
|
332
|
-
w
|
|
333
|
-
];
|
|
334
|
-
me.forEach((t, n) => {
|
|
335
|
-
e.style.setProperty(t, `${H[n]}px`);
|
|
336
|
-
}), a && s.setCornerSize({
|
|
337
|
-
width: D,
|
|
338
|
-
height: O
|
|
339
|
-
}), s.setHiddenState(h);
|
|
340
|
-
let U = s.overflowEdgeThreshold();
|
|
341
|
-
s.setOverflowEdges({
|
|
342
|
-
xStart: !h.x && b > U.xStart,
|
|
343
|
-
xEnd: !h.x && S > U.xEnd,
|
|
344
|
-
yStart: !h.y && C > U.yStart,
|
|
345
|
-
yEnd: !h.y && w > U.yEnd
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
let P = typeof ResizeObserver > "u" ? void 0 : q((e) => {
|
|
349
|
-
!D || !e.some((e) => e.target === D) || !j && (j = !0, x[0] === D.clientHeight && x[1] === D.scrollHeight && x[2] === D.clientWidth && x[3] === D.scrollWidth) || N();
|
|
350
|
-
});
|
|
351
|
-
S(() => ({
|
|
352
|
-
hidden: s.hiddenState(),
|
|
353
|
-
direction: u(),
|
|
354
|
-
threshold: s.overflowEdgeThreshold(),
|
|
355
|
-
viewport: s.viewportElement(),
|
|
356
|
-
scrollbarX: s.scrollbarXElement(),
|
|
357
|
-
scrollbarY: s.scrollbarYElement(),
|
|
358
|
-
thumbX: s.thumbXElement(),
|
|
359
|
-
thumbY: s.thumbYElement()
|
|
360
|
-
}), () => {
|
|
361
|
-
queueMicrotask(N);
|
|
362
|
-
}), S(s.viewportElement, (e) => {
|
|
363
|
-
if (!(!e || !P)) return D = e, j = !1, P.observe(e), E = setTimeout(() => {
|
|
364
|
-
let t = e.getAnimations?.bind(e), n = t?.({ subtree: !0 }) ?? [];
|
|
365
|
-
n.length > 0 && Promise.allSettled(n.map((e) => e.finished)).then(N).catch(() => {});
|
|
366
|
-
}, 0), () => {
|
|
367
|
-
P.unobserve(e), D === e && (D = void 0), E !== void 0 && (clearTimeout(E), E = void 0);
|
|
368
|
-
};
|
|
369
|
-
});
|
|
370
|
-
function I() {
|
|
371
|
-
w = !1;
|
|
372
|
-
}
|
|
373
|
-
function L() {
|
|
374
|
-
let e = s.viewportElement();
|
|
375
|
-
e && (N(), (s.touchModality() || !w) && s.handleScroll({
|
|
376
|
-
x: e.scrollLeft,
|
|
377
|
-
y: e.scrollTop
|
|
378
|
-
}), T !== void 0 && clearTimeout(T), T = setTimeout(() => {
|
|
379
|
-
w = !0;
|
|
380
|
-
}, 100));
|
|
381
|
-
}
|
|
382
|
-
let z = a(() => f.onScroll, () => L), V = a(() => f.onWheel, () => I), H = a(() => f.onPointerMove, () => I), U = a(() => f.onPointerEnter, () => I), ee = a(() => f.onKeyDown, () => I), te = { computeThumbPosition: N };
|
|
383
|
-
A(() => {
|
|
384
|
-
ye(), s.viewportElement()?.matches(":hover") && s.setHovering(!0);
|
|
385
|
-
}), k(() => {
|
|
386
|
-
T !== void 0 && clearTimeout(T), E !== void 0 && clearTimeout(E), s.viewportElement() === M && s.setViewportElement(void 0);
|
|
387
|
-
});
|
|
388
|
-
let W = t(e, () => g(), (e) => (() => {
|
|
389
|
-
var t = d(pe);
|
|
390
|
-
return _(t, e, !1), h(), t;
|
|
391
|
-
})());
|
|
392
|
-
return l(de, {
|
|
393
|
-
value: te,
|
|
394
|
-
get children() {
|
|
395
|
-
return l(W, m({
|
|
396
|
-
ref: [((e) => {
|
|
397
|
-
M = e, s.setViewportElement(e);
|
|
398
|
-
}), f.ref],
|
|
399
|
-
get class() {
|
|
400
|
-
return v();
|
|
401
|
-
},
|
|
402
|
-
get style() {
|
|
403
|
-
return y();
|
|
404
|
-
},
|
|
405
|
-
role: "presentation",
|
|
406
|
-
get "data-id"() {
|
|
407
|
-
return `${s.rootId}-viewport`;
|
|
408
|
-
},
|
|
409
|
-
get tabindex() {
|
|
410
|
-
return s.hiddenState().x && s.hiddenState().y ? -1 : 0;
|
|
411
|
-
},
|
|
412
|
-
onScroll: z,
|
|
413
|
-
onWheel: V,
|
|
414
|
-
onPointerMove: H,
|
|
415
|
-
onPointerEnter: U,
|
|
416
|
-
onKeyDown: ee
|
|
417
|
-
}, b, p, { get children() {
|
|
418
|
-
return f.children;
|
|
419
|
-
} }));
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
function _e(e) {
|
|
424
|
-
let t = e.clientHeight >= e.scrollHeight, n = e.clientWidth >= e.scrollWidth;
|
|
425
|
-
return {
|
|
426
|
-
x: n,
|
|
427
|
-
y: t,
|
|
428
|
-
corner: n || t
|
|
429
|
-
};
|
|
430
|
-
}
|
|
431
|
-
function ve(e, t, n, r, i, a, o) {
|
|
432
|
-
let s = Math.max(0, Math.min(n, r)), c = n - s, l = Math.max(16, a * i / (i + Math.abs(c)));
|
|
433
|
-
return e.style.setProperty(t, c ? `${l}px` : ""), (r ? s / r * o : 0) + (c > 0 ? a - l : 0);
|
|
434
|
-
}
|
|
435
|
-
function ye() {
|
|
436
|
-
if (!(he || be())) {
|
|
437
|
-
if (typeof CSS < "u" && "registerProperty" in CSS) for (let e of me) try {
|
|
438
|
-
CSS.registerProperty({
|
|
439
|
-
name: e,
|
|
440
|
-
syntax: "<length>",
|
|
441
|
-
inherits: !1,
|
|
442
|
-
initialValue: "0px"
|
|
443
|
-
});
|
|
444
|
-
} catch {}
|
|
445
|
-
he = !0;
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
function be() {
|
|
449
|
-
return typeof CSS < "u" && !!CSS.supports?.("-webkit-backdrop-filter:none");
|
|
450
|
-
}
|
|
451
|
-
//#endregion
|
|
452
|
-
//#region src/scroll-area/scrollbar/ScrollAreaScrollbarContext.ts
|
|
453
|
-
var J = Symbol("ScrollAreaScrollbarContext"), xe = x(J);
|
|
454
|
-
function Se() {
|
|
455
|
-
let e = M(xe);
|
|
456
|
-
if (e === J) throw Error("Base UI: ScrollAreaScrollbarContext is missing. ScrollAreaScrollbar parts must be placed within <ScrollArea.Scrollbar>.");
|
|
457
|
-
return e;
|
|
458
|
-
}
|
|
459
|
-
//#endregion
|
|
460
|
-
//#region src/scroll-area/scrollbar/ScrollAreaScrollbar.tsx
|
|
461
|
-
var Ce = /* @__PURE__ */ v("<div>");
|
|
462
|
-
function we(e) {
|
|
463
|
-
let s = R(), u = o(), f = e, p = e, [g, v] = T(), y = O(p, "render", "children", "class", "keepMounted", "onMouseDown", "onPointerCancel", "onPointerDown", "onPointerUp", "orientation", "ref", "style"), x = C(() => f.orientation ?? "vertical"), E = C(() => x() === "vertical"), D = C(() => E() ? s.hiddenState().y : s.hiddenState().x), k = C(() => (f.keepMounted ?? !1) || !D()), A = C(() => !s.hasMeasuredScrollbar() && !(f.keepMounted ?? !1)), M = C(() => ({
|
|
464
|
-
...s.state(),
|
|
465
|
-
hovering: s.hovering(),
|
|
466
|
-
scrolling: E() ? s.scrollingY() : s.scrollingX(),
|
|
467
|
-
orientation: x()
|
|
468
|
-
})), I = C(() => r(e.class, M())), L = C(() => {
|
|
469
|
-
let t = s.thumbSize(), n = i(e.style, M()), r = E() ? `top:0;bottom:var(--scroll-area-corner-height);inset-inline-end:0;--scroll-area-thumb-height:${t.height}px;` : `inset-inline-start:0;inset-inline-end:var(--scroll-area-corner-width);bottom:0;--scroll-area-thumb-width:${t.width}px;`;
|
|
470
|
-
return typeof n == "string" ? `position:absolute;touch-action:none;-webkit-user-select:none;user-select:none;visibility:${A() ? "hidden" : "visible"};${r}${n}` : c({
|
|
471
|
-
position: "absolute",
|
|
472
|
-
"touch-action": "none",
|
|
473
|
-
"-webkit-user-select": "none",
|
|
474
|
-
"user-select": "none",
|
|
475
|
-
visibility: A() ? "hidden" : void 0,
|
|
476
|
-
...E() ? {
|
|
477
|
-
top: 0,
|
|
478
|
-
bottom: "var(--scroll-area-corner-height)",
|
|
479
|
-
"inset-inline-end": 0,
|
|
480
|
-
"--scroll-area-thumb-height": `${t.height}px`
|
|
481
|
-
} : {
|
|
482
|
-
"inset-inline-start": 0,
|
|
483
|
-
"inset-inline-end": "var(--scroll-area-corner-width)",
|
|
484
|
-
bottom: 0,
|
|
485
|
-
"--scroll-area-thumb-width": `${t.width}px`
|
|
486
|
-
}
|
|
487
|
-
}, n === !1 ? void 0 : n);
|
|
488
|
-
}), z = C(() => n(M(), B));
|
|
489
|
-
S(() => ({
|
|
490
|
-
element: g(),
|
|
491
|
-
render: k(),
|
|
492
|
-
vertical: E()
|
|
493
|
-
}), (e) => {
|
|
494
|
-
if (!e.element || !e.render) return;
|
|
495
|
-
let t = e.vertical ? s.setScrollbarYElement : s.setScrollbarXElement, n = e.vertical ? s.scrollbarYElement : s.scrollbarXElement;
|
|
496
|
-
return t(e.element), () => {
|
|
497
|
-
j(n) === e.element && t(void 0);
|
|
498
|
-
};
|
|
499
|
-
}), S(() => ({
|
|
500
|
-
direction: u(),
|
|
501
|
-
render: k(),
|
|
502
|
-
scrollbar: g(),
|
|
503
|
-
vertical: E(),
|
|
504
|
-
viewport: s.viewportElement()
|
|
505
|
-
}), (e) => {
|
|
506
|
-
if (!e.render || !e.scrollbar || !e.viewport) return;
|
|
507
|
-
let t = e.viewport, n = e.scrollbar, r = () => se(n, "wheel", (n) => {
|
|
508
|
-
if (n.ctrlKey) return;
|
|
509
|
-
let r = !e.vertical, i = r ? n.deltaX : n.deltaY;
|
|
510
|
-
if (i === 0) return;
|
|
511
|
-
let a = r ? t.scrollWidth - t.clientWidth : t.scrollHeight - t.clientHeight, o = r && e.direction === "rtl" ? -a : 0, c = r && e.direction === "rtl" ? 0 : a, l = r ? t.scrollLeft : t.scrollTop;
|
|
512
|
-
if (l <= o && i < 0 || l >= c && i > 0) return;
|
|
513
|
-
n.preventDefault();
|
|
514
|
-
let u = Math.min(c, Math.max(o, l + i));
|
|
515
|
-
r ? t.scrollLeft = u : t.scrollTop = u, s.handleScroll({
|
|
516
|
-
x: t.scrollLeft,
|
|
517
|
-
y: t.scrollTop
|
|
518
|
-
});
|
|
519
|
-
}, { passive: !1 });
|
|
520
|
-
return w((e) => {
|
|
521
|
-
let t = r();
|
|
522
|
-
return () => {
|
|
523
|
-
t(), e();
|
|
524
|
-
};
|
|
525
|
-
});
|
|
526
|
-
});
|
|
527
|
-
function V(e) {
|
|
528
|
-
if (e.button !== 0) return;
|
|
529
|
-
let t = E() ? s.thumbYElement() : s.thumbXElement();
|
|
530
|
-
if (t && P(t, N(e))) return;
|
|
531
|
-
let n = s.viewportElement(), r = g();
|
|
532
|
-
if (!n || !t || !r) return;
|
|
533
|
-
let i = E() ? "y" : "x", a = F(t, "margin", i), o = F(r, "padding", i), c = E() ? t.offsetHeight : t.offsetWidth, l = r.getBoundingClientRect(), d = E() ? e.clientY - l.top - c / 2 - o + a / 2 : e.clientX - l.left - c / 2 - o + a / 2, f = E() ? n.scrollHeight : n.scrollWidth, p = E() ? n.clientHeight : n.clientWidth, m = (E() ? r.offsetHeight : r.offsetWidth) - c - o - a;
|
|
534
|
-
if (m <= 0) return;
|
|
535
|
-
let h = d / m, _ = f - p;
|
|
536
|
-
s.disableViewportSnap(), E() ? n.scrollTop = h * _ : n.scrollLeft = u() === "rtl" ? -(1 - h) * _ : h * _, s.handleScroll({
|
|
537
|
-
x: n.scrollLeft,
|
|
538
|
-
y: n.scrollTop
|
|
539
|
-
}), s.handlePointerDown(e, x());
|
|
540
|
-
}
|
|
541
|
-
let H = a(() => f.onMouseDown, () => (e) => e.preventDefault()), U = a(() => f.onPointerDown, () => V), ee = a(() => f.onPointerUp, () => s.handlePointerUp), te = a(() => f.onPointerCancel, () => s.handlePointerUp), W = t(e, () => M(), (e) => (() => {
|
|
542
|
-
var t = d(Ce);
|
|
543
|
-
return _(t, e, !1), h(), t;
|
|
544
|
-
})());
|
|
545
|
-
return l(b, {
|
|
546
|
-
get when() {
|
|
547
|
-
return k();
|
|
548
|
-
},
|
|
549
|
-
get children() {
|
|
550
|
-
return l(xe, {
|
|
551
|
-
value: x,
|
|
552
|
-
get children() {
|
|
553
|
-
return l(W, m({
|
|
554
|
-
ref: [((e) => v(e)), f.ref],
|
|
555
|
-
get class() {
|
|
556
|
-
return I();
|
|
557
|
-
},
|
|
558
|
-
get style() {
|
|
559
|
-
return L();
|
|
560
|
-
},
|
|
561
|
-
get "data-id"() {
|
|
562
|
-
return `${s.rootId}-scrollbar`;
|
|
563
|
-
},
|
|
564
|
-
"aria-hidden": "true",
|
|
565
|
-
onMouseDown: H,
|
|
566
|
-
onPointerDown: U,
|
|
567
|
-
onPointerUp: ee,
|
|
568
|
-
onPointerCancel: te
|
|
569
|
-
}, z, y, { get children() {
|
|
570
|
-
return f.children;
|
|
571
|
-
} }));
|
|
572
|
-
}
|
|
573
|
-
});
|
|
574
|
-
}
|
|
575
|
-
});
|
|
576
|
-
}
|
|
577
|
-
//#endregion
|
|
578
|
-
//#region src/scroll-area/content/ScrollAreaContent.tsx
|
|
579
|
-
var Y = /* @__PURE__ */ v("<div>");
|
|
580
|
-
function Te(e) {
|
|
581
|
-
let a = fe(), o = R(), s = e, u = O(e, "render", "children", "class", "ref", "style"), f = C(() => o.state()), p = C(() => r(e.class, f())), g = C(() => {
|
|
582
|
-
let t = i(e.style, f());
|
|
583
|
-
return typeof t == "string" ? `min-width:fit-content;${t}` : c({ "min-width": "fit-content" }, t === !1 ? void 0 : t);
|
|
584
|
-
}), v = C(() => n(f(), B)), y = j(o.hasMeasuredScrollbar), b, x = !1, [w, E] = T(), D = typeof ResizeObserver > "u" ? void 0 : q((e) => {
|
|
585
|
-
!b || !e.some((e) => e.target === b) || !x && (x = !0, !y) || a.computeThumbPosition();
|
|
586
|
-
});
|
|
587
|
-
S(w, (e) => {
|
|
588
|
-
if (!(!e || !D)) return b = e, x = !1, D.observe(e), () => {
|
|
589
|
-
D.unobserve(e), b === e && (b = void 0);
|
|
590
|
-
};
|
|
591
|
-
});
|
|
592
|
-
let k = t(e, () => f(), (e) => (() => {
|
|
593
|
-
var t = d(Y);
|
|
594
|
-
return _(t, e, !1), h(), t;
|
|
595
|
-
})());
|
|
596
|
-
return l(k, m({
|
|
597
|
-
ref: [((e) => E(e)), s.ref],
|
|
598
|
-
get class() {
|
|
599
|
-
return p();
|
|
600
|
-
},
|
|
601
|
-
get style() {
|
|
602
|
-
return g();
|
|
603
|
-
},
|
|
604
|
-
role: "presentation"
|
|
605
|
-
}, v, u, { get children() {
|
|
606
|
-
return s.children;
|
|
607
|
-
} }));
|
|
608
|
-
}
|
|
609
|
-
//#endregion
|
|
610
|
-
//#region src/scroll-area/thumb/ScrollAreaThumb.tsx
|
|
611
|
-
var X = /* @__PURE__ */ v("<div>");
|
|
612
|
-
function Z(e) {
|
|
613
|
-
let o = R(), s = Se(), u = e, f = e, [p, g] = T(), v = O(f, "render", "children", "class", "onPointerCancel", "onPointerDown", "onPointerMove", "onPointerUp", "ref", "style"), y = C(() => s() === "vertical"), b = C(() => ({
|
|
614
|
-
scrolling: y() ? o.scrollingY() : o.scrollingX(),
|
|
615
|
-
orientation: s()
|
|
616
|
-
})), x = C(() => r(e.class, b())), w = C(() => {
|
|
617
|
-
let t = i(e.style, b()), n = y() ? "height:var(--scroll-area-thumb-height);" : "width:var(--scroll-area-thumb-width);";
|
|
618
|
-
return typeof t == "string" ? `visibility:${o.hasMeasuredScrollbar() ? "visible" : "hidden"};${n}${t}` : c({
|
|
619
|
-
visibility: o.hasMeasuredScrollbar() ? void 0 : "hidden",
|
|
620
|
-
...y() ? { height: "var(--scroll-area-thumb-height)" } : { width: "var(--scroll-area-thumb-width)" }
|
|
621
|
-
}, t === !1 ? void 0 : t);
|
|
622
|
-
}), E = C(() => n(b()));
|
|
623
|
-
S(() => ({
|
|
624
|
-
element: p(),
|
|
625
|
-
vertical: y()
|
|
626
|
-
}), (e) => {
|
|
627
|
-
if (!e.element) return;
|
|
628
|
-
let t = e.vertical ? o.setThumbYElement : o.setThumbXElement, n = e.vertical ? o.thumbYElement : o.thumbXElement;
|
|
629
|
-
return t(e.element), () => {
|
|
630
|
-
j(n) === e.element && t(void 0);
|
|
631
|
-
};
|
|
632
|
-
});
|
|
633
|
-
let D = a(() => u.onPointerDown, () => (e) => o.handlePointerDown(e, s())), k = a(() => u.onPointerMove, () => o.handlePointerMove), A = a(() => u.onPointerUp, () => o.handlePointerUp), M = a(() => u.onPointerCancel, () => o.handlePointerUp), N = t(e, () => b(), (e) => (() => {
|
|
634
|
-
var t = d(X);
|
|
635
|
-
return _(t, e, !1), h(), t;
|
|
636
|
-
})());
|
|
637
|
-
return l(N, m({
|
|
638
|
-
ref: [((e) => g(e)), u.ref],
|
|
639
|
-
get class() {
|
|
640
|
-
return x();
|
|
641
|
-
},
|
|
642
|
-
get style() {
|
|
643
|
-
return w();
|
|
644
|
-
},
|
|
645
|
-
onPointerDown: D,
|
|
646
|
-
onPointerMove: k,
|
|
647
|
-
onPointerUp: A,
|
|
648
|
-
onPointerCancel: M
|
|
649
|
-
}, E, v, { get children() {
|
|
650
|
-
return u.children;
|
|
651
|
-
} }));
|
|
652
|
-
}
|
|
653
|
-
//#endregion
|
|
654
|
-
//#region src/scroll-area/corner/ScrollAreaCorner.tsx
|
|
655
|
-
var Q = /* @__PURE__ */ v("<div>");
|
|
656
|
-
function Ee(e) {
|
|
657
|
-
let n = R(), a = e, o = e, [s, u] = T(), f = O(o, "render", "children", "class", "ref", "style"), p = {}, g = C(() => !n.hiddenState().corner), v = C(() => r(e.class, p)), y = C(() => {
|
|
658
|
-
let t = n.cornerSize(), r = i(e.style, p);
|
|
659
|
-
return typeof r == "string" ? `position:absolute;bottom:0;inset-inline-end:0;width:${t.width}px;height:${t.height}px;${r}` : c({
|
|
660
|
-
position: "absolute",
|
|
661
|
-
bottom: 0,
|
|
662
|
-
"inset-inline-end": 0,
|
|
663
|
-
width: `${t.width}px`,
|
|
664
|
-
height: `${t.height}px`
|
|
665
|
-
}, r === !1 ? void 0 : r);
|
|
666
|
-
});
|
|
667
|
-
S(() => ({
|
|
668
|
-
element: s(),
|
|
669
|
-
render: g()
|
|
670
|
-
}), (e) => {
|
|
671
|
-
if (!e.element || !e.render) {
|
|
672
|
-
e.render || n.setCornerSize({
|
|
673
|
-
width: 0,
|
|
674
|
-
height: 0
|
|
675
|
-
});
|
|
676
|
-
return;
|
|
677
|
-
}
|
|
678
|
-
return n.setCornerElement(e.element), () => {
|
|
679
|
-
j(n.cornerElement) === e.element && n.setCornerElement(void 0);
|
|
680
|
-
};
|
|
681
|
-
});
|
|
682
|
-
let x = t(e, () => p, (e) => (() => {
|
|
683
|
-
var t = d(Q);
|
|
684
|
-
return _(t, e, !1), h(), t;
|
|
685
|
-
})());
|
|
686
|
-
return l(b, {
|
|
687
|
-
get when() {
|
|
688
|
-
return g();
|
|
689
|
-
},
|
|
690
|
-
get children() {
|
|
691
|
-
return l(x, m({
|
|
692
|
-
ref: [((e) => u(e)), a.ref],
|
|
693
|
-
get class() {
|
|
694
|
-
return v();
|
|
695
|
-
},
|
|
696
|
-
get style() {
|
|
697
|
-
return y();
|
|
698
|
-
},
|
|
699
|
-
"aria-hidden": "true"
|
|
700
|
-
}, f, { get children() {
|
|
701
|
-
return a.children;
|
|
702
|
-
} }));
|
|
703
|
-
}
|
|
704
|
-
});
|
|
705
|
-
}
|
|
706
|
-
//#endregion
|
|
707
|
-
//#region src/scroll-area/index.parts.ts
|
|
708
|
-
var De = /* @__PURE__ */ e({
|
|
709
|
-
Content: () => Te,
|
|
710
|
-
Corner: () => Ee,
|
|
711
|
-
Root: () => W,
|
|
712
|
-
Scrollbar: () => we,
|
|
713
|
-
Thumb: () => Z,
|
|
714
|
-
Viewport: () => ge
|
|
715
|
-
});
|
|
716
|
-
//#endregion
|
|
717
|
-
export { De as t };
|