solid-baseui 0.1.0-alpha.0 → 0.1.0-alpha.1
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 +30 -0
- package/README.md +95 -8
- package/dist/lib/client/DialogHandle-BGyIbcvg.js +521 -0
- package/dist/lib/client/DialogPopup-Df7MC358.js +138 -0
- package/dist/lib/client/FieldControl-C0PATyKV.js +142 -0
- package/dist/lib/client/{FocusManager-grSdNHqW.js → FocusManager-NP1uPXTi.js} +5 -5
- package/dist/lib/client/{FormContext-BB05lWOI.js → FormContext-CwLBtm_d.js} +1 -0
- package/dist/lib/client/{LabelableContext-DKsB0fIx.js → LabelableContext-CmQF-TX2.js} +3 -6
- package/dist/lib/client/MenuSubmenuTrigger-yfncqM-D.js +1584 -0
- package/dist/lib/client/{PopupHandle-CcJG4NMy.js → PopupHandle-CQI6Om1Z.js} +1 -1
- package/dist/lib/client/{PopupStore-DjB-wO88.js → PopupStore-Du0O57fL.js} +118 -98
- package/dist/lib/client/{PopupViewport-DgrIqQea.js → PopupViewport-IS4XU03s.js} +2 -2
- package/dist/lib/client/Separator-D5oJzlA3.js +27 -0
- package/dist/lib/client/TriggerFocusGuards-Cs8LVBj5.js +51 -0
- package/dist/lib/client/accordion/index.js +1 -1
- package/dist/lib/client/accordion-BFeZFpJZ.js +381 -0
- package/dist/lib/client/alert-dialog/index.js +1 -1
- package/dist/lib/client/{alert-dialog-BH_3ndio.js → alert-dialog-BxGUF8_Q.js} +2 -2
- package/dist/lib/client/autocomplete/index.js +1 -1
- package/dist/lib/client/{autocomplete-Cob_FZEP.js → autocomplete-C9QA98XD.js} +30 -25
- package/dist/lib/client/avatar/index.js +1 -1
- package/dist/lib/client/avatar-BQoEzzav.js +191 -0
- package/dist/lib/client/button/index.js +1 -1
- package/dist/lib/client/button-akYS6FyY.js +88 -0
- package/dist/lib/client/checkbox/index.js +1 -1
- package/dist/lib/client/checkbox-DOXtzBhA.js +425 -0
- package/dist/lib/client/checkbox-group/index.js +1 -1
- package/dist/lib/client/checkbox-group-CwMDoSTK.js +135 -0
- package/dist/lib/client/collapsible/index.js +1 -1
- package/dist/lib/client/collapsible-t8YReaIp.js +230 -0
- package/dist/lib/client/combobox/index.js +2 -2
- package/dist/lib/client/combobox-6DhOdzit.js +399 -0
- package/dist/lib/client/{constants-BYjBUIIi.js → constants-cOVxAoxB.js} +5 -1
- package/dist/lib/client/context-menu/index.js +1 -1
- package/dist/lib/client/context-menu-CplDpqmi.js +220 -0
- package/dist/lib/client/{createAnchorPositioning-DcxDXUgB.js → createAnchorPositioning-D96gu-Dz.js} +148 -145
- package/dist/lib/client/{createCollapsiblePanel-DeDu0O2t.js → createCollapsiblePanel-BQ8r4RTi.js} +1 -1
- package/dist/lib/client/createFocusInteraction--s9_qBf3.js +60 -0
- package/dist/lib/client/createLabelableId-DxJRwMUJ.js +14 -0
- package/dist/lib/client/{createPopupAutoResize-CGNiLhGq.js → createPopupAutoResize-Dn-stj-8.js} +1 -1
- package/dist/lib/client/{createTransitionStatus-B1L-whed.js → createTransitionStatus-BL_cPSEA.js} +12 -12
- package/dist/lib/client/dialog/index.js +1 -1
- package/dist/lib/client/{dialog-DkaQwIgP.js → dialog-B9tR9X48.js} +2 -2
- package/dist/lib/client/drawer/index.js +1 -1
- package/dist/lib/client/drawer-dyr3_sKQ.js +1539 -0
- package/dist/lib/client/field/index.js +1 -1
- package/dist/lib/client/field-CjUAjp1m.js +483 -0
- package/dist/lib/client/fieldset/index.js +1 -1
- package/dist/lib/client/fieldset-Byqk3noT.js +70 -0
- package/dist/lib/client/form/index.js +1 -1
- package/dist/lib/client/form-6Ne_bWQX.js +109 -0
- package/dist/lib/client/index.js +44 -42
- package/dist/lib/client/input/index.js +1 -1
- package/dist/lib/client/{input-gb0ejxkm.js → input-_QHvSSqM.js} +1 -1
- package/dist/lib/client/internals/form-context/index.js +1 -1
- package/dist/lib/client/internals/labelable-provider/index.js +1 -1
- package/dist/lib/client/menu/index.js +1 -1
- package/dist/lib/client/menu-DLqUBmMK.js +334 -0
- package/dist/lib/client/menubar/index.js +1 -1
- package/dist/lib/client/menubar-DhPRUQZ6.js +163 -0
- package/dist/lib/client/{mergeStyleValue-C4ITiiIV.js → mergeStyleValue-DhTA9Nwe.js} +7 -3
- package/dist/lib/client/meter/index.js +1 -1
- package/dist/lib/client/meter-BvWdppcx.js +178 -0
- package/dist/lib/client/navigation-menu/index.js +1 -1
- package/dist/lib/client/navigation-menu-mVHV41Ky.js +1070 -0
- package/dist/lib/client/number-field/index.js +1 -1
- package/dist/lib/client/number-field-DusLw_0X.js +1043 -0
- package/dist/lib/client/otp-field/index.js +1 -1
- package/dist/lib/client/otp-field-D-B9tZzF.js +584 -0
- package/dist/lib/client/popover/index.js +1 -1
- package/dist/lib/client/popover-Cv7xn0nW.js +938 -0
- package/dist/lib/client/popupStateMapping-C6jQ_LKo.js +371 -0
- package/dist/lib/client/preview-card/index.js +1 -1
- package/dist/lib/client/preview-card-FTN_aafM.js +632 -0
- package/dist/lib/client/progress/index.js +1 -1
- package/dist/lib/client/progress-AVKxvgpc.js +195 -0
- package/dist/lib/client/radio/index.js +1 -1
- package/dist/lib/client/radio-DA_oZhQT.js +284 -0
- package/dist/lib/client/radio-group/index.js +1 -1
- package/dist/lib/client/radio-group-CWtQxWDl.js +195 -0
- package/dist/lib/client/runOnceAnimationsFinish-CFADb4CN.js +49 -0
- package/dist/lib/client/{safePolygon--bbKn0c8.js → safePolygon-DJG0VIVo.js} +4 -0
- package/dist/lib/client/scroll-area/index.js +1 -1
- package/dist/lib/client/scroll-area-NCr49LkD.js +717 -0
- package/dist/lib/client/select/index.js +1 -1
- package/dist/lib/client/select-DSPJt7Rk.js +1933 -0
- package/dist/lib/client/separator/index.js +1 -1
- package/dist/lib/client/slider/index.js +1 -1
- package/dist/lib/client/slider-CWq9hxFf.js +927 -0
- package/dist/lib/client/switch/index.js +1 -1
- package/dist/lib/client/switch-CPl7QHKI.js +306 -0
- package/dist/lib/client/tabs/index.js +1 -1
- package/dist/lib/client/tabs-Bn4rZDyZ.js +692 -0
- package/dist/lib/client/toast/index.js +1 -1
- package/dist/lib/client/toast-7LdqZWOs.js +1118 -0
- package/dist/lib/client/toggle/index.js +1 -1
- package/dist/lib/client/toggle-CsC37e3e.js +142 -0
- package/dist/lib/client/toggle-group/index.js +1 -1
- package/dist/lib/client/toggle-group-DSWb9HxN.js +134 -0
- package/dist/lib/client/toolbar/index.js +1 -1
- package/dist/lib/client/toolbar-DcCi3HNp.js +504 -0
- package/dist/lib/client/tooltip/index.js +1 -1
- package/dist/lib/client/tooltip-D-PkGco9.js +849 -0
- package/dist/lib/client/use-render/index.js +2 -0
- package/dist/lib/client/useFilteredItems-B7z2CGMV.js +2270 -0
- package/dist/lib/client/useRender-CxZ8PI-g.js +12 -0
- package/dist/lib/server/{DialogHandle-ATZlm9RC.js → DialogHandle-nJSSy_jM.js} +24 -33
- package/dist/lib/server/{DialogPopup-BebI-w5P.js → DialogPopup-Da1aIxVA.js} +10 -13
- package/dist/lib/server/{FieldControl-Y_kI7ARp.js → FieldControl-BDeNR3ug.js} +56 -20
- package/dist/lib/server/{FocusManager-BrbZVWME.js → FocusManager-1LfoCsya.js} +1 -3
- package/dist/lib/server/{FormContext-pvESt85v.js → FormContext-CYwo_ZnB.js} +1 -0
- package/dist/lib/server/{LabelableContext-DZP3rgAY.js → LabelableContext-BTeF0IWb.js} +4 -6
- package/dist/lib/server/{MenuSubmenuTrigger-DA4gsv6z.js → MenuSubmenuTrigger-rR8ZN7YR.js} +133 -166
- package/dist/lib/server/{PopupHandle-DthPgNjy.js → PopupHandle-Ct6wywmP.js} +1 -1
- package/dist/lib/server/{PopupStore-DEs3FAEe.js → PopupStore-kHjFPiQ5.js} +38 -14
- package/dist/lib/server/{PopupViewport-3r_KTFwX.js → PopupViewport-DftN5VUp.js} +2 -2
- package/dist/lib/server/{Separator-vhhYxWGr.js → Separator-DTvtnxzP.js} +4 -6
- package/dist/lib/server/TriggerFocusGuards-CvoGfft9.js +61 -0
- package/dist/lib/server/accordion/index.js +32 -70
- package/dist/lib/server/alert-dialog/index.js +2 -2
- package/dist/lib/server/autocomplete/index.js +14 -5
- package/dist/lib/server/avatar/index.js +90 -51
- package/dist/lib/server/button/index.js +8 -9
- package/dist/lib/server/checkbox/index.js +30 -57
- package/dist/lib/server/checkbox-group/index.js +20 -10
- package/dist/lib/server/collapsible/index.js +36 -43
- package/dist/lib/server/combobox/index.js +64 -35
- package/dist/lib/server/{constants-9H__9xbS.js → constants-D7ciIzsV.js} +8 -3
- package/dist/lib/server/context-menu/index.js +7 -9
- package/dist/lib/server/{createAnchorPositioning-C-cVOPwz.js → createAnchorPositioning-B5Y0WEev.js} +11 -6
- package/dist/lib/server/{createCollapsiblePanel-DTyVJz0G.js → createCollapsiblePanel-B45kTe6v.js} +1 -1
- package/dist/lib/server/{createFocusInteraction-EIS0QOel.js → createFocusInteraction-DMyKsniI.js} +22 -2
- package/dist/lib/server/createLabelableId-WMUKtY6s.js +18 -0
- package/dist/lib/server/{createPopupAutoResize-DO50jjNX.js → createPopupAutoResize-ImBjwdj_.js} +1 -1
- package/dist/lib/server/{createTransitionStatus-BTlrerSS.js → createTransitionStatus-184v7j3-.js} +2 -2
- package/dist/lib/server/dialog/index.js +2 -2
- package/dist/lib/server/drawer/index.js +63 -71
- package/dist/lib/server/field/index.js +105 -93
- package/dist/lib/server/fieldset/index.js +13 -16
- package/dist/lib/server/form/index.js +16 -12
- package/dist/lib/server/index.js +5 -3
- package/dist/lib/server/input/index.js +1 -1
- package/dist/lib/server/internals/form-context/index.js +1 -1
- package/dist/lib/server/internals/labelable-provider/index.js +1 -1
- package/dist/lib/server/menu/index.js +21 -20
- package/dist/lib/server/menubar/index.js +6 -31
- package/dist/lib/server/{mergeStyleValue-Db8bRCM4.js → mergeStyleValue-BwJ10_X2.js} +6 -1
- package/dist/lib/server/meter/index.js +20 -32
- package/dist/lib/server/navigation-menu/index.js +53 -124
- package/dist/lib/server/number-field/index.js +44 -42
- package/dist/lib/server/otp-field/index.js +11 -14
- package/dist/lib/server/popover/index.js +42 -59
- package/dist/lib/server/{popupStateMapping-nKoUwoke.js → popupStateMapping-B2KsiiLb.js} +18 -16
- package/dist/lib/server/preview-card/index.js +30 -41
- package/dist/lib/server/progress/index.js +21 -33
- package/dist/lib/server/radio/index.js +18 -39
- package/dist/lib/server/radio-group/index.js +7 -8
- package/dist/lib/server/{runOnceAnimationsFinish-DCHzXWZU.js → runOnceAnimationsFinish-CYq38H8J.js} +2 -1
- package/dist/lib/server/{safePolygon-CAm5RJGv.js → safePolygon-C1GNJbKR.js} +5 -0
- package/dist/lib/server/scroll-area/index.js +23 -32
- package/dist/lib/server/select/index.js +95 -181
- package/dist/lib/server/separator/index.js +1 -1
- package/dist/lib/server/slider/index.js +25 -38
- package/dist/lib/server/switch/index.js +13 -23
- package/dist/lib/server/tabs/index.js +185 -129
- package/dist/lib/server/toast/index.js +49 -66
- package/dist/lib/server/toggle/index.js +4 -6
- package/dist/lib/server/toggle-group/index.js +9 -7
- package/dist/lib/server/toolbar/index.js +62 -79
- package/dist/lib/server/tooltip/index.js +28 -37
- package/dist/lib/server/use-render/index.js +2 -0
- package/dist/lib/server/{useFilteredItems-DvuctLt3.js → useFilteredItems-DCxq20Is.js} +164 -189
- package/dist/lib/server/useRender-CryVdCjs.js +16 -0
- package/dist/lib/types/accordion/header/AccordionHeader.d.ts +1 -1
- package/dist/lib/types/accordion/item/AccordionItem.d.ts +1 -1
- package/dist/lib/types/accordion/panel/AccordionPanel.d.ts +1 -1
- package/dist/lib/types/accordion/root/AccordionRoot.d.ts +2 -7
- package/dist/lib/types/accordion/trigger/AccordionTrigger.d.ts +1 -1
- package/dist/lib/types/alert-dialog/trigger/AlertDialogTrigger.d.ts +1 -2
- package/dist/lib/types/autocomplete/trigger/AutocompleteTrigger.d.ts +1 -0
- package/dist/lib/types/avatar/fallback/AvatarFallback.d.ts +2 -2
- package/dist/lib/types/avatar/image/AvatarImage.d.ts +9 -3
- package/dist/lib/types/avatar/image/createImageLoadingStatus.d.ts +3 -2
- package/dist/lib/types/avatar/root/AvatarRoot.d.ts +1 -1
- package/dist/lib/types/button/Button.d.ts +1 -1
- package/dist/lib/types/checkbox-group/CheckboxGroupContext.d.ts +4 -1
- package/dist/lib/types/collapsible/panel/CollapsiblePanel.d.ts +1 -1
- package/dist/lib/types/collapsible/root/CollapsibleRoot.d.ts +1 -1
- package/dist/lib/types/collapsible/trigger/CollapsibleTrigger.d.ts +1 -1
- package/dist/lib/types/combobox/index.d.ts +2 -0
- package/dist/lib/types/combobox/index.parts.d.ts +1 -0
- package/dist/lib/types/combobox/items/createItems.d.ts +42 -0
- package/dist/lib/types/combobox/root/AriaCombobox.d.ts +4 -0
- package/dist/lib/types/combobox/root/ComboboxRoot.d.ts +12 -8
- package/dist/lib/types/combobox/root/ComboboxRootContext.d.ts +2 -0
- package/dist/lib/types/combobox/trigger/ComboboxTrigger.d.ts +1 -0
- package/dist/lib/types/dialog/backdrop/DialogBackdrop.d.ts +1 -1
- package/dist/lib/types/dialog/description/DialogDescription.d.ts +1 -1
- package/dist/lib/types/dialog/title/DialogTitle.d.ts +1 -1
- package/dist/lib/types/dialog/viewport/DialogViewport.d.ts +1 -1
- package/dist/lib/types/drawer/backdrop/DrawerBackdrop.d.ts +1 -1
- package/dist/lib/types/drawer/content/DrawerContent.d.ts +1 -1
- package/dist/lib/types/drawer/indent/DrawerIndent.d.ts +1 -1
- package/dist/lib/types/drawer/indent-background/DrawerIndentBackground.d.ts +1 -1
- package/dist/lib/types/field/root/FieldRoot.d.ts +1 -1
- package/dist/lib/types/field/root/createFieldValidation.d.ts +3 -2
- package/dist/lib/types/fieldset/legend/FieldsetLegend.d.ts +1 -1
- package/dist/lib/types/fieldset/root/FieldsetRoot.d.ts +1 -1
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/internals/createTransitionStatus.d.ts +1 -1
- package/dist/lib/types/internals/form-context/FormContext.d.ts +1 -0
- package/dist/lib/types/internals/labelable-provider/LabelableContext.d.ts +1 -0
- package/dist/lib/types/internals/labelable-provider/createLabelableId.d.ts +3 -0
- package/dist/lib/types/internals/overlay/PopupPortal.d.ts +4 -2
- package/dist/lib/types/internals/overlay/createPopupPresence.d.ts +1 -0
- package/dist/lib/types/menu/root/MenuRootContext.d.ts +1 -0
- package/dist/lib/types/meter/indicator/MeterIndicator.d.ts +1 -1
- package/dist/lib/types/meter/label/MeterLabel.d.ts +1 -1
- package/dist/lib/types/meter/root/MeterRoot.d.ts +1 -1
- package/dist/lib/types/meter/track/MeterTrack.d.ts +1 -1
- package/dist/lib/types/meter/value/MeterValue.d.ts +1 -1
- package/dist/lib/types/navigation-menu/trigger/NavigationMenuTrigger.d.ts +1 -0
- package/dist/lib/types/number-field/root/NumberFieldRootContext.d.ts +1 -0
- package/dist/lib/types/popover/arrow/PopoverArrow.d.ts +1 -1
- package/dist/lib/types/popover/backdrop/PopoverBackdrop.d.ts +1 -1
- package/dist/lib/types/popover/description/PopoverDescription.d.ts +1 -1
- package/dist/lib/types/popover/positioner/PopoverPositioner.d.ts +1 -1
- package/dist/lib/types/popover/title/PopoverTitle.d.ts +1 -1
- package/dist/lib/types/preview-card/arrow/PreviewCardArrow.d.ts +1 -1
- package/dist/lib/types/preview-card/backdrop/PreviewCardBackdrop.d.ts +1 -1
- package/dist/lib/types/preview-card/positioner/PreviewCardPositioner.d.ts +1 -1
- package/dist/lib/types/progress/indicator/ProgressIndicator.d.ts +1 -1
- package/dist/lib/types/progress/label/ProgressLabel.d.ts +1 -1
- package/dist/lib/types/progress/root/ProgressRoot.d.ts +1 -1
- package/dist/lib/types/progress/track/ProgressTrack.d.ts +1 -1
- package/dist/lib/types/progress/value/ProgressValue.d.ts +1 -1
- package/dist/lib/types/radio/indicator/RadioIndicator.d.ts +2 -2
- package/dist/lib/types/scroll-area/content/ScrollAreaContent.d.ts +1 -1
- package/dist/lib/types/scroll-area/corner/ScrollAreaCorner.d.ts +1 -1
- package/dist/lib/types/scroll-area/root/ScrollAreaRoot.d.ts +1 -1
- package/dist/lib/types/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +2 -1
- package/dist/lib/types/scroll-area/thumb/ScrollAreaThumb.d.ts +1 -1
- package/dist/lib/types/scroll-area/viewport/ScrollAreaViewport.d.ts +1 -1
- package/dist/lib/types/separator/Separator.d.ts +1 -1
- package/dist/lib/types/tabs/indicator/prehydrationScript.d.ts +1 -1
- package/dist/lib/types/tabs/list/TabsList.d.ts +1 -1
- package/dist/lib/types/tabs/panel/TabsPanel.d.ts +1 -1
- package/dist/lib/types/tabs/root/TabsRoot.d.ts +1 -1
- package/dist/lib/types/tabs/tab/TabsTab.d.ts +1 -1
- package/dist/lib/types/toast/createToastManager.d.ts +2 -2
- package/dist/lib/types/toast/store/ToastStore.d.ts +1 -1
- package/dist/lib/types/toast/useToastManager.d.ts +1 -1
- package/dist/lib/types/toggle/Toggle.d.ts +1 -1
- package/dist/lib/types/toggle-group/ToggleGroup.d.ts +1 -1
- package/dist/lib/types/toolbar/group/ToolbarGroup.d.ts +1 -1
- package/dist/lib/types/toolbar/link/ToolbarLink.d.ts +1 -1
- package/dist/lib/types/toolbar/root/ToolbarRoot.d.ts +1 -1
- package/dist/lib/types/toolbar/separator/ToolbarSeparator.d.ts +1 -1
- package/dist/lib/types/tooltip/arrow/TooltipArrow.d.ts +1 -1
- package/dist/lib/types/tooltip/positioner/TooltipPositioner.d.ts +1 -1
- package/dist/lib/types/types/index.d.ts +7 -3
- package/dist/lib/types/use-render/index.d.ts +2 -0
- package/dist/lib/types/use-render/useRender.d.ts +10 -0
- package/package.json +24 -11
- package/dist/lib/client/DialogHandle-DrN2YWCv.js +0 -518
- package/dist/lib/client/DialogPopup-ZlqmGfdk.js +0 -136
- package/dist/lib/client/FieldControl-Bc-z2og6.js +0 -116
- package/dist/lib/client/MenuSubmenuTrigger-QZkQ0F2v.js +0 -1570
- package/dist/lib/client/Separator-9DboD_Si.js +0 -25
- package/dist/lib/client/TriggerFocusGuards-CQ-JuASy.js +0 -56
- package/dist/lib/client/accordion-sOXt9AlG.js +0 -399
- package/dist/lib/client/avatar-AF9vyD4q.js +0 -146
- package/dist/lib/client/button-DpUi-2g8.js +0 -82
- package/dist/lib/client/checkbox-BbAwOptH.js +0 -441
- package/dist/lib/client/checkbox-group-CSSp_805.js +0 -128
- package/dist/lib/client/collapsible-BIbje_ub.js +0 -232
- package/dist/lib/client/combobox-8O-vgTLL.js +0 -352
- package/dist/lib/client/context-menu-BTMkXtrs.js +0 -217
- package/dist/lib/client/createFocusInteraction-D4w1-235.js +0 -50
- package/dist/lib/client/drawer-Ce2cChLt.js +0 -1550
- package/dist/lib/client/field-C-o7jzKW.js +0 -469
- package/dist/lib/client/fieldset-BQTAWv2L.js +0 -65
- package/dist/lib/client/form-BINBiW5L.js +0 -106
- package/dist/lib/client/menu-DeMT08oD.js +0 -326
- package/dist/lib/client/menubar-C4aomSYv.js +0 -185
- package/dist/lib/client/meter-xSU37Q0m.js +0 -171
- package/dist/lib/client/navigation-menu-ZILQmdn6.js +0 -1083
- package/dist/lib/client/number-field-B8CsTb_8.js +0 -1035
- package/dist/lib/client/otp-field-DBkMcnog.js +0 -582
- package/dist/lib/client/popover-CQwyp-fs.js +0 -929
- package/dist/lib/client/popupStateMapping-C9eZl19i.js +0 -367
- package/dist/lib/client/preview-card-D_2Q8lpC.js +0 -625
- package/dist/lib/client/progress-D7r0xAC9.js +0 -188
- package/dist/lib/client/radio-CzGQ81z1.js +0 -299
- package/dist/lib/client/radio-group-DpHlBKA6.js +0 -193
- package/dist/lib/client/runOnceAnimationsFinish-15EM-Z4l.js +0 -48
- package/dist/lib/client/scroll-area-CffM4U0R.js +0 -701
- package/dist/lib/client/select-IFhiEg73.js +0 -1940
- package/dist/lib/client/slider-BCagYmGp.js +0 -921
- package/dist/lib/client/switch-RIJeDnvS.js +0 -308
- package/dist/lib/client/tabs-fOAKs7r3.js +0 -696
- package/dist/lib/client/toast-D2P8UqUs.js +0 -1108
- package/dist/lib/client/toggle-group-0Aue0owJ.js +0 -129
- package/dist/lib/client/toggle-momVEIBL.js +0 -138
- package/dist/lib/client/toolbar-Du22aKCv.js +0 -492
- package/dist/lib/client/tooltip-CyK61fl1.js +0 -844
- package/dist/lib/client/useFilteredItems-DTekHz39.js +0 -2223
- package/dist/lib/client/withoutComponentBinding-CcCW7fSc.js +0 -13
- package/dist/lib/server/TriggerFocusGuards-sbGwf45f.js +0 -63
- package/dist/lib/server/withoutComponentBinding-BHaWr5kU.js +0 -20
- package/dist/lib/types/internals/withoutComponentBinding.d.ts +0 -7
|
@@ -0,0 +1,1043 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { t } from "./useRender-CxZ8PI-g.js";
|
|
3
|
+
import { getStateAttributesProps as n } from "./internals/getStateAttributesProps.js";
|
|
4
|
+
import { 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
|
+
import { n as p, t as m } from "./resolveStyle-XcgAuaKR.js";
|
|
6
|
+
import { createChangeEventDetails as h, createGenericEventDetails as g } from "./internals/createBaseUIEventDetails.js";
|
|
7
|
+
import { composeEventHandlers as _ } from "./internals/composeEventHandlers.js";
|
|
8
|
+
import { fieldValidityMapping as v } from "./internals/field-constants.js";
|
|
9
|
+
import { n as y } from "./FieldRootContext-izCEh80D.js";
|
|
10
|
+
import { n as b } from "./FormContext-CwLBtm_d.js";
|
|
11
|
+
import { r as x } from "./LabelableContext-CmQF-TX2.js";
|
|
12
|
+
import { mergeStyles as S } from "./internals/mergeStyles.js";
|
|
13
|
+
import { Portal as C, createComponent as w, delegateEvents as T, effect as E, getNextElement as D, memo as O, mergeProps as ee, ref as te, runHydrationEvents as k, setAttribute as A, setProperty as ne, spread as j, style as M, template as N } from "@solidjs/web";
|
|
14
|
+
import { Show as P, createContext as F, createEffect as I, createMemo as L, createSignal as R, createUniqueId as z, flush as B, omit as V, onCleanup as H, onSettled as U, untrack as W, useContext as G } from "solid-js";
|
|
15
|
+
//#region src/number-field/utils/parse.ts
|
|
16
|
+
var K = "零〇一二三四五六七八九", q = /[٠-٩۰-۹0-9]/g, J = /[零〇一二三四五六七八九]/g, re = [
|
|
17
|
+
"%",
|
|
18
|
+
"٪",
|
|
19
|
+
"%",
|
|
20
|
+
"﹪"
|
|
21
|
+
], ie = ["‰", "؉"], ae = /[%٪%﹪]/, Y = /[‰؉]/, oe = /[%٪%﹪]/g, se = /[‰؉]/g, ce = /[٠-٩۰-۹]/, le = /[零〇一二三四五六七八九]/, ue = /[0-9٠-٩۰-۹0-9零〇一二三四五六七八九]/;
|
|
22
|
+
function de(e) {
|
|
23
|
+
return ue.test(e);
|
|
24
|
+
}
|
|
25
|
+
var fe = [
|
|
26
|
+
".",
|
|
27
|
+
",",
|
|
28
|
+
".",
|
|
29
|
+
",",
|
|
30
|
+
"٫",
|
|
31
|
+
"٬"
|
|
32
|
+
], pe = /\p{Zs}/u, me = /\p{Cf}/u, he = /\p{Cf}/gu, ge = [
|
|
33
|
+
"+",
|
|
34
|
+
"+",
|
|
35
|
+
"﹢"
|
|
36
|
+
], _e = [
|
|
37
|
+
"-",
|
|
38
|
+
"−",
|
|
39
|
+
"-",
|
|
40
|
+
"‒",
|
|
41
|
+
"–",
|
|
42
|
+
"—",
|
|
43
|
+
"﹣"
|
|
44
|
+
], X = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
45
|
+
function Z(e, t) {
|
|
46
|
+
return new Intl.NumberFormat(e, t);
|
|
47
|
+
}
|
|
48
|
+
function ve(e, t) {
|
|
49
|
+
let [n, r = "0"] = String(e).split("e");
|
|
50
|
+
return Number(`${n}e${Number(r) + t}`);
|
|
51
|
+
}
|
|
52
|
+
var ye = /[-−-‒–—﹣]/gu, Q = /[++﹢]/gu, be = /[-−-‒–—﹣]/, xe = /[++﹢]/, Se = 11111.1;
|
|
53
|
+
function Ce(e, t) {
|
|
54
|
+
return Z(e, t).formatToParts(Se);
|
|
55
|
+
}
|
|
56
|
+
function we(e, t) {
|
|
57
|
+
let n = Ce(e, t), r = {};
|
|
58
|
+
n.forEach((e) => {
|
|
59
|
+
r[e.type] = e.value;
|
|
60
|
+
});
|
|
61
|
+
let i = ".";
|
|
62
|
+
return Z(e).formatToParts(.1).forEach((e) => {
|
|
63
|
+
e.type === "decimal" && (i = e.value);
|
|
64
|
+
}), {
|
|
65
|
+
...r,
|
|
66
|
+
decimal: i
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function $(e, t, n) {
|
|
70
|
+
let r = e.replace(he, "").trim();
|
|
71
|
+
r = r.replace(ye, "-").replace(Q, "+");
|
|
72
|
+
let i = !1, a = (e, t) => (t === "-" && (i = !0), "");
|
|
73
|
+
r = r.replace(/([+-])\s*$/, a).replace(/^\s*([+-])/, a);
|
|
74
|
+
let o = t;
|
|
75
|
+
o === void 0 && (ce.test(r) ? o = "ar" : le.test(r) && (o = "zh"));
|
|
76
|
+
let { group: s, decimal: c, currency: l, exponentSeparator: u } = we(o, n), d = Z(o, n).formatToParts(1).filter((e) => e.type === "unit").map((e) => X(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(X(s), "g"));
|
|
78
|
+
let m = [
|
|
79
|
+
[p, ""],
|
|
80
|
+
[new RegExp(X(c), "g"), "."],
|
|
81
|
+
[/[.٫]/g, "."],
|
|
82
|
+
[/[,٬]/g, ""],
|
|
83
|
+
[l ? new RegExp(X(l), "g") : null, ""],
|
|
84
|
+
[f, ""],
|
|
85
|
+
[oe, ""],
|
|
86
|
+
[se, ""],
|
|
87
|
+
[u ? new RegExp(X(u), "g") : null, "e"],
|
|
88
|
+
[q, (e) => String(e.charCodeAt(0) % 16)],
|
|
89
|
+
[J, (e) => String(Math.max(K.indexOf(e) - 1, 0))]
|
|
90
|
+
].reduce((e, [t, n]) => t ? e.replace(t, n) : e, r), h = m.lastIndexOf(".");
|
|
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 = ae.test(e) || v === "percent";
|
|
93
|
+
return Y.test(e) ? _ = ve(_, -3) : !y && b && (_ = ve(_, -2)), Number.isFinite(_) ? _ : null;
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/number-field/utils/format.ts
|
|
97
|
+
var Te = /* @__PURE__ */ new Map();
|
|
98
|
+
function Ee(e) {
|
|
99
|
+
if (e !== void 0) return Array.isArray(e) ? e.map((e) => e.toString()).join(",") : e.toString();
|
|
100
|
+
}
|
|
101
|
+
function De(e, t) {
|
|
102
|
+
let n = JSON.stringify({
|
|
103
|
+
locale: Ee(e),
|
|
104
|
+
options: t
|
|
105
|
+
}), r = Te.get(n);
|
|
106
|
+
return r || (r = new Intl.NumberFormat(e, t), Te.set(n, r)), r;
|
|
107
|
+
}
|
|
108
|
+
function Oe(e, t, n) {
|
|
109
|
+
return e === null ? "" : De(t, n).format(e);
|
|
110
|
+
}
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/number-field/utils/platform.ts
|
|
113
|
+
function ke() {
|
|
114
|
+
return typeof navigator > "u" ? "" : navigator.platform.toLowerCase();
|
|
115
|
+
}
|
|
116
|
+
function Ae() {
|
|
117
|
+
return typeof navigator > "u" ? "" : navigator.userAgent.toLowerCase();
|
|
118
|
+
}
|
|
119
|
+
function je() {
|
|
120
|
+
let e = ke(), t = typeof navigator > "u" ? 0 : navigator.maxTouchPoints;
|
|
121
|
+
return /^i(os$|p)/.test(e) || e === "macintel" && t > 1;
|
|
122
|
+
}
|
|
123
|
+
function Me() {
|
|
124
|
+
return typeof CSS < "u" && !!CSS.supports?.("-webkit-backdrop-filter:none");
|
|
125
|
+
}
|
|
126
|
+
function Ne() {
|
|
127
|
+
return !Me() && Ae().includes("firefox");
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/number-field/utils/stateAttributesMapping.ts
|
|
131
|
+
var Pe = {
|
|
132
|
+
inputValue: () => null,
|
|
133
|
+
value: () => null,
|
|
134
|
+
...v
|
|
135
|
+
}, Fe = 1e-10, Ie = 1e-10;
|
|
136
|
+
function Le(e) {
|
|
137
|
+
return e?.maximumFractionDigits != null || e?.minimumFractionDigits != null || e?.maximumSignificantDigits != null || e?.minimumSignificantDigits != null || e?.roundingIncrement != null || e?.roundingMode != null || e?.roundingPriority != null;
|
|
138
|
+
}
|
|
139
|
+
function Re(e, t) {
|
|
140
|
+
if (!Number.isFinite(e)) return e;
|
|
141
|
+
if (!Le(t)) {
|
|
142
|
+
let t = parseFloat(e.toPrecision(15));
|
|
143
|
+
return Math.abs(t - e) <= Math.min(2 ** -52 * Math.max(1, Math.abs(e)), Ie) ? t : e;
|
|
144
|
+
}
|
|
145
|
+
let n = new Intl.NumberFormat("en-US", {
|
|
146
|
+
...t,
|
|
147
|
+
signDisplay: "auto",
|
|
148
|
+
currencySign: "standard",
|
|
149
|
+
notation: t.notation === "compact" ? "standard" : t.notation,
|
|
150
|
+
useGrouping: !1
|
|
151
|
+
}), r = n.format(e), i = $(r, "en-US", t);
|
|
152
|
+
return i === null ? e : n.format(i) === r ? i : e;
|
|
153
|
+
}
|
|
154
|
+
function ze(e, t, n, r) {
|
|
155
|
+
let i = Math.abs(n), a = Math.sign(n), o = i * Fe * a, s = e - t + o;
|
|
156
|
+
return r ? t + Math.round(s / n) * n : t + (a > 0 ? Math.floor(s / i) : Math.ceil(s / i)) * i;
|
|
157
|
+
}
|
|
158
|
+
function Be(e, t, n) {
|
|
159
|
+
return Math.max(t, Math.min(e, n));
|
|
160
|
+
}
|
|
161
|
+
function Ve(e, t, n, r, i, a, o, s, c) {
|
|
162
|
+
if (e === null) return e;
|
|
163
|
+
let l = e;
|
|
164
|
+
if (t != null && o && t !== 0 && (l = ze(l, s || n === -(2 ** 53 - 1) ? i : n, t, s)), c && (l = Be(l, n, r)), t == null && !Le(a)) return l;
|
|
165
|
+
let u = Re(l, a);
|
|
166
|
+
return c ? Be(u, n, r) : u;
|
|
167
|
+
}
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/number-field/root/NumberFieldRootContext.ts
|
|
170
|
+
var He = Symbol("NumberFieldRootContext"), Ue = F(He);
|
|
171
|
+
function We() {
|
|
172
|
+
let e = G(Ue);
|
|
173
|
+
if (e === He) throw Error("Base UI: NumberFieldRootContext is missing. NumberField parts must be placed within <NumberField.Root>.");
|
|
174
|
+
return e;
|
|
175
|
+
}
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/number-field/root/NumberFieldRoot.tsx
|
|
178
|
+
var Ge = /* @__PURE__ */ N("<div>"), Ke = /* @__PURE__ */ N("<input type=number aria-hidden=true tabindex=-1>"), qe = {
|
|
179
|
+
"clip-path": "inset(50%)",
|
|
180
|
+
overflow: "hidden",
|
|
181
|
+
"white-space": "nowrap",
|
|
182
|
+
border: "0",
|
|
183
|
+
padding: "0",
|
|
184
|
+
width: "1px",
|
|
185
|
+
height: "1px",
|
|
186
|
+
margin: "-1px",
|
|
187
|
+
position: "fixed",
|
|
188
|
+
top: "0",
|
|
189
|
+
left: "0"
|
|
190
|
+
}, Je = {
|
|
191
|
+
...qe,
|
|
192
|
+
position: "absolute"
|
|
193
|
+
};
|
|
194
|
+
function Ye(e) {
|
|
195
|
+
let i = y(!0), a = b(), o = x(), s = e, c = e, l = Symbol("NumberField"), u = W(o.controlId), d = typeof u == "string" ? u : `base-ui-${z()}`, _ = W(() => s.value !== void 0), [v, S] = R(() => W(() => s.defaultValue ?? null)), [C, T] = R(), [O, N] = R(), [P, F] = R(!1), [B, H] = R("numeric"), U = !0, G = null, K = !1, q = V(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"), J = L(() => _ ? s.value ?? null : v()), ae = L(() => s.id ?? d), Y = L(() => s.min), oe = L(() => s.max), se = L(() => Y() ?? -(2 ** 53 - 1)), ce = L(() => oe() ?? 2 ** 53 - 1), le = L(() => i.disabled() || (s.disabled ?? !1)), ue = L(() => s.readOnly ?? !1), de = L(() => s.required ?? !1), me = L(() => s.name), he = L(() => i.name() ?? me()), X = L(() => s.locale), Z = L(() => s.format), [ve, ye] = R(() => Oe(W(J), W(X), W(Z))), Q = L(() => ({
|
|
196
|
+
...i.state(),
|
|
197
|
+
disabled: le(),
|
|
198
|
+
readOnly: ue(),
|
|
199
|
+
required: de(),
|
|
200
|
+
value: J(),
|
|
201
|
+
inputValue: ve(),
|
|
202
|
+
scrubbing: P()
|
|
203
|
+
})), be = L(() => p(e.class, Q())), xe = t(e, () => Q(), (e) => (() => {
|
|
204
|
+
var t = D(Ge);
|
|
205
|
+
return j(t, e, !1), k(), t;
|
|
206
|
+
})()), Se = L(() => m(e.style, Q())), $ = L(() => n(Q(), Pe));
|
|
207
|
+
function Te(e) {
|
|
208
|
+
ye(e);
|
|
209
|
+
}
|
|
210
|
+
function Ee() {
|
|
211
|
+
let e = Z(), t = Ce(X(), e), n = new Set(fe), r = (e) => {
|
|
212
|
+
for (let t of e) n.add(t);
|
|
213
|
+
}, i = t.find((e) => e.type === "decimal")?.value ?? we(X(), e).decimal;
|
|
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)), pe.test(e.value) && n.add(" "));
|
|
216
|
+
let a = e?.style;
|
|
217
|
+
return (a === "percent" || a === "unit" && e?.unit === "percent") && r(re), (a === "percent" || a === "unit" && e?.unit === "permille") && r(ie), r(ge), (se() < 0 || (s.allowOutOfRange ?? !1)) && r(_e), n;
|
|
218
|
+
}
|
|
219
|
+
function De(e) {
|
|
220
|
+
if (e?.altKey) return s.smallStep ?? .1;
|
|
221
|
+
if (e?.shiftKey) return s.largeStep ?? 10;
|
|
222
|
+
let t = s.step ?? 1;
|
|
223
|
+
return t === "any" ? 1 : t;
|
|
224
|
+
}
|
|
225
|
+
function ke(e, t) {
|
|
226
|
+
let n = t.direction, r = t.event, a = t.reason.startsWith("input-") || t.reason === "none", o = Ve(e, n ? De(r) * n : void 0, se(), ce(), Y() ?? 0, Z(), s.snapOnStep ?? !1, r.altKey ?? !1, !(s.allowOutOfRange && a)), c = o !== J() || a && (e !== J() || !U);
|
|
227
|
+
if (c) {
|
|
228
|
+
if (s.onValueChange?.(o, t), t.isCanceled) return !1;
|
|
229
|
+
_ || S(o), i.setDirty(o !== i.validityData().initialValue), K = !0;
|
|
230
|
+
}
|
|
231
|
+
return G = o, U && Te(Oe(o, X(), Z())), c;
|
|
232
|
+
}
|
|
233
|
+
function Ae(e, { direction: t, currentValue: n, event: r, reason: i }) {
|
|
234
|
+
let a = n ?? J(), o = r;
|
|
235
|
+
return typeof a == "number" ? ke(a + e * t, h(i, o, void 0, { direction: t })) : ke(0, h(i, o));
|
|
236
|
+
}
|
|
237
|
+
function Me(e, t) {
|
|
238
|
+
K = !1, s.onValueCommitted?.(e, t);
|
|
239
|
+
}
|
|
240
|
+
function Ne() {
|
|
241
|
+
let e = C();
|
|
242
|
+
e && (e.setSelectionRange(e.value.length, e.value.length), e.focus());
|
|
243
|
+
}
|
|
244
|
+
function Fe(e) {
|
|
245
|
+
let t = C();
|
|
246
|
+
if (e.ctrlKey || !t || t.ownerDocument.activeElement !== t) return;
|
|
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(), U = !0, Ae(De(e), {
|
|
249
|
+
direction: i > 0 ? -1 : 1,
|
|
250
|
+
event: e,
|
|
251
|
+
reason: "wheel"
|
|
252
|
+
}) && Me(G, g(r, e)));
|
|
253
|
+
}
|
|
254
|
+
function Ie(e) {
|
|
255
|
+
if (e.defaultPrevented || le() || ue()) return;
|
|
256
|
+
let t = e.currentTarget.valueAsNumber, n = Number.isNaN(t) ? null : t;
|
|
257
|
+
ke(n, h(f, e)), a.clearError(he()), i.validation.change(G ?? n);
|
|
258
|
+
}
|
|
259
|
+
return I(() => J(), (e) => {
|
|
260
|
+
i.setFilled(e !== null);
|
|
261
|
+
}), I(() => ({
|
|
262
|
+
currentValue: ve(),
|
|
263
|
+
formattedValue: Oe(J(), X(), Z())
|
|
264
|
+
}), (e) => {
|
|
265
|
+
U && e.formattedValue !== e.currentValue && Te(e.formattedValue);
|
|
266
|
+
}), I(() => se(), (e) => {
|
|
267
|
+
je() && H(e >= 0 ? "decimal" : "text");
|
|
268
|
+
}), I(() => ({
|
|
269
|
+
allowWheelScrub: s.allowWheelScrub ?? !1,
|
|
270
|
+
disabled: le(),
|
|
271
|
+
input: C(),
|
|
272
|
+
readOnly: ue()
|
|
273
|
+
}), (e) => {
|
|
274
|
+
if (!e.allowWheelScrub || e.disabled || e.readOnly || !e.input) return;
|
|
275
|
+
let t = e.input;
|
|
276
|
+
return t.addEventListener("wheel", Fe, { passive: !1 }), () => t.removeEventListener("wheel", Fe);
|
|
277
|
+
}), I(() => ({
|
|
278
|
+
disabled: le(),
|
|
279
|
+
hidden: O()
|
|
280
|
+
}), (e) => {
|
|
281
|
+
if (!(!e.hidden || e.disabled)) return i.validation.registerInput(l, e.hidden, () => W(() => C() ?? null));
|
|
282
|
+
}), w(Ue, {
|
|
283
|
+
value: {
|
|
284
|
+
controlSource: l,
|
|
285
|
+
minWithDefault: se,
|
|
286
|
+
maxWithDefault: ce,
|
|
287
|
+
id: ae,
|
|
288
|
+
setValue: ke,
|
|
289
|
+
getStepAmount: De,
|
|
290
|
+
incrementValue: Ae,
|
|
291
|
+
inputElement: C,
|
|
292
|
+
focusInput: Ne,
|
|
293
|
+
setInputElement: (e) => T(e),
|
|
294
|
+
allowInputSync: () => U,
|
|
295
|
+
setAllowInputSync: (e) => {
|
|
296
|
+
U = e;
|
|
297
|
+
},
|
|
298
|
+
formatOptions: Z,
|
|
299
|
+
value: J,
|
|
300
|
+
lastChangedValue: () => G,
|
|
301
|
+
setLastChangedValue: (e) => {
|
|
302
|
+
G = e;
|
|
303
|
+
},
|
|
304
|
+
hasPendingCommit: () => K,
|
|
305
|
+
setHasPendingCommit: (e) => {
|
|
306
|
+
K = e;
|
|
307
|
+
},
|
|
308
|
+
name: he,
|
|
309
|
+
nameProp: me,
|
|
310
|
+
inputMode: B,
|
|
311
|
+
getAllowedNonNumericKeys: Ee,
|
|
312
|
+
min: Y,
|
|
313
|
+
max: oe,
|
|
314
|
+
inputValue: ve,
|
|
315
|
+
setInputValue: Te,
|
|
316
|
+
locale: X,
|
|
317
|
+
setIsScrubbing: (e) => F(e),
|
|
318
|
+
state: Q,
|
|
319
|
+
onValueCommitted: Me
|
|
320
|
+
},
|
|
321
|
+
get children() {
|
|
322
|
+
return [w(xe, ee({
|
|
323
|
+
ref: [s.ref],
|
|
324
|
+
get class() {
|
|
325
|
+
return be();
|
|
326
|
+
},
|
|
327
|
+
get style() {
|
|
328
|
+
return Se();
|
|
329
|
+
}
|
|
330
|
+
}, $, q)), (() => {
|
|
331
|
+
var e = D(Ke);
|
|
332
|
+
return e.$$input = Ie, e.addEventListener("focus", Ne), te(() => [((e) => N(e)), s.inputRef], e), E(() => ({
|
|
333
|
+
e: s.form,
|
|
334
|
+
t: he(),
|
|
335
|
+
a: J() ?? "",
|
|
336
|
+
o: Y(),
|
|
337
|
+
i: oe(),
|
|
338
|
+
n: s.step ?? 1,
|
|
339
|
+
s: le(),
|
|
340
|
+
h: ue(),
|
|
341
|
+
r: de(),
|
|
342
|
+
d: he() ? Je : qe
|
|
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), ne(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), M(e, u, d?.d);
|
|
345
|
+
}), k(), e;
|
|
346
|
+
})()];
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
T(["input"]);
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region src/number-field/group/NumberFieldGroup.tsx
|
|
353
|
+
var Xe = /* @__PURE__ */ N("<div>");
|
|
354
|
+
function Ze(e) {
|
|
355
|
+
let r = We(), i = V(e, "render", "class", "style"), a = r.state, o = L(() => p(e.class, a())), s = t(e, a, (e) => (() => {
|
|
356
|
+
var t = D(Xe);
|
|
357
|
+
return j(t, e, !1), k(), t;
|
|
358
|
+
})()), c = L(() => m(e.style, a())), l = L(() => n(a(), Pe));
|
|
359
|
+
return w(s, ee({
|
|
360
|
+
get class() {
|
|
361
|
+
return o();
|
|
362
|
+
},
|
|
363
|
+
get style() {
|
|
364
|
+
return c();
|
|
365
|
+
},
|
|
366
|
+
role: "group"
|
|
367
|
+
}, l, i));
|
|
368
|
+
}
|
|
369
|
+
//#endregion
|
|
370
|
+
//#region src/number-field/root/createPressAndHold.ts
|
|
371
|
+
var Qe = 60, $e = 400, et = 8, tt = 50, nt = 3;
|
|
372
|
+
function rt(e) {
|
|
373
|
+
return e === "touch" || e === "pen";
|
|
374
|
+
}
|
|
375
|
+
function it(e) {
|
|
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
|
+
function g() {
|
|
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;
|
|
379
|
+
}
|
|
380
|
+
function _(n) {
|
|
381
|
+
g();
|
|
382
|
+
let r = e.element(), i = r?.ownerDocument.defaultView;
|
|
383
|
+
if (!r || !i) return;
|
|
384
|
+
function a(e) {
|
|
385
|
+
e.preventDefault();
|
|
386
|
+
}
|
|
387
|
+
i.addEventListener("contextmenu", a), m = () => {
|
|
388
|
+
i.removeEventListener("contextmenu", a);
|
|
389
|
+
}, h();
|
|
390
|
+
let o = { once: !0 };
|
|
391
|
+
function s(n) {
|
|
392
|
+
t = !1, g(), e.onStop()?.(n);
|
|
393
|
+
}
|
|
394
|
+
if (i.addEventListener("pointerup", s, o), h = () => {
|
|
395
|
+
i.removeEventListener("pointerup", s, o);
|
|
396
|
+
}, !e.tick()(n)) {
|
|
397
|
+
g();
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
l = i, c = i.setTimeout(() => {
|
|
401
|
+
c = void 0, l = void 0, d = i, u = i.setInterval(() => {
|
|
402
|
+
e.tick()(n) || g();
|
|
403
|
+
}, Qe);
|
|
404
|
+
}, $e);
|
|
405
|
+
}
|
|
406
|
+
let v = {
|
|
407
|
+
onTouchStart() {
|
|
408
|
+
a = !0;
|
|
409
|
+
},
|
|
410
|
+
onTouchEnd() {
|
|
411
|
+
a = !1;
|
|
412
|
+
},
|
|
413
|
+
onPointerDown(a) {
|
|
414
|
+
if (a.defaultPrevented || a.button || e.disabled()) return;
|
|
415
|
+
if (s = a.pointerType, o = !1, t = !0, r = a.clientX, i = a.clientY, !rt(a.pointerType)) {
|
|
416
|
+
a.preventDefault(), _(a);
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
let c = a.currentTarget?.ownerDocument.defaultView ?? e.element()?.ownerDocument.defaultView;
|
|
420
|
+
c && (f !== void 0 && p?.clearTimeout(f), p = c, f = c.setTimeout(() => {
|
|
421
|
+
f = void 0, p = void 0;
|
|
422
|
+
let e = n;
|
|
423
|
+
n = 0, t && e < nt ? (_(a), o = !0) : (o = !1, g());
|
|
424
|
+
}, tt));
|
|
425
|
+
},
|
|
426
|
+
onPointerUp(e) {
|
|
427
|
+
rt(e.pointerType) && (t = !1);
|
|
428
|
+
},
|
|
429
|
+
onPointerMove(a) {
|
|
430
|
+
if (e.disabled() || !rt(a.pointerType) || !t) return;
|
|
431
|
+
n += 1;
|
|
432
|
+
let o = r - a.clientX, s = i - a.clientY;
|
|
433
|
+
o ** 2 + s ** 2 > et ** 2 && g();
|
|
434
|
+
},
|
|
435
|
+
onMouseEnter(n) {
|
|
436
|
+
n.defaultPrevented || e.disabled() || !t || a || rt(s) || _(n);
|
|
437
|
+
},
|
|
438
|
+
onMouseLeave() {
|
|
439
|
+
a || g();
|
|
440
|
+
},
|
|
441
|
+
onMouseUp() {
|
|
442
|
+
a || g();
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
function y(e) {
|
|
446
|
+
return e.defaultPrevented ? !0 : rt(s) ? o : e.detail !== 0;
|
|
447
|
+
}
|
|
448
|
+
return I(e.disabled, (e) => {
|
|
449
|
+
e && (t = !1, a = !1, s = "", g());
|
|
450
|
+
}), H(() => {
|
|
451
|
+
g(), h();
|
|
452
|
+
}), {
|
|
453
|
+
pointerHandlers: v,
|
|
454
|
+
shouldSkipClick: y
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
//#endregion
|
|
458
|
+
//#region src/number-field/increment/NumberFieldStepperButton.tsx
|
|
459
|
+
var at = /* @__PURE__ */ N("<button>"), ot = {
|
|
460
|
+
"-webkit-user-select": "none",
|
|
461
|
+
"user-select": "none"
|
|
462
|
+
};
|
|
463
|
+
function st(e, r) {
|
|
464
|
+
let i = We(), a = e, o = e, c = null, l = !1, u = V(o, "render", "class", "disabled", "nativeButton", "onClick", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "onPointerDown", "onPointerMove", "onPointerUp", "onTouchEnd", "onTouchStart", "ref", "style"), f = i.state, v = L(() => a.nativeButton ?? !0), y = L(() => {
|
|
465
|
+
let e = f(), t = e.value !== null && (r ? e.value >= i.maxWithDefault() : e.value <= i.minWithDefault());
|
|
466
|
+
return (a.disabled ?? !1) || e.disabled || t;
|
|
467
|
+
}), b = L(() => y() || f().readOnly), x = L(() => ({
|
|
468
|
+
...f(),
|
|
469
|
+
disabled: y()
|
|
470
|
+
})), C = L(() => p(e.class, x())), T = t(e, () => x(), (e) => (() => {
|
|
471
|
+
var t = D(at);
|
|
472
|
+
return j(t, e, !1), k(), t;
|
|
473
|
+
})()), E = L(() => {
|
|
474
|
+
let t = m(e.style, x());
|
|
475
|
+
return typeof t == "string" ? `-webkit-user-select:none;user-select:none;${t}` : S(ot, t === !1 ? void 0 : t) ?? ot;
|
|
476
|
+
}), te = L(() => n(x(), Pe)), A = r ? s : d;
|
|
477
|
+
function ne(e) {
|
|
478
|
+
let t = !i.allowInputSync();
|
|
479
|
+
if (i.setAllowInputSync(!0), !t) {
|
|
480
|
+
let e = i.value();
|
|
481
|
+
return i.setLastChangedValue(e), e;
|
|
482
|
+
}
|
|
483
|
+
let n = $(i.inputValue(), i.locale(), i.formatOptions());
|
|
484
|
+
if (n !== null) {
|
|
485
|
+
let t = h(A, e);
|
|
486
|
+
if (i.setValue(n, t), !t.isCanceled) return n;
|
|
487
|
+
}
|
|
488
|
+
return i.value();
|
|
489
|
+
}
|
|
490
|
+
function M(e) {
|
|
491
|
+
let t = l ? c : void 0;
|
|
492
|
+
return l = !1, i.incrementValue(i.getStepAmount(e), {
|
|
493
|
+
direction: r ? 1 : -1,
|
|
494
|
+
currentValue: t,
|
|
495
|
+
event: e,
|
|
496
|
+
reason: A
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
function N(e) {
|
|
500
|
+
let t = i.lastChangedValue() ?? i.value();
|
|
501
|
+
i.onValueCommitted(t, g(A, e));
|
|
502
|
+
}
|
|
503
|
+
let P = it({
|
|
504
|
+
disabled: b,
|
|
505
|
+
element: i.inputElement,
|
|
506
|
+
tick: () => M,
|
|
507
|
+
onStop: () => N
|
|
508
|
+
});
|
|
509
|
+
function F(e) {
|
|
510
|
+
if (e.defaultPrevented || b() || P.shouldSkipClick(e)) return;
|
|
511
|
+
let t = ne(e);
|
|
512
|
+
i.incrementValue(i.getStepAmount(e), {
|
|
513
|
+
direction: r ? 1 : -1,
|
|
514
|
+
currentValue: t,
|
|
515
|
+
event: e,
|
|
516
|
+
reason: A
|
|
517
|
+
});
|
|
518
|
+
let n = i.lastChangedValue() ?? i.value();
|
|
519
|
+
n !== t && i.onValueCommitted(n, g(A, e));
|
|
520
|
+
}
|
|
521
|
+
function I(e) {
|
|
522
|
+
e.defaultPrevented || f().readOnly || e.button || y() || (c = ne(e), l = !0, i.setLastChangedValue(null), rt(e.pointerType) || i.focusInput(), P.pointerHandlers.onPointerDown(e));
|
|
523
|
+
}
|
|
524
|
+
let R = _(() => W(b) ? ct : void 0, () => a.onClick, () => F), z = _(() => W(b) ? ct : void 0, () => a.onPointerDown, () => I), B = _(() => W(b) ? lt : void 0, () => a.onMouseDown), H = _(() => W(b) ? ut : void 0, () => a.onKeyDown, () => W(v) ? void 0 : dt), G = _(() => W(b) ? lt : void 0, () => a.onKeyUp, () => W(v) ? void 0 : ft), K = _(() => a.onPointerUp, () => P.pointerHandlers.onPointerUp), q = _(() => a.onPointerMove, () => P.pointerHandlers.onPointerMove), J = _(() => a.onTouchStart, () => P.pointerHandlers.onTouchStart), re = _(() => a.onTouchEnd, () => P.pointerHandlers.onTouchEnd), ie = _(() => a.onMouseEnter, () => P.pointerHandlers.onMouseEnter), ae = _(() => a.onMouseLeave, () => P.pointerHandlers.onMouseLeave), Y = _(() => a.onMouseUp, () => P.pointerHandlers.onMouseUp);
|
|
525
|
+
return U(() => {}), w(T, ee({
|
|
526
|
+
ref: [((e) => e), a.ref],
|
|
527
|
+
get class() {
|
|
528
|
+
return C();
|
|
529
|
+
},
|
|
530
|
+
get style() {
|
|
531
|
+
return E();
|
|
532
|
+
},
|
|
533
|
+
get type() {
|
|
534
|
+
return v() ? "button" : void 0;
|
|
535
|
+
},
|
|
536
|
+
get role() {
|
|
537
|
+
return v() ? void 0 : "button";
|
|
538
|
+
},
|
|
539
|
+
tabIndex: -1,
|
|
540
|
+
get disabled() {
|
|
541
|
+
return v() && y() ? !0 : void 0;
|
|
542
|
+
},
|
|
543
|
+
get "aria-disabled"() {
|
|
544
|
+
return O(() => !!b())() ? "true" : v() ? "false" : void 0;
|
|
545
|
+
},
|
|
546
|
+
"aria-label": r ? "Increase" : "Decrease",
|
|
547
|
+
get "aria-controls"() {
|
|
548
|
+
return i.id();
|
|
549
|
+
},
|
|
550
|
+
onClick: R,
|
|
551
|
+
onMouseDown: B,
|
|
552
|
+
onKeyDown: H,
|
|
553
|
+
onKeyUp: G,
|
|
554
|
+
onPointerDown: z,
|
|
555
|
+
onPointerUp: K,
|
|
556
|
+
onPointerMove: q,
|
|
557
|
+
onTouchStart: J,
|
|
558
|
+
onTouchEnd: re,
|
|
559
|
+
onMouseEnter: ie,
|
|
560
|
+
onMouseLeave: ae,
|
|
561
|
+
onMouseUp: Y
|
|
562
|
+
}, te, u));
|
|
563
|
+
}
|
|
564
|
+
function ct(e) {
|
|
565
|
+
e.preventDefault(), e.preventBaseUIHandler();
|
|
566
|
+
}
|
|
567
|
+
function lt(e) {
|
|
568
|
+
e.preventBaseUIHandler();
|
|
569
|
+
}
|
|
570
|
+
function ut(e) {
|
|
571
|
+
e.key !== "Tab" && e.preventDefault(), e.preventBaseUIHandler();
|
|
572
|
+
}
|
|
573
|
+
function dt(e) {
|
|
574
|
+
if (e.target !== e.currentTarget) return;
|
|
575
|
+
let t = pt(e.currentTarget), n = e.key === "Enter", r = e.key === " ";
|
|
576
|
+
if (t || !n && !r) {
|
|
577
|
+
t && r && e.preventDefault();
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
e.defaultPrevented || (e.preventDefault(), n && (e.preventBaseUIHandler(), mt(e.currentTarget, e)));
|
|
581
|
+
}
|
|
582
|
+
function ft(e) {
|
|
583
|
+
e.target === e.currentTarget && !e.defaultPrevented && e.key === " " && (e.preventBaseUIHandler(), mt(e.currentTarget, e));
|
|
584
|
+
}
|
|
585
|
+
function pt(e) {
|
|
586
|
+
return e.tagName === "A" && !!e.href;
|
|
587
|
+
}
|
|
588
|
+
function mt(e, t) {
|
|
589
|
+
let n = e.ownerDocument.defaultView;
|
|
590
|
+
if (!n) return;
|
|
591
|
+
let r = n.PointerEvent ?? n.MouseEvent;
|
|
592
|
+
e.dispatchEvent(new r("click", {
|
|
593
|
+
bubbles: !0,
|
|
594
|
+
cancelable: !0,
|
|
595
|
+
composed: !0,
|
|
596
|
+
detail: 0,
|
|
597
|
+
shiftKey: t.shiftKey,
|
|
598
|
+
ctrlKey: t.ctrlKey,
|
|
599
|
+
altKey: t.altKey,
|
|
600
|
+
metaKey: t.metaKey
|
|
601
|
+
}));
|
|
602
|
+
}
|
|
603
|
+
//#endregion
|
|
604
|
+
//#region src/number-field/increment/NumberFieldIncrement.tsx
|
|
605
|
+
function ht(e) {
|
|
606
|
+
return st(e, !0);
|
|
607
|
+
}
|
|
608
|
+
//#endregion
|
|
609
|
+
//#region src/number-field/decrement/NumberFieldDecrement.tsx
|
|
610
|
+
function gt(e) {
|
|
611
|
+
return st(e, !1);
|
|
612
|
+
}
|
|
613
|
+
//#endregion
|
|
614
|
+
//#region src/number-field/input/NumberFieldInput.tsx
|
|
615
|
+
var _t = /* @__PURE__ */ N("<input>"), vt = /* @__PURE__ */ new Set([
|
|
616
|
+
"Backspace",
|
|
617
|
+
"Delete",
|
|
618
|
+
"ArrowLeft",
|
|
619
|
+
"ArrowRight",
|
|
620
|
+
"Tab",
|
|
621
|
+
"Enter",
|
|
622
|
+
"Escape"
|
|
623
|
+
]);
|
|
624
|
+
function yt(e) {
|
|
625
|
+
let r = We(), i = y(!0), s = b(), d = x(), f = e, v = e, [S, C] = R(), T = !1, E = null, O = W(r.value), te = V(v, "render", "aria-describedby", "aria-labelledby", "aria-roledescription", "class", "onBlur", "onFocus", "onInput", "onKeyDown", "onPaste", "ref", "style"), A = r.state, ne = L(() => p(e.class, A())), M = t(e, A, (e) => (() => {
|
|
626
|
+
var t = D(_t);
|
|
627
|
+
return j(t, e, !1), k(), t;
|
|
628
|
+
})()), N = L(() => m(e.style, A())), P = L(() => n(A(), Pe)), F = L(() => f["aria-labelledby"] ?? d.labelId()), z = L(() => d.getAriaDescribedBy(f["aria-describedby"])), B = {
|
|
629
|
+
id: void 0,
|
|
630
|
+
name: void 0,
|
|
631
|
+
value: r.value,
|
|
632
|
+
getControl: () => S() ?? null
|
|
633
|
+
};
|
|
634
|
+
function U(e) {
|
|
635
|
+
e.defaultPrevented || A().disabled || i.setFocused(!0);
|
|
636
|
+
}
|
|
637
|
+
function G(e) {
|
|
638
|
+
let t = A();
|
|
639
|
+
if (e.defaultPrevented || t.disabled || (i.setTouched(!0), i.setFocused(!1), t.readOnly)) return;
|
|
640
|
+
let n = !r.allowInputSync(), a = r.hasPendingCommit(), o = r.value(), s = r.inputValue();
|
|
641
|
+
if (r.setAllowInputSync(!0), s.trim() === "") {
|
|
642
|
+
let t = h(c, e);
|
|
643
|
+
if (r.setValue(null, t), t.isCanceled) return;
|
|
644
|
+
i.validationMode() === "onBlur" && i.validation.commit(null), (n || a || o !== null) && r.onValueCommitted(null, g(c, e));
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
let l = r.formatOptions(), d = $(s, r.locale(), l);
|
|
648
|
+
if (d === null) return;
|
|
649
|
+
let f = Le(l), p;
|
|
650
|
+
p = !n && !f ? o : f ? Re(d, l) : d;
|
|
651
|
+
let m = o !== p, _ = n || m || a, v = p;
|
|
652
|
+
if (m) {
|
|
653
|
+
let t = h(u, e);
|
|
654
|
+
if (T = !0, r.setValue(p, t), t.isCanceled) {
|
|
655
|
+
T = !1;
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
v = r.lastChangedValue(), v === o && (T = !1);
|
|
659
|
+
}
|
|
660
|
+
i.validationMode() === "onBlur" && i.validation.commit(v), _ && r.onValueCommitted(v, g(u, e));
|
|
661
|
+
let y = Oe(v, r.locale(), l);
|
|
662
|
+
s !== y && r.setInputValue(y);
|
|
663
|
+
}
|
|
664
|
+
function K(e) {
|
|
665
|
+
if (e.defaultPrevented) {
|
|
666
|
+
e.currentTarget.value = r.inputValue();
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
r.setAllowInputSync(!1);
|
|
670
|
+
let t = e.currentTarget.value;
|
|
671
|
+
if (t.trim() === "") {
|
|
672
|
+
r.setInputValue(t), r.setValue(null, h(c, e));
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
let n = r.getAllowedNonNumericKeys();
|
|
676
|
+
if (!Array.from(t).every((e) => de(e) || be.test(e) || n.has(e) || me.test(e))) {
|
|
677
|
+
e.currentTarget.value = r.inputValue();
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
let i = $(t, r.locale(), r.formatOptions());
|
|
681
|
+
r.setInputValue(t), i !== null && r.setValue(i, h(l, e));
|
|
682
|
+
}
|
|
683
|
+
function q(e) {
|
|
684
|
+
let t = A();
|
|
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 } = we(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, _ = [[be, ye], [xe, Q]];
|
|
687
|
+
for (let [t, r] of _) if (t.test(e.key) && Array.from(a).some((e) => t.test(e))) {
|
|
688
|
+
let e = n.search(r), t = e !== -1 && m(e);
|
|
689
|
+
s = !(be.test(n) || xe.test(n)) || p || t;
|
|
690
|
+
}
|
|
691
|
+
for (let t of [
|
|
692
|
+
c,
|
|
693
|
+
l,
|
|
694
|
+
u
|
|
695
|
+
]) if (t && e.key === t) {
|
|
696
|
+
let e = n.indexOf(t);
|
|
697
|
+
s = e === -1 || p || m(e);
|
|
698
|
+
}
|
|
699
|
+
let v = e.key === "ArrowUp" || e.key === "ArrowDown";
|
|
700
|
+
if (e.which === 229 || e.altKey && !v || e.ctrlKey || e.metaKey || s || de(e.key) || vt.has(e.key)) return;
|
|
701
|
+
let y = null;
|
|
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
|
+
let b = i ? $(n, r.locale(), r.formatOptions()) : null;
|
|
704
|
+
e.preventDefault(), e.stopPropagation();
|
|
705
|
+
let x = !1;
|
|
706
|
+
(v || y !== null) && r.setAllowInputSync(!0), v ? (i || r.setLastChangedValue(r.value()), x = r.incrementValue(r.getStepAmount(e), {
|
|
707
|
+
direction: e.key === "ArrowUp" ? 1 : -1,
|
|
708
|
+
currentValue: b,
|
|
709
|
+
event: e,
|
|
710
|
+
reason: o
|
|
711
|
+
})) : y !== null && (x = r.setValue(y, h(o, e))), x && r.onValueCommitted(r.lastChangedValue(), g(o, e));
|
|
712
|
+
}
|
|
713
|
+
function J(e) {
|
|
714
|
+
let t = A();
|
|
715
|
+
if (e.defaultPrevented || t.readOnly || t.disabled) return;
|
|
716
|
+
let n = "";
|
|
717
|
+
try {
|
|
718
|
+
n = e.clipboardData?.getData("text/plain") ?? "";
|
|
719
|
+
} catch {
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
e.preventDefault();
|
|
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), E = i + n.length, r.setValue(l, h(a, e)), r.setInputValue(c));
|
|
725
|
+
}
|
|
726
|
+
let re = _(() => f.onFocus, () => U), ie = _(() => f.onBlur, () => G), ae = _(() => f.onInput, () => K), Y = _(() => f.onKeyDown, () => q), oe = _(() => f.onPaste, () => J);
|
|
727
|
+
return I(() => ({
|
|
728
|
+
element: S(),
|
|
729
|
+
inputValue: r.inputValue()
|
|
730
|
+
}), (e) => {
|
|
731
|
+
if (E === null) return;
|
|
732
|
+
let t = E;
|
|
733
|
+
E = null, e.element?.setSelectionRange(t, t);
|
|
734
|
+
}), I(() => ({
|
|
735
|
+
disabled: A().disabled,
|
|
736
|
+
element: S(),
|
|
737
|
+
id: r.id(),
|
|
738
|
+
name: r.nameProp()
|
|
739
|
+
}), (e) => {
|
|
740
|
+
B.id = e.id, B.name = e.name, i.registerFieldControl(r.controlSource, e.disabled || !e.element ? void 0 : B), d.registerControlId(r.controlSource, e.element ? e.id : void 0);
|
|
741
|
+
}), I(() => ({
|
|
742
|
+
name: r.name(),
|
|
743
|
+
shouldValidateOnChange: i.shouldValidateOnChange(),
|
|
744
|
+
value: r.value()
|
|
745
|
+
}), (e) => {
|
|
746
|
+
if (e.value !== O) {
|
|
747
|
+
if (O = e.value, s.clearError(e.name), T && !e.shouldValidateOnChange) {
|
|
748
|
+
T = !1;
|
|
749
|
+
return;
|
|
750
|
+
}
|
|
751
|
+
W(() => i.validation.change(e.value));
|
|
752
|
+
}
|
|
753
|
+
}), H(() => {
|
|
754
|
+
r.setInputElement(void 0), i.registerFieldControl(r.controlSource, void 0), d.registerControlId(r.controlSource, void 0);
|
|
755
|
+
}), w(M, ee({
|
|
756
|
+
ref: [((e) => {
|
|
757
|
+
C(e), r.setInputElement(e);
|
|
758
|
+
}), f.ref],
|
|
759
|
+
get id() {
|
|
760
|
+
return r.id();
|
|
761
|
+
},
|
|
762
|
+
get class() {
|
|
763
|
+
return ne();
|
|
764
|
+
},
|
|
765
|
+
get style() {
|
|
766
|
+
return N();
|
|
767
|
+
},
|
|
768
|
+
get required() {
|
|
769
|
+
return A().required;
|
|
770
|
+
},
|
|
771
|
+
get disabled() {
|
|
772
|
+
return A().disabled;
|
|
773
|
+
},
|
|
774
|
+
get readonly() {
|
|
775
|
+
return A().readOnly;
|
|
776
|
+
},
|
|
777
|
+
get inputMode() {
|
|
778
|
+
return r.inputMode();
|
|
779
|
+
},
|
|
780
|
+
get value() {
|
|
781
|
+
return r.inputValue();
|
|
782
|
+
},
|
|
783
|
+
type: "text",
|
|
784
|
+
autocomplete: "off",
|
|
785
|
+
autocorrect: "off",
|
|
786
|
+
spellcheck: "false",
|
|
787
|
+
get "aria-roledescription"() {
|
|
788
|
+
return f["aria-roledescription"] ?? "Number field";
|
|
789
|
+
},
|
|
790
|
+
get "aria-invalid"() {
|
|
791
|
+
return !A().disabled && A().valid === !1 ? "true" : void 0;
|
|
792
|
+
},
|
|
793
|
+
get "aria-labelledby"() {
|
|
794
|
+
return F();
|
|
795
|
+
},
|
|
796
|
+
get "aria-describedby"() {
|
|
797
|
+
return z();
|
|
798
|
+
},
|
|
799
|
+
onFocus: re,
|
|
800
|
+
onBlur: (e) => W(() => ie(e)),
|
|
801
|
+
onInput: ae,
|
|
802
|
+
onKeyDown: Y,
|
|
803
|
+
onPaste: oe
|
|
804
|
+
}, P, te));
|
|
805
|
+
}
|
|
806
|
+
//#endregion
|
|
807
|
+
//#region src/number-field/utils/getViewportRect.ts
|
|
808
|
+
function bt(e, t) {
|
|
809
|
+
let n = t.ownerDocument.defaultView ?? window;
|
|
810
|
+
if (e != null) {
|
|
811
|
+
let n = t.getBoundingClientRect();
|
|
812
|
+
return {
|
|
813
|
+
left: n.left - e / 2,
|
|
814
|
+
top: n.top - e / 2,
|
|
815
|
+
right: n.right + e / 2,
|
|
816
|
+
bottom: n.bottom + e / 2
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
let r = n.visualViewport;
|
|
820
|
+
return r ? {
|
|
821
|
+
left: r.offsetLeft,
|
|
822
|
+
top: r.offsetTop,
|
|
823
|
+
right: r.offsetLeft + r.width,
|
|
824
|
+
bottom: r.offsetTop + r.height
|
|
825
|
+
} : {
|
|
826
|
+
left: 0,
|
|
827
|
+
top: 0,
|
|
828
|
+
right: n.document.documentElement.clientWidth,
|
|
829
|
+
bottom: n.document.documentElement.clientHeight
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
//#endregion
|
|
833
|
+
//#region src/number-field/scrub-area/NumberFieldScrubAreaContext.ts
|
|
834
|
+
var xt = Symbol("NumberFieldScrubAreaContext"), St = F(xt);
|
|
835
|
+
function Ct() {
|
|
836
|
+
let e = G(St);
|
|
837
|
+
if (e === xt) throw Error("Base UI: NumberFieldScrubAreaContext is missing. NumberFieldScrubArea parts must be placed within <NumberField.ScrubArea>.");
|
|
838
|
+
return e;
|
|
839
|
+
}
|
|
840
|
+
//#endregion
|
|
841
|
+
//#region src/number-field/scrub-area/NumberFieldScrubArea.tsx
|
|
842
|
+
var wt = /* @__PURE__ */ N("<span>"), Tt = {
|
|
843
|
+
"touch-action": "none",
|
|
844
|
+
"-webkit-user-select": "none",
|
|
845
|
+
"user-select": "none"
|
|
846
|
+
};
|
|
847
|
+
function Et(e) {
|
|
848
|
+
let r = We(), a = e, o = e, [s, c] = R(), [l, u] = R(), [d, f] = R(!1), [h, v] = R(!1), [y, b] = R(!1), x = L(() => r.state().disabled), C = L(() => r.state().readOnly), T = r.state, E = V(o, "render", "class", "direction", "onPointerDown", "pixelSensitivity", "ref", "style", "teleportDistance"), O = L(() => p(e.class, T())), te = t(e, T, (e) => (() => {
|
|
849
|
+
var t = D(wt);
|
|
850
|
+
return j(t, e, !1), k(), t;
|
|
851
|
+
})()), A = L(() => {
|
|
852
|
+
let t = m(e.style, T());
|
|
853
|
+
return typeof t == "string" ? `touch-action:none;-webkit-user-select:none;user-select:none;${t}` : S(Tt, t === !1 ? void 0 : t);
|
|
854
|
+
}), ne = L(() => n(T(), Pe)), M = {
|
|
855
|
+
x: 0,
|
|
856
|
+
y: 0
|
|
857
|
+
}, N = !1, P = !1, F = null, z, U;
|
|
858
|
+
function W() {
|
|
859
|
+
z !== void 0 && (U?.clearTimeout(z), z = void 0, U = void 0);
|
|
860
|
+
}
|
|
861
|
+
function G(e, t, n) {
|
|
862
|
+
let r = e.ownerDocument.defaultView?.visualViewport?.scale ?? 1;
|
|
863
|
+
e.style.transform = `translate3d(${t}px,${n}px,0) scale(${1 / r})`;
|
|
864
|
+
}
|
|
865
|
+
function K(e) {
|
|
866
|
+
let t = l(), n = s();
|
|
867
|
+
if (!t || !n) return;
|
|
868
|
+
let r = bt(a.teleportDistance, n), i = (e, t, n, r) => e + t < n ? r - t : e + t > r ? n - t : e;
|
|
869
|
+
M.x = i(Math.round(M.x + e.movementX), t.offsetWidth / 2, r.left, r.right), M.y = i(Math.round(M.y + e.movementY), t.offsetHeight / 2, r.top, r.bottom), G(t, M.x, M.y);
|
|
870
|
+
}
|
|
871
|
+
function q(e, t) {
|
|
872
|
+
let n = () => {
|
|
873
|
+
b(e), r.setIsScrubbing(e);
|
|
874
|
+
};
|
|
875
|
+
if (!e) {
|
|
876
|
+
n();
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
879
|
+
B(n);
|
|
880
|
+
let i = l();
|
|
881
|
+
i && (M.x = t.clientX - i.offsetWidth / 2, M.y = t.clientY - i.offsetHeight / 2, G(i, M.x, M.y));
|
|
882
|
+
}
|
|
883
|
+
function J(e, t) {
|
|
884
|
+
try {
|
|
885
|
+
s()?.ownerDocument.exitPointerLock();
|
|
886
|
+
} catch {} finally {
|
|
887
|
+
if (N = !1, q(!1, e), r.onValueCommitted(r.lastChangedValue() ?? r.value(), g(i, e)), !P && F != null) {
|
|
888
|
+
let e = t.ownerDocument.defaultView;
|
|
889
|
+
e && F.dispatchEvent(new e.MouseEvent("click", {
|
|
890
|
+
bubbles: !0,
|
|
891
|
+
cancelable: !0
|
|
892
|
+
}));
|
|
893
|
+
}
|
|
894
|
+
P = !1, F = null;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
I(() => ({
|
|
898
|
+
direction: a.direction ?? "horizontal",
|
|
899
|
+
disabled: x(),
|
|
900
|
+
input: r.inputElement(),
|
|
901
|
+
pixelSensitivity: a.pixelSensitivity ?? 2,
|
|
902
|
+
readOnly: C(),
|
|
903
|
+
scrubbing: y()
|
|
904
|
+
}), (e) => {
|
|
905
|
+
if (!e.input || e.disabled || e.readOnly || !e.scrubbing) return;
|
|
906
|
+
let t = e.input, n = t.ownerDocument.defaultView;
|
|
907
|
+
if (!n) return;
|
|
908
|
+
let a = n, o = 0;
|
|
909
|
+
function s(e) {
|
|
910
|
+
N && (Ne() ? (W(), U = a, z = a.setTimeout(J, 20, e, t)) : J(e, t));
|
|
911
|
+
}
|
|
912
|
+
function c(t) {
|
|
913
|
+
if (!N) return;
|
|
914
|
+
t.preventDefault(), K(t);
|
|
915
|
+
let { movementX: n, movementY: a } = t;
|
|
916
|
+
if (o += e.direction === "vertical" ? a : n, Math.abs(o) >= e.pixelSensitivity) {
|
|
917
|
+
o = 0, P = !0;
|
|
918
|
+
let s = (e.direction === "vertical" ? -a : n) * r.getStepAmount(t);
|
|
919
|
+
s !== 0 && (r.setAllowInputSync(!0), r.incrementValue(Math.abs(s), {
|
|
920
|
+
direction: s >= 0 ? 1 : -1,
|
|
921
|
+
event: t,
|
|
922
|
+
reason: i
|
|
923
|
+
}));
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
return a.addEventListener("pointerup", s, !0), a.addEventListener("pointermove", c, !0), () => {
|
|
927
|
+
z !== void 0 && (U?.clearTimeout(z), z = void 0, U = void 0), a.removeEventListener("pointerup", s, !0), a.removeEventListener("pointermove", c, !0);
|
|
928
|
+
};
|
|
929
|
+
}), I(() => ({
|
|
930
|
+
disabled: x(),
|
|
931
|
+
element: s(),
|
|
932
|
+
readOnly: C()
|
|
933
|
+
}), (e) => {
|
|
934
|
+
if (!e.element || e.disabled || e.readOnly) return;
|
|
935
|
+
let t = (e) => {
|
|
936
|
+
e.touches.length === 1 && e.preventDefault();
|
|
937
|
+
};
|
|
938
|
+
return e.element.addEventListener("touchstart", t), () => e.element?.removeEventListener("touchstart", t);
|
|
939
|
+
});
|
|
940
|
+
async function re(e) {
|
|
941
|
+
if (e.defaultPrevented || C() || e.button !== 0 || x()) return;
|
|
942
|
+
let t = e.pointerType === "touch";
|
|
943
|
+
if (f(t), e.pointerType === "mouse" && (e.preventDefault(), r.focusInput()), N = !0, P = !1, F = Dt(e), q(!0, e), !t && !Me()) {
|
|
944
|
+
let t = s() ?? e.currentTarget;
|
|
945
|
+
try {
|
|
946
|
+
await t.ownerDocument.body.requestPointerLock(), v(!1);
|
|
947
|
+
} catch {
|
|
948
|
+
v(!0);
|
|
949
|
+
} finally {
|
|
950
|
+
N && q(!0, e);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
let ie = _(() => a.onPointerDown, () => re);
|
|
955
|
+
return H(() => {
|
|
956
|
+
if (W(), u(void 0), N) {
|
|
957
|
+
N = !1, r.setIsScrubbing(!1);
|
|
958
|
+
try {
|
|
959
|
+
s()?.ownerDocument.exitPointerLock();
|
|
960
|
+
} catch {}
|
|
961
|
+
}
|
|
962
|
+
}), w(St, {
|
|
963
|
+
value: {
|
|
964
|
+
isScrubbing: y,
|
|
965
|
+
isTouchInput: d,
|
|
966
|
+
isPointerLockDenied: h,
|
|
967
|
+
scrubAreaElement: s,
|
|
968
|
+
scrubAreaCursorElement: l,
|
|
969
|
+
setScrubAreaCursorElement: u
|
|
970
|
+
},
|
|
971
|
+
get children() {
|
|
972
|
+
return w(te, ee({
|
|
973
|
+
ref: [((e) => c(e)), a.ref],
|
|
974
|
+
role: "presentation",
|
|
975
|
+
get class() {
|
|
976
|
+
return O();
|
|
977
|
+
},
|
|
978
|
+
get style() {
|
|
979
|
+
return A();
|
|
980
|
+
},
|
|
981
|
+
onPointerDown: ie
|
|
982
|
+
}, ne, E));
|
|
983
|
+
}
|
|
984
|
+
});
|
|
985
|
+
}
|
|
986
|
+
function Dt(e) {
|
|
987
|
+
return e.composedPath?.()[0] ?? e.target;
|
|
988
|
+
}
|
|
989
|
+
//#endregion
|
|
990
|
+
//#region src/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.tsx
|
|
991
|
+
var Ot = /* @__PURE__ */ N("<span>"), kt = {
|
|
992
|
+
position: "fixed",
|
|
993
|
+
top: "0",
|
|
994
|
+
left: "0",
|
|
995
|
+
"pointer-events": "none"
|
|
996
|
+
};
|
|
997
|
+
function At(e) {
|
|
998
|
+
let r = We(), i = Ct(), a = e, o = V(e, "render", "class", "ref", "style"), s = r.state, c = L(() => i.isScrubbing() && !Me() && !i.isTouchInput() && !i.isPointerLockDenied()), l = () => i.scrubAreaElement()?.ownerDocument.body, u = L(() => p(e.class, s())), d = t(e, s, (e) => (() => {
|
|
999
|
+
var t = D(Ot);
|
|
1000
|
+
return j(t, e, !1), k(), t;
|
|
1001
|
+
})()), f = L(() => {
|
|
1002
|
+
let t = m(e.style, s());
|
|
1003
|
+
return typeof t == "string" ? `position:fixed;top:0;left:0;pointer-events:none;${t}` : S(kt, t === !1 ? void 0 : t);
|
|
1004
|
+
}), h = L(() => n(s(), Pe));
|
|
1005
|
+
return I(c, (e) => {
|
|
1006
|
+
e || i.setScrubAreaCursorElement(void 0);
|
|
1007
|
+
}), H(() => {
|
|
1008
|
+
i.setScrubAreaCursorElement(void 0);
|
|
1009
|
+
}), w(P, {
|
|
1010
|
+
get when() {
|
|
1011
|
+
return O(() => !!c())() ? l() : void 0;
|
|
1012
|
+
},
|
|
1013
|
+
keyed: !0,
|
|
1014
|
+
children: (e) => w(C, {
|
|
1015
|
+
mount: e,
|
|
1016
|
+
get children() {
|
|
1017
|
+
return w(d, ee({
|
|
1018
|
+
ref: [((e) => i.setScrubAreaCursorElement(e)), a.ref],
|
|
1019
|
+
role: "presentation",
|
|
1020
|
+
get class() {
|
|
1021
|
+
return u();
|
|
1022
|
+
},
|
|
1023
|
+
get style() {
|
|
1024
|
+
return f();
|
|
1025
|
+
}
|
|
1026
|
+
}, h, o));
|
|
1027
|
+
}
|
|
1028
|
+
})
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
//#endregion
|
|
1032
|
+
//#region src/number-field/index.parts.ts
|
|
1033
|
+
var jt = /* @__PURE__ */ e({
|
|
1034
|
+
Decrement: () => gt,
|
|
1035
|
+
Group: () => Ze,
|
|
1036
|
+
Increment: () => ht,
|
|
1037
|
+
Input: () => yt,
|
|
1038
|
+
Root: () => Ye,
|
|
1039
|
+
ScrubArea: () => Et,
|
|
1040
|
+
ScrubAreaCursor: () => At
|
|
1041
|
+
});
|
|
1042
|
+
//#endregion
|
|
1043
|
+
export { jt as t };
|