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
|
@@ -5,101 +5,101 @@ import { C as r, p as i, s as a, w as o } from "./reasons-Co5CzjKq.js";
|
|
|
5
5
|
import { n as s, t as c } from "./resolveStyle-XcgAuaKR.js";
|
|
6
6
|
import { createChangeEventDetails as l } from "./internals/createBaseUIEventDetails.js";
|
|
7
7
|
import { transitionStatusMapping as u } from "./internals/stateAttributesMapping.js";
|
|
8
|
-
import { composeEventHandlers as d } from "./internals/composeEventHandlers.js";
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import { n as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { createComponent as
|
|
15
|
-
import { Show as
|
|
8
|
+
import { composeEventHandlers as d, liveEventHandler as f } from "./internals/composeEventHandlers.js";
|
|
9
|
+
import { t as p } from "./runOnceAnimationsFinish-CFADb4CN.js";
|
|
10
|
+
import { t as m } from "./createTransitionStatus-BL_cPSEA.js";
|
|
11
|
+
import { n as h } from "./DirectionContext-BwMabICS.js";
|
|
12
|
+
import { t as g } from "./mergeStyleValue-Dcd36yxZ.js";
|
|
13
|
+
import { n as _ } from "./CSPContext-faVzToiT.js";
|
|
14
|
+
import { createComponent as v, getNextElement as y, isServer as b, memo as x, mergeProps as S, runHydrationEvents as C, spread as w, template as T } from "@solidjs/web";
|
|
15
|
+
import { Show as E, createContext as D, createEffect as O, createMemo as k, createSignal as A, createUniqueId as j, omit as M, onCleanup as N, onSettled as P, sharedConfig as F, untrack as I, useContext as L } from "solid-js";
|
|
16
16
|
//#region src/tabs/root/TabsRootContext.ts
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
let e =
|
|
20
|
-
if (e ===
|
|
17
|
+
var R = Symbol("TabsRootContext"), z = D(R);
|
|
18
|
+
function B() {
|
|
19
|
+
let e = L(z);
|
|
20
|
+
if (e === R) throw Error("Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>.");
|
|
21
21
|
return e;
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/tabs/root/TabsRootDataAttributes.ts
|
|
25
|
-
var
|
|
25
|
+
var V = /* @__PURE__ */ function(e) {
|
|
26
26
|
return e.orientation = "data-orientation", e.activationDirection = "data-activation-direction", e;
|
|
27
|
-
}({}),
|
|
28
|
-
orientation: (e) => ({ [
|
|
29
|
-
tabActivationDirection: (e) => ({ [
|
|
30
|
-
},
|
|
31
|
-
function
|
|
32
|
-
let o = e, u = e, d =
|
|
27
|
+
}({}), H = {
|
|
28
|
+
orientation: (e) => ({ [V.orientation]: e }),
|
|
29
|
+
tabActivationDirection: (e) => ({ [V.activationDirection]: e })
|
|
30
|
+
}, U = /* @__PURE__ */ T("<div>");
|
|
31
|
+
function W(e) {
|
|
32
|
+
let o = e, u = e, d = I(() => o.value !== void 0), f = I(() => o.defaultValue !== void 0), p = I(() => o.defaultValue), m = I(() => o.defaultValue === void 0 ? 0 : o.defaultValue), [h, g] = A(() => m), [_, b] = A("none"), [x, T] = A(0), [E, D] = A(0), j = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(), F = 0, L = 0, R = I(() => d ? o.value : h()), B = !1, V = !f, W = f, q = !1, J, te = !1, ne = !1, re = !1, ie = !1, ae = !1, oe = M(u, "render", "class", "defaultValue", "onValueChange", "orientation", "ref", "style", "value"), Y = k(() => d ? o.value : h()), X = k(() => o.orientation ?? "horizontal"), Z = k(() => ({
|
|
33
33
|
orientation: X(),
|
|
34
|
-
tabActivationDirection:
|
|
35
|
-
})), se =
|
|
34
|
+
tabActivationDirection: _()
|
|
35
|
+
})), se = k(() => s(e.class, Z())), ce = k(() => c(e.style, Z())), le = k(() => n(Z(), H));
|
|
36
36
|
function ue() {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
te || (te = !0, queueMicrotask(() => {
|
|
38
|
+
te = !1, re || T((e) => e + 1);
|
|
39
39
|
}));
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
function de() {
|
|
42
|
+
ne || (ne = !0, queueMicrotask(() => {
|
|
43
|
+
ne = !1, re || D((e) => e + 1);
|
|
44
44
|
}));
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return e.order =
|
|
46
|
+
function Q(e) {
|
|
47
|
+
return e.order = F, F += 1, j.set(e.token, e), ue(), () => {
|
|
48
48
|
j.delete(e.token), ue();
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
function fe(e) {
|
|
52
|
-
return e.order =
|
|
53
|
-
|
|
52
|
+
return e.order = L, L += 1, P.set(e.token, e), de(), () => {
|
|
53
|
+
P.delete(e.token), de();
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
function pe(e) {
|
|
57
|
-
|
|
57
|
+
P.has(e.token) && (e.order = L, L += 1, de());
|
|
58
58
|
}
|
|
59
59
|
function $() {
|
|
60
60
|
return Array.from(j.values()).filter((e) => {
|
|
61
61
|
let t = e.element();
|
|
62
62
|
return t && t.isConnected;
|
|
63
|
-
}).sort(
|
|
63
|
+
}).sort(G);
|
|
64
64
|
}
|
|
65
65
|
function me() {
|
|
66
|
-
return Array.from(
|
|
66
|
+
return Array.from(P.values()).filter((e) => {
|
|
67
67
|
let t = e.element();
|
|
68
68
|
return e.rendered() && t && t.isConnected;
|
|
69
|
-
}).sort(
|
|
69
|
+
}).sort(G);
|
|
70
70
|
}
|
|
71
71
|
function he(e) {
|
|
72
|
-
return
|
|
72
|
+
return x(), $().find((t) => t.value() === e)?.element();
|
|
73
73
|
}
|
|
74
74
|
function ge(e) {
|
|
75
|
-
return
|
|
75
|
+
return x(), $().find((t) => t.value() === e)?.id();
|
|
76
76
|
}
|
|
77
77
|
function _e(e) {
|
|
78
78
|
E();
|
|
79
79
|
let t;
|
|
80
|
-
for (let n of
|
|
80
|
+
for (let n of P.values()) {
|
|
81
81
|
let r = n.element();
|
|
82
82
|
n.rendered() && r?.isConnected && n.value() === e && (!t || n.order > t.order) && (t = n);
|
|
83
83
|
}
|
|
84
84
|
return t?.id();
|
|
85
85
|
}
|
|
86
86
|
function ve(e, t) {
|
|
87
|
-
let n =
|
|
88
|
-
return t.activationDirection = n, o.onValueChange?.(e, t), !t.isCanceled && (d || (
|
|
87
|
+
let n = K(Y(), e, X(), $());
|
|
88
|
+
return t.activationDirection = n, o.onValueChange?.(e, t), !t.isCanceled && (d || (R = e, B = !1, b(n), g(() => e)), !0);
|
|
89
89
|
}
|
|
90
90
|
function ye(e, t) {
|
|
91
|
-
|
|
91
|
+
R = e, B = !1, b("none"), g(() => e), o.onValueChange?.(e, l(t, void 0, void 0, { activationDirection: "none" })), V = !1;
|
|
92
92
|
}
|
|
93
93
|
let be = {
|
|
94
94
|
value: Y,
|
|
95
95
|
orientation: X,
|
|
96
|
-
tabActivationDirection:
|
|
96
|
+
tabActivationDirection: _,
|
|
97
97
|
state: Z,
|
|
98
|
-
tabsVersion:
|
|
98
|
+
tabsVersion: x,
|
|
99
99
|
panelsVersion: E,
|
|
100
100
|
getOrderedTabs: $,
|
|
101
101
|
getTabIndex(e) {
|
|
102
|
-
return
|
|
102
|
+
return x(), $().indexOf(e);
|
|
103
103
|
},
|
|
104
104
|
getPanelIndex(e) {
|
|
105
105
|
return E(), me().indexOf(e);
|
|
@@ -109,22 +109,22 @@ function V(e) {
|
|
|
109
109
|
getTabPanelIdByValue: _e,
|
|
110
110
|
claimPanel: pe,
|
|
111
111
|
notifyTabChange: ue,
|
|
112
|
-
notifyPanelChange:
|
|
112
|
+
notifyPanelChange: de,
|
|
113
113
|
onValueChange: ve,
|
|
114
|
-
registerTab:
|
|
114
|
+
registerTab: Q,
|
|
115
115
|
registerPanel: fe
|
|
116
116
|
};
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
O(() => {
|
|
118
|
+
x();
|
|
119
119
|
let e = Y(), t = X(), n = $();
|
|
120
120
|
return {
|
|
121
121
|
currentValue: e,
|
|
122
|
-
direction:
|
|
123
|
-
incomplete:
|
|
122
|
+
direction: R === e && !B ? void 0 : K(R, e, t, n),
|
|
123
|
+
incomplete: R != null && e != null && n.every((t) => t.value() !== e)
|
|
124
124
|
};
|
|
125
125
|
}, (e) => {
|
|
126
|
-
e.direction !== void 0 && (
|
|
127
|
-
}),
|
|
126
|
+
e.direction !== void 0 && (B = e.incomplete, b(e.direction), B || (R = e.currentValue));
|
|
127
|
+
}), O(() => (x(), {
|
|
128
128
|
currentValue: Y(),
|
|
129
129
|
registrations: $().map((e) => ({
|
|
130
130
|
registration: e,
|
|
@@ -136,10 +136,10 @@ function V(e) {
|
|
|
136
136
|
if (d) return;
|
|
137
137
|
let t = e.registrations;
|
|
138
138
|
if (t.length === 0) {
|
|
139
|
-
|
|
139
|
+
q && e.currentValue !== null && !J?.isConnected && ye(null, r);
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
q = !0, J = t[0]?.element;
|
|
143
143
|
let n = t.find((t) => t.value === e.currentValue), s = t.find((e) => !e.disabled), c = n?.disabled === !0, u = n == null && e.currentValue !== null;
|
|
144
144
|
if (!c && e.currentValue === m && (W = !1), !(W && c && e.currentValue === m)) {
|
|
145
145
|
if (c || u) {
|
|
@@ -153,22 +153,22 @@ function V(e) {
|
|
|
153
153
|
}
|
|
154
154
|
V && n && (o.onValueChange?.(e.currentValue, l(i, void 0, void 0, { activationDirection: "none" })), V = !1);
|
|
155
155
|
}
|
|
156
|
-
}),
|
|
156
|
+
}), O(() => ({
|
|
157
157
|
defaultValue: o.defaultValue,
|
|
158
158
|
suppliedControlled: o.value !== void 0
|
|
159
159
|
}), (e) => {
|
|
160
|
-
|
|
161
|
-
}),
|
|
162
|
-
|
|
160
|
+
ee() && (!ie && e.suppliedControlled !== d && (ie = !0, console.error(`Base UI: A Tabs component changed from ${d ? "controlled" : "uncontrolled"} to ${d ? "uncontrolled" : "controlled"}.`)), !d && !ae && e.defaultValue !== p && (ae = !0, console.error("Base UI: A Tabs component changed its defaultValue after initialization.")));
|
|
161
|
+
}), N(() => {
|
|
162
|
+
re = !0;
|
|
163
163
|
});
|
|
164
164
|
let xe = t(e, () => Z(), (e) => (() => {
|
|
165
|
-
var t =
|
|
166
|
-
return
|
|
165
|
+
var t = y(U);
|
|
166
|
+
return w(t, e, !1), C(), t;
|
|
167
167
|
})());
|
|
168
|
-
return
|
|
168
|
+
return v(z, {
|
|
169
169
|
value: be,
|
|
170
170
|
get children() {
|
|
171
|
-
return
|
|
171
|
+
return v(xe, S({
|
|
172
172
|
ref: [o.ref],
|
|
173
173
|
get class() {
|
|
174
174
|
return se();
|
|
@@ -180,7 +180,7 @@ function V(e) {
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function G(e, t) {
|
|
184
184
|
let n = e.element(), r = t.element();
|
|
185
185
|
if (n && r && n !== r) {
|
|
186
186
|
let e = n.compareDocumentPosition(r);
|
|
@@ -191,46 +191,46 @@ function H(e, t) {
|
|
|
191
191
|
}
|
|
192
192
|
return e.order - t.order;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function K(e, t, n, r) {
|
|
195
195
|
if (e == null || t == null) return "none";
|
|
196
196
|
let i = r.find((t) => t.value() === e)?.element(), a = r.find((e) => e.value() === t)?.element(), o = n === "horizontal" ? "left" : "up", s = n === "horizontal" ? "right" : "down";
|
|
197
197
|
if (!i || !a) return i !== a && (typeof e == "number" || typeof e == "string") && typeof e == typeof t ? t > e ? s : o : "none";
|
|
198
198
|
let c = n === "horizontal" ? "left" : "top", l = i.getBoundingClientRect()[c], u = a.getBoundingClientRect()[c];
|
|
199
199
|
return u < l ? o : u > l ? s : "none";
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function ee() {
|
|
202
202
|
return !1;
|
|
203
203
|
}
|
|
204
204
|
//#endregion
|
|
205
205
|
//#region src/tabs/list/TabsListContext.ts
|
|
206
|
-
var
|
|
207
|
-
function
|
|
208
|
-
let e =
|
|
209
|
-
if (e ===
|
|
206
|
+
var q = Symbol("TabsListContext"), J = D(q);
|
|
207
|
+
function te() {
|
|
208
|
+
let e = L(J);
|
|
209
|
+
if (e === q) throw Error("Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>.");
|
|
210
210
|
return e;
|
|
211
211
|
}
|
|
212
212
|
//#endregion
|
|
213
213
|
//#region src/tabs/list/TabsList.tsx
|
|
214
|
-
var
|
|
215
|
-
function
|
|
216
|
-
let r =
|
|
217
|
-
function
|
|
218
|
-
|
|
219
|
-
|
|
214
|
+
var ne = /* @__PURE__ */ T("<div>");
|
|
215
|
+
function re(e) {
|
|
216
|
+
let r = B(), i = h(), a = e, o = e, [l, u] = A(), [p, m] = A(), g = /* @__PURE__ */ new Set(), _ = !1, b = 0, x, T = !1, E = !1, D = M(o, "activateOnFocus", "render", "class", "loopFocus", "onKeyDown", "ref", "style"), j = k(() => a.activateOnFocus ?? !1), N = k(() => a.loopFocus ?? !0), P = k(() => r.state()), F = k(() => s(e.class, P())), L = k(() => c(e.style, P())), R = k(() => n(P(), H));
|
|
217
|
+
function z() {
|
|
218
|
+
T = !0, !E && (E = !0, queueMicrotask(() => {
|
|
219
|
+
E = !1, T = !1;
|
|
220
220
|
}));
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
|
|
222
|
+
function V(e) {
|
|
223
|
+
b = I(r.getOrderedTabs).indexOf(e), x = e.token, m(e.token);
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
return
|
|
227
|
-
|
|
225
|
+
function U(e) {
|
|
226
|
+
return g.add(e), () => {
|
|
227
|
+
g.delete(e);
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
for (let e of
|
|
230
|
+
function W() {
|
|
231
|
+
for (let e of g) e();
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function G(e) {
|
|
234
234
|
if (e.defaultPrevented || e.shiftKey || e.ctrlKey || e.altKey || e.metaKey) return;
|
|
235
235
|
let t = r.getOrderedTabs();
|
|
236
236
|
if (t.length < 2 && e.key !== "Home" && e.key !== "End") return;
|
|
@@ -240,26 +240,26 @@ function K(e) {
|
|
|
240
240
|
});
|
|
241
241
|
if (a < 0) return;
|
|
242
242
|
let o;
|
|
243
|
-
if (e.key === "Home") o =
|
|
244
|
-
else if (e.key === "End") o =
|
|
243
|
+
if (e.key === "Home") o = oe(t, 1);
|
|
244
|
+
else if (e.key === "End") o = oe(t, -1);
|
|
245
245
|
else {
|
|
246
|
-
let n =
|
|
246
|
+
let n = ie(e.key, r.orientation(), i());
|
|
247
247
|
if (n === 0) return;
|
|
248
|
-
o = ae(t, a, n,
|
|
248
|
+
o = ae(t, a, n, N());
|
|
249
249
|
}
|
|
250
250
|
if (o === void 0 || o === a) return;
|
|
251
251
|
let s = t[o], c = s?.element();
|
|
252
|
-
!s || !c || (e.preventDefault(), e.stopPropagation(),
|
|
252
|
+
!s || !c || (e.preventDefault(), e.stopPropagation(), z(), V(s), X(c, r.orientation()), queueMicrotask(() => s.element()?.focus()));
|
|
253
253
|
}
|
|
254
|
-
let
|
|
255
|
-
activateOnFocus:
|
|
256
|
-
highlightedTab:
|
|
254
|
+
let K = d(f(() => a.onKeyDown), G), ee = {
|
|
255
|
+
activateOnFocus: j,
|
|
256
|
+
highlightedTab: p,
|
|
257
257
|
listElement: l,
|
|
258
|
-
markNavigating:
|
|
259
|
-
registerIndicatorUpdateListener:
|
|
260
|
-
setHighlightedTab:
|
|
258
|
+
markNavigating: z,
|
|
259
|
+
registerIndicatorUpdateListener: U,
|
|
260
|
+
setHighlightedTab: V
|
|
261
261
|
};
|
|
262
|
-
|
|
262
|
+
O(() => (r.tabsVersion(), {
|
|
263
263
|
activeValue: r.value(),
|
|
264
264
|
element: l(),
|
|
265
265
|
tabs: r.getOrderedTabs().map((e) => ({
|
|
@@ -271,21 +271,21 @@ function K(e) {
|
|
|
271
271
|
}), (e) => {
|
|
272
272
|
let t = e.tabs.find((t) => t.value === e.activeValue), n = (e) => {
|
|
273
273
|
let t = e?.element;
|
|
274
|
-
return t && !
|
|
274
|
+
return t && !Y(t) && !t.hidden && t.ownerDocument.defaultView?.getComputedStyle(t).display !== "none";
|
|
275
275
|
};
|
|
276
|
-
if (!
|
|
277
|
-
|
|
276
|
+
if (!_ && e.tabs.length > 0) {
|
|
277
|
+
_ = !0, V((n(t) ? t : e.tabs.find(n) ?? e.tabs[0]).registration);
|
|
278
278
|
return;
|
|
279
279
|
}
|
|
280
|
-
let r = e.tabs.findIndex((e) => e.registration.token ===
|
|
280
|
+
let r = e.tabs.findIndex((e) => e.registration.token === x);
|
|
281
281
|
if (r === -1 && e.tabs.length > 0) {
|
|
282
|
-
let r = e.tabs[
|
|
283
|
-
|
|
284
|
-
} else r !== -1 && (
|
|
285
|
-
if (!t || t.disabled ||
|
|
286
|
-
let i = e.element ?
|
|
287
|
-
e.element && i &&
|
|
288
|
-
}),
|
|
282
|
+
let r = e.tabs[b];
|
|
283
|
+
V((n(r) ? r : n(t) ? t : e.tabs.find(n) ?? e.tabs[0]).registration);
|
|
284
|
+
} else r !== -1 && (b = r);
|
|
285
|
+
if (!t || t.disabled || T) return;
|
|
286
|
+
let i = e.element ? Z(e.element.ownerDocument) : null;
|
|
287
|
+
e.element && i && se(e.element, i) || V(t.registration);
|
|
288
|
+
}), O(() => (r.tabsVersion(), {
|
|
289
289
|
element: l(),
|
|
290
290
|
tabs: r.getOrderedTabs().flatMap((e) => e.element() ?? [])
|
|
291
291
|
}), (e) => {
|
|
@@ -293,11 +293,11 @@ function K(e) {
|
|
|
293
293
|
if (!t) return;
|
|
294
294
|
let n = t.ownerDocument.defaultView?.ResizeObserver;
|
|
295
295
|
if (!n) return;
|
|
296
|
-
let r = new n(
|
|
296
|
+
let r = new n(W);
|
|
297
297
|
r.observe(t);
|
|
298
298
|
for (let t of e.tabs) r.observe(t);
|
|
299
299
|
return () => r.disconnect();
|
|
300
|
-
}),
|
|
300
|
+
}), O(l, (e) => {
|
|
301
301
|
if (!e) return;
|
|
302
302
|
let t = e.ownerDocument.defaultView?.MutationObserver;
|
|
303
303
|
if (!t) return;
|
|
@@ -306,35 +306,35 @@ function K(e) {
|
|
|
306
306
|
childList: !0,
|
|
307
307
|
subtree: !0
|
|
308
308
|
}), () => n.disconnect();
|
|
309
|
-
}),
|
|
309
|
+
}), O(() => ({
|
|
310
310
|
activeValue: r.value(),
|
|
311
311
|
version: r.tabsVersion()
|
|
312
|
-
}), () =>
|
|
313
|
-
let
|
|
314
|
-
var t =
|
|
315
|
-
return
|
|
312
|
+
}), () => W());
|
|
313
|
+
let q = t(e, () => P(), (e) => (() => {
|
|
314
|
+
var t = y(ne);
|
|
315
|
+
return w(t, e, !1), C(), t;
|
|
316
316
|
})());
|
|
317
|
-
return
|
|
318
|
-
value:
|
|
317
|
+
return v(J, {
|
|
318
|
+
value: ee,
|
|
319
319
|
get children() {
|
|
320
|
-
return
|
|
320
|
+
return v(q, S({
|
|
321
321
|
ref: [((e) => u(e)), a.ref],
|
|
322
322
|
get class() {
|
|
323
|
-
return
|
|
323
|
+
return F();
|
|
324
324
|
},
|
|
325
325
|
get style() {
|
|
326
|
-
return
|
|
326
|
+
return L();
|
|
327
327
|
},
|
|
328
328
|
role: "tablist",
|
|
329
329
|
get "aria-orientation"() {
|
|
330
330
|
return r.orientation() === "vertical" ? "vertical" : void 0;
|
|
331
331
|
},
|
|
332
|
-
onKeyDown:
|
|
333
|
-
},
|
|
332
|
+
onKeyDown: K
|
|
333
|
+
}, R, D));
|
|
334
334
|
}
|
|
335
335
|
});
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function ie(e, t, n) {
|
|
338
338
|
return t === "vertical" ? e === "ArrowUp" ? -1 : +(e === "ArrowDown") : e === "ArrowLeft" ? n === "rtl" ? 1 : -1 : e === "ArrowRight" ? n === "rtl" ? -1 : 1 : 0;
|
|
339
339
|
}
|
|
340
340
|
function ae(e, t, n, r) {
|
|
@@ -345,36 +345,36 @@ function ae(e, t, n, r) {
|
|
|
345
345
|
i = (i + e.length) % e.length;
|
|
346
346
|
}
|
|
347
347
|
let t = e[i]?.element();
|
|
348
|
-
if (t && !
|
|
348
|
+
if (t && !Y(t) && !t.hidden) return i;
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function oe(e, t) {
|
|
352
352
|
let n = t === 1 ? 0 : e.length - 1;
|
|
353
353
|
for (; n >= 0 && n < e.length;) {
|
|
354
354
|
let r = e[n]?.element();
|
|
355
|
-
if (r && !
|
|
355
|
+
if (r && !Y(r) && !r.hidden) return n;
|
|
356
356
|
n += t;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function Y(e) {
|
|
360
360
|
try {
|
|
361
361
|
return e.matches(":disabled");
|
|
362
362
|
} catch {
|
|
363
363
|
return !1;
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function X(e, t) {
|
|
367
367
|
e.scrollIntoView?.({
|
|
368
368
|
block: t === "vertical" ? "nearest" : "center",
|
|
369
369
|
inline: t === "horizontal" ? "nearest" : "center"
|
|
370
370
|
});
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function Z(e) {
|
|
373
373
|
let t = e.activeElement;
|
|
374
374
|
for (; t?.shadowRoot?.activeElement;) t = t.shadowRoot.activeElement;
|
|
375
375
|
return t;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function se(e, t) {
|
|
378
378
|
if (e.contains(t)) return !0;
|
|
379
379
|
let n = t;
|
|
380
380
|
for (; n;) {
|
|
@@ -385,116 +385,116 @@ function Z(e, t) {
|
|
|
385
385
|
}
|
|
386
386
|
//#endregion
|
|
387
387
|
//#region src/tabs/tab/TabsTabDataAttributes.ts
|
|
388
|
-
var
|
|
388
|
+
var ce = /* @__PURE__ */ function(e) {
|
|
389
389
|
return e.orientation = "data-orientation", e.activationDirection = "data-activation-direction", e.active = "data-active", e.disabled = "data-disabled", e;
|
|
390
|
-
}({}),
|
|
391
|
-
...
|
|
392
|
-
active: (e) => e ? { [
|
|
393
|
-
disabled: (e) => e ? { [
|
|
390
|
+
}({}), le = /* @__PURE__ */ T("<button>"), ue = {
|
|
391
|
+
...H,
|
|
392
|
+
active: (e) => e ? { [ce.active]: "" } : null,
|
|
393
|
+
disabled: (e) => e ? { [ce.disabled]: "" } : null
|
|
394
394
|
};
|
|
395
|
-
function
|
|
396
|
-
let r =
|
|
397
|
-
token:
|
|
395
|
+
function de(e) {
|
|
396
|
+
let r = B(), i = te(), a = e, u = e, p = `base-ui-${j()}`, m = Symbol("TabsTab"), [h, g] = A(), _ = k(() => a.id ?? p), b = k(() => a.disabled ?? !1), x = k(() => a.nativeButton ?? !0), T = k(() => a.value === r.value()), E = {
|
|
397
|
+
token: m,
|
|
398
398
|
order: 0,
|
|
399
|
-
element:
|
|
400
|
-
id:
|
|
399
|
+
element: h,
|
|
400
|
+
id: _,
|
|
401
401
|
value: () => a.value,
|
|
402
|
-
disabled:
|
|
403
|
-
},
|
|
404
|
-
disabled:
|
|
405
|
-
active:
|
|
402
|
+
disabled: b
|
|
403
|
+
}, D = r.registerTab(E), P = M(u, "render", "class", "disabled", "id", "nativeButton", "onClick", "onFocus", "onKeyDown", "onPointerDown", "ref", "style", "value"), F = k(() => ({
|
|
404
|
+
disabled: b(),
|
|
405
|
+
active: T(),
|
|
406
406
|
orientation: r.orientation(),
|
|
407
407
|
tabActivationDirection: r.tabActivationDirection()
|
|
408
|
-
})),
|
|
409
|
-
function
|
|
408
|
+
})), L = k(() => s(e.class, F())), R = k(() => c(e.style, F())), z = k(() => n(F(), ue)), V = k(() => i.highlightedTab() === m ? 0 : -1), H = k(() => r.getTabPanelIdByValue(a.value)), U = !1, W = !1, G;
|
|
409
|
+
function K(e) {
|
|
410
410
|
r.onValueChange(a.value, l(o, e, void 0, { activationDirection: "none" }));
|
|
411
411
|
}
|
|
412
|
-
function
|
|
413
|
-
|
|
412
|
+
function ee(e) {
|
|
413
|
+
b() && (e.preventDefault(), e.preventBaseUIHandler());
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
|
|
415
|
+
function q(e) {
|
|
416
|
+
T() || b() || e.button !== 0 || K(e);
|
|
417
417
|
}
|
|
418
|
-
function
|
|
419
|
-
i.setHighlightedTab(
|
|
418
|
+
function J(e) {
|
|
419
|
+
i.setHighlightedTab(E), !T() && !b() && i.activateOnFocus() && (!U || W) && K(e);
|
|
420
420
|
}
|
|
421
|
-
function
|
|
422
|
-
if (
|
|
423
|
-
|
|
421
|
+
function ne(e) {
|
|
422
|
+
if (T() || b()) return;
|
|
423
|
+
U = !0, W = e.button === 0, G?.();
|
|
424
424
|
let t = e.currentTarget.ownerDocument, n = () => {
|
|
425
|
-
|
|
425
|
+
U = !1, W = !1, G?.(), G = void 0;
|
|
426
426
|
};
|
|
427
|
-
t.addEventListener("pointerup", n), t.addEventListener("pointercancel", n),
|
|
427
|
+
t.addEventListener("pointerup", n), t.addEventListener("pointercancel", n), G = () => {
|
|
428
428
|
t.removeEventListener("pointerup", n), t.removeEventListener("pointercancel", n);
|
|
429
429
|
};
|
|
430
430
|
}
|
|
431
|
-
function
|
|
432
|
-
e.target !== e.currentTarget ||
|
|
431
|
+
function re(e) {
|
|
432
|
+
e.target !== e.currentTarget || T() || b() || i.activateOnFocus() || e.key !== "Enter" && e.key !== " " || (e.preventDefault(), K(e));
|
|
433
433
|
}
|
|
434
|
-
let
|
|
435
|
-
|
|
436
|
-
disabled:
|
|
437
|
-
element:
|
|
438
|
-
id:
|
|
434
|
+
let ie = d(f(() => I(() => b() ? ee : void 0)), f(() => a.onClick), q), ae = d(f(() => a.onFocus), J), oe = d(f(() => a.onKeyDown), re), Y = d(f(() => a.onPointerDown), ne);
|
|
435
|
+
O(() => ({
|
|
436
|
+
disabled: b(),
|
|
437
|
+
element: h(),
|
|
438
|
+
id: _(),
|
|
439
439
|
value: a.value
|
|
440
|
-
}), () => r.notifyTabChange()),
|
|
441
|
-
|
|
440
|
+
}), () => r.notifyTabChange()), N(() => {
|
|
441
|
+
G?.(), D();
|
|
442
442
|
});
|
|
443
|
-
let
|
|
444
|
-
var t =
|
|
445
|
-
return
|
|
443
|
+
let X = t(e, () => F(), (e) => (() => {
|
|
444
|
+
var t = y(le);
|
|
445
|
+
return w(t, e, !1), C(), t;
|
|
446
446
|
})());
|
|
447
|
-
return
|
|
448
|
-
ref: [((e) =>
|
|
447
|
+
return v(X, S({
|
|
448
|
+
ref: [((e) => g(e)), a.ref],
|
|
449
449
|
get id() {
|
|
450
|
-
return
|
|
450
|
+
return _();
|
|
451
451
|
},
|
|
452
452
|
get class() {
|
|
453
|
-
return
|
|
453
|
+
return L();
|
|
454
454
|
},
|
|
455
455
|
get style() {
|
|
456
|
-
return
|
|
456
|
+
return R();
|
|
457
457
|
},
|
|
458
458
|
get type() {
|
|
459
|
-
return
|
|
459
|
+
return x() ? "button" : void 0;
|
|
460
460
|
},
|
|
461
461
|
role: "tab",
|
|
462
462
|
get tabIndex() {
|
|
463
|
-
return
|
|
463
|
+
return V();
|
|
464
464
|
},
|
|
465
465
|
get "aria-controls"() {
|
|
466
|
-
return
|
|
466
|
+
return H();
|
|
467
467
|
},
|
|
468
468
|
get "aria-selected"() {
|
|
469
|
-
return
|
|
469
|
+
return T() ? "true" : "false";
|
|
470
470
|
},
|
|
471
471
|
get "aria-disabled"() {
|
|
472
|
-
return
|
|
472
|
+
return b() ? "true" : void 0;
|
|
473
473
|
},
|
|
474
474
|
get "data-composite-item-active"() {
|
|
475
|
-
return
|
|
475
|
+
return T() ? "" : void 0;
|
|
476
476
|
},
|
|
477
|
-
onClick:
|
|
477
|
+
onClick: ie,
|
|
478
478
|
onFocus: ae,
|
|
479
|
-
onKeyDown:
|
|
480
|
-
onPointerDown:
|
|
481
|
-
},
|
|
479
|
+
onKeyDown: oe,
|
|
480
|
+
onPointerDown: Y
|
|
481
|
+
}, z, P));
|
|
482
482
|
}
|
|
483
483
|
//#endregion
|
|
484
484
|
//#region src/tabs/indicator/TabsIndicatorCssVars.ts
|
|
485
485
|
var Q = /* @__PURE__ */ function(e) {
|
|
486
486
|
return e.activeTabLeft = "--active-tab-left", e.activeTabRight = "--active-tab-right", e.activeTabTop = "--active-tab-top", e.activeTabBottom = "--active-tab-bottom", e.activeTabWidth = "--active-tab-width", e.activeTabHeight = "--active-tab-height", e;
|
|
487
|
-
}({}),
|
|
488
|
-
...
|
|
487
|
+
}({}), fe = /* @__PURE__ */ T("<span>"), pe = /* @__PURE__ */ T("<script>"), $ = {
|
|
488
|
+
...H,
|
|
489
489
|
activeTabPosition: () => null,
|
|
490
490
|
activeTabSize: () => null
|
|
491
491
|
};
|
|
492
|
-
function
|
|
493
|
-
let r =
|
|
492
|
+
function me(e) {
|
|
493
|
+
let r = B(), i = te(), a = _(), o = e, l = e, [u, d] = A(null), [f, p] = A(0), [m, h] = A(!!(b || F.hydrating)), T = { innerHTML: "" }, D = M(l, "render", "class", "ref", "renderBeforeHydration", "style"), j = k(() => ({
|
|
494
494
|
...r.state(),
|
|
495
495
|
activeTabPosition: u()?.position ?? null,
|
|
496
496
|
activeTabSize: u()?.size ?? null
|
|
497
|
-
})),
|
|
497
|
+
})), I = k(() => s(e.class, j())), L = k(() => {
|
|
498
498
|
let e = u();
|
|
499
499
|
if (e) return {
|
|
500
500
|
[Q.activeTabLeft]: `${e.position.left}px`,
|
|
@@ -504,15 +504,18 @@ function $(e) {
|
|
|
504
504
|
[Q.activeTabWidth]: `${e.size.width}px`,
|
|
505
505
|
[Q.activeTabHeight]: `${e.size.height}px`
|
|
506
506
|
};
|
|
507
|
-
}),
|
|
507
|
+
}), R = k(() => {
|
|
508
|
+
let t = L(), n = c(e.style, j());
|
|
509
|
+
return t ? g(t, n) : n;
|
|
510
|
+
}), z = k(() => {
|
|
508
511
|
let e = u();
|
|
509
512
|
return !e || e.size.width <= 0 || e.size.height <= 0;
|
|
510
|
-
}),
|
|
511
|
-
function
|
|
513
|
+
}), V = k(() => n(j(), $));
|
|
514
|
+
function H(e, t) {
|
|
512
515
|
if (!e || t == null) return null;
|
|
513
516
|
let n = r.getTabElementBySelectedValue(t);
|
|
514
517
|
if (!n) return null;
|
|
515
|
-
let i =
|
|
518
|
+
let i = ve(n), a = ve(e), o = n.getBoundingClientRect(), s = e.getBoundingClientRect(), c = a.width > 0 ? s.width / a.width : 1, l = a.height > 0 ? s.height / a.height : 1, { left: u, top: d } = he(n, e), f = (o.left - s.left) / c + e.scrollLeft - e.clientLeft, p = (o.top - s.top) / l + e.scrollTop - e.clientTop, m = _e(n);
|
|
516
519
|
return Math.abs(f - m.x - u) <= 2 && Math.abs(p - m.y - d) <= 2 && (u = f, d = p), {
|
|
517
520
|
position: {
|
|
518
521
|
left: u,
|
|
@@ -523,53 +526,53 @@ function $(e) {
|
|
|
523
526
|
size: i
|
|
524
527
|
};
|
|
525
528
|
}
|
|
526
|
-
let
|
|
529
|
+
let U = i.registerIndicatorUpdateListener(() => {
|
|
527
530
|
p((e) => e + 1);
|
|
528
531
|
});
|
|
529
|
-
|
|
532
|
+
O(() => (f(), r.tabsVersion(), H(i.listElement(), r.value())), (e) => {
|
|
530
533
|
d(e);
|
|
531
|
-
}),
|
|
532
|
-
|
|
533
|
-
}),
|
|
534
|
-
let
|
|
535
|
-
var t =
|
|
536
|
-
return
|
|
534
|
+
}), P(() => {
|
|
535
|
+
h(!1);
|
|
536
|
+
}), N(U);
|
|
537
|
+
let W = t(e, () => j(), (e) => (() => {
|
|
538
|
+
var t = y(fe);
|
|
539
|
+
return w(t, e, !1), C(), t;
|
|
537
540
|
})());
|
|
538
|
-
return
|
|
541
|
+
return v(E, {
|
|
539
542
|
get when() {
|
|
540
543
|
return r.value() != null;
|
|
541
544
|
},
|
|
542
545
|
get children() {
|
|
543
|
-
return [
|
|
546
|
+
return [v(W, S({
|
|
544
547
|
ref: [o.ref],
|
|
545
548
|
get class() {
|
|
546
|
-
return
|
|
549
|
+
return I();
|
|
547
550
|
},
|
|
548
551
|
get style() {
|
|
549
|
-
return
|
|
552
|
+
return R();
|
|
550
553
|
},
|
|
551
554
|
role: "presentation",
|
|
552
555
|
get hidden() {
|
|
553
|
-
return
|
|
556
|
+
return z();
|
|
554
557
|
}
|
|
555
|
-
},
|
|
556
|
-
var e =
|
|
557
|
-
return
|
|
558
|
+
}, V, D)), x(() => x(() => !!((o.renderBeforeHydration ?? !1) && m()))() ? (() => {
|
|
559
|
+
var e = y(pe);
|
|
560
|
+
return w(e, S({ get nonce() {
|
|
558
561
|
return a.nonce();
|
|
559
|
-
} },
|
|
562
|
+
} }, T), !1), C(), e;
|
|
560
563
|
})() : (o.renderBeforeHydration ?? !1) && m())];
|
|
561
564
|
}
|
|
562
565
|
});
|
|
563
566
|
}
|
|
564
|
-
function
|
|
565
|
-
let n =
|
|
567
|
+
function he(e, t) {
|
|
568
|
+
let n = ge(e), r = ge(t), i = n.left - r.left - t.clientLeft, a = n.top - r.top - t.clientTop, o = e.assignedSlot ?? e.parentNode;
|
|
566
569
|
for (; o && o !== t;) o.nodeType === 1 && (i -= o.scrollLeft || 0, a -= o.scrollTop || 0), o = o.assignedSlot ?? o.parentNode ?? o.host;
|
|
567
570
|
return {
|
|
568
571
|
left: i,
|
|
569
572
|
top: a
|
|
570
573
|
};
|
|
571
574
|
}
|
|
572
|
-
function
|
|
575
|
+
function ge(e) {
|
|
573
576
|
let t = 0, n = 0, r = e;
|
|
574
577
|
for (; r;) {
|
|
575
578
|
t += r.offsetLeft, n += r.offsetTop;
|
|
@@ -581,7 +584,7 @@ function he(e) {
|
|
|
581
584
|
top: n
|
|
582
585
|
};
|
|
583
586
|
}
|
|
584
|
-
function
|
|
587
|
+
function _e(e) {
|
|
585
588
|
let t = e.ownerDocument.defaultView.getComputedStyle(e), n = t.transform.match(/matrix(?:3d)?\(([^)]+)\)/)?.[1]?.split(",").map(Number), r = n?.[n.length === 16 ? 12 : 4] ?? 0, i = n?.[n.length === 16 ? 13 : 5] ?? 0, a = t.translate?.split(" ") ?? [];
|
|
586
589
|
for (let t = 0; t < 2; t += 1) {
|
|
587
590
|
let n = a[t] ?? "", o = Number.parseFloat(n), s = Number.isFinite(o) ? o * (n.endsWith("%") ? (t === 0 ? e.offsetWidth : e.offsetHeight) / 100 : 1) : 0;
|
|
@@ -592,7 +595,7 @@ function ge(e) {
|
|
|
592
595
|
y: i
|
|
593
596
|
};
|
|
594
597
|
}
|
|
595
|
-
function
|
|
598
|
+
function ve(e) {
|
|
596
599
|
let t = e.ownerDocument.defaultView?.getComputedStyle(e), n = Number.parseFloat(t?.width ?? "") || 0, r = Number.parseFloat(t?.height ?? "") || 0;
|
|
597
600
|
return (Math.round(n) !== e.offsetWidth || Math.round(r) !== e.offsetHeight) && (n = e.offsetWidth, r = e.offsetHeight), {
|
|
598
601
|
width: n,
|
|
@@ -601,92 +604,92 @@ function _e(e) {
|
|
|
601
604
|
}
|
|
602
605
|
//#endregion
|
|
603
606
|
//#region src/tabs/panel/TabsPanelDataAttributes.ts
|
|
604
|
-
var
|
|
607
|
+
var ye = /* @__PURE__ */ function(e) {
|
|
605
608
|
return e.orientation = "data-orientation", e.activationDirection = "data-activation-direction", e.hidden = "data-hidden", e.index = "data-index", e;
|
|
606
|
-
}({}),
|
|
607
|
-
...
|
|
609
|
+
}({}), be = /* @__PURE__ */ T("<div>"), xe = {
|
|
610
|
+
...H,
|
|
608
611
|
...u,
|
|
609
|
-
hidden: (e) => e ? { [
|
|
612
|
+
hidden: (e) => e ? { [ye.hidden]: "" } : null
|
|
610
613
|
};
|
|
611
|
-
function
|
|
612
|
-
let r =
|
|
614
|
+
function Se(e) {
|
|
615
|
+
let r = B(), i = e, a = e, o = `base-ui-${j()}`, l = Symbol("TabsPanel"), [u, d] = A(), f = k(() => i.id ?? o), h = k(() => i.value === r.value()), g = m(() => h()), _ = k(() => !g.mounted()), b = k(() => (i.keepMounted ?? !1) || g.mounted()), x = {
|
|
613
616
|
token: l,
|
|
614
617
|
order: 0,
|
|
615
618
|
element: u,
|
|
616
|
-
id:
|
|
619
|
+
id: f,
|
|
617
620
|
value: () => i.value,
|
|
618
621
|
rendered: b
|
|
619
|
-
},
|
|
622
|
+
}, T = r.registerPanel(x), D = M(a, "render", "class", "id", "keepMounted", "ref", "style", "value"), P = k(() => ({
|
|
620
623
|
...r.state(),
|
|
621
|
-
hidden:
|
|
624
|
+
hidden: _(),
|
|
622
625
|
transitionStatus: g.transitionStatus()
|
|
623
|
-
})),
|
|
624
|
-
|
|
626
|
+
})), F = k(() => b() ? s(e.class, P()) : void 0), L = k(() => b() ? c(e.style, P()) : void 0), R = k(() => n(P(), xe)), z = k(() => r.getPanelIndex(x)), V = k(() => r.getTabIdByPanelValue(i.value)), H = I(h);
|
|
627
|
+
O(() => ({
|
|
625
628
|
element: u(),
|
|
626
629
|
open: h(),
|
|
627
630
|
status: g.transitionStatus()
|
|
628
631
|
}), (e) => {
|
|
629
|
-
if (
|
|
632
|
+
if (H = e.open, e.open || e.status !== "ending" || !e.element) return;
|
|
630
633
|
let t = new AbortController();
|
|
631
|
-
return
|
|
632
|
-
|
|
634
|
+
return p(e.element, () => {
|
|
635
|
+
H || g.setMounted(!1);
|
|
633
636
|
}, t.signal), () => t.abort();
|
|
634
|
-
}),
|
|
637
|
+
}), O(() => ({
|
|
635
638
|
element: u(),
|
|
636
|
-
id:
|
|
639
|
+
id: f(),
|
|
637
640
|
rendered: b(),
|
|
638
641
|
value: i.value
|
|
639
642
|
}), (e) => {
|
|
640
|
-
e.rendered && e.element ? r.claimPanel(
|
|
641
|
-
}),
|
|
642
|
-
let
|
|
643
|
-
var t =
|
|
644
|
-
return
|
|
643
|
+
e.rendered && e.element ? r.claimPanel(x) : r.notifyPanelChange();
|
|
644
|
+
}), N(() => T());
|
|
645
|
+
let U = t(e, () => P(), (e) => (() => {
|
|
646
|
+
var t = y(be);
|
|
647
|
+
return w(t, e, !1), C(), t;
|
|
645
648
|
})());
|
|
646
|
-
return
|
|
649
|
+
return v(E, {
|
|
647
650
|
get when() {
|
|
648
651
|
return b();
|
|
649
652
|
},
|
|
650
653
|
get children() {
|
|
651
|
-
return
|
|
654
|
+
return v(U, S({
|
|
652
655
|
ref: [((e) => d(e)), i.ref],
|
|
653
656
|
get id() {
|
|
654
|
-
return
|
|
657
|
+
return f();
|
|
655
658
|
},
|
|
656
659
|
get class() {
|
|
657
|
-
return
|
|
660
|
+
return F();
|
|
658
661
|
},
|
|
659
662
|
get style() {
|
|
660
|
-
return
|
|
663
|
+
return L();
|
|
661
664
|
},
|
|
662
665
|
role: "tabpanel",
|
|
663
666
|
get tabIndex() {
|
|
664
667
|
return h() ? 0 : -1;
|
|
665
668
|
},
|
|
666
669
|
get "aria-labelledby"() {
|
|
667
|
-
return
|
|
670
|
+
return V();
|
|
668
671
|
},
|
|
669
672
|
get hidden() {
|
|
670
|
-
return
|
|
673
|
+
return _();
|
|
671
674
|
},
|
|
672
675
|
get inert() {
|
|
673
676
|
return !h() || void 0;
|
|
674
677
|
},
|
|
675
678
|
get "data-index"() {
|
|
676
|
-
return
|
|
679
|
+
return z();
|
|
677
680
|
}
|
|
678
|
-
},
|
|
681
|
+
}, R, D));
|
|
679
682
|
}
|
|
680
683
|
});
|
|
681
684
|
}
|
|
682
685
|
//#endregion
|
|
683
686
|
//#region src/tabs/index.parts.ts
|
|
684
|
-
var
|
|
685
|
-
Indicator: () =>
|
|
686
|
-
List: () =>
|
|
687
|
-
Panel: () =>
|
|
688
|
-
Root: () =>
|
|
689
|
-
Tab: () =>
|
|
687
|
+
var Ce = /* @__PURE__ */ e({
|
|
688
|
+
Indicator: () => me,
|
|
689
|
+
List: () => re,
|
|
690
|
+
Panel: () => Se,
|
|
691
|
+
Root: () => W,
|
|
692
|
+
Tab: () => de
|
|
690
693
|
});
|
|
691
694
|
//#endregion
|
|
692
|
-
export {
|
|
695
|
+
export { Ce as t };
|