solid-baseui 0.1.0-alpha.1 → 0.1.0-alpha.3
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 +56 -0
- package/README.md +30 -35
- 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 +2 -2
- 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,16 +5,16 @@ import { w as r } from "./reasons-Co5CzjKq.js";
|
|
|
5
5
|
import { n as i, t as a } from "./resolveStyle-XcgAuaKR.js";
|
|
6
6
|
import { createChangeEventDetails as o } from "./internals/createBaseUIEventDetails.js";
|
|
7
7
|
import { transitionStatusMapping as s } from "./internals/stateAttributesMapping.js";
|
|
8
|
-
import { composeEventHandlers as c } from "./internals/composeEventHandlers.js";
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import { fieldStateAttributesMapping as
|
|
12
|
-
import {
|
|
13
|
-
import { r as
|
|
14
|
-
import { n as
|
|
15
|
-
import { n as
|
|
16
|
-
import { createComponent as
|
|
17
|
-
import { Show as D, createContext as O, createEffect as k, createMemo as A, createSignal as j, createUniqueId as M, omit as N, onCleanup as
|
|
8
|
+
import { composeEventHandlers as c, liveEventHandler as l } from "./internals/composeEventHandlers.js";
|
|
9
|
+
import { t as u } from "./runOnceAnimationsFinish-CFADb4CN.js";
|
|
10
|
+
import { t as d } from "./createTransitionStatus-BL_cPSEA.js";
|
|
11
|
+
import { fieldStateAttributesMapping as f } from "./internals/field-constants.js";
|
|
12
|
+
import { r as p } from "./FieldRootContext-D3fuVjs3.js";
|
|
13
|
+
import { r as m } from "./LabelableContext-CmQF-TX2.js";
|
|
14
|
+
import { n as h } from "./FieldItemContext-Bwzf-4tL.js";
|
|
15
|
+
import { n as g } from "./RadioGroupContext-CZexBsPa.js";
|
|
16
|
+
import { createComponent as _, delegateEvents as v, effect as y, getNextElement as b, memo as x, mergeProps as S, ref as ee, runHydrationEvents as C, setAttribute as w, setProperty as te, spread as T, style as ne, template as E } from "@solidjs/web";
|
|
17
|
+
import { Show as D, createContext as O, createEffect as k, createMemo as A, createSignal as j, createUniqueId as M, omit as N, onCleanup as re, onSettled as ie, untrack as ae, useContext as P } from "solid-js";
|
|
18
18
|
//#region src/radio/root/RadioRootContext.ts
|
|
19
19
|
var F = Symbol("RadioRootContext"), I = O(F);
|
|
20
20
|
function L() {
|
|
@@ -24,7 +24,7 @@ function L() {
|
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region src/radio/root/RadioRoot.tsx
|
|
27
|
-
var
|
|
27
|
+
var oe = /* @__PURE__ */ E("<span>"), se = /* @__PURE__ */ E("<input type=radio tabindex=-1 aria-hidden=true>"), R = {
|
|
28
28
|
"clip-path": "inset(50%)",
|
|
29
29
|
overflow: "hidden",
|
|
30
30
|
"white-space": "nowrap",
|
|
@@ -36,44 +36,44 @@ var ae = /* @__PURE__ */ E("<span>"), oe = /* @__PURE__ */ E("<input type=radio
|
|
|
36
36
|
position: "fixed",
|
|
37
37
|
top: "0",
|
|
38
38
|
left: "0"
|
|
39
|
-
},
|
|
39
|
+
}, ce = {
|
|
40
40
|
...R,
|
|
41
41
|
position: "absolute"
|
|
42
|
-
},
|
|
43
|
-
...
|
|
42
|
+
}, le = {
|
|
43
|
+
...f,
|
|
44
44
|
checked(e) {
|
|
45
45
|
return e ? { "data-checked": "" } : { "data-unchecked": "" };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
function z(e) {
|
|
49
|
-
let s =
|
|
50
|
-
...
|
|
49
|
+
let s = g(), u = p(!0), d = h(), f = m(), v = e, E = e, D = Symbol("Radio"), O = Symbol("RadioLabelSource"), P = `base-ui-${M()}`, F = `base-ui-${M()}`, L = `base-ui-${M()}`, z = ae(f.controlId), V = typeof z == "string" ? z : P, [H, U] = j(), [W, de] = j(), [fe, G] = j(), pe = N(E, "aria-describedby", "aria-labelledby", "render", "class", "disabled", "id", "inputRef", "nativeButton", "onClick", "onFocus", "onKeyDown", "onKeyUp", "readOnly", "ref", "required", "style", "value"), K = A(() => v.nativeButton ?? !1), q = A(() => u.disabled() || d.disabled() || (s?.disabled() ?? !1) || (v.disabled ?? !1)), J = A(() => (s?.readOnly() ?? !1) || (v.readOnly ?? !1)), Y = A(() => (s?.required() ?? !1) || (v.required ?? !1)), X = A(() => s ? s.checkedValue() === v.value : v.value === ""), Z = A(() => v.id ?? V), me = A(() => K() ? Z() : F), Q = A(() => ({
|
|
50
|
+
...u.state(),
|
|
51
51
|
required: Y(),
|
|
52
52
|
disabled: q(),
|
|
53
53
|
readOnly: J(),
|
|
54
54
|
checked: X()
|
|
55
|
-
})),
|
|
56
|
-
var t =
|
|
57
|
-
return T(t, e, !1),
|
|
58
|
-
})()),
|
|
55
|
+
})), he = A(() => i(e.class, Q())), ge = t(e, () => Q(), (e) => (() => {
|
|
56
|
+
var t = b(oe);
|
|
57
|
+
return T(t, e, !1), C(), t;
|
|
58
|
+
})()), _e = A(() => a(e.style, Q())), ve = A(() => n(Q(), le)), ye = A(() => v["aria-labelledby"] ?? f.labelId() ?? fe()), be = A(() => f.getAriaDescribedBy(v["aria-describedby"])), $ = {
|
|
59
59
|
token: D,
|
|
60
60
|
checked: X,
|
|
61
61
|
disabled: q,
|
|
62
62
|
element: H,
|
|
63
63
|
input: W,
|
|
64
|
-
value: () =>
|
|
65
|
-
},
|
|
66
|
-
function
|
|
67
|
-
if (
|
|
64
|
+
value: () => v.value
|
|
65
|
+
}, xe = c(l(() => v.onClick)), Se = c(l(() => v.onFocus)), Ce = c(l(() => v.onKeyDown)), we = c(l(() => v.onKeyUp));
|
|
66
|
+
function Te(e) {
|
|
67
|
+
if (xe.call(e.currentTarget, e), e.baseUIHandlerPrevented || e.defaultPrevented || q() || J()) return;
|
|
68
68
|
e.preventDefault();
|
|
69
69
|
let t = W();
|
|
70
70
|
t && !X() && B(t, e);
|
|
71
71
|
}
|
|
72
|
-
function Te(e) {
|
|
73
|
-
xe.call(e.currentTarget, e), !e.baseUIHandlerPrevented && (s?.setActiveRadio($), !(!s || q() || J() || !s.touched()) && (W()?.click(), s.setTouched(!1)));
|
|
74
|
-
}
|
|
75
72
|
function Ee(e) {
|
|
76
|
-
|
|
73
|
+
Se.call(e.currentTarget, e), !e.baseUIHandlerPrevented && (s?.setActiveRadio($), !(!s || q() || J() || !s.touched()) && (W()?.click(), s.setTouched(!1)));
|
|
74
|
+
}
|
|
75
|
+
function De(e) {
|
|
76
|
+
if (Ce.call(e.currentTarget, e), !e.baseUIHandlerPrevented) {
|
|
77
77
|
if (e.key === "Enter") {
|
|
78
78
|
e.preventDefault();
|
|
79
79
|
return;
|
|
@@ -81,13 +81,13 @@ function z(e) {
|
|
|
81
81
|
!K() && e.key === " " && e.preventDefault();
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
function De(e) {
|
|
85
|
-
Ce.call(e.currentTarget, e), !(e.baseUIHandlerPrevented || K() || e.defaultPrevented || e.key !== " " || q() || J()) && B(e.currentTarget, e);
|
|
86
|
-
}
|
|
87
84
|
function Oe(e) {
|
|
85
|
+
we.call(e.currentTarget, e), !(e.baseUIHandlerPrevented || K() || e.defaultPrevented || e.key !== " " || q() || J()) && B(e.currentTarget, e);
|
|
86
|
+
}
|
|
87
|
+
function ke(e) {
|
|
88
88
|
let t = e.currentTarget;
|
|
89
89
|
if (e.stopPropagation(), X()) return;
|
|
90
|
-
if (!s || q() || J() ||
|
|
90
|
+
if (!s || q() || J() || v.value === void 0) {
|
|
91
91
|
e.preventDefault();
|
|
92
92
|
let n = X();
|
|
93
93
|
queueMicrotask(() => {
|
|
@@ -96,21 +96,21 @@ function z(e) {
|
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
let n = o(r, e);
|
|
99
|
-
if (!s.selectValue(
|
|
99
|
+
if (!s.selectValue(v.value, n)) {
|
|
100
100
|
e.preventDefault(), queueMicrotask(s.syncInputs);
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
|
-
|
|
103
|
+
u.setTouched(!0), queueMicrotask(s.syncInputs);
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function Ae() {
|
|
106
106
|
H()?.focus();
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function je() {
|
|
109
109
|
return H() ?? null;
|
|
110
110
|
}
|
|
111
|
-
return k(Z, (e) =>
|
|
112
|
-
explicit:
|
|
113
|
-
fieldLabel:
|
|
111
|
+
return k(Z, (e) => f.registerControlId(O, e)), k(() => s, (e) => e?.registerRadio($)), k(() => ({
|
|
112
|
+
explicit: v["aria-labelledby"],
|
|
113
|
+
fieldLabel: f.labelId(),
|
|
114
114
|
input: W(),
|
|
115
115
|
inputId: Z(),
|
|
116
116
|
nativeButton: K()
|
|
@@ -129,37 +129,37 @@ function z(e) {
|
|
|
129
129
|
input: W(),
|
|
130
130
|
source: s?.fieldControlSource
|
|
131
131
|
}), (e) => {
|
|
132
|
-
if (!(!e.input || !e.source)) return
|
|
132
|
+
if (!(!e.input || !e.source)) return u.validation.registerInput(e.source, e.input, je);
|
|
133
133
|
}), k(() => ({
|
|
134
134
|
checked: X(),
|
|
135
135
|
disabled: q(),
|
|
136
136
|
input: W()
|
|
137
137
|
}), (e) => {
|
|
138
|
-
e.checked &&
|
|
139
|
-
}),
|
|
138
|
+
e.checked && u.setFilled(!0), s?.notifyRadioChange();
|
|
139
|
+
}), ie(() => {
|
|
140
140
|
H();
|
|
141
|
-
}),
|
|
142
|
-
|
|
143
|
-
}),
|
|
141
|
+
}), re(() => {
|
|
142
|
+
f.registerControlId(O, void 0);
|
|
143
|
+
}), _(I, {
|
|
144
144
|
value: Q,
|
|
145
145
|
get children() {
|
|
146
|
-
return [
|
|
147
|
-
ref: [((e) => U(e)),
|
|
146
|
+
return [_(ge, S({
|
|
147
|
+
ref: [((e) => U(e)), v.ref],
|
|
148
148
|
get id() {
|
|
149
|
-
return
|
|
149
|
+
return me();
|
|
150
150
|
},
|
|
151
151
|
get class() {
|
|
152
|
-
return
|
|
152
|
+
return he();
|
|
153
153
|
},
|
|
154
154
|
get style() {
|
|
155
|
-
return
|
|
155
|
+
return _e();
|
|
156
156
|
},
|
|
157
157
|
get type() {
|
|
158
158
|
return K() ? "button" : void 0;
|
|
159
159
|
},
|
|
160
160
|
role: "radio",
|
|
161
161
|
get tabIndex() {
|
|
162
|
-
return
|
|
162
|
+
return x(() => !!q())() ? -1 : s ? s.isTabStop($) ? 0 : -1 : 0;
|
|
163
163
|
},
|
|
164
164
|
get disabled() {
|
|
165
165
|
return K() && q() ? !0 : void 0;
|
|
@@ -171,10 +171,10 @@ function z(e) {
|
|
|
171
171
|
return X() ? "true" : "false";
|
|
172
172
|
},
|
|
173
173
|
get "aria-labelledby"() {
|
|
174
|
-
return
|
|
174
|
+
return ye();
|
|
175
175
|
},
|
|
176
176
|
get "aria-describedby"() {
|
|
177
|
-
return
|
|
177
|
+
return be();
|
|
178
178
|
},
|
|
179
179
|
get "aria-invalid"() {
|
|
180
180
|
return Q().valid === !1 && !q() ? "true" : void 0;
|
|
@@ -182,30 +182,30 @@ function z(e) {
|
|
|
182
182
|
get "data-composite-item-active"() {
|
|
183
183
|
return X() ? "" : void 0;
|
|
184
184
|
},
|
|
185
|
-
onClick:
|
|
186
|
-
onFocus:
|
|
187
|
-
onKeyDown:
|
|
188
|
-
onKeyUp:
|
|
189
|
-
},
|
|
190
|
-
var e =
|
|
191
|
-
return e.addEventListener("focus",
|
|
185
|
+
onClick: Te,
|
|
186
|
+
onFocus: Ee,
|
|
187
|
+
onKeyDown: De,
|
|
188
|
+
onKeyUp: Oe
|
|
189
|
+
}, ve, pe)), (() => {
|
|
190
|
+
var e = b(se);
|
|
191
|
+
return e.addEventListener("focus", Ae), e.$$click = ke, ee(() => [((e) => de(e)), v.inputRef], e), y(() => ({
|
|
192
192
|
e: s?.form(),
|
|
193
193
|
t: K() ? void 0 : Z(),
|
|
194
194
|
a: s?.name(),
|
|
195
|
-
o: s?.name() ?
|
|
196
|
-
i:
|
|
195
|
+
o: s?.name() ? ce : R,
|
|
196
|
+
i: v.value === void 0 ? void 0 : ue(v.value),
|
|
197
197
|
n: q(),
|
|
198
198
|
s: X(),
|
|
199
199
|
h: Y(),
|
|
200
200
|
r: J()
|
|
201
201
|
}), ({ e: t, t: n, a: r, o: i, i: a, n: o, s, h: c, r: l }, u) => {
|
|
202
|
-
t !== u?.e &&
|
|
203
|
-
}),
|
|
202
|
+
t !== u?.e && w(e, "form", t), n !== u?.t && w(e, "id", n), r !== u?.a && w(e, "name", r), ne(e, i, u?.o), te(e, "value", a), o !== u?.n && w(e, "disabled", o), te(e, "checked", s), c !== u?.h && w(e, "required", c), l !== u?.r && w(e, "readonly", l);
|
|
203
|
+
}), C(), e;
|
|
204
204
|
})()];
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function ue(e) {
|
|
209
209
|
if (e == null) return "";
|
|
210
210
|
if (typeof e == "string") return e;
|
|
211
211
|
try {
|
|
@@ -229,24 +229,24 @@ function B(e, t) {
|
|
|
229
229
|
metaKey: t.metaKey
|
|
230
230
|
}));
|
|
231
231
|
}
|
|
232
|
-
|
|
232
|
+
v(["click"]);
|
|
233
233
|
//#endregion
|
|
234
234
|
//#region src/radio/indicator/RadioIndicator.tsx
|
|
235
235
|
var V = /* @__PURE__ */ E("<span>"), H = {
|
|
236
|
-
...
|
|
236
|
+
...f,
|
|
237
237
|
...s,
|
|
238
238
|
checked(e) {
|
|
239
239
|
return e ? { "data-checked": "" } : { "data-unchecked": "" };
|
|
240
240
|
}
|
|
241
241
|
};
|
|
242
242
|
function U(e) {
|
|
243
|
-
let r, o = !1, s = L(), c = e,
|
|
243
|
+
let r, o = !1, s = L(), c = e, l = N(e, "render", "class", "keepMounted", "ref", "style"), f = A(() => s().checked), p = d(() => f()), m = A(() => (c.keepMounted ?? !1) || p.mounted()), h = A(() => ({
|
|
244
244
|
...s(),
|
|
245
245
|
transitionStatus: p.transitionStatus()
|
|
246
|
-
})),
|
|
247
|
-
var t =
|
|
248
|
-
return T(t, e, !1),
|
|
249
|
-
})()), v = A(() => m() ? i(e.class, h()) : void 0),
|
|
246
|
+
})), g = t(e, () => h(), (e) => (() => {
|
|
247
|
+
var t = b(V);
|
|
248
|
+
return T(t, e, !1), C(), t;
|
|
249
|
+
})()), v = A(() => m() ? i(e.class, h()) : void 0), y = A(() => m() ? a(e.style, h()) : void 0), x = A(() => n(h(), H));
|
|
250
250
|
return k(() => ({
|
|
251
251
|
checked: f(),
|
|
252
252
|
element: r,
|
|
@@ -254,23 +254,23 @@ function U(e) {
|
|
|
254
254
|
}), (e) => {
|
|
255
255
|
if (o = e.checked, e.checked || e.status !== "ending" || !e.element) return;
|
|
256
256
|
let t = new AbortController();
|
|
257
|
-
return
|
|
257
|
+
return u(e.element, () => {
|
|
258
258
|
o || p.setMounted(!1);
|
|
259
259
|
}, t.signal), () => t.abort();
|
|
260
|
-
}),
|
|
260
|
+
}), _(D, {
|
|
261
261
|
get when() {
|
|
262
262
|
return m();
|
|
263
263
|
},
|
|
264
264
|
get children() {
|
|
265
|
-
return g
|
|
265
|
+
return _(g, S({
|
|
266
266
|
ref: [c.ref, ((e) => r = e)],
|
|
267
267
|
get class() {
|
|
268
268
|
return v();
|
|
269
269
|
},
|
|
270
270
|
get style() {
|
|
271
|
-
return
|
|
271
|
+
return y();
|
|
272
272
|
}
|
|
273
|
-
}, x,
|
|
273
|
+
}, x, l));
|
|
274
274
|
}
|
|
275
275
|
});
|
|
276
276
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../radio-group-
|
|
1
|
+
import { t as e } from "../radio-group-NbuJvjQe.js";
|
|
2
2
|
export { e as RadioGroup };
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { t as e } from "./useRender-CxZ8PI-g.js";
|
|
2
|
+
import { getStateAttributesProps as t } from "./internals/getStateAttributesProps.js";
|
|
3
|
+
import { n, t as r } from "./resolveStyle-XcgAuaKR.js";
|
|
4
|
+
import { composeEventHandlers as i, liveEventHandler as a } from "./internals/composeEventHandlers.js";
|
|
5
|
+
import { n as o } from "./DirectionContext-BwMabICS.js";
|
|
6
|
+
import { fieldStateAttributesMapping as s } from "./internals/field-constants.js";
|
|
7
|
+
import { r as ee } from "./FieldRootContext-D3fuVjs3.js";
|
|
8
|
+
import { n as te } from "./FormContext-CwLBtm_d.js";
|
|
9
|
+
import { r as ne } from "./LabelableContext-CmQF-TX2.js";
|
|
10
|
+
import { n as re } from "./FieldsetRootContext-BgThSAcd.js";
|
|
11
|
+
import { t as ie } from "./RadioGroupContext-CZexBsPa.js";
|
|
12
|
+
import { createComponent as c, getNextElement as l, mergeProps as u, runHydrationEvents as d, spread as f, template as p } from "@solidjs/web";
|
|
13
|
+
import { createEffect as m, createMemo as h, createSignal as g, createUniqueId as ae, omit as oe, onCleanup as se, onSettled as ce, untrack as _ } from "solid-js";
|
|
14
|
+
//#region src/radio-group/RadioGroup.tsx
|
|
15
|
+
var le = /* @__PURE__ */ p("<div>");
|
|
16
|
+
function v(p) {
|
|
17
|
+
let v = ee(!0), de = re(!0), S = te(), C = ne(), w = o(), T = p, fe = p, E = Symbol("RadioGroup"), D = `base-ui-${ae()}`, O = _(() => T.value !== void 0), [k, A] = g(() => _(() => T.defaultValue)), [j, M] = g(), [N, P] = g(!1), [F, I] = g(), [L, R] = g(0), z = /* @__PURE__ */ new Map(), B, V = _(() => O ? T.value : k()), H, U, pe = oe(fe, "aria-describedby", "aria-labelledby", "render", "class", "defaultValue", "disabled", "form", "inputRef", "name", "onBlur", "onFocus", "onKeyDown", "onValueChange", "readOnly", "ref", "required", "style", "value"), W = h(() => O ? T.value : k()), G = h(() => v.disabled() || (T.disabled ?? !1)), K = h(() => T.readOnly ?? !1), q = h(() => T.required ?? !1), J = h(() => v.name() ?? T.name), me = h(() => W() ?? null), Y = h(() => ({
|
|
18
|
+
...v.state(),
|
|
19
|
+
disabled: G(),
|
|
20
|
+
readOnly: K(),
|
|
21
|
+
required: q()
|
|
22
|
+
})), he = h(() => n(p.class, Y())), ge = e(p, () => Y(), (e) => (() => {
|
|
23
|
+
var t = l(le);
|
|
24
|
+
return f(t, e, !1), d(), t;
|
|
25
|
+
})()), _e = h(() => r(p.style, Y())), ve = h(() => t(Y(), s)), ye = h(() => T["aria-labelledby"] ?? C.labelId() ?? de?.legendId()), be = h(() => C.getAriaDescribedBy(T["aria-describedby"])), xe = h(() => {
|
|
26
|
+
L();
|
|
27
|
+
let e = Array.from(z.values()), t = e.find((e) => e.checked() && !e.disabled());
|
|
28
|
+
return t ? t.token : e.find((e) => e.token === F() && !e.disabled())?.token ?? e.find((e) => !e.disabled())?.token;
|
|
29
|
+
});
|
|
30
|
+
function Se(e) {
|
|
31
|
+
return z.set(e.token, e), (_(e.checked) || !B && !_(e.disabled)) && (B = e.token, I(e.token)), X(), () => {
|
|
32
|
+
if (z.delete(e.token), B === e.token) {
|
|
33
|
+
let e = Array.from(z.values()).find((e) => _(e.checked) && !_(e.disabled)) ?? Array.from(z.values()).find((e) => !_(e.disabled));
|
|
34
|
+
B = e?.token, I(e?.token);
|
|
35
|
+
}
|
|
36
|
+
X();
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function X() {
|
|
40
|
+
R((e) => e + 1);
|
|
41
|
+
}
|
|
42
|
+
function Z(e) {
|
|
43
|
+
e.disabled() || (B = e.token, I(e.token));
|
|
44
|
+
}
|
|
45
|
+
function Ce(e) {
|
|
46
|
+
return !e.disabled() && xe() === e.token;
|
|
47
|
+
}
|
|
48
|
+
function Q(e, t) {
|
|
49
|
+
return T.onValueChange?.(e, t), !t.isCanceled && (O || A(() => e), !0);
|
|
50
|
+
}
|
|
51
|
+
function we() {
|
|
52
|
+
for (let e of z.values()) {
|
|
53
|
+
let t = _(e.input);
|
|
54
|
+
t && (t.checked = _(e.checked));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function Te() {
|
|
58
|
+
let e = S.formElement();
|
|
59
|
+
if (!e) return W() ?? null;
|
|
60
|
+
L();
|
|
61
|
+
for (let t of z.values()) {
|
|
62
|
+
let n = t.input();
|
|
63
|
+
if (n?.checked && b(n, e)) return W() ?? null;
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
let $ = {
|
|
68
|
+
id: D,
|
|
69
|
+
name: T.name,
|
|
70
|
+
value: me,
|
|
71
|
+
getValue: Te,
|
|
72
|
+
getControl: () => v.validation.getInputControl() ?? j() ?? null
|
|
73
|
+
}, Ee = i(a(() => T.onFocus)), De = i(a(() => T.onBlur)), Oe = i(a(() => T.onKeyDown));
|
|
74
|
+
function ke(e) {
|
|
75
|
+
Ee.call(e.currentTarget, e), !e.baseUIHandlerPrevented && v.setFocused(!0);
|
|
76
|
+
}
|
|
77
|
+
function Ae(e) {
|
|
78
|
+
if (De.call(e.currentTarget, e), e.baseUIHandlerPrevented) return;
|
|
79
|
+
let t = e.relatedTarget;
|
|
80
|
+
t instanceof Element && y(e.currentTarget, t) || (v.setTouched(!0), v.setFocused(!1), v.validationMode() === "onBlur" && v.validation.commit(W()));
|
|
81
|
+
}
|
|
82
|
+
function je(e) {
|
|
83
|
+
if (Oe.call(e.currentTarget, e), e.baseUIHandlerPrevented) return;
|
|
84
|
+
let t = ue(e, w());
|
|
85
|
+
if (t === 0 || e.ctrlKey || e.altKey || e.metaKey) return;
|
|
86
|
+
L();
|
|
87
|
+
let n = Array.from(z.values()).filter((e) => !e.disabled());
|
|
88
|
+
if (n.length < 2) return;
|
|
89
|
+
let r = e.composedPath()[0], i = n.findIndex((e) => r instanceof Node && e.element()?.contains(r));
|
|
90
|
+
if (i === -1) return;
|
|
91
|
+
let a = n[(i + t + n.length) % n.length];
|
|
92
|
+
!a || a === n[i] || (e.preventDefault(), e.stopPropagation(), P(!0), Z(a), queueMicrotask(() => a.element()?.focus()));
|
|
93
|
+
}
|
|
94
|
+
let Me = {
|
|
95
|
+
checkedValue: W,
|
|
96
|
+
disabled: G,
|
|
97
|
+
fieldControlSource: E,
|
|
98
|
+
form: () => T.form,
|
|
99
|
+
name: J,
|
|
100
|
+
readOnly: K,
|
|
101
|
+
required: q,
|
|
102
|
+
state: Y,
|
|
103
|
+
touched: N,
|
|
104
|
+
isTabStop: Ce,
|
|
105
|
+
notifyRadioChange: X,
|
|
106
|
+
registerRadio: Se,
|
|
107
|
+
selectValue: Q,
|
|
108
|
+
setActiveRadio: Z,
|
|
109
|
+
setTouched: P,
|
|
110
|
+
syncInputs: we
|
|
111
|
+
};
|
|
112
|
+
return m(() => ({
|
|
113
|
+
disabled: G(),
|
|
114
|
+
element: j(),
|
|
115
|
+
id: T.id ?? D,
|
|
116
|
+
name: T.name
|
|
117
|
+
}), (e) => {
|
|
118
|
+
$.id = e.id, $.name = e.name, v.registerFieldControl(E, e.disabled || !e.element ? void 0 : $);
|
|
119
|
+
}), m(() => ({
|
|
120
|
+
initialValue: v.validityData().initialValue,
|
|
121
|
+
name: J(),
|
|
122
|
+
value: W()
|
|
123
|
+
}), (e) => {
|
|
124
|
+
e.value !== V && (V = e.value, _(() => {
|
|
125
|
+
S.clearError(e.name), v.setDirty(e.value !== e.initialValue), v.setFilled(e.value != null), v.validation.change(e.value), X();
|
|
126
|
+
}));
|
|
127
|
+
}), m(() => {
|
|
128
|
+
L();
|
|
129
|
+
let e = Array.from(z.values()), t = e.find((e) => e.checked() && !e.disabled() && e.input())?.input();
|
|
130
|
+
return {
|
|
131
|
+
inputRef: T.inputRef,
|
|
132
|
+
representative: t ?? e.find((e) => !e.disabled() && e.input())?.input()
|
|
133
|
+
};
|
|
134
|
+
}, (e) => {
|
|
135
|
+
(e.representative !== H || e.inputRef !== U) && (H = e.representative, U = e.inputRef, e.representative && x(e.inputRef, e.representative));
|
|
136
|
+
}), ce(() => {
|
|
137
|
+
v.setFilled(W() != null);
|
|
138
|
+
}), se(() => v.registerFieldControl(E, void 0)), c(ie, {
|
|
139
|
+
value: Me,
|
|
140
|
+
get children() {
|
|
141
|
+
return c(ge, u({
|
|
142
|
+
ref: [((e) => M(e)), T.ref],
|
|
143
|
+
get class() {
|
|
144
|
+
return he();
|
|
145
|
+
},
|
|
146
|
+
get style() {
|
|
147
|
+
return _e();
|
|
148
|
+
},
|
|
149
|
+
role: "radiogroup",
|
|
150
|
+
get "aria-required"() {
|
|
151
|
+
return q() ? "true" : void 0;
|
|
152
|
+
},
|
|
153
|
+
get "aria-disabled"() {
|
|
154
|
+
return G() ? "true" : void 0;
|
|
155
|
+
},
|
|
156
|
+
get "aria-readonly"() {
|
|
157
|
+
return K() ? "true" : void 0;
|
|
158
|
+
},
|
|
159
|
+
get "aria-labelledby"() {
|
|
160
|
+
return ye();
|
|
161
|
+
},
|
|
162
|
+
get "aria-describedby"() {
|
|
163
|
+
return be();
|
|
164
|
+
},
|
|
165
|
+
get "aria-invalid"() {
|
|
166
|
+
return Y().valid === !1 && !G() ? "true" : void 0;
|
|
167
|
+
},
|
|
168
|
+
onFocus: ke,
|
|
169
|
+
onBlur: Ae,
|
|
170
|
+
onKeyDown: je
|
|
171
|
+
}, ve, pe));
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
function ue(e, t) {
|
|
176
|
+
return e.key === "ArrowDown" ? 1 : e.key === "ArrowUp" ? -1 : e.key === "ArrowRight" ? t === "rtl" ? -1 : 1 : e.key === "ArrowLeft" ? t === "rtl" ? 1 : -1 : 0;
|
|
177
|
+
}
|
|
178
|
+
function y(e, t) {
|
|
179
|
+
if (e.contains(t)) return !0;
|
|
180
|
+
let n = t;
|
|
181
|
+
for (; n;) {
|
|
182
|
+
if (n === e) return !0;
|
|
183
|
+
n = n.parentNode ?? (n instanceof ShadowRoot ? n.host : null);
|
|
184
|
+
}
|
|
185
|
+
return !1;
|
|
186
|
+
}
|
|
187
|
+
function b(e, t) {
|
|
188
|
+
return e.matches(":disabled") ? !1 : e.form === t || e.form === null && !e.hasAttribute("form");
|
|
189
|
+
}
|
|
190
|
+
function x(e, t) {
|
|
191
|
+
if (Array.isArray(e)) for (let n of e) x(n, t);
|
|
192
|
+
else typeof e == "function" && e(t);
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
export { v as t };
|