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
|
@@ -4,32 +4,32 @@ import { getStateAttributesProps as n } from "./internals/getStateAttributesProp
|
|
|
4
4
|
import { F as r, O as i, _ as a, b as o, f as s, g as c, h as l, m as u, o as d, w as f } from "./reasons-Co5CzjKq.js";
|
|
5
5
|
import { n as p, t as m } from "./resolveStyle-XcgAuaKR.js";
|
|
6
6
|
import { createChangeEventDetails as h, createGenericEventDetails as g } from "./internals/createBaseUIEventDetails.js";
|
|
7
|
-
import { composeEventHandlers as _ } from "./internals/composeEventHandlers.js";
|
|
8
|
-
import { fieldValidityMapping as
|
|
9
|
-
import {
|
|
10
|
-
import { n as
|
|
11
|
-
import { r as
|
|
12
|
-
import { mergeStyles as
|
|
13
|
-
import { Portal as
|
|
14
|
-
import { Show as
|
|
7
|
+
import { composeEventHandlers as _, liveEventHandler as v } from "./internals/composeEventHandlers.js";
|
|
8
|
+
import { fieldValidityMapping as y } from "./internals/field-constants.js";
|
|
9
|
+
import { r as b } from "./FieldRootContext-D3fuVjs3.js";
|
|
10
|
+
import { n as x } from "./FormContext-CwLBtm_d.js";
|
|
11
|
+
import { r as S } from "./LabelableContext-CmQF-TX2.js";
|
|
12
|
+
import { mergeStyles as C } from "./internals/mergeStyles.js";
|
|
13
|
+
import { Portal as w, createComponent as T, delegateEvents as E, effect as D, getNextElement as O, memo as ee, mergeProps as te, ref as ne, runHydrationEvents as k, setAttribute as A, setProperty as re, spread as ie, style as j, template as M } from "@solidjs/web";
|
|
14
|
+
import { Show as N, createContext as P, createEffect as F, createMemo as I, createSignal as L, createUniqueId as R, flush as z, omit as ae, onCleanup as B, onSettled as V, untrack as H, useContext as U } from "solid-js";
|
|
15
15
|
//#region src/number-field/utils/parse.ts
|
|
16
|
-
var
|
|
16
|
+
var oe = "零〇一二三四五六七八九", W = /[٠-٩۰-۹0-9]/g, G = /[零〇一二三四五六七八九]/g, se = [
|
|
17
17
|
"%",
|
|
18
18
|
"٪",
|
|
19
19
|
"%",
|
|
20
20
|
"﹪"
|
|
21
|
-
],
|
|
22
|
-
function
|
|
23
|
-
return
|
|
21
|
+
], ce = ["‰", "؉"], K = /[%٪%﹪]/, q = /[‰؉]/, J = /[%٪%﹪]/g, le = /[‰؉]/g, Y = /[٠-٩۰-۹]/, ue = /[零〇一二三四五六七八九]/, de = /[0-9٠-٩۰-۹0-9零〇一二三四五六七八九]/;
|
|
22
|
+
function fe(e) {
|
|
23
|
+
return de.test(e);
|
|
24
24
|
}
|
|
25
|
-
var
|
|
25
|
+
var pe = [
|
|
26
26
|
".",
|
|
27
27
|
",",
|
|
28
28
|
".",
|
|
29
29
|
",",
|
|
30
30
|
"٫",
|
|
31
31
|
"٬"
|
|
32
|
-
],
|
|
32
|
+
], me = /\p{Zs}/u, he = /\p{Cf}/u, X = /\p{Cf}/gu, ge = [
|
|
33
33
|
"+",
|
|
34
34
|
"+",
|
|
35
35
|
"﹢"
|
|
@@ -41,25 +41,25 @@ var fe = [
|
|
|
41
41
|
"–",
|
|
42
42
|
"—",
|
|
43
43
|
"﹣"
|
|
44
|
-
],
|
|
45
|
-
function
|
|
44
|
+
], Z = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
45
|
+
function ve(e, t) {
|
|
46
46
|
return new Intl.NumberFormat(e, t);
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function ye(e, t) {
|
|
49
49
|
let [n, r = "0"] = String(e).split("e");
|
|
50
50
|
return Number(`${n}e${Number(r) + t}`);
|
|
51
51
|
}
|
|
52
|
-
var
|
|
53
|
-
function Ce(e, t) {
|
|
54
|
-
return Z(e, t).formatToParts(Se);
|
|
55
|
-
}
|
|
52
|
+
var Q = /[-−-‒–—﹣]/gu, be = /[++﹢]/gu, xe = /[-−-‒–—﹣]/, Se = /[++﹢]/, Ce = 11111.1;
|
|
56
53
|
function we(e, t) {
|
|
57
|
-
|
|
54
|
+
return ve(e, t).formatToParts(Ce);
|
|
55
|
+
}
|
|
56
|
+
function Te(e, t) {
|
|
57
|
+
let n = we(e, t), r = {};
|
|
58
58
|
n.forEach((e) => {
|
|
59
59
|
r[e.type] = e.value;
|
|
60
60
|
});
|
|
61
61
|
let i = ".";
|
|
62
|
-
return
|
|
62
|
+
return ve(e).formatToParts(.1).forEach((e) => {
|
|
63
63
|
e.type === "decimal" && (i = e.value);
|
|
64
64
|
}), {
|
|
65
65
|
...r,
|
|
@@ -67,80 +67,80 @@ function we(e, t) {
|
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
function $(e, t, n) {
|
|
70
|
-
let r = e.replace(
|
|
71
|
-
r = r.replace(
|
|
70
|
+
let r = e.replace(X, "").trim();
|
|
71
|
+
r = r.replace(Q, "-").replace(be, "+");
|
|
72
72
|
let i = !1, a = (e, t) => (t === "-" && (i = !0), "");
|
|
73
73
|
r = r.replace(/([+-])\s*$/, a).replace(/^\s*([+-])/, a);
|
|
74
74
|
let o = t;
|
|
75
|
-
o === void 0 && (
|
|
76
|
-
let { group: s, decimal: c, currency: l, exponentSeparator: u } =
|
|
77
|
-
s && (p = /\p{Zs}/u.test(s) ? /\p{Zs}/gu : s === "'" || s === "’" ? /['’]/g : new RegExp(
|
|
75
|
+
o === void 0 && (Y.test(r) ? o = "ar" : ue.test(r) && (o = "zh"));
|
|
76
|
+
let { group: s, decimal: c, currency: l, exponentSeparator: u } = Te(o, n), d = ve(o, n).formatToParts(1).filter((e) => e.type === "unit").map((e) => Z(e.value)), f = d.length ? new RegExp(d.join("|"), "g") : null, p = null;
|
|
77
|
+
s && (p = /\p{Zs}/u.test(s) ? /\p{Zs}/gu : s === "'" || s === "’" ? /['’]/g : new RegExp(Z(s), "g"));
|
|
78
78
|
let m = [
|
|
79
79
|
[p, ""],
|
|
80
|
-
[new RegExp(
|
|
80
|
+
[new RegExp(Z(c), "g"), "."],
|
|
81
81
|
[/[.٫]/g, "."],
|
|
82
82
|
[/[,٬]/g, ""],
|
|
83
|
-
[l ? new RegExp(
|
|
83
|
+
[l ? new RegExp(Z(l), "g") : null, ""],
|
|
84
84
|
[f, ""],
|
|
85
|
-
[
|
|
86
|
-
[
|
|
87
|
-
[u ? new RegExp(
|
|
88
|
-
[
|
|
89
|
-
[
|
|
85
|
+
[J, ""],
|
|
86
|
+
[le, ""],
|
|
87
|
+
[u ? new RegExp(Z(u), "g") : null, "e"],
|
|
88
|
+
[W, (e) => String(e.charCodeAt(0) % 16)],
|
|
89
|
+
[G, (e) => String(Math.max(oe.indexOf(e) - 1, 0))]
|
|
90
90
|
].reduce((e, [t, n]) => t ? e.replace(t, n) : e, r), h = m.lastIndexOf(".");
|
|
91
91
|
if (h !== -1 && (m = `${m.slice(0, h).replace(/\./g, "")}.${m.slice(h + 1).replace(/\./g, "")}`), /^[-+]?Infinity$/i.test(r) || r.includes("∞")) return null;
|
|
92
|
-
let g = (i ? "-" : "") + m, _ = parseFloat(g), v = n?.style, y = v === "unit" && n?.unit === "percent", b =
|
|
93
|
-
return
|
|
92
|
+
let g = (i ? "-" : "") + m, _ = parseFloat(g), v = n?.style, y = v === "unit" && n?.unit === "percent", b = K.test(e) || v === "percent";
|
|
93
|
+
return q.test(e) ? _ = ye(_, -3) : !y && b && (_ = ye(_, -2)), Number.isFinite(_) ? _ : null;
|
|
94
94
|
}
|
|
95
95
|
//#endregion
|
|
96
96
|
//#region src/number-field/utils/format.ts
|
|
97
|
-
var
|
|
98
|
-
function
|
|
97
|
+
var Ee = /* @__PURE__ */ new Map();
|
|
98
|
+
function De(e) {
|
|
99
99
|
if (e !== void 0) return Array.isArray(e) ? e.map((e) => e.toString()).join(",") : e.toString();
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function Oe(e, t) {
|
|
102
102
|
let n = JSON.stringify({
|
|
103
|
-
locale:
|
|
103
|
+
locale: De(e),
|
|
104
104
|
options: t
|
|
105
|
-
}), r =
|
|
106
|
-
return r || (r = new Intl.NumberFormat(e, t),
|
|
105
|
+
}), r = Ee.get(n);
|
|
106
|
+
return r || (r = new Intl.NumberFormat(e, t), Ee.set(n, r)), r;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
return e === null ? "" :
|
|
108
|
+
function ke(e, t, n) {
|
|
109
|
+
return e === null ? "" : Oe(t, n).format(e);
|
|
110
110
|
}
|
|
111
111
|
//#endregion
|
|
112
112
|
//#region src/number-field/utils/platform.ts
|
|
113
|
-
function
|
|
113
|
+
function Ae() {
|
|
114
114
|
return typeof navigator > "u" ? "" : navigator.platform.toLowerCase();
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function je() {
|
|
117
117
|
return typeof navigator > "u" ? "" : navigator.userAgent.toLowerCase();
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
let e =
|
|
119
|
+
function Me() {
|
|
120
|
+
let e = Ae(), t = typeof navigator > "u" ? 0 : navigator.maxTouchPoints;
|
|
121
121
|
return /^i(os$|p)/.test(e) || e === "macintel" && t > 1;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function Ne() {
|
|
124
124
|
return typeof CSS < "u" && !!CSS.supports?.("-webkit-backdrop-filter:none");
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
return !
|
|
126
|
+
function Pe() {
|
|
127
|
+
return !Ne() && je().includes("firefox");
|
|
128
128
|
}
|
|
129
129
|
//#endregion
|
|
130
130
|
//#region src/number-field/utils/stateAttributesMapping.ts
|
|
131
|
-
var
|
|
131
|
+
var Fe = {
|
|
132
132
|
inputValue: () => null,
|
|
133
133
|
value: () => null,
|
|
134
|
-
...
|
|
135
|
-
},
|
|
136
|
-
function
|
|
134
|
+
...y
|
|
135
|
+
}, Ie = 1e-10, Le = 1e-10;
|
|
136
|
+
function Re(e) {
|
|
137
137
|
return e?.maximumFractionDigits != null || e?.minimumFractionDigits != null || e?.maximumSignificantDigits != null || e?.minimumSignificantDigits != null || e?.roundingIncrement != null || e?.roundingMode != null || e?.roundingPriority != null;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function ze(e, t) {
|
|
140
140
|
if (!Number.isFinite(e)) return e;
|
|
141
|
-
if (!
|
|
141
|
+
if (!Re(t)) {
|
|
142
142
|
let t = parseFloat(e.toPrecision(15));
|
|
143
|
-
return Math.abs(t - e) <= Math.min(2 ** -52 * Math.max(1, Math.abs(e)),
|
|
143
|
+
return Math.abs(t - e) <= Math.min(2 ** -52 * Math.max(1, Math.abs(e)), Le) ? t : e;
|
|
144
144
|
}
|
|
145
145
|
let n = new Intl.NumberFormat("en-US", {
|
|
146
146
|
...t,
|
|
@@ -151,31 +151,31 @@ function Re(e, t) {
|
|
|
151
151
|
}), r = n.format(e), i = $(r, "en-US", t);
|
|
152
152
|
return i === null ? e : n.format(i) === r ? i : e;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
let i = Math.abs(n), a = Math.sign(n), o = i *
|
|
154
|
+
function Be(e, t, n, r) {
|
|
155
|
+
let i = Math.abs(n), a = Math.sign(n), o = i * Ie * a, s = e - t + o;
|
|
156
156
|
return r ? t + Math.round(s / n) * n : t + (a > 0 ? Math.floor(s / i) : Math.ceil(s / i)) * i;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Ve(e, t, n) {
|
|
159
159
|
return Math.max(t, Math.min(e, n));
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function He(e, t, n, r, i, a, o, s, c) {
|
|
162
162
|
if (e === null) return e;
|
|
163
163
|
let l = e;
|
|
164
|
-
if (t != null && o && t !== 0 && (l =
|
|
165
|
-
let u =
|
|
166
|
-
return c ?
|
|
164
|
+
if (t != null && o && t !== 0 && (l = Be(l, s || n === -(2 ** 53 - 1) ? i : n, t, s)), c && (l = Ve(l, n, r)), t == null && !Re(a)) return l;
|
|
165
|
+
let u = ze(l, a);
|
|
166
|
+
return c ? Ve(u, n, r) : u;
|
|
167
167
|
}
|
|
168
168
|
//#endregion
|
|
169
169
|
//#region src/number-field/root/NumberFieldRootContext.ts
|
|
170
|
-
var
|
|
171
|
-
function
|
|
172
|
-
let e =
|
|
173
|
-
if (e ===
|
|
170
|
+
var Ue = Symbol("NumberFieldRootContext"), We = P(Ue);
|
|
171
|
+
function Ge() {
|
|
172
|
+
let e = U(We);
|
|
173
|
+
if (e === Ue) throw Error("Base UI: NumberFieldRootContext is missing. NumberField parts must be placed within <NumberField.Root>.");
|
|
174
174
|
return e;
|
|
175
175
|
}
|
|
176
176
|
//#endregion
|
|
177
177
|
//#region src/number-field/root/NumberFieldRoot.tsx
|
|
178
|
-
var
|
|
178
|
+
var Ke = /* @__PURE__ */ M("<div>"), qe = /* @__PURE__ */ M("<input type=number aria-hidden=true tabindex=-1>"), Je = {
|
|
179
179
|
"clip-path": "inset(50%)",
|
|
180
180
|
overflow: "hidden",
|
|
181
181
|
"white-space": "nowrap",
|
|
@@ -187,34 +187,34 @@ var Ge = /* @__PURE__ */ N("<div>"), Ke = /* @__PURE__ */ N("<input type=number
|
|
|
187
187
|
position: "fixed",
|
|
188
188
|
top: "0",
|
|
189
189
|
left: "0"
|
|
190
|
-
},
|
|
191
|
-
...
|
|
190
|
+
}, Ye = {
|
|
191
|
+
...Je,
|
|
192
192
|
position: "absolute"
|
|
193
193
|
};
|
|
194
|
-
function
|
|
195
|
-
let i =
|
|
194
|
+
function Xe(e) {
|
|
195
|
+
let i = b(!0), a = x(), o = S(), s = e, c = e, l = Symbol("NumberField"), u = H(o.controlId), d = typeof u == "string" ? u : `base-ui-${R()}`, _ = H(() => s.value !== void 0), [v, y] = L(() => H(() => s.defaultValue ?? null)), [C, w] = L(), [E, ee] = L(), [M, N] = L(!1), [P, z] = L("numeric"), B = !0, V = null, U = !1, oe = ae(c, "allowOutOfRange", "allowWheelScrub", "render", "class", "defaultValue", "disabled", "form", "format", "id", "inputRef", "largeStep", "locale", "max", "min", "name", "onChange", "onValueChange", "onValueCommitted", "readOnly", "ref", "required", "smallStep", "snapOnStep", "step", "style", "value"), W = I(() => _ ? s.value ?? null : v()), G = I(() => s.id ?? d), K = I(() => s.min), q = I(() => s.max), J = I(() => K() ?? -(2 ** 53 - 1)), le = I(() => q() ?? 2 ** 53 - 1), Y = I(() => i.disabled() || (s.disabled ?? !1)), ue = I(() => s.readOnly ?? !1), de = I(() => s.required ?? !1), fe = I(() => s.name), he = I(() => i.name() ?? fe()), X = I(() => s.locale), Z = I(() => s.format), [ve, ye] = L(() => ke(H(W), H(X), H(Z))), Q = I(() => ({
|
|
196
196
|
...i.state(),
|
|
197
|
-
disabled:
|
|
197
|
+
disabled: Y(),
|
|
198
198
|
readOnly: ue(),
|
|
199
199
|
required: de(),
|
|
200
|
-
value:
|
|
200
|
+
value: W(),
|
|
201
201
|
inputValue: ve(),
|
|
202
|
-
scrubbing:
|
|
203
|
-
})), be =
|
|
204
|
-
var t =
|
|
205
|
-
return
|
|
206
|
-
})()), Se =
|
|
207
|
-
function
|
|
202
|
+
scrubbing: M()
|
|
203
|
+
})), be = I(() => p(e.class, Q())), xe = t(e, () => Q(), (e) => (() => {
|
|
204
|
+
var t = O(Ke);
|
|
205
|
+
return ie(t, e, !1), k(), t;
|
|
206
|
+
})()), Se = I(() => m(e.style, Q())), Ce = I(() => n(Q(), Fe));
|
|
207
|
+
function $(e) {
|
|
208
208
|
ye(e);
|
|
209
209
|
}
|
|
210
210
|
function Ee() {
|
|
211
|
-
let e = Z(), t =
|
|
211
|
+
let e = Z(), t = we(X(), e), n = new Set(pe), r = (e) => {
|
|
212
212
|
for (let t of e) n.add(t);
|
|
213
|
-
}, i = t.find((e) => e.type === "decimal")?.value ??
|
|
213
|
+
}, i = t.find((e) => e.type === "decimal")?.value ?? Te(X(), e).decimal;
|
|
214
214
|
n.add(i);
|
|
215
|
-
for (let e of t) e.type !== "integer" && e.type !== "fraction" && e.type !== "exponentInteger" && e.type !== "compact" && (r(Array.from(e.value)),
|
|
215
|
+
for (let e of t) e.type !== "integer" && e.type !== "fraction" && e.type !== "exponentInteger" && e.type !== "compact" && (r(Array.from(e.value)), me.test(e.value) && n.add(" "));
|
|
216
216
|
let a = e?.style;
|
|
217
|
-
return (a === "percent" || a === "unit" && e?.unit === "percent") && r(
|
|
217
|
+
return (a === "percent" || a === "unit" && e?.unit === "percent") && r(se), (a === "percent" || a === "unit" && e?.unit === "permille") && r(ce), r(ge), (J() < 0 || (s.allowOutOfRange ?? !1)) && r(_e), n;
|
|
218
218
|
}
|
|
219
219
|
function De(e) {
|
|
220
220
|
if (e?.altKey) return s.smallStep ?? .1;
|
|
@@ -222,104 +222,104 @@ function Ye(e) {
|
|
|
222
222
|
let t = s.step ?? 1;
|
|
223
223
|
return t === "any" ? 1 : t;
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
let n = t.direction, r = t.event, a = t.reason.startsWith("input-") || t.reason === "none", o =
|
|
225
|
+
function Oe(e, t) {
|
|
226
|
+
let n = t.direction, r = t.event, a = t.reason.startsWith("input-") || t.reason === "none", o = He(e, n ? De(r) * n : void 0, J(), le(), K() ?? 0, Z(), s.snapOnStep ?? !1, r.altKey ?? !1, !(s.allowOutOfRange && a)), c = o !== W() || a && (e !== W() || !B);
|
|
227
227
|
if (c) {
|
|
228
228
|
if (s.onValueChange?.(o, t), t.isCanceled) return !1;
|
|
229
|
-
_ ||
|
|
229
|
+
_ || y(o), i.setDirty(o !== i.validityData().initialValue), U = !0;
|
|
230
230
|
}
|
|
231
|
-
return
|
|
231
|
+
return V = o, B && $(ke(o, X(), Z())), c;
|
|
232
232
|
}
|
|
233
233
|
function Ae(e, { direction: t, currentValue: n, event: r, reason: i }) {
|
|
234
|
-
let a = n ??
|
|
235
|
-
return typeof a == "number" ?
|
|
234
|
+
let a = n ?? W(), o = r;
|
|
235
|
+
return typeof a == "number" ? Oe(a + e * t, h(i, o, void 0, { direction: t })) : Oe(0, h(i, o));
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
|
|
237
|
+
function je(e, t) {
|
|
238
|
+
U = !1, s.onValueCommitted?.(e, t);
|
|
239
239
|
}
|
|
240
240
|
function Ne() {
|
|
241
241
|
let e = C();
|
|
242
242
|
e && (e.setSelectionRange(e.value.length, e.value.length), e.focus());
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Pe(e) {
|
|
245
245
|
let t = C();
|
|
246
246
|
if (e.ctrlKey || !t || t.ownerDocument.activeElement !== t) return;
|
|
247
247
|
let n = Math.abs(e.deltaX) > Math.abs(e.deltaY), i = e.shiftKey && n ? e.deltaX : e.deltaY;
|
|
248
|
-
i === 0 || !e.shiftKey && n || (e.preventDefault(),
|
|
248
|
+
i === 0 || !e.shiftKey && n || (e.preventDefault(), B = !0, Ae(De(e), {
|
|
249
249
|
direction: i > 0 ? -1 : 1,
|
|
250
250
|
event: e,
|
|
251
251
|
reason: "wheel"
|
|
252
|
-
}) &&
|
|
252
|
+
}) && je(V, g(r, e)));
|
|
253
253
|
}
|
|
254
254
|
function Ie(e) {
|
|
255
|
-
if (e.defaultPrevented ||
|
|
255
|
+
if (e.defaultPrevented || Y() || ue()) return;
|
|
256
256
|
let t = e.currentTarget.valueAsNumber, n = Number.isNaN(t) ? null : t;
|
|
257
|
-
|
|
257
|
+
Oe(n, h(f, e)), a.clearError(he()), i.validation.change(V ?? n);
|
|
258
258
|
}
|
|
259
|
-
return
|
|
259
|
+
return F(() => W(), (e) => {
|
|
260
260
|
i.setFilled(e !== null);
|
|
261
|
-
}),
|
|
261
|
+
}), F(() => ({
|
|
262
262
|
currentValue: ve(),
|
|
263
|
-
formattedValue:
|
|
263
|
+
formattedValue: ke(W(), X(), Z())
|
|
264
264
|
}), (e) => {
|
|
265
|
-
|
|
266
|
-
}),
|
|
267
|
-
|
|
268
|
-
}),
|
|
265
|
+
B && e.formattedValue !== e.currentValue && $(e.formattedValue);
|
|
266
|
+
}), F(() => J(), (e) => {
|
|
267
|
+
Me() && z(e >= 0 ? "decimal" : "text");
|
|
268
|
+
}), F(() => ({
|
|
269
269
|
allowWheelScrub: s.allowWheelScrub ?? !1,
|
|
270
|
-
disabled:
|
|
270
|
+
disabled: Y(),
|
|
271
271
|
input: C(),
|
|
272
272
|
readOnly: ue()
|
|
273
273
|
}), (e) => {
|
|
274
274
|
if (!e.allowWheelScrub || e.disabled || e.readOnly || !e.input) return;
|
|
275
275
|
let t = e.input;
|
|
276
|
-
return t.addEventListener("wheel",
|
|
277
|
-
}),
|
|
278
|
-
disabled:
|
|
279
|
-
hidden:
|
|
276
|
+
return t.addEventListener("wheel", Pe, { passive: !1 }), () => t.removeEventListener("wheel", Pe);
|
|
277
|
+
}), F(() => ({
|
|
278
|
+
disabled: Y(),
|
|
279
|
+
hidden: E()
|
|
280
280
|
}), (e) => {
|
|
281
|
-
if (!(!e.hidden || e.disabled)) return i.validation.registerInput(l, e.hidden, () =>
|
|
282
|
-
}),
|
|
281
|
+
if (!(!e.hidden || e.disabled)) return i.validation.registerInput(l, e.hidden, () => H(() => C() ?? null));
|
|
282
|
+
}), T(We, {
|
|
283
283
|
value: {
|
|
284
284
|
controlSource: l,
|
|
285
|
-
minWithDefault:
|
|
286
|
-
maxWithDefault:
|
|
287
|
-
id:
|
|
288
|
-
setValue:
|
|
285
|
+
minWithDefault: J,
|
|
286
|
+
maxWithDefault: le,
|
|
287
|
+
id: G,
|
|
288
|
+
setValue: Oe,
|
|
289
289
|
getStepAmount: De,
|
|
290
290
|
incrementValue: Ae,
|
|
291
291
|
inputElement: C,
|
|
292
292
|
focusInput: Ne,
|
|
293
|
-
setInputElement: (e) =>
|
|
294
|
-
allowInputSync: () =>
|
|
293
|
+
setInputElement: (e) => w(e),
|
|
294
|
+
allowInputSync: () => B,
|
|
295
295
|
setAllowInputSync: (e) => {
|
|
296
|
-
|
|
296
|
+
B = e;
|
|
297
297
|
},
|
|
298
298
|
formatOptions: Z,
|
|
299
|
-
value:
|
|
300
|
-
lastChangedValue: () =>
|
|
299
|
+
value: W,
|
|
300
|
+
lastChangedValue: () => V,
|
|
301
301
|
setLastChangedValue: (e) => {
|
|
302
|
-
|
|
302
|
+
V = e;
|
|
303
303
|
},
|
|
304
|
-
hasPendingCommit: () =>
|
|
304
|
+
hasPendingCommit: () => U,
|
|
305
305
|
setHasPendingCommit: (e) => {
|
|
306
|
-
|
|
306
|
+
U = e;
|
|
307
307
|
},
|
|
308
308
|
name: he,
|
|
309
|
-
nameProp:
|
|
310
|
-
inputMode:
|
|
309
|
+
nameProp: fe,
|
|
310
|
+
inputMode: P,
|
|
311
311
|
getAllowedNonNumericKeys: Ee,
|
|
312
|
-
min:
|
|
313
|
-
max:
|
|
312
|
+
min: K,
|
|
313
|
+
max: q,
|
|
314
314
|
inputValue: ve,
|
|
315
|
-
setInputValue:
|
|
315
|
+
setInputValue: $,
|
|
316
316
|
locale: X,
|
|
317
|
-
setIsScrubbing: (e) =>
|
|
317
|
+
setIsScrubbing: (e) => N(e),
|
|
318
318
|
state: Q,
|
|
319
|
-
onValueCommitted:
|
|
319
|
+
onValueCommitted: je
|
|
320
320
|
},
|
|
321
321
|
get children() {
|
|
322
|
-
return [
|
|
322
|
+
return [T(xe, te({
|
|
323
323
|
ref: [s.ref],
|
|
324
324
|
get class() {
|
|
325
325
|
return be();
|
|
@@ -327,36 +327,36 @@ function Ye(e) {
|
|
|
327
327
|
get style() {
|
|
328
328
|
return Se();
|
|
329
329
|
}
|
|
330
|
-
},
|
|
331
|
-
var e =
|
|
332
|
-
return e.$$input = Ie, e.addEventListener("focus", Ne),
|
|
330
|
+
}, Ce, oe)), (() => {
|
|
331
|
+
var e = O(qe);
|
|
332
|
+
return e.$$input = Ie, e.addEventListener("focus", Ne), ne(() => [((e) => ee(e)), s.inputRef], e), D(() => ({
|
|
333
333
|
e: s.form,
|
|
334
334
|
t: he(),
|
|
335
|
-
a:
|
|
336
|
-
o:
|
|
337
|
-
i:
|
|
335
|
+
a: W() ?? "",
|
|
336
|
+
o: K(),
|
|
337
|
+
i: q(),
|
|
338
338
|
n: s.step ?? 1,
|
|
339
|
-
s:
|
|
339
|
+
s: Y(),
|
|
340
340
|
h: ue(),
|
|
341
341
|
r: de(),
|
|
342
|
-
d: he() ?
|
|
342
|
+
d: he() ? Ye : Je
|
|
343
343
|
}), ({ e: t, t: n, a: r, o: i, i: a, n: o, s, h: c, r: l, d: u }, d) => {
|
|
344
|
-
t !== d?.e && A(e, "form", t), n !== d?.t && A(e, "name", n),
|
|
344
|
+
t !== d?.e && A(e, "form", t), n !== d?.t && A(e, "name", n), re(e, "value", r), i !== d?.o && A(e, "min", i), a !== d?.i && A(e, "max", a), o !== d?.n && A(e, "step", o), s !== d?.s && A(e, "disabled", s), c !== d?.h && A(e, "readonly", c), l !== d?.r && A(e, "required", l), j(e, u, d?.d);
|
|
345
345
|
}), k(), e;
|
|
346
346
|
})()];
|
|
347
347
|
}
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
|
-
|
|
350
|
+
E(["input"]);
|
|
351
351
|
//#endregion
|
|
352
352
|
//#region src/number-field/group/NumberFieldGroup.tsx
|
|
353
|
-
var
|
|
354
|
-
function
|
|
355
|
-
let r =
|
|
356
|
-
var t =
|
|
357
|
-
return
|
|
358
|
-
})()), c =
|
|
359
|
-
return
|
|
353
|
+
var Ze = /* @__PURE__ */ M("<div>");
|
|
354
|
+
function Qe(e) {
|
|
355
|
+
let r = Ge(), i = ae(e, "render", "class", "style"), a = r.state, o = I(() => p(e.class, a())), s = t(e, a, (e) => (() => {
|
|
356
|
+
var t = O(Ze);
|
|
357
|
+
return ie(t, e, !1), k(), t;
|
|
358
|
+
})()), c = I(() => m(e.style, a())), l = I(() => n(a(), Fe));
|
|
359
|
+
return T(s, te({
|
|
360
360
|
get class() {
|
|
361
361
|
return o();
|
|
362
362
|
},
|
|
@@ -368,11 +368,11 @@ function Ze(e) {
|
|
|
368
368
|
}
|
|
369
369
|
//#endregion
|
|
370
370
|
//#region src/number-field/root/createPressAndHold.ts
|
|
371
|
-
var
|
|
372
|
-
function
|
|
371
|
+
var $e = 60, et = 400, tt = 8, nt = 50, rt = 3;
|
|
372
|
+
function it(e) {
|
|
373
373
|
return e === "touch" || e === "pen";
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function at(e) {
|
|
376
376
|
let t = !1, n = 0, r = 0, i = 0, a = !1, o = !1, s = "", c, l, u, d, f, p, m = () => void 0, h = () => void 0;
|
|
377
377
|
function g() {
|
|
378
378
|
f !== void 0 && (p?.clearTimeout(f), f = void 0, p = void 0), c !== void 0 && (l?.clearTimeout(c), c = void 0, l = void 0), u !== void 0 && (d?.clearInterval(u), u = void 0, d = void 0), m(), m = () => void 0, n = 0;
|
|
@@ -400,8 +400,8 @@ function it(e) {
|
|
|
400
400
|
l = i, c = i.setTimeout(() => {
|
|
401
401
|
c = void 0, l = void 0, d = i, u = i.setInterval(() => {
|
|
402
402
|
e.tick()(n) || g();
|
|
403
|
-
},
|
|
404
|
-
},
|
|
403
|
+
}, $e);
|
|
404
|
+
}, et);
|
|
405
405
|
}
|
|
406
406
|
let v = {
|
|
407
407
|
onTouchStart() {
|
|
@@ -412,7 +412,7 @@ function it(e) {
|
|
|
412
412
|
},
|
|
413
413
|
onPointerDown(a) {
|
|
414
414
|
if (a.defaultPrevented || a.button || e.disabled()) return;
|
|
415
|
-
if (s = a.pointerType, o = !1, t = !0, r = a.clientX, i = a.clientY, !
|
|
415
|
+
if (s = a.pointerType, o = !1, t = !0, r = a.clientX, i = a.clientY, !it(a.pointerType)) {
|
|
416
416
|
a.preventDefault(), _(a);
|
|
417
417
|
return;
|
|
418
418
|
}
|
|
@@ -420,20 +420,20 @@ function it(e) {
|
|
|
420
420
|
c && (f !== void 0 && p?.clearTimeout(f), p = c, f = c.setTimeout(() => {
|
|
421
421
|
f = void 0, p = void 0;
|
|
422
422
|
let e = n;
|
|
423
|
-
n = 0, t && e <
|
|
424
|
-
},
|
|
423
|
+
n = 0, t && e < rt ? (_(a), o = !0) : (o = !1, g());
|
|
424
|
+
}, nt));
|
|
425
425
|
},
|
|
426
426
|
onPointerUp(e) {
|
|
427
|
-
|
|
427
|
+
it(e.pointerType) && (t = !1);
|
|
428
428
|
},
|
|
429
429
|
onPointerMove(a) {
|
|
430
|
-
if (e.disabled() || !
|
|
430
|
+
if (e.disabled() || !it(a.pointerType) || !t) return;
|
|
431
431
|
n += 1;
|
|
432
432
|
let o = r - a.clientX, s = i - a.clientY;
|
|
433
|
-
o ** 2 + s ** 2 >
|
|
433
|
+
o ** 2 + s ** 2 > tt ** 2 && g();
|
|
434
434
|
},
|
|
435
435
|
onMouseEnter(n) {
|
|
436
|
-
n.defaultPrevented || e.disabled() || !t || a ||
|
|
436
|
+
n.defaultPrevented || e.disabled() || !t || a || it(s) || _(n);
|
|
437
437
|
},
|
|
438
438
|
onMouseLeave() {
|
|
439
439
|
a || g();
|
|
@@ -443,11 +443,11 @@ function it(e) {
|
|
|
443
443
|
}
|
|
444
444
|
};
|
|
445
445
|
function y(e) {
|
|
446
|
-
return e.defaultPrevented ? !0 :
|
|
446
|
+
return e.defaultPrevented ? !0 : it(s) ? o : e.detail !== 0;
|
|
447
447
|
}
|
|
448
|
-
return
|
|
448
|
+
return F(e.disabled, (e) => {
|
|
449
449
|
e && (t = !1, a = !1, s = "", g());
|
|
450
|
-
}),
|
|
450
|
+
}), B(() => {
|
|
451
451
|
g(), h();
|
|
452
452
|
}), {
|
|
453
453
|
pointerHandlers: v,
|
|
@@ -456,25 +456,25 @@ function it(e) {
|
|
|
456
456
|
}
|
|
457
457
|
//#endregion
|
|
458
458
|
//#region src/number-field/increment/NumberFieldStepperButton.tsx
|
|
459
|
-
var
|
|
459
|
+
var ot = /* @__PURE__ */ M("<button>"), st = {
|
|
460
460
|
"-webkit-user-select": "none",
|
|
461
461
|
"user-select": "none"
|
|
462
462
|
};
|
|
463
|
-
function
|
|
464
|
-
let i =
|
|
463
|
+
function ct(e, r) {
|
|
464
|
+
let i = Ge(), a = e, o = e, c = null, l = !1, u = ae(o, "render", "class", "disabled", "nativeButton", "onClick", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "onPointerDown", "onPointerMove", "onPointerUp", "onTouchEnd", "onTouchStart", "ref", "style"), f = i.state, y = I(() => a.nativeButton ?? !0), b = I(() => {
|
|
465
465
|
let e = f(), t = e.value !== null && (r ? e.value >= i.maxWithDefault() : e.value <= i.minWithDefault());
|
|
466
466
|
return (a.disabled ?? !1) || e.disabled || t;
|
|
467
|
-
}),
|
|
467
|
+
}), x = I(() => b() || f().readOnly), S = I(() => ({
|
|
468
468
|
...f(),
|
|
469
|
-
disabled:
|
|
470
|
-
})),
|
|
471
|
-
var t =
|
|
472
|
-
return
|
|
473
|
-
})()),
|
|
474
|
-
let t = m(e.style,
|
|
475
|
-
return typeof t == "string" ? `-webkit-user-select:none;user-select:none;${t}` :
|
|
476
|
-
}),
|
|
477
|
-
function
|
|
469
|
+
disabled: b()
|
|
470
|
+
})), w = I(() => p(e.class, S())), E = t(e, () => S(), (e) => (() => {
|
|
471
|
+
var t = O(ot);
|
|
472
|
+
return ie(t, e, !1), k(), t;
|
|
473
|
+
})()), D = I(() => {
|
|
474
|
+
let t = m(e.style, S());
|
|
475
|
+
return typeof t == "string" ? `-webkit-user-select:none;user-select:none;${t}` : C(st, t === !1 ? void 0 : t) ?? st;
|
|
476
|
+
}), ne = I(() => n(S(), Fe)), A = r ? s : d;
|
|
477
|
+
function re(e) {
|
|
478
478
|
let t = !i.allowInputSync();
|
|
479
479
|
if (i.setAllowInputSync(!0), !t) {
|
|
480
480
|
let e = i.value();
|
|
@@ -487,7 +487,7 @@ function st(e, r) {
|
|
|
487
487
|
}
|
|
488
488
|
return i.value();
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function j(e) {
|
|
491
491
|
let t = l ? c : void 0;
|
|
492
492
|
return l = !1, i.incrementValue(i.getStepAmount(e), {
|
|
493
493
|
direction: r ? 1 : -1,
|
|
@@ -496,19 +496,19 @@ function st(e, r) {
|
|
|
496
496
|
reason: A
|
|
497
497
|
});
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function M(e) {
|
|
500
500
|
let t = i.lastChangedValue() ?? i.value();
|
|
501
501
|
i.onValueCommitted(t, g(A, e));
|
|
502
502
|
}
|
|
503
|
-
let
|
|
504
|
-
disabled:
|
|
503
|
+
let N = at({
|
|
504
|
+
disabled: x,
|
|
505
505
|
element: i.inputElement,
|
|
506
|
-
tick: () =>
|
|
507
|
-
onStop: () =>
|
|
506
|
+
tick: () => j,
|
|
507
|
+
onStop: () => M
|
|
508
508
|
});
|
|
509
|
-
function
|
|
510
|
-
if (e.defaultPrevented ||
|
|
511
|
-
let t =
|
|
509
|
+
function P(e) {
|
|
510
|
+
if (e.defaultPrevented || x() || N.shouldSkipClick(e)) return;
|
|
511
|
+
let t = re(e);
|
|
512
512
|
i.incrementValue(i.getStepAmount(e), {
|
|
513
513
|
direction: r ? 1 : -1,
|
|
514
514
|
currentValue: t,
|
|
@@ -518,74 +518,74 @@ function st(e, r) {
|
|
|
518
518
|
let n = i.lastChangedValue() ?? i.value();
|
|
519
519
|
n !== t && i.onValueCommitted(n, g(A, e));
|
|
520
520
|
}
|
|
521
|
-
function
|
|
522
|
-
e.defaultPrevented || f().readOnly || e.button ||
|
|
521
|
+
function F(e) {
|
|
522
|
+
e.defaultPrevented || f().readOnly || e.button || b() || (c = re(e), l = !0, i.setLastChangedValue(null), it(e.pointerType) || i.focusInput(), N.pointerHandlers.onPointerDown(e));
|
|
523
523
|
}
|
|
524
|
-
let
|
|
525
|
-
return
|
|
524
|
+
let L = _(v(() => H(x) ? lt : void 0), v(() => a.onClick), P), R = _(v(() => H(x) ? lt : void 0), v(() => a.onPointerDown), F), z = _(v(() => H(x) ? ut : void 0), v(() => a.onMouseDown)), B = _(v(() => H(x) ? dt : void 0), v(() => a.onKeyDown), v(() => H(y) ? void 0 : ft)), U = _(v(() => H(x) ? ut : void 0), v(() => a.onKeyUp), v(() => H(y) ? void 0 : pt)), oe = _(v(() => a.onPointerUp), v(() => N.pointerHandlers.onPointerUp)), W = _(v(() => a.onPointerMove), v(() => N.pointerHandlers.onPointerMove)), G = _(v(() => a.onTouchStart), v(() => N.pointerHandlers.onTouchStart)), se = _(v(() => a.onTouchEnd), v(() => N.pointerHandlers.onTouchEnd)), ce = _(v(() => a.onMouseEnter), v(() => N.pointerHandlers.onMouseEnter)), K = _(v(() => a.onMouseLeave), v(() => N.pointerHandlers.onMouseLeave)), q = _(v(() => a.onMouseUp), v(() => N.pointerHandlers.onMouseUp));
|
|
525
|
+
return V(() => {}), T(E, te({
|
|
526
526
|
ref: [((e) => e), a.ref],
|
|
527
527
|
get class() {
|
|
528
|
-
return
|
|
528
|
+
return w();
|
|
529
529
|
},
|
|
530
530
|
get style() {
|
|
531
|
-
return
|
|
531
|
+
return D();
|
|
532
532
|
},
|
|
533
533
|
get type() {
|
|
534
|
-
return
|
|
534
|
+
return y() ? "button" : void 0;
|
|
535
535
|
},
|
|
536
536
|
get role() {
|
|
537
|
-
return
|
|
537
|
+
return y() ? void 0 : "button";
|
|
538
538
|
},
|
|
539
539
|
tabIndex: -1,
|
|
540
540
|
get disabled() {
|
|
541
|
-
return
|
|
541
|
+
return y() && b() ? !0 : void 0;
|
|
542
542
|
},
|
|
543
543
|
get "aria-disabled"() {
|
|
544
|
-
return
|
|
544
|
+
return ee(() => !!x())() ? "true" : y() ? "false" : void 0;
|
|
545
545
|
},
|
|
546
546
|
"aria-label": r ? "Increase" : "Decrease",
|
|
547
547
|
get "aria-controls"() {
|
|
548
548
|
return i.id();
|
|
549
549
|
},
|
|
550
|
-
onClick:
|
|
551
|
-
onMouseDown:
|
|
552
|
-
onKeyDown:
|
|
553
|
-
onKeyUp:
|
|
554
|
-
onPointerDown:
|
|
555
|
-
onPointerUp:
|
|
556
|
-
onPointerMove:
|
|
557
|
-
onTouchStart:
|
|
558
|
-
onTouchEnd:
|
|
559
|
-
onMouseEnter:
|
|
560
|
-
onMouseLeave:
|
|
561
|
-
onMouseUp:
|
|
562
|
-
},
|
|
550
|
+
onClick: L,
|
|
551
|
+
onMouseDown: z,
|
|
552
|
+
onKeyDown: B,
|
|
553
|
+
onKeyUp: U,
|
|
554
|
+
onPointerDown: R,
|
|
555
|
+
onPointerUp: oe,
|
|
556
|
+
onPointerMove: W,
|
|
557
|
+
onTouchStart: G,
|
|
558
|
+
onTouchEnd: se,
|
|
559
|
+
onMouseEnter: ce,
|
|
560
|
+
onMouseLeave: K,
|
|
561
|
+
onMouseUp: q
|
|
562
|
+
}, ne, u));
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function lt(e) {
|
|
565
565
|
e.preventDefault(), e.preventBaseUIHandler();
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function ut(e) {
|
|
568
568
|
e.preventBaseUIHandler();
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function dt(e) {
|
|
571
571
|
e.key !== "Tab" && e.preventDefault(), e.preventBaseUIHandler();
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function ft(e) {
|
|
574
574
|
if (e.target !== e.currentTarget) return;
|
|
575
|
-
let t =
|
|
575
|
+
let t = mt(e.currentTarget), n = e.key === "Enter", r = e.key === " ";
|
|
576
576
|
if (t || !n && !r) {
|
|
577
577
|
t && r && e.preventDefault();
|
|
578
578
|
return;
|
|
579
579
|
}
|
|
580
|
-
e.defaultPrevented || (e.preventDefault(), n && (e.preventBaseUIHandler(),
|
|
581
|
-
}
|
|
582
|
-
function ft(e) {
|
|
583
|
-
e.target === e.currentTarget && !e.defaultPrevented && e.key === " " && (e.preventBaseUIHandler(), mt(e.currentTarget, e));
|
|
580
|
+
e.defaultPrevented || (e.preventDefault(), n && (e.preventBaseUIHandler(), ht(e.currentTarget, e)));
|
|
584
581
|
}
|
|
585
582
|
function pt(e) {
|
|
583
|
+
e.target === e.currentTarget && !e.defaultPrevented && e.key === " " && (e.preventBaseUIHandler(), ht(e.currentTarget, e));
|
|
584
|
+
}
|
|
585
|
+
function mt(e) {
|
|
586
586
|
return e.tagName === "A" && !!e.href;
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function ht(e, t) {
|
|
589
589
|
let n = e.ownerDocument.defaultView;
|
|
590
590
|
if (!n) return;
|
|
591
591
|
let r = n.PointerEvent ?? n.MouseEvent;
|
|
@@ -602,17 +602,17 @@ function mt(e, t) {
|
|
|
602
602
|
}
|
|
603
603
|
//#endregion
|
|
604
604
|
//#region src/number-field/increment/NumberFieldIncrement.tsx
|
|
605
|
-
function
|
|
606
|
-
return
|
|
605
|
+
function gt(e) {
|
|
606
|
+
return ct(e, !0);
|
|
607
607
|
}
|
|
608
608
|
//#endregion
|
|
609
609
|
//#region src/number-field/decrement/NumberFieldDecrement.tsx
|
|
610
|
-
function
|
|
611
|
-
return
|
|
610
|
+
function _t(e) {
|
|
611
|
+
return ct(e, !1);
|
|
612
612
|
}
|
|
613
613
|
//#endregion
|
|
614
614
|
//#region src/number-field/input/NumberFieldInput.tsx
|
|
615
|
-
var
|
|
615
|
+
var vt = /* @__PURE__ */ M("<input>"), yt = /* @__PURE__ */ new Set([
|
|
616
616
|
"Backspace",
|
|
617
617
|
"Delete",
|
|
618
618
|
"ArrowLeft",
|
|
@@ -621,20 +621,20 @@ var _t = /* @__PURE__ */ N("<input>"), vt = /* @__PURE__ */ new Set([
|
|
|
621
621
|
"Enter",
|
|
622
622
|
"Escape"
|
|
623
623
|
]);
|
|
624
|
-
function
|
|
625
|
-
let r =
|
|
626
|
-
var t =
|
|
627
|
-
return
|
|
628
|
-
})()),
|
|
624
|
+
function bt(e) {
|
|
625
|
+
let r = Ge(), i = b(!0), s = x(), d = S(), f = e, y = e, [C, w] = L(), E = !1, D = null, ee = H(r.value), ne = ae(y, "render", "aria-describedby", "aria-labelledby", "aria-roledescription", "class", "onBlur", "onFocus", "onInput", "onKeyDown", "onPaste", "ref", "style"), A = r.state, re = I(() => p(e.class, A())), j = t(e, A, (e) => (() => {
|
|
626
|
+
var t = O(vt);
|
|
627
|
+
return ie(t, e, !1), k(), t;
|
|
628
|
+
})()), M = I(() => m(e.style, A())), N = I(() => n(A(), Fe)), P = I(() => f["aria-labelledby"] ?? d.labelId()), R = I(() => d.getAriaDescribedBy(f["aria-describedby"])), z = {
|
|
629
629
|
id: void 0,
|
|
630
630
|
name: void 0,
|
|
631
631
|
value: r.value,
|
|
632
|
-
getControl: () =>
|
|
632
|
+
getControl: () => C() ?? null
|
|
633
633
|
};
|
|
634
|
-
function
|
|
634
|
+
function V(e) {
|
|
635
635
|
e.defaultPrevented || A().disabled || i.setFocused(!0);
|
|
636
636
|
}
|
|
637
|
-
function
|
|
637
|
+
function U(e) {
|
|
638
638
|
let t = A();
|
|
639
639
|
if (e.defaultPrevented || t.disabled || (i.setTouched(!0), i.setFocused(!1), t.readOnly)) return;
|
|
640
640
|
let n = !r.allowInputSync(), a = r.hasPendingCommit(), o = r.value(), s = r.inputValue();
|
|
@@ -646,22 +646,22 @@ function yt(e) {
|
|
|
646
646
|
}
|
|
647
647
|
let l = r.formatOptions(), d = $(s, r.locale(), l);
|
|
648
648
|
if (d === null) return;
|
|
649
|
-
let f =
|
|
650
|
-
p = !n && !f ? o : f ?
|
|
649
|
+
let f = Re(l), p;
|
|
650
|
+
p = !n && !f ? o : f ? ze(d, l) : d;
|
|
651
651
|
let m = o !== p, _ = n || m || a, v = p;
|
|
652
652
|
if (m) {
|
|
653
653
|
let t = h(u, e);
|
|
654
|
-
if (
|
|
655
|
-
|
|
654
|
+
if (E = !0, r.setValue(p, t), t.isCanceled) {
|
|
655
|
+
E = !1;
|
|
656
656
|
return;
|
|
657
657
|
}
|
|
658
|
-
v = r.lastChangedValue(), v === o && (
|
|
658
|
+
v = r.lastChangedValue(), v === o && (E = !1);
|
|
659
659
|
}
|
|
660
660
|
i.validationMode() === "onBlur" && i.validation.commit(v), _ && r.onValueCommitted(v, g(u, e));
|
|
661
|
-
let y =
|
|
661
|
+
let y = ke(v, r.locale(), l);
|
|
662
662
|
s !== y && r.setInputValue(y);
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function oe(e) {
|
|
665
665
|
if (e.defaultPrevented) {
|
|
666
666
|
e.currentTarget.value = r.inputValue();
|
|
667
667
|
return;
|
|
@@ -673,20 +673,20 @@ function yt(e) {
|
|
|
673
673
|
return;
|
|
674
674
|
}
|
|
675
675
|
let n = r.getAllowedNonNumericKeys();
|
|
676
|
-
if (!Array.from(t).every((e) =>
|
|
676
|
+
if (!Array.from(t).every((e) => fe(e) || xe.test(e) || n.has(e) || he.test(e))) {
|
|
677
677
|
e.currentTarget.value = r.inputValue();
|
|
678
678
|
return;
|
|
679
679
|
}
|
|
680
680
|
let i = $(t, r.locale(), r.formatOptions());
|
|
681
681
|
r.setInputValue(t), i !== null && r.setValue(i, h(l, e));
|
|
682
682
|
}
|
|
683
|
-
function
|
|
683
|
+
function W(e) {
|
|
684
684
|
let t = A();
|
|
685
685
|
if (e.defaultPrevented || t.readOnly || t.disabled) return;
|
|
686
|
-
let n = r.inputValue(), i = !r.allowInputSync(), a = r.getAllowedNonNumericKeys(), s = a.has(e.key), { decimal: c, currency: l, percentSign: u } =
|
|
686
|
+
let n = r.inputValue(), i = !r.allowInputSync(), a = r.getAllowedNonNumericKeys(), s = a.has(e.key), { decimal: c, currency: l, percentSign: u } = Te(r.locale(), r.formatOptions()), d = e.currentTarget.selectionStart, f = e.currentTarget.selectionEnd, p = d === 0 && f === n.length, m = (e) => d !== null && f !== null && e >= d && e < f, _ = [[xe, Q], [Se, be]];
|
|
687
687
|
for (let [t, r] of _) if (t.test(e.key) && Array.from(a).some((e) => t.test(e))) {
|
|
688
688
|
let e = n.search(r), t = e !== -1 && m(e);
|
|
689
|
-
s = !(
|
|
689
|
+
s = !(xe.test(n) || Se.test(n)) || p || t;
|
|
690
690
|
}
|
|
691
691
|
for (let t of [
|
|
692
692
|
c,
|
|
@@ -697,7 +697,7 @@ function yt(e) {
|
|
|
697
697
|
s = e === -1 || p || m(e);
|
|
698
698
|
}
|
|
699
699
|
let v = e.key === "ArrowUp" || e.key === "ArrowDown";
|
|
700
|
-
if (e.which === 229 || e.altKey && !v || e.ctrlKey || e.metaKey || s ||
|
|
700
|
+
if (e.which === 229 || e.altKey && !v || e.ctrlKey || e.metaKey || s || fe(e.key) || yt.has(e.key)) return;
|
|
701
701
|
let y = null;
|
|
702
702
|
if (e.key === "Home" && r.min() !== void 0 ? y = r.min() ?? null : e.key === "End" && r.max() !== void 0 && (y = r.max() ?? null), e.key.length > 1 && !v && y === null) return;
|
|
703
703
|
let b = i ? $(n, r.locale(), r.formatOptions()) : null;
|
|
@@ -710,7 +710,7 @@ function yt(e) {
|
|
|
710
710
|
reason: o
|
|
711
711
|
})) : y !== null && (x = r.setValue(y, h(o, e))), x && r.onValueCommitted(r.lastChangedValue(), g(o, e));
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function G(e) {
|
|
714
714
|
let t = A();
|
|
715
715
|
if (e.defaultPrevented || t.readOnly || t.disabled) return;
|
|
716
716
|
let n = "";
|
|
@@ -721,49 +721,49 @@ function yt(e) {
|
|
|
721
721
|
}
|
|
722
722
|
e.preventDefault();
|
|
723
723
|
let i = e.currentTarget.selectionStart ?? 0, o = e.currentTarget.selectionEnd ?? i, s = r.inputValue(), c = s.slice(0, i) + n + s.slice(o), l = $(c, r.locale(), r.formatOptions());
|
|
724
|
-
l !== null && (r.setAllowInputSync(!1),
|
|
724
|
+
l !== null && (r.setAllowInputSync(!1), D = i + n.length, r.setValue(l, h(a, e)), r.setInputValue(c));
|
|
725
725
|
}
|
|
726
|
-
let
|
|
727
|
-
return
|
|
728
|
-
element:
|
|
726
|
+
let se = _(v(() => f.onFocus), V), ce = _(v(() => f.onBlur), U), K = _(v(() => f.onInput), oe), q = _(v(() => f.onKeyDown), W), J = _(v(() => f.onPaste), G);
|
|
727
|
+
return F(() => ({
|
|
728
|
+
element: C(),
|
|
729
729
|
inputValue: r.inputValue()
|
|
730
730
|
}), (e) => {
|
|
731
|
-
if (
|
|
732
|
-
let t =
|
|
733
|
-
|
|
734
|
-
}),
|
|
731
|
+
if (D === null) return;
|
|
732
|
+
let t = D;
|
|
733
|
+
D = null, e.element?.setSelectionRange(t, t);
|
|
734
|
+
}), F(() => ({
|
|
735
735
|
disabled: A().disabled,
|
|
736
|
-
element:
|
|
736
|
+
element: C(),
|
|
737
737
|
id: r.id(),
|
|
738
738
|
name: r.nameProp()
|
|
739
739
|
}), (e) => {
|
|
740
|
-
|
|
741
|
-
}),
|
|
740
|
+
z.id = e.id, z.name = e.name, i.registerFieldControl(r.controlSource, e.disabled || !e.element ? void 0 : z), d.registerControlId(r.controlSource, e.element ? e.id : void 0);
|
|
741
|
+
}), F(() => ({
|
|
742
742
|
name: r.name(),
|
|
743
743
|
shouldValidateOnChange: i.shouldValidateOnChange(),
|
|
744
744
|
value: r.value()
|
|
745
745
|
}), (e) => {
|
|
746
|
-
if (e.value !==
|
|
747
|
-
if (
|
|
748
|
-
|
|
746
|
+
if (e.value !== ee) {
|
|
747
|
+
if (ee = e.value, s.clearError(e.name), E && !e.shouldValidateOnChange) {
|
|
748
|
+
E = !1;
|
|
749
749
|
return;
|
|
750
750
|
}
|
|
751
|
-
|
|
751
|
+
H(() => i.validation.change(e.value));
|
|
752
752
|
}
|
|
753
|
-
}),
|
|
753
|
+
}), B(() => {
|
|
754
754
|
r.setInputElement(void 0), i.registerFieldControl(r.controlSource, void 0), d.registerControlId(r.controlSource, void 0);
|
|
755
|
-
}),
|
|
755
|
+
}), T(j, te({
|
|
756
756
|
ref: [((e) => {
|
|
757
|
-
|
|
757
|
+
w(e), r.setInputElement(e);
|
|
758
758
|
}), f.ref],
|
|
759
759
|
get id() {
|
|
760
760
|
return r.id();
|
|
761
761
|
},
|
|
762
762
|
get class() {
|
|
763
|
-
return
|
|
763
|
+
return re();
|
|
764
764
|
},
|
|
765
765
|
get style() {
|
|
766
|
-
return
|
|
766
|
+
return M();
|
|
767
767
|
},
|
|
768
768
|
get required() {
|
|
769
769
|
return A().required;
|
|
@@ -791,21 +791,21 @@ function yt(e) {
|
|
|
791
791
|
return !A().disabled && A().valid === !1 ? "true" : void 0;
|
|
792
792
|
},
|
|
793
793
|
get "aria-labelledby"() {
|
|
794
|
-
return
|
|
794
|
+
return P();
|
|
795
795
|
},
|
|
796
796
|
get "aria-describedby"() {
|
|
797
|
-
return
|
|
797
|
+
return R();
|
|
798
798
|
},
|
|
799
|
-
onFocus:
|
|
800
|
-
onBlur: (e) =>
|
|
801
|
-
onInput:
|
|
802
|
-
onKeyDown:
|
|
803
|
-
onPaste:
|
|
804
|
-
},
|
|
799
|
+
onFocus: se,
|
|
800
|
+
onBlur: (e) => H(() => ce.call(e.currentTarget, e)),
|
|
801
|
+
onInput: K,
|
|
802
|
+
onKeyDown: q,
|
|
803
|
+
onPaste: J
|
|
804
|
+
}, N, ne));
|
|
805
805
|
}
|
|
806
806
|
//#endregion
|
|
807
807
|
//#region src/number-field/utils/getViewportRect.ts
|
|
808
|
-
function
|
|
808
|
+
function xt(e, t) {
|
|
809
809
|
let n = t.ownerDocument.defaultView ?? window;
|
|
810
810
|
if (e != null) {
|
|
811
811
|
let n = t.getBoundingClientRect();
|
|
@@ -831,90 +831,90 @@ function bt(e, t) {
|
|
|
831
831
|
}
|
|
832
832
|
//#endregion
|
|
833
833
|
//#region src/number-field/scrub-area/NumberFieldScrubAreaContext.ts
|
|
834
|
-
var
|
|
835
|
-
function
|
|
836
|
-
let e =
|
|
837
|
-
if (e ===
|
|
834
|
+
var St = Symbol("NumberFieldScrubAreaContext"), Ct = P(St);
|
|
835
|
+
function wt() {
|
|
836
|
+
let e = U(Ct);
|
|
837
|
+
if (e === St) throw Error("Base UI: NumberFieldScrubAreaContext is missing. NumberFieldScrubArea parts must be placed within <NumberField.ScrubArea>.");
|
|
838
838
|
return e;
|
|
839
839
|
}
|
|
840
840
|
//#endregion
|
|
841
841
|
//#region src/number-field/scrub-area/NumberFieldScrubArea.tsx
|
|
842
|
-
var
|
|
842
|
+
var Tt = /* @__PURE__ */ M("<span>"), Et = {
|
|
843
843
|
"touch-action": "none",
|
|
844
844
|
"-webkit-user-select": "none",
|
|
845
845
|
"user-select": "none"
|
|
846
846
|
};
|
|
847
|
-
function
|
|
848
|
-
let r =
|
|
849
|
-
var t =
|
|
850
|
-
return
|
|
851
|
-
})()), A =
|
|
852
|
-
let t = m(e.style,
|
|
853
|
-
return typeof t == "string" ? `touch-action:none;-webkit-user-select:none;user-select:none;${t}` :
|
|
854
|
-
}),
|
|
847
|
+
function Dt(e) {
|
|
848
|
+
let r = Ge(), a = e, o = e, [s, c] = L(), [l, u] = L(), [d, f] = L(!1), [h, y] = L(!1), [b, x] = L(!1), S = I(() => r.state().disabled), w = I(() => r.state().readOnly), E = r.state, D = ae(o, "render", "class", "direction", "onPointerDown", "pixelSensitivity", "ref", "style", "teleportDistance"), ee = I(() => p(e.class, E())), ne = t(e, E, (e) => (() => {
|
|
849
|
+
var t = O(Tt);
|
|
850
|
+
return ie(t, e, !1), k(), t;
|
|
851
|
+
})()), A = I(() => {
|
|
852
|
+
let t = m(e.style, E());
|
|
853
|
+
return typeof t == "string" ? `touch-action:none;-webkit-user-select:none;user-select:none;${t}` : C(Et, t === !1 ? void 0 : t);
|
|
854
|
+
}), re = I(() => n(E(), Fe)), j = {
|
|
855
855
|
x: 0,
|
|
856
856
|
y: 0
|
|
857
|
-
},
|
|
858
|
-
function
|
|
859
|
-
|
|
857
|
+
}, M = !1, N = !1, P = null, R, V;
|
|
858
|
+
function H() {
|
|
859
|
+
R !== void 0 && (V?.clearTimeout(R), R = void 0, V = void 0);
|
|
860
860
|
}
|
|
861
|
-
function
|
|
861
|
+
function U(e, t, n) {
|
|
862
862
|
let r = e.ownerDocument.defaultView?.visualViewport?.scale ?? 1;
|
|
863
863
|
e.style.transform = `translate3d(${t}px,${n}px,0) scale(${1 / r})`;
|
|
864
864
|
}
|
|
865
|
-
function
|
|
865
|
+
function oe(e) {
|
|
866
866
|
let t = l(), n = s();
|
|
867
867
|
if (!t || !n) return;
|
|
868
|
-
let r =
|
|
869
|
-
|
|
868
|
+
let r = xt(a.teleportDistance, n), i = (e, t, n, r) => e + t < n ? r - t : e + t > r ? n - t : e;
|
|
869
|
+
j.x = i(Math.round(j.x + e.movementX), t.offsetWidth / 2, r.left, r.right), j.y = i(Math.round(j.y + e.movementY), t.offsetHeight / 2, r.top, r.bottom), U(t, j.x, j.y);
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function W(e, t) {
|
|
872
872
|
let n = () => {
|
|
873
|
-
|
|
873
|
+
x(e), r.setIsScrubbing(e);
|
|
874
874
|
};
|
|
875
875
|
if (!e) {
|
|
876
876
|
n();
|
|
877
877
|
return;
|
|
878
878
|
}
|
|
879
|
-
|
|
879
|
+
z(n);
|
|
880
880
|
let i = l();
|
|
881
|
-
i && (
|
|
881
|
+
i && (j.x = t.clientX - i.offsetWidth / 2, j.y = t.clientY - i.offsetHeight / 2, U(i, j.x, j.y));
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function G(e, t) {
|
|
884
884
|
try {
|
|
885
885
|
s()?.ownerDocument.exitPointerLock();
|
|
886
886
|
} catch {} finally {
|
|
887
|
-
if (
|
|
887
|
+
if (M = !1, W(!1, e), r.onValueCommitted(r.lastChangedValue() ?? r.value(), g(i, e)), !N && P != null) {
|
|
888
888
|
let e = t.ownerDocument.defaultView;
|
|
889
|
-
e &&
|
|
889
|
+
e && P.dispatchEvent(new e.MouseEvent("click", {
|
|
890
890
|
bubbles: !0,
|
|
891
891
|
cancelable: !0
|
|
892
892
|
}));
|
|
893
893
|
}
|
|
894
|
-
|
|
894
|
+
N = !1, P = null;
|
|
895
895
|
}
|
|
896
896
|
}
|
|
897
|
-
|
|
897
|
+
F(() => ({
|
|
898
898
|
direction: a.direction ?? "horizontal",
|
|
899
|
-
disabled:
|
|
899
|
+
disabled: S(),
|
|
900
900
|
input: r.inputElement(),
|
|
901
901
|
pixelSensitivity: a.pixelSensitivity ?? 2,
|
|
902
|
-
readOnly:
|
|
903
|
-
scrubbing:
|
|
902
|
+
readOnly: w(),
|
|
903
|
+
scrubbing: b()
|
|
904
904
|
}), (e) => {
|
|
905
905
|
if (!e.input || e.disabled || e.readOnly || !e.scrubbing) return;
|
|
906
906
|
let t = e.input, n = t.ownerDocument.defaultView;
|
|
907
907
|
if (!n) return;
|
|
908
908
|
let a = n, o = 0;
|
|
909
909
|
function s(e) {
|
|
910
|
-
|
|
910
|
+
M && (Pe() ? (H(), V = a, R = a.setTimeout(G, 20, e, t)) : G(e, t));
|
|
911
911
|
}
|
|
912
912
|
function c(t) {
|
|
913
|
-
if (!
|
|
914
|
-
t.preventDefault(),
|
|
913
|
+
if (!M) return;
|
|
914
|
+
t.preventDefault(), oe(t);
|
|
915
915
|
let { movementX: n, movementY: a } = t;
|
|
916
916
|
if (o += e.direction === "vertical" ? a : n, Math.abs(o) >= e.pixelSensitivity) {
|
|
917
|
-
o = 0,
|
|
917
|
+
o = 0, N = !0;
|
|
918
918
|
let s = (e.direction === "vertical" ? -a : n) * r.getStepAmount(t);
|
|
919
919
|
s !== 0 && (r.setAllowInputSync(!0), r.incrementValue(Math.abs(s), {
|
|
920
920
|
direction: s >= 0 ? 1 : -1,
|
|
@@ -924,12 +924,12 @@ function Et(e) {
|
|
|
924
924
|
}
|
|
925
925
|
}
|
|
926
926
|
return a.addEventListener("pointerup", s, !0), a.addEventListener("pointermove", c, !0), () => {
|
|
927
|
-
|
|
927
|
+
R !== void 0 && (V?.clearTimeout(R), R = void 0, V = void 0), a.removeEventListener("pointerup", s, !0), a.removeEventListener("pointermove", c, !0);
|
|
928
928
|
};
|
|
929
|
-
}),
|
|
930
|
-
disabled:
|
|
929
|
+
}), F(() => ({
|
|
930
|
+
disabled: S(),
|
|
931
931
|
element: s(),
|
|
932
|
-
readOnly:
|
|
932
|
+
readOnly: w()
|
|
933
933
|
}), (e) => {
|
|
934
934
|
if (!e.element || e.disabled || e.readOnly) return;
|
|
935
935
|
let t = (e) => {
|
|
@@ -937,31 +937,31 @@ function Et(e) {
|
|
|
937
937
|
};
|
|
938
938
|
return e.element.addEventListener("touchstart", t), () => e.element?.removeEventListener("touchstart", t);
|
|
939
939
|
});
|
|
940
|
-
async function
|
|
941
|
-
if (e.defaultPrevented ||
|
|
940
|
+
async function se(e) {
|
|
941
|
+
if (e.defaultPrevented || w() || e.button !== 0 || S()) return;
|
|
942
942
|
let t = e.pointerType === "touch";
|
|
943
|
-
if (f(t), e.pointerType === "mouse" && (e.preventDefault(), r.focusInput()),
|
|
943
|
+
if (f(t), e.pointerType === "mouse" && (e.preventDefault(), r.focusInput()), M = !0, N = !1, P = Ot(e), W(!0, e), !t && !Ne()) {
|
|
944
944
|
let t = s() ?? e.currentTarget;
|
|
945
945
|
try {
|
|
946
|
-
await t.ownerDocument.body.requestPointerLock(),
|
|
946
|
+
await t.ownerDocument.body.requestPointerLock(), y(!1);
|
|
947
947
|
} catch {
|
|
948
|
-
|
|
948
|
+
y(!0);
|
|
949
949
|
} finally {
|
|
950
|
-
|
|
950
|
+
M && W(!0, e);
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
|
-
let
|
|
955
|
-
return
|
|
956
|
-
if (
|
|
957
|
-
|
|
954
|
+
let ce = _(v(() => a.onPointerDown), se);
|
|
955
|
+
return B(() => {
|
|
956
|
+
if (H(), u(void 0), M) {
|
|
957
|
+
M = !1, r.setIsScrubbing(!1);
|
|
958
958
|
try {
|
|
959
959
|
s()?.ownerDocument.exitPointerLock();
|
|
960
960
|
} catch {}
|
|
961
961
|
}
|
|
962
|
-
}),
|
|
962
|
+
}), T(Ct, {
|
|
963
963
|
value: {
|
|
964
|
-
isScrubbing:
|
|
964
|
+
isScrubbing: b,
|
|
965
965
|
isTouchInput: d,
|
|
966
966
|
isPointerLockDenied: h,
|
|
967
967
|
scrubAreaElement: s,
|
|
@@ -969,52 +969,52 @@ function Et(e) {
|
|
|
969
969
|
setScrubAreaCursorElement: u
|
|
970
970
|
},
|
|
971
971
|
get children() {
|
|
972
|
-
return
|
|
972
|
+
return T(ne, te({
|
|
973
973
|
ref: [((e) => c(e)), a.ref],
|
|
974
974
|
role: "presentation",
|
|
975
975
|
get class() {
|
|
976
|
-
return
|
|
976
|
+
return ee();
|
|
977
977
|
},
|
|
978
978
|
get style() {
|
|
979
979
|
return A();
|
|
980
980
|
},
|
|
981
|
-
onPointerDown:
|
|
982
|
-
},
|
|
981
|
+
onPointerDown: ce
|
|
982
|
+
}, re, D));
|
|
983
983
|
}
|
|
984
984
|
});
|
|
985
985
|
}
|
|
986
|
-
function
|
|
986
|
+
function Ot(e) {
|
|
987
987
|
return e.composedPath?.()[0] ?? e.target;
|
|
988
988
|
}
|
|
989
989
|
//#endregion
|
|
990
990
|
//#region src/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.tsx
|
|
991
|
-
var
|
|
991
|
+
var kt = /* @__PURE__ */ M("<span>"), At = {
|
|
992
992
|
position: "fixed",
|
|
993
993
|
top: "0",
|
|
994
994
|
left: "0",
|
|
995
995
|
"pointer-events": "none"
|
|
996
996
|
};
|
|
997
|
-
function
|
|
998
|
-
let r =
|
|
999
|
-
var t =
|
|
1000
|
-
return
|
|
1001
|
-
})()), f =
|
|
997
|
+
function jt(e) {
|
|
998
|
+
let r = Ge(), i = wt(), a = e, o = ae(e, "render", "class", "ref", "style"), s = r.state, c = I(() => i.isScrubbing() && !Ne() && !i.isTouchInput() && !i.isPointerLockDenied()), l = () => i.scrubAreaElement()?.ownerDocument.body, u = I(() => p(e.class, s())), d = t(e, s, (e) => (() => {
|
|
999
|
+
var t = O(kt);
|
|
1000
|
+
return ie(t, e, !1), k(), t;
|
|
1001
|
+
})()), f = I(() => {
|
|
1002
1002
|
let t = m(e.style, s());
|
|
1003
|
-
return typeof t == "string" ? `position:fixed;top:0;left:0;pointer-events:none;${t}` :
|
|
1004
|
-
}), h =
|
|
1005
|
-
return
|
|
1003
|
+
return typeof t == "string" ? `position:fixed;top:0;left:0;pointer-events:none;${t}` : C(At, t === !1 ? void 0 : t);
|
|
1004
|
+
}), h = I(() => n(s(), Fe));
|
|
1005
|
+
return F(c, (e) => {
|
|
1006
1006
|
e || i.setScrubAreaCursorElement(void 0);
|
|
1007
|
-
}),
|
|
1007
|
+
}), B(() => {
|
|
1008
1008
|
i.setScrubAreaCursorElement(void 0);
|
|
1009
|
-
}),
|
|
1009
|
+
}), T(N, {
|
|
1010
1010
|
get when() {
|
|
1011
|
-
return
|
|
1011
|
+
return ee(() => !!c())() ? l() : void 0;
|
|
1012
1012
|
},
|
|
1013
1013
|
keyed: !0,
|
|
1014
|
-
children: (e) => w
|
|
1014
|
+
children: (e) => T(w, {
|
|
1015
1015
|
mount: e,
|
|
1016
1016
|
get children() {
|
|
1017
|
-
return
|
|
1017
|
+
return T(d, te({
|
|
1018
1018
|
ref: [((e) => i.setScrubAreaCursorElement(e)), a.ref],
|
|
1019
1019
|
role: "presentation",
|
|
1020
1020
|
get class() {
|
|
@@ -1030,14 +1030,14 @@ function At(e) {
|
|
|
1030
1030
|
}
|
|
1031
1031
|
//#endregion
|
|
1032
1032
|
//#region src/number-field/index.parts.ts
|
|
1033
|
-
var
|
|
1034
|
-
Decrement: () =>
|
|
1035
|
-
Group: () =>
|
|
1036
|
-
Increment: () =>
|
|
1037
|
-
Input: () =>
|
|
1038
|
-
Root: () =>
|
|
1039
|
-
ScrubArea: () =>
|
|
1040
|
-
ScrubAreaCursor: () =>
|
|
1033
|
+
var Mt = /* @__PURE__ */ e({
|
|
1034
|
+
Decrement: () => _t,
|
|
1035
|
+
Group: () => Qe,
|
|
1036
|
+
Increment: () => gt,
|
|
1037
|
+
Input: () => bt,
|
|
1038
|
+
Root: () => Xe,
|
|
1039
|
+
ScrubArea: () => Dt,
|
|
1040
|
+
ScrubAreaCursor: () => jt
|
|
1041
1041
|
});
|
|
1042
1042
|
//#endregion
|
|
1043
|
-
export {
|
|
1043
|
+
export { Mt as t };
|