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,2270 @@
|
|
|
1
|
+
import { t as e } from "./useRender-CxZ8PI-g.js";
|
|
2
|
+
import { getStateAttributesProps as t } from "./internals/getStateAttributesProps.js";
|
|
3
|
+
import { E as n, S as r, b as i, g as a, h as o, i as s, l as c, r as l, t as u, v as d, w as f, y as p } from "./reasons-Co5CzjKq.js";
|
|
4
|
+
import { n as m, t as h } from "./resolveStyle-XcgAuaKR.js";
|
|
5
|
+
import { createChangeEventDetails as g, createGenericEventDetails as _ } from "./internals/createBaseUIEventDetails.js";
|
|
6
|
+
import { transitionStatusMapping as v } from "./internals/stateAttributesMapping.js";
|
|
7
|
+
import { composeEventHandlers as y } from "./internals/composeEventHandlers.js";
|
|
8
|
+
import { t as b } from "./runOnceAnimationsFinish-CFADb4CN.js";
|
|
9
|
+
import { a as x, c as ee, l as S, n as C, o as w, p as T } from "./dom-BEAeQ9Eb.js";
|
|
10
|
+
import { i as E, n as D, r as O, t as te } from "./compositeNavigation-sxniYTc7.js";
|
|
11
|
+
import { t as k } from "./createAnchorPositioning-D96gu-Dz.js";
|
|
12
|
+
import { t as ne } from "./InternalBackdrop-cSK13gaM.js";
|
|
13
|
+
import { t as A } from "./createAnchoredPopupScrollLock-Cx0cbh1_.js";
|
|
14
|
+
import { t as re } from "./createClickInteraction-CTaIFBiV.js";
|
|
15
|
+
import { c as ie, i as ae, n as oe, r as se, s as ce, t as le } from "./FloatingTree-23B7KKPD.js";
|
|
16
|
+
import { a as ue, n as de, o as fe, t as pe } from "./PopupStore-Du0O57fL.js";
|
|
17
|
+
import { t as me } from "./createTransitionStatus-BL_cPSEA.js";
|
|
18
|
+
import { a as he, i as j, n as ge, o as _e, r as ve } from "./popupStateMapping-C6jQ_LKo.js";
|
|
19
|
+
import { t as M } from "./FocusManager-NP1uPXTi.js";
|
|
20
|
+
import { t as ye } from "./setRef-fXF6OIo3.js";
|
|
21
|
+
import { a as be, i as xe, n as Se, r as N, t as Ce } from "./buttonSemantics-paljfpOX.js";
|
|
22
|
+
import { n as we } from "./DirectionContext-BwMabICS.js";
|
|
23
|
+
import { DEFAULT_FIELD_STATE_ATTRIBUTES as Te, fieldStateAttributesMapping as Ee } from "./internals/field-constants.js";
|
|
24
|
+
import { n as De } from "./FieldRootContext-izCEh80D.js";
|
|
25
|
+
import { n as Oe } from "./FormContext-CwLBtm_d.js";
|
|
26
|
+
import { a as ke, c as Ae, i as je, l as Me, n as Ne, o as Pe, r as Fe, s as Ie, t as Le } from "./mergeStyleValue-DhTA9Nwe.js";
|
|
27
|
+
import { r as Re } from "./LabelableContext-CmQF-TX2.js";
|
|
28
|
+
import { i as ze } from "./scrollable-SRNYlhF7.js";
|
|
29
|
+
import { t as Be } from "./platform-Bk5Q32mf.js";
|
|
30
|
+
import { createComponent as P, delegateEvents as Ve, effect as He, getNextElement as F, memo as Ue, mergeProps as I, ref as We, runHydrationEvents as L, setAttribute as R, setProperty as Ge, spread as z, style as Ke, template as B } from "@solidjs/web";
|
|
31
|
+
import { For as qe, Show as Je, createContext as Ye, createEffect as V, createMemo as H, createSignal as U, createUniqueId as Xe, flush as Ze, omit as W, onCleanup as G, untrack as K, useContext as q } from "solid-js";
|
|
32
|
+
//#region src/internals/overlay/createListNavigation.ts
|
|
33
|
+
function Qe(e) {
|
|
34
|
+
let t = () => e.enabled?.() ?? !0, n = () => e.orientation?.() ?? "vertical", i = (e) => e === "Home" || e === "End" || n() !== "horizontal" && (e === "ArrowDown" || e === "ArrowUp") || n() !== "vertical" && (e === "ArrowLeft" || e === "ArrowRight"), a = null, o = (t) => t === "Home" || t === "ArrowDown" ? !0 : t === "End" || t === "ArrowUp" ? !1 : t === (e.rtl?.() ?? !1 ? "ArrowLeft" : "ArrowRight"), s = (t, r, i = !1) => {
|
|
35
|
+
let a = e.activeIndex() ?? e.selectedIndex?.() ?? -1;
|
|
36
|
+
if (i) a = o(t.key) ? D(r, e.disabledIndices?.()) : te(r, e.disabledIndices?.());
|
|
37
|
+
else {
|
|
38
|
+
let i = e.loopFocus?.() ?? !1, o = i && (e.allowEscape?.() ?? !1), s = O({
|
|
39
|
+
list: r,
|
|
40
|
+
currentIndex: a,
|
|
41
|
+
key: t.key,
|
|
42
|
+
orientation: n(),
|
|
43
|
+
rtl: e.rtl?.() ?? !1,
|
|
44
|
+
loop: o ? a === -1 : i,
|
|
45
|
+
cols: e.cols?.() ?? 1,
|
|
46
|
+
disabledIndices: e.disabledIndices?.()
|
|
47
|
+
}), c = t.key === "Home" || t.key === "End";
|
|
48
|
+
a = s === a && o && a !== -1 && !c ? -1 : s;
|
|
49
|
+
}
|
|
50
|
+
e.onNavigate(a === -1 ? null : a, t), !(e.virtual?.() ?? !1) && a >= 0 && r[a]?.focus({ preventScroll: !0 });
|
|
51
|
+
};
|
|
52
|
+
return V(() => ({
|
|
53
|
+
open: e.context.track().open,
|
|
54
|
+
list: e.list()
|
|
55
|
+
}), (e) => {
|
|
56
|
+
if (!a || !e.open || e.list.length === 0) return;
|
|
57
|
+
let t = a;
|
|
58
|
+
a = null, K(() => s(t.event, e.list, !0));
|
|
59
|
+
}), {
|
|
60
|
+
onKeyDown(n) {
|
|
61
|
+
if (!t() || !i(n.key)) return;
|
|
62
|
+
if (n.preventDefault(), n.stopPropagation(), !e.context.state.open) {
|
|
63
|
+
let t = n.key.startsWith("Arrow");
|
|
64
|
+
if (!(e.openOnArrowKeyDown?.() ?? !0) || !t) return;
|
|
65
|
+
a = { event: n };
|
|
66
|
+
let i = g(r, n, e.context.state.domReferenceElement ?? void 0);
|
|
67
|
+
if (e.context.setOpen(!0, i), i.isCanceled) {
|
|
68
|
+
a = null;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
let o = e.list();
|
|
72
|
+
e.context.state.open && o.length > 0 && (a = null, s(n, o, !0));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
let o = e.list();
|
|
76
|
+
o.length > 0 && s(n, o);
|
|
77
|
+
},
|
|
78
|
+
onItemPointerMove(n, r) {
|
|
79
|
+
!t() || !(e.focusItemOnHover?.() ?? !0) || E(e.list(), r, e.disabledIndices?.()) || (e.onNavigate(r, n), (e.virtual?.() ?? !1) || e.list()[r]?.focus({ preventScroll: !0 }));
|
|
80
|
+
},
|
|
81
|
+
onItemPointerLeave(n) {
|
|
82
|
+
t() && (e.virtual?.() ?? !1) && e.onNavigate(null, n);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/internals/overlay/createTypeahead.ts
|
|
88
|
+
function $e(e) {
|
|
89
|
+
let t = "", n = K(() => e.selectedIndex?.() ?? e.activeIndex() ?? -1), r = null, i, a = () => {
|
|
90
|
+
clearTimeout(i), t = "", n = r ?? n, e.onTyping?.(!1);
|
|
91
|
+
};
|
|
92
|
+
G(a), V(() => ({
|
|
93
|
+
open: e.context.track().open,
|
|
94
|
+
selected: e.selectedIndex?.() ?? null
|
|
95
|
+
}), (e) => {
|
|
96
|
+
(e.open || e.selected === null) && (clearTimeout(i), r = null, t = "");
|
|
97
|
+
});
|
|
98
|
+
let o = (t) => {
|
|
99
|
+
let n = e.elements?.()[t];
|
|
100
|
+
if (n && !w(n) || n?.matches(":disabled")) return !1;
|
|
101
|
+
let r = e.disabledIndices?.();
|
|
102
|
+
return !r || !E([], t, r);
|
|
103
|
+
}, s = (t, n) => {
|
|
104
|
+
let r = e.list();
|
|
105
|
+
if (!r.length) return -1;
|
|
106
|
+
let i = (n % r.length + r.length) % r.length, a = t.toLowerCase();
|
|
107
|
+
for (let e = 0; e < r.length; e += 1) {
|
|
108
|
+
let t = (i + e) % r.length;
|
|
109
|
+
if (r[t]?.toLowerCase().startsWith(a) && o(t)) return t;
|
|
110
|
+
}
|
|
111
|
+
return -1;
|
|
112
|
+
};
|
|
113
|
+
return {
|
|
114
|
+
onKeyDown(c) {
|
|
115
|
+
if (!(e.enabled?.() ?? !0) || c.key.length !== 1 || c.ctrlKey || c.metaKey || c.altKey) return;
|
|
116
|
+
let l = e.list();
|
|
117
|
+
t && c.key === " " && (c.preventDefault(), c.stopPropagation(), e.onTyping?.(!0));
|
|
118
|
+
let u = t === "";
|
|
119
|
+
u && (n = e.selectedIndex?.() ?? e.activeIndex() ?? -1), l.every((e, t) => e && o(t) ? e[0]?.toLowerCase() !== e[1]?.toLowerCase() : !0) && t === c.key && (t = "", n = r ?? n), t += c.key, clearTimeout(i), i = setTimeout(a, e.resetMs?.() ?? 750);
|
|
120
|
+
let d = (u ? e.selectedIndex?.() ?? e.activeIndex() ?? -1 : n) + 1, f = s(t, d);
|
|
121
|
+
f === -1 ? c.key !== " " && a() : (e.context.state.open && c.key !== " " && (c.preventDefault(), c.stopPropagation()), e.onTyping?.(!0), e.onMatch(f), r = f);
|
|
122
|
+
},
|
|
123
|
+
onBlur(t) {
|
|
124
|
+
let n = t.relatedTarget;
|
|
125
|
+
!C(e.context.state.domReferenceElement, n) && !C(e.context.state.floatingElement, n) && a();
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/internals/valueLabel.ts
|
|
131
|
+
function et(e) {
|
|
132
|
+
if (e == null) return "";
|
|
133
|
+
if (typeof e == "string") return e;
|
|
134
|
+
try {
|
|
135
|
+
return JSON.stringify(e) ?? String(e);
|
|
136
|
+
} catch {
|
|
137
|
+
return String(e);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function tt(e) {
|
|
141
|
+
return Array.isArray(e) && e.length > 0 && typeof e[0] == "object" && e[0] != null && Array.isArray(e[0].items);
|
|
142
|
+
}
|
|
143
|
+
function nt(e) {
|
|
144
|
+
return Array.isArray(e) ? tt(e) ? e.flatMap((e) => e.items) : e : [];
|
|
145
|
+
}
|
|
146
|
+
function rt(e) {
|
|
147
|
+
if (e == null) return !1;
|
|
148
|
+
if (!Array.isArray(e)) return Object.hasOwn(e, "null");
|
|
149
|
+
for (let t of nt(e)) {
|
|
150
|
+
let e = t;
|
|
151
|
+
if (e && typeof e == "object" && e.value == null && e.label != null) return !0;
|
|
152
|
+
}
|
|
153
|
+
return !1;
|
|
154
|
+
}
|
|
155
|
+
function it(e, t) {
|
|
156
|
+
if (t && e != null) return t(e) ?? "";
|
|
157
|
+
if (e && typeof e == "object") {
|
|
158
|
+
if ("label" in e && e.label != null) return String(e.label);
|
|
159
|
+
if ("value" in e) return String(e.value);
|
|
160
|
+
}
|
|
161
|
+
return et(e);
|
|
162
|
+
}
|
|
163
|
+
function at(e, t) {
|
|
164
|
+
return t && e != null ? t(e) ?? "" : e && typeof e == "object" && "value" in e && "label" in e ? et(e.value) : et(e);
|
|
165
|
+
}
|
|
166
|
+
function ot(e, t, n) {
|
|
167
|
+
let r = () => it(e, n);
|
|
168
|
+
if (n && e != null) return n(e);
|
|
169
|
+
if (e && typeof e == "object" && "label" in e && e.label != null) return e.label;
|
|
170
|
+
if (t && !Array.isArray(t)) return Object.hasOwn(t, String(e)) ? t[String(e)] ?? r() : r();
|
|
171
|
+
if (Array.isArray(t)) {
|
|
172
|
+
let n = nt(t);
|
|
173
|
+
if (typeof e != "object" || !e) {
|
|
174
|
+
let t = n.find((t) => t && t.value === e);
|
|
175
|
+
return t && t.label != null ? t.label : r();
|
|
176
|
+
}
|
|
177
|
+
if ("value" in e) {
|
|
178
|
+
let t = n.find((t) => t && t.value === e.value);
|
|
179
|
+
if (t && t.label != null) return t.label;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return r();
|
|
183
|
+
}
|
|
184
|
+
function st(e, t, n) {
|
|
185
|
+
return e.flatMap((e, r) => {
|
|
186
|
+
let i = ot(e, t, n);
|
|
187
|
+
return r === 0 ? [i] : [", ", i];
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/internals/filter.ts
|
|
192
|
+
var ct = /* @__PURE__ */ new Map();
|
|
193
|
+
function lt(e) {
|
|
194
|
+
return Array.isArray(e) ? e.map((e) => lt(e)).join(",") : e == null ? "" : String(e);
|
|
195
|
+
}
|
|
196
|
+
function ut(e = {}) {
|
|
197
|
+
let t = {
|
|
198
|
+
usage: "search",
|
|
199
|
+
sensitivity: "base",
|
|
200
|
+
ignorePunctuation: !0,
|
|
201
|
+
...e
|
|
202
|
+
}, n = `${lt(e.locale)}|${JSON.stringify(t)}`, r = ct.get(n);
|
|
203
|
+
if (r) return r;
|
|
204
|
+
let i = new Intl.Collator(e.locale, t), a = {
|
|
205
|
+
contains(e, t, n) {
|
|
206
|
+
if (!t) return !0;
|
|
207
|
+
let r = it(e, n);
|
|
208
|
+
for (let e = 0; e <= r.length - t.length; e += 1) if (i.compare(r.slice(e, e + t.length), t) === 0) return !0;
|
|
209
|
+
return !1;
|
|
210
|
+
},
|
|
211
|
+
startsWith(e, t, n) {
|
|
212
|
+
if (!t) return !0;
|
|
213
|
+
let r = it(e, n);
|
|
214
|
+
return i.compare(r.slice(0, t.length), t) === 0;
|
|
215
|
+
},
|
|
216
|
+
endsWith(e, t, n) {
|
|
217
|
+
if (!t) return !0;
|
|
218
|
+
let r = it(e, n), a = t.length;
|
|
219
|
+
return r.length >= a && i.compare(r.slice(r.length - a), t) === 0;
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
return ct.set(n, a), a;
|
|
223
|
+
}
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/combobox/store/ComboboxItemRegistry.ts
|
|
226
|
+
var dt = class {
|
|
227
|
+
registrations = /* @__PURE__ */ new Map();
|
|
228
|
+
revision;
|
|
229
|
+
setRevision;
|
|
230
|
+
order = 0;
|
|
231
|
+
constructor() {
|
|
232
|
+
let [e, t] = U(0, { ownedWrite: !0 });
|
|
233
|
+
this.revision = e, this.setRevision = t;
|
|
234
|
+
}
|
|
235
|
+
register(e) {
|
|
236
|
+
let t = {
|
|
237
|
+
...e,
|
|
238
|
+
order: this.order
|
|
239
|
+
};
|
|
240
|
+
return this.order += 1, this.registrations.set(e.token, t), this.touch(), () => {
|
|
241
|
+
this.registrations.delete(e.token) && this.touch();
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
touch() {
|
|
245
|
+
this.setRevision((e) => e + 1);
|
|
246
|
+
}
|
|
247
|
+
items() {
|
|
248
|
+
return this.revision(), Array.from(this.registrations.values()).sort(ft);
|
|
249
|
+
}
|
|
250
|
+
indexOf(e) {
|
|
251
|
+
let t = this.items(), n = t.findIndex((t) => t.token === e);
|
|
252
|
+
return n === -1 ? -1 : t[n]?.index() ?? n;
|
|
253
|
+
}
|
|
254
|
+
elements() {
|
|
255
|
+
let e = this.items(), t = [];
|
|
256
|
+
e.forEach((e, n) => {
|
|
257
|
+
t[e.index() ?? n] = e.element();
|
|
258
|
+
});
|
|
259
|
+
for (let e = 0; e < t.length; e += 1) t[e] ??= null;
|
|
260
|
+
return t;
|
|
261
|
+
}
|
|
262
|
+
values() {
|
|
263
|
+
let e = this.items(), t = [];
|
|
264
|
+
return e.forEach((e, n) => {
|
|
265
|
+
t[e.index() ?? n] = e.value();
|
|
266
|
+
}), t;
|
|
267
|
+
}
|
|
268
|
+
labels() {
|
|
269
|
+
return this.elements().map((e) => e?.textContent ?? null);
|
|
270
|
+
}
|
|
271
|
+
disabledIndices() {
|
|
272
|
+
return this.items().flatMap((e, t) => e.disabled() ? [e.index() ?? t] : []);
|
|
273
|
+
}
|
|
274
|
+
size() {
|
|
275
|
+
return this.items().length;
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
function ft(e, t) {
|
|
279
|
+
let n = e.index(), r = t.index();
|
|
280
|
+
if (n !== void 0 && r !== void 0) return n - r;
|
|
281
|
+
let i = e.element(), a = t.element();
|
|
282
|
+
if (i && a && i !== a && i.isConnected && a.isConnected) {
|
|
283
|
+
let e = i.compareDocumentPosition(a);
|
|
284
|
+
if (e & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
|
|
285
|
+
if (e & Node.DOCUMENT_POSITION_PRECEDING) return 1;
|
|
286
|
+
}
|
|
287
|
+
return e.order - t.order;
|
|
288
|
+
}
|
|
289
|
+
//#endregion
|
|
290
|
+
//#region src/combobox/store/ComboboxStore.ts
|
|
291
|
+
function J(e) {
|
|
292
|
+
let [t, n] = U(() => e, { ownedWrite: !0 });
|
|
293
|
+
return [t, (e) => {
|
|
294
|
+
n(() => e);
|
|
295
|
+
}];
|
|
296
|
+
}
|
|
297
|
+
var pt = class extends pe {
|
|
298
|
+
collection = new dt();
|
|
299
|
+
keyboardActive = !0;
|
|
300
|
+
pointerDownItem = null;
|
|
301
|
+
selectionEvent = null;
|
|
302
|
+
chipsContainerElement = null;
|
|
303
|
+
clearElement = null;
|
|
304
|
+
emptyElement = null;
|
|
305
|
+
startDismissElement = null;
|
|
306
|
+
endDismissElement = null;
|
|
307
|
+
activeIndex;
|
|
308
|
+
setActiveIndex;
|
|
309
|
+
selectedIndex;
|
|
310
|
+
setSelectedIndex;
|
|
311
|
+
forceMounted;
|
|
312
|
+
setForceMounted;
|
|
313
|
+
labelId;
|
|
314
|
+
setLabelId;
|
|
315
|
+
listElement;
|
|
316
|
+
setListElement;
|
|
317
|
+
popupSide;
|
|
318
|
+
setPopupSide;
|
|
319
|
+
openMethod;
|
|
320
|
+
setOpenMethod;
|
|
321
|
+
inputInsidePopup;
|
|
322
|
+
setInputInsidePopup;
|
|
323
|
+
inputOwnsFormValue;
|
|
324
|
+
setInputOwnsFormValue;
|
|
325
|
+
constructor(e) {
|
|
326
|
+
super(e), [this.activeIndex, this.setActiveIndex] = J(null), [this.selectedIndex, this.setSelectedIndex] = J(null), [this.forceMounted, this.setForceMounted] = J(!1), [this.labelId, this.setLabelId] = J(void 0), [this.listElement, this.setListElement] = J(null), [this.popupSide, this.setPopupSide] = J(null), [this.openMethod, this.setOpenMethod] = J(null), [this.inputInsidePopup, this.setInputInsidePopup] = J(!0), [this.inputOwnsFormValue, this.setInputOwnsFormValue] = J(!1);
|
|
327
|
+
}
|
|
328
|
+
elements() {
|
|
329
|
+
return this.collection.elements();
|
|
330
|
+
}
|
|
331
|
+
resolvedPopupSide() {
|
|
332
|
+
return this.track().mounted && this.track().positionerElement ? this.popupSide() : null;
|
|
333
|
+
}
|
|
334
|
+
resetAfterClose() {
|
|
335
|
+
this.setOpenMethod(null), this.pointerDownItem = null, this.selectionEvent = null;
|
|
336
|
+
}
|
|
337
|
+
}, mt = Symbol("ComboboxRootContext"), ht = Ye(mt);
|
|
338
|
+
function Y() {
|
|
339
|
+
let e = q(ht);
|
|
340
|
+
if (e === mt) throw Error("Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.");
|
|
341
|
+
return e;
|
|
342
|
+
}
|
|
343
|
+
var gt = Symbol("ComboboxGroupCollectionContext"), _t = Ye(gt);
|
|
344
|
+
function vt() {
|
|
345
|
+
let e = q(_t);
|
|
346
|
+
return e === gt ? void 0 : e;
|
|
347
|
+
}
|
|
348
|
+
//#endregion
|
|
349
|
+
//#region src/combobox/root/AriaCombobox.tsx
|
|
350
|
+
var yt = /* @__PURE__ */ B("<input tabindex=-1 aria-hidden=true>"), bt = /* @__PURE__ */ B("<input type=hidden>"), xt = {
|
|
351
|
+
"clip-path": "inset(50%)",
|
|
352
|
+
overflow: "hidden",
|
|
353
|
+
"white-space": "nowrap",
|
|
354
|
+
border: "0",
|
|
355
|
+
padding: "0",
|
|
356
|
+
width: "1px",
|
|
357
|
+
height: "1px",
|
|
358
|
+
margin: "-1px",
|
|
359
|
+
position: "fixed",
|
|
360
|
+
top: "0",
|
|
361
|
+
left: "0"
|
|
362
|
+
}, St = {
|
|
363
|
+
...xt,
|
|
364
|
+
position: "absolute"
|
|
365
|
+
}, Ct = Symbol("none"), wt = {
|
|
366
|
+
value: Ct,
|
|
367
|
+
index: -1
|
|
368
|
+
};
|
|
369
|
+
function Tt(e) {
|
|
370
|
+
let t = De(!0), r = Oe(), o = Re(), s = we(), c = ie(), l = ce(), u = c ?? new se(), m = Symbol("Combobox"), h = `base-ui-${Xe()}`, v = `base-ui-${Xe()}`, y = Xe(), b = K(() => e.selectedValue !== void 0), x = K(() => e.inputValue !== void 0), S = K(() => e.open !== void 0), w = K(() => e.inputValue !== void 0 || e.defaultInputValue !== void 0), T = H(() => e.selectionMode), E = H(() => e.selectionMode === "multiple"), D = H(() => e.selectionMode === "single"), O = H(() => e.isItemEqualToValue ?? ke), te = () => e.itemCollection ? k : e.itemToStringLabel;
|
|
371
|
+
function k(t) {
|
|
372
|
+
let n = e.itemCollection;
|
|
373
|
+
if (!n) return it(t, e.itemToStringLabel);
|
|
374
|
+
if (!n.hasValue(t, O())) {
|
|
375
|
+
let r = nt(e.filteredItems).find((e) => je(n.value(e), t, O()));
|
|
376
|
+
if (r !== void 0) return n.itemLabel(r);
|
|
377
|
+
}
|
|
378
|
+
return n.label(t, O(), e.itemToStringLabel);
|
|
379
|
+
}
|
|
380
|
+
let ne = (t) => e.itemCollection ? e.itemCollection.value(t) : t, A = () => e.itemCollection?.itemLabel ?? e.itemToStringLabel, de = () => e.itemToStringValue, pe = K(() => {
|
|
381
|
+
let t = e.defaultSelectedValue;
|
|
382
|
+
return t == null ? e.selectionMode === "multiple" ? [] : t ?? null : Array.isArray(t) ? t.slice() : t;
|
|
383
|
+
}), [me, he] = U(() => pe), j = H(() => b ? e.selectedValue ?? null : me()), ge = K(() => w ? e.defaultInputValue ?? e.inputValue ?? "" : e.selectionMode === "single" ? k(j()) : ""), [_e, ve] = U(ge), M = H(() => x ? e.inputValue ?? "" : _e()), [ye, be] = U(!1), [xe, Se] = U(null), [N, Ce] = U(null, { ownedWrite: !0 }), [Te, Ee] = U(null, { ownedWrite: !0 }), [Ne, Fe] = U(null, { ownedWrite: !0 }), [Le, Be] = U(null, { ownedWrite: !0 }), [Ve, I] = U(null, { ownedWrite: !0 }), L = H(() => e.id ?? h), z = H(() => t.disabled() || (e.disabled ?? !1)), B = H(() => e.readOnly ?? !1), Je = H(() => e.required ?? !1), Ye = H(() => e.modal ?? !1), Ze = H(() => e.grid ?? !1), W = H(() => e.virtualized ?? !1), q = H(() => e.inline ?? !1), $e = H(() => e.openOnInputClick ?? !0), et = H(() => e.keepHighlight ?? !1), rt = H(() => e.highlightItemOnHover ?? !0), ot = H(() => e.loopFocus ?? !0), st = H(() => e.submitOnItemClick ?? !1), ct = H(() => e.autoComplete ?? "list"), lt = H(() => e.limit ?? -1), dt = H(() => t.name() ?? e.name), ft = H(() => e.form), J = H(() => e.items !== void 0), mt = H(() => e.filteredItems !== void 0), Y = H(() => e.autoHighlight === "always" ? "always" : e.autoHighlight ? "input-change" : !1), gt = H(() => ut({ locale: e.locale })), _t = H(() => {
|
|
384
|
+
if (e.filter === null) return () => !0;
|
|
385
|
+
if (e.filter !== void 0) return e.filter;
|
|
386
|
+
let t = gt(), n = A();
|
|
387
|
+
return (e, r) => e != null && t.contains(e, r, n);
|
|
388
|
+
}), vt = H(() => xe() ?? String(M()).trim()), Tt = H(() => D() ? k(j()) : ""), kt = H(() => {
|
|
389
|
+
let e = Tt(), t = vt();
|
|
390
|
+
return D() && !ye() && t !== "" && e.length === t.length && gt().contains(e, t);
|
|
391
|
+
}), At = H(() => e.filterQuery ?? (kt() ? "" : vt())), jt = H(() => J() && mt() && kt() && (!e.itemCollection || e.itemCollection.hasValue(j(), O()))), Mt = H(() => nt(e.items)), Nt = H(() => {
|
|
392
|
+
if (e.filteredItems !== void 0 && !jt()) return e.filteredItems;
|
|
393
|
+
let t = e.items;
|
|
394
|
+
if (t === void 0) return [];
|
|
395
|
+
let n = At(), r = lt(), i = _t(), a = A();
|
|
396
|
+
if (tt(t)) {
|
|
397
|
+
let e = [], o = 0;
|
|
398
|
+
for (let s of t) {
|
|
399
|
+
if (r > -1 && o >= r) break;
|
|
400
|
+
let t = r > -1 ? r - o : Infinity, c = n === "" ? s.items.slice(0, t) : [];
|
|
401
|
+
if (n !== "") for (let e of s.items) {
|
|
402
|
+
if (c.length >= t) break;
|
|
403
|
+
i(e, n, a) && c.push(e);
|
|
404
|
+
}
|
|
405
|
+
c.length > 0 && (e.push({
|
|
406
|
+
...s,
|
|
407
|
+
items: c
|
|
408
|
+
}), o += c.length);
|
|
409
|
+
}
|
|
410
|
+
return e;
|
|
411
|
+
}
|
|
412
|
+
let o = Mt();
|
|
413
|
+
if (n === "") return r > -1 ? o.slice(0, r) : o;
|
|
414
|
+
let s = [];
|
|
415
|
+
for (let e of o) {
|
|
416
|
+
if (r > -1 && s.length >= r) break;
|
|
417
|
+
i(e, n, a) && s.push(e);
|
|
418
|
+
}
|
|
419
|
+
return s;
|
|
420
|
+
}), Pt = H(() => {
|
|
421
|
+
let e = Nt();
|
|
422
|
+
return tt(e) ? e.flatMap((e) => e.items) : e;
|
|
423
|
+
}), Ft = H(() => Nt().length === 0), It = !1, Lt = wt, Rt = null, zt = null, Bt = !1, Vt = Et(K(j)), Ht = K(M), Ut = K(vt), X = new pt({
|
|
424
|
+
controlledOpen: () => S ? e.open : void 0,
|
|
425
|
+
floatingId: v,
|
|
426
|
+
nodeId: y,
|
|
427
|
+
onOpenChange: () => (t, n) => {
|
|
428
|
+
X.open() !== t && (!t && e.actionsRef && n.preventUnmountOnClose(), n.reason === "escape-key" && J() && Pt().length === 0 && !X.emptyElement && n.allowPropagation(), e.onOpenChange?.(t, n), !n.isCanceled && on(t, n));
|
|
429
|
+
},
|
|
430
|
+
onOpenChangeComplete: () => e.onOpenChangeComplete
|
|
431
|
+
});
|
|
432
|
+
X.update({ open: K(() => e.open ?? e.defaultOpen ?? !1) }), X.configureTriggerUnmount({ closeOnActiveTriggerUnmount: !1 }), X.setInputOwnsFormValue(K(() => e.selectionMode === "none"));
|
|
433
|
+
let Wt = ae({
|
|
434
|
+
tree: u,
|
|
435
|
+
id: y,
|
|
436
|
+
parentId: l,
|
|
437
|
+
context: () => X.context.floatingRoot
|
|
438
|
+
}), Gt = ue(X, () => Kt(), { onUnmount: () => pn() });
|
|
439
|
+
function Kt() {
|
|
440
|
+
return q() ? X.track().positionerElement?.closest("[role=\"dialog\"]") ?? null : X.track().popupElement;
|
|
441
|
+
}
|
|
442
|
+
let Z = H(() => J() || mt() ? Pt().map(ne) : X.collection.values());
|
|
443
|
+
function qt() {
|
|
444
|
+
let e = X.collection.labels();
|
|
445
|
+
if (!J()) return e;
|
|
446
|
+
let t = Pt().map((e) => it(e, A()));
|
|
447
|
+
return X.forceMounted() ? t.map((t, n) => e[n] ?? t) : t;
|
|
448
|
+
}
|
|
449
|
+
let Jt = H(() => {
|
|
450
|
+
let e = X.collection.elements(), t = Z().length;
|
|
451
|
+
return e.length < t && (e.length = t), e;
|
|
452
|
+
}), Yt = H(() => {
|
|
453
|
+
if (!Ze()) return 1;
|
|
454
|
+
X.collection.items();
|
|
455
|
+
let e = X.listElement()?.querySelector("[role=\"row\"]");
|
|
456
|
+
return Math.max(1, e?.childElementCount ?? 1);
|
|
457
|
+
}), Xt = H(() => {
|
|
458
|
+
let e = j();
|
|
459
|
+
return e == null ? !1 : E() && Array.isArray(e) ? e.length > 0 : !0;
|
|
460
|
+
}), Zt = H(() => {
|
|
461
|
+
let e = j();
|
|
462
|
+
return Array.isArray(e) && e.length > 0;
|
|
463
|
+
}), Qt = H(() => T() === "none" ? M() : j()), $t = H(() => {
|
|
464
|
+
if (T() === "none") return M();
|
|
465
|
+
let t = j();
|
|
466
|
+
return Array.isArray(t) ? t.map((t) => at(t, e.itemToStringValue)) : at(t, e.itemToStringValue);
|
|
467
|
+
}), en = H(() => {
|
|
468
|
+
let t = Qt();
|
|
469
|
+
return Array.isArray(t) ? "" : at(t, e.itemToStringValue);
|
|
470
|
+
}), tn = H(() => E() || T() === "none" && X.inputOwnsFormValue() ? void 0 : dt());
|
|
471
|
+
function nn(t, n, r) {
|
|
472
|
+
if (n === -1) {
|
|
473
|
+
if (Lt === wt) return;
|
|
474
|
+
Lt = wt;
|
|
475
|
+
} else Lt = {
|
|
476
|
+
value: t,
|
|
477
|
+
index: n
|
|
478
|
+
};
|
|
479
|
+
e.onItemHighlighted?.(t, _(r, void 0, { index: n }));
|
|
480
|
+
}
|
|
481
|
+
function Q(e) {
|
|
482
|
+
if (e.selectedIndex !== void 0 && X.setSelectedIndex(e.selectedIndex), e.activeIndex === void 0) return;
|
|
483
|
+
X.setActiveIndex(e.activeIndex);
|
|
484
|
+
let t = e.type || "none";
|
|
485
|
+
e.activeIndex === null ? nn(void 0, -1, t) : nn(K(Z)[e.activeIndex], e.activeIndex, t);
|
|
486
|
+
}
|
|
487
|
+
function rn() {
|
|
488
|
+
let e = X.listElement();
|
|
489
|
+
if (W() || !e) return;
|
|
490
|
+
let t = X.track().popupElement, n = e.firstElementChild ?? e;
|
|
491
|
+
for (; ee(n) && !(t ? !C(t, n) : n.getAttribute("role") === "dialog");) {
|
|
492
|
+
if (ze(n)) {
|
|
493
|
+
n.scrollTop = 0;
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
496
|
+
n = n.parentElement;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
function $(t, n) {
|
|
500
|
+
if (e.onInputValueChange?.(t, n), !n.isCanceled) {
|
|
501
|
+
if (It = n.reason === a, n.reason === "input-change") {
|
|
502
|
+
X.open() && xe() !== null && Se(null);
|
|
503
|
+
let e = n.event, r = e.inputType;
|
|
504
|
+
if (e.type === "compositionend" || r != null && r !== "" && r !== "insertReplacementText") {
|
|
505
|
+
let e = t.trim() !== "";
|
|
506
|
+
e && be(!0), Rt = { hasQuery: e }, rn(), e && Y() && X.activeIndex() == null && (X.open() || q()) && X.setActiveIndex(0);
|
|
507
|
+
}
|
|
508
|
+
} else n.reason === "input-clear" && t === "" && X.inputInsidePopup() && (Rt = {
|
|
509
|
+
hasQuery: !1,
|
|
510
|
+
selection: !0
|
|
511
|
+
});
|
|
512
|
+
x || ve(t);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
function an(e, t) {
|
|
516
|
+
return X.setOpen(e, t);
|
|
517
|
+
}
|
|
518
|
+
function on(e, n) {
|
|
519
|
+
if (e && X.inputInsidePopup() && !q() && xe() !== null && (be(!1), Se(null), M() !== "" && n.reason !== "input-change" && $("", g(a, n.event))), !e && ye()) {
|
|
520
|
+
let e = vt();
|
|
521
|
+
D() ? (q() || Se(e), e === "" && be(!1)) : E() && (q() || Se(e), X.inputInsidePopup() && Q({ activeIndex: null }), (!X.inputInsidePopup() || q()) && $("", g(a, n.event, void 0, { isItemPress: n.reason === p })));
|
|
522
|
+
}
|
|
523
|
+
!e && X.inputInsidePopup() && (n.reason === "focus-out" || n.reason === "outside-press") && (t.setTouched(!0), t.setFocused(!1), t.validationMode() === "onBlur" && t.validation.commit(K(Qt)));
|
|
524
|
+
}
|
|
525
|
+
function sn(t, n) {
|
|
526
|
+
e.onSelectedValueChange?.(t, n), !n.isCanceled && (b || he(() => t), (T() === "none" && X.track().popupElement != null && (e.fillInputOnItemPress ?? !0) || D() && !X.inputInsidePopup()) && $(k(t), g(n.reason, n.event)));
|
|
527
|
+
}
|
|
528
|
+
function cn(e, t) {
|
|
529
|
+
let n = e.target, r = X.selectionEvent ?? e;
|
|
530
|
+
X.selectionEvent = null;
|
|
531
|
+
let i = g(p, r), o = n?.closest("a")?.getAttribute("href");
|
|
532
|
+
if (o) {
|
|
533
|
+
o.startsWith("#") && an(!1, i);
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
if (E()) {
|
|
537
|
+
let e = Array.isArray(j()) ? j() : [], n = Me(e, t, O());
|
|
538
|
+
if (sn(n ? Ae(e, t, O()) : [...e, t], i), i.isCanceled || (N()?.value.trim() ?? "") === "") return;
|
|
539
|
+
X.inputInsidePopup() ? ($("", g(a, i.event, void 0, { isItemPress: !0 })), Rt && !n && (Rt.toggledValue = t)) : an(!1, i);
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
sn(t, i), !i.isCanceled && an(!1, i);
|
|
543
|
+
}
|
|
544
|
+
function ln() {
|
|
545
|
+
let e = t.validation.getInputControl()?.closest("form") ?? Ve()?.form ?? N()?.form;
|
|
546
|
+
e && typeof e.requestSubmit == "function" && e.requestSubmit();
|
|
547
|
+
}
|
|
548
|
+
function un() {
|
|
549
|
+
e.items || X.setForceMounted(!0);
|
|
550
|
+
}
|
|
551
|
+
function dn() {
|
|
552
|
+
N()?.focus();
|
|
553
|
+
}
|
|
554
|
+
function fn(e, t) {
|
|
555
|
+
let n = K(Jt)[e];
|
|
556
|
+
n && (X.selectionEvent = t, n.click(), X.selectionEvent = null);
|
|
557
|
+
}
|
|
558
|
+
function pn() {
|
|
559
|
+
be(!1), Se(null), X.resetAfterClose(), T() === "none" ? Q({
|
|
560
|
+
activeIndex: null,
|
|
561
|
+
selectedIndex: null
|
|
562
|
+
}) : Q({ activeIndex: null });
|
|
563
|
+
let e = N();
|
|
564
|
+
if (E() && e && e.value !== "" && !It && $("", g(a)), D()) {
|
|
565
|
+
if (X.inputInsidePopup()) e && e.value !== "" && $("", g(a));
|
|
566
|
+
else {
|
|
567
|
+
let t = k(j());
|
|
568
|
+
e && e.value !== t && $(t, g(t === "" ? a : f));
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
let mn = { unmount() {
|
|
573
|
+
Gt.forceUnmount();
|
|
574
|
+
} }, hn = H(() => X.open() || q()), gn = H(() => {
|
|
575
|
+
let e = N(), t = e?.tagName === "INPUT", n = e == null || t, r = n || hn(), i = n ? {
|
|
576
|
+
autocomplete: "off",
|
|
577
|
+
spellcheck: "false",
|
|
578
|
+
autocorrect: "off",
|
|
579
|
+
autocapitalize: "none"
|
|
580
|
+
} : {};
|
|
581
|
+
return r && (i.role = "combobox", i["aria-expanded"] = hn() ? "true" : "false", i["aria-haspopup"] = Ze() ? "grid" : "listbox", i["aria-controls"] = hn() ? X.listElement()?.id : void 0, i["aria-autocomplete"] = B() ? "none" : ct()), i;
|
|
582
|
+
}), _n = re({
|
|
583
|
+
context: X.context.floatingRoot,
|
|
584
|
+
enabled: () => !z() && $e(),
|
|
585
|
+
event: () => "mousedown-only",
|
|
586
|
+
toggle: () => !1,
|
|
587
|
+
reason: () => d,
|
|
588
|
+
touchOpenDelay: () => X.inputInsidePopup() ? 0 : 100
|
|
589
|
+
}), vn = fe({
|
|
590
|
+
context: X.context.floatingRoot,
|
|
591
|
+
tree: () => u,
|
|
592
|
+
enabled: () => !z() && !q(),
|
|
593
|
+
outsidePressEvent: () => ({
|
|
594
|
+
mouse: "sloppy",
|
|
595
|
+
touch: "intentional"
|
|
596
|
+
}),
|
|
597
|
+
bubbles: () => q(),
|
|
598
|
+
outsidePress: () => (e) => {
|
|
599
|
+
let t = e.target;
|
|
600
|
+
return !C(Te(), t) && !C(X.clearElement, t) && !C(X.chipsContainerElement, t) && !C(Ne(), t);
|
|
601
|
+
}
|
|
602
|
+
}), yn = Qe({
|
|
603
|
+
context: X.context.floatingRoot,
|
|
604
|
+
enabled: () => !z(),
|
|
605
|
+
list: Jt,
|
|
606
|
+
activeIndex: X.activeIndex,
|
|
607
|
+
selectedIndex: X.selectedIndex,
|
|
608
|
+
virtual: () => !0,
|
|
609
|
+
loopFocus: ot,
|
|
610
|
+
allowEscape: () => ot() && !Y(),
|
|
611
|
+
focusItemOnHover: rt,
|
|
612
|
+
orientation: () => Ze() ? "both" : "vertical",
|
|
613
|
+
cols: Yt,
|
|
614
|
+
rtl: () => s() === "rtl",
|
|
615
|
+
openOnArrowKeyDown: () => !1,
|
|
616
|
+
disabledIndices: () => [],
|
|
617
|
+
onNavigate(e, t) {
|
|
618
|
+
if (!(!t && !X.open() || X.track().transitionStatus === "ending")) {
|
|
619
|
+
if (!t) {
|
|
620
|
+
Q({ activeIndex: e });
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
Q({
|
|
624
|
+
activeIndex: e,
|
|
625
|
+
type: X.keyboardActive ? i : n
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}), bn = {
|
|
630
|
+
store: X,
|
|
631
|
+
tree: u,
|
|
632
|
+
node: Wt,
|
|
633
|
+
presence: Gt,
|
|
634
|
+
id: L,
|
|
635
|
+
items: () => e.items,
|
|
636
|
+
hasItems: J,
|
|
637
|
+
query: vt,
|
|
638
|
+
filteredItems: Nt,
|
|
639
|
+
flatFilteredItems: Pt,
|
|
640
|
+
listEmpty: Ft,
|
|
641
|
+
itemValues: Z,
|
|
642
|
+
itemLabels: qt,
|
|
643
|
+
hasItemCollection: () => e.itemCollection !== void 0,
|
|
644
|
+
selectedValue: j,
|
|
645
|
+
inputValue: M,
|
|
646
|
+
hasSelectedValue: Xt,
|
|
647
|
+
hasSelectionChips: Zt,
|
|
648
|
+
selectionMode: T,
|
|
649
|
+
multiple: E,
|
|
650
|
+
single: D,
|
|
651
|
+
disabled: z,
|
|
652
|
+
readOnly: B,
|
|
653
|
+
required: Je,
|
|
654
|
+
modal: Ye,
|
|
655
|
+
grid: Ze,
|
|
656
|
+
virtualized: W,
|
|
657
|
+
inline: q,
|
|
658
|
+
openOnInputClick: $e,
|
|
659
|
+
autoHighlight: Y,
|
|
660
|
+
keepHighlight: et,
|
|
661
|
+
highlightItemOnHover: rt,
|
|
662
|
+
loopFocus: ot,
|
|
663
|
+
autoComplete: ct,
|
|
664
|
+
submitOnItemClick: st,
|
|
665
|
+
hasInputValueProp: () => w,
|
|
666
|
+
name: dt,
|
|
667
|
+
form: ft,
|
|
668
|
+
itemToStringLabel: te,
|
|
669
|
+
itemToStringValue: de,
|
|
670
|
+
comparator: O,
|
|
671
|
+
inputElement: N,
|
|
672
|
+
setInputElement: Ce,
|
|
673
|
+
triggerElement: Te,
|
|
674
|
+
setTriggerElement: Ee,
|
|
675
|
+
inputGroupElement: Ne,
|
|
676
|
+
setInputGroupElement: Fe,
|
|
677
|
+
internalBackdropElement: Le,
|
|
678
|
+
setInternalBackdropElement: Be,
|
|
679
|
+
setOpen: an,
|
|
680
|
+
setInputValue: $,
|
|
681
|
+
setSelectedValue: sn,
|
|
682
|
+
setIndices: Q,
|
|
683
|
+
handleSelection: cn,
|
|
684
|
+
forceMount: un,
|
|
685
|
+
requestSubmit: ln,
|
|
686
|
+
focusInput: dn,
|
|
687
|
+
clickHighlightedItem: fn,
|
|
688
|
+
listNavigation: yn,
|
|
689
|
+
dismiss: vn,
|
|
690
|
+
click: _n,
|
|
691
|
+
cols: Yt,
|
|
692
|
+
referenceAria: gn,
|
|
693
|
+
expanded: hn,
|
|
694
|
+
field: t,
|
|
695
|
+
formContext: r
|
|
696
|
+
}, xn = {
|
|
697
|
+
id: h,
|
|
698
|
+
name: void 0,
|
|
699
|
+
value: Qt,
|
|
700
|
+
getValue: $t,
|
|
701
|
+
getControl: () => X.inputInsidePopup() ? Te() : N()
|
|
702
|
+
};
|
|
703
|
+
X.context.floatingRoot.context.data.insideElements = () => [
|
|
704
|
+
Le(),
|
|
705
|
+
X.startDismissElement,
|
|
706
|
+
X.endDismissElement
|
|
707
|
+
], V(() => ({
|
|
708
|
+
open: X.open(),
|
|
709
|
+
activeTriggerId: X.activeTriggerId()
|
|
710
|
+
}), () => K(() => X.reconcileTriggers())), V(() => ({
|
|
711
|
+
inline: q(),
|
|
712
|
+
open: X.open()
|
|
713
|
+
}), (e) => {
|
|
714
|
+
e.inline && X.context.floatingRoot.update({ open: !0 });
|
|
715
|
+
}), V(() => ({
|
|
716
|
+
mode: T(),
|
|
717
|
+
inline: q(),
|
|
718
|
+
insidePopup: X.inputInsidePopup()
|
|
719
|
+
}), (e) => X.setInputOwnsFormValue(e.mode === "none" && (e.inline || !e.insidePopup))), V(() => ({
|
|
720
|
+
open: X.open(),
|
|
721
|
+
selected: j(),
|
|
722
|
+
mode: T(),
|
|
723
|
+
values: Z(),
|
|
724
|
+
compare: O(),
|
|
725
|
+
isMultiple: E()
|
|
726
|
+
}), (e) => {
|
|
727
|
+
e.open || (X.pointerDownItem = null, e.mode !== "none" && K(() => Q({ selectedIndex: Ie(e.values, e.selected, e.compare, e.isMultiple) })));
|
|
728
|
+
}), V(() => ({
|
|
729
|
+
activeIndex: X.activeIndex(),
|
|
730
|
+
values: Z(),
|
|
731
|
+
input: M(),
|
|
732
|
+
open: X.open(),
|
|
733
|
+
inline: q(),
|
|
734
|
+
highlight: Y()
|
|
735
|
+
}), (e) => K(() => Sn(e)));
|
|
736
|
+
function Sn(e) {
|
|
737
|
+
let t = Rt;
|
|
738
|
+
if (t) {
|
|
739
|
+
let n = e.open || e.inline || X.track().positionerElement?.hidden === !1;
|
|
740
|
+
if (t.hasQuery) e.highlight && n && X.setActiveIndex(0), Rt = null;
|
|
741
|
+
else if (String(e.input).trim() === "" && (Rt = null, n)) {
|
|
742
|
+
let n = t.selection;
|
|
743
|
+
e.highlight === "always" && !n && T() === "none" && X.setActiveIndex(0), queueMicrotask(() => K(() => {
|
|
744
|
+
if (!X.open() && !q() || (N()?.value.trim() ?? "") !== "") return;
|
|
745
|
+
let e = j(), r = E(), i = r && Array.isArray(e) ? e.length > 0 : T() !== "none" && e != null;
|
|
746
|
+
if (i || n) {
|
|
747
|
+
let n = Pe(Z(), t.toggledValue, O());
|
|
748
|
+
X.setActiveIndex(i ? n === -1 ? Ie(Z(), e, O(), r) : n : null);
|
|
749
|
+
} else Y() === "always" && X.setActiveIndex(0);
|
|
750
|
+
}));
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
if (!e.open && !e.inline) return;
|
|
754
|
+
if (e.activeIndex == null) {
|
|
755
|
+
if (e.highlight === "always" && e.values.length > 0) {
|
|
756
|
+
X.setActiveIndex(0);
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
nn(void 0, -1, f);
|
|
760
|
+
return;
|
|
761
|
+
}
|
|
762
|
+
if (e.activeIndex >= e.values.length) {
|
|
763
|
+
nn(void 0, -1, f), X.setActiveIndex(null);
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
let n = e.values[e.activeIndex], r = Lt.value, i = r !== Ct && je(n, r, O());
|
|
767
|
+
(Lt.index !== e.activeIndex || !i) && nn(n, e.activeIndex, f);
|
|
768
|
+
}
|
|
769
|
+
V(() => ({
|
|
770
|
+
index: X.activeIndex(),
|
|
771
|
+
elements: Jt()
|
|
772
|
+
}), (e) => {
|
|
773
|
+
e.index == null || !X.keyboardActive || e.elements[e.index]?.scrollIntoView?.({
|
|
774
|
+
block: "nearest",
|
|
775
|
+
inline: "nearest"
|
|
776
|
+
});
|
|
777
|
+
}), V(() => ({
|
|
778
|
+
open: X.open(),
|
|
779
|
+
mounted: Gt.mounted(),
|
|
780
|
+
count: Z().length
|
|
781
|
+
}), (e) => {
|
|
782
|
+
if (!e.open) {
|
|
783
|
+
Bt = !1, zt = null;
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
786
|
+
!e.mounted || e.count === 0 || Bt || (Bt = !0, K(() => {
|
|
787
|
+
let t = zt;
|
|
788
|
+
if (zt = null, X.activeIndex() != null || ye()) return;
|
|
789
|
+
let n = T() === "none" ? null : Ie(Z(), j(), O(), E());
|
|
790
|
+
if (n != null) {
|
|
791
|
+
Q({
|
|
792
|
+
activeIndex: n,
|
|
793
|
+
selectedIndex: n
|
|
794
|
+
});
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
if (t && (T() !== "none" || Y() !== !1)) {
|
|
798
|
+
Q({ activeIndex: t === "first" ? 0 : e.count - 1 });
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
801
|
+
Y() === "always" && Q({ activeIndex: 0 });
|
|
802
|
+
}));
|
|
803
|
+
}), V(() => ({
|
|
804
|
+
mode: T(),
|
|
805
|
+
input: M(),
|
|
806
|
+
selected: j(),
|
|
807
|
+
isMultiple: E()
|
|
808
|
+
}), (e) => {
|
|
809
|
+
if (e.mode === "none") {
|
|
810
|
+
t.setFilled(String(e.input) !== "");
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
t.setFilled(e.isMultiple ? Array.isArray(e.selected) && e.selected.length > 0 : e.selected != null);
|
|
814
|
+
}), V(() => ({
|
|
815
|
+
hasItems: J(),
|
|
816
|
+
highlight: Y(),
|
|
817
|
+
count: Pt().length
|
|
818
|
+
}), (e) => {
|
|
819
|
+
e.hasItems && e.highlight && e.count === 0 && K(() => Q({ activeIndex: null }));
|
|
820
|
+
}), V(() => ({
|
|
821
|
+
query: vt(),
|
|
822
|
+
open: X.open()
|
|
823
|
+
}), (e) => {
|
|
824
|
+
let t = Ut;
|
|
825
|
+
Ut = e.query, !(t === e.query || !e.open) && e.query !== "" && e.query !== String(ge) && be(!0);
|
|
826
|
+
});
|
|
827
|
+
function Cn() {
|
|
828
|
+
let e = k(j());
|
|
829
|
+
M() !== e && $(e, g(f));
|
|
830
|
+
}
|
|
831
|
+
V(() => ({
|
|
832
|
+
selected: j(),
|
|
833
|
+
mode: T(),
|
|
834
|
+
compare: O()
|
|
835
|
+
}), (e) => {
|
|
836
|
+
let n = Vt;
|
|
837
|
+
Dt(e.selected, n, e.compare) || (Vt = Et(e.selected), e.mode !== "none" && K(() => {
|
|
838
|
+
r.clearError(dt()), t.setDirty(!Ot(e.selected, t.validityData().initialValue, e.compare)), t.validation.change(e.selected), D() && !w && !X.inputInsidePopup() && Cn();
|
|
839
|
+
}));
|
|
840
|
+
}), V(() => ({
|
|
841
|
+
input: M(),
|
|
842
|
+
mode: T()
|
|
843
|
+
}), (e) => {
|
|
844
|
+
let n = Ht;
|
|
845
|
+
Ht = e.input, n !== e.input && e.mode === "none" && K(() => {
|
|
846
|
+
r.clearError(dt()), t.setDirty(e.input !== t.validityData().initialValue), t.validation.change(e.input);
|
|
847
|
+
});
|
|
848
|
+
}), V(() => ({
|
|
849
|
+
items: e.items,
|
|
850
|
+
label: Tt()
|
|
851
|
+
}), (e, t) => {
|
|
852
|
+
!t || e.items === t.items && e.label === t.label || K(() => {
|
|
853
|
+
!D() || w || X.inputInsidePopup() || ye() || Cn();
|
|
854
|
+
});
|
|
855
|
+
}), V(() => ({
|
|
856
|
+
disabled: z(),
|
|
857
|
+
id: L(),
|
|
858
|
+
name: e.name,
|
|
859
|
+
control: X.inputInsidePopup() ? Te() : N()
|
|
860
|
+
}), (e) => {
|
|
861
|
+
xn.id = e.id, xn.name = e.name, t.registerFieldControl(m, e.disabled || !e.control ? void 0 : xn);
|
|
862
|
+
}), V(Ve, (e) => {
|
|
863
|
+
if (e) return t.validation.registerInput(m, e, () => X.inputInsidePopup() ? Te() : N());
|
|
864
|
+
}), V(() => e.actionsRef, (e) => {
|
|
865
|
+
e?.(mn);
|
|
866
|
+
});
|
|
867
|
+
function wn(e, t) {
|
|
868
|
+
zt = e, X.setOpenMethod("keyboard"), an(!0, g("list-navigation", t, Te() ?? void 0)) || (zt = null);
|
|
869
|
+
}
|
|
870
|
+
function Tn(e) {
|
|
871
|
+
if (!z()) {
|
|
872
|
+
if (!X.open() && !q()) {
|
|
873
|
+
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
874
|
+
e.preventDefault(), e.stopPropagation(), wn(e.key === "ArrowDown" ? "first" : "last", e);
|
|
875
|
+
return;
|
|
876
|
+
}
|
|
877
|
+
yn.onKeyDown(e);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
bn.listNavigation = {
|
|
881
|
+
...yn,
|
|
882
|
+
onKeyDown: Tn
|
|
883
|
+
};
|
|
884
|
+
function En(t) {
|
|
885
|
+
if (t.defaultPrevented || z() || B()) return;
|
|
886
|
+
let n = t.currentTarget.value, r = n.toLowerCase(), i = g(f, t), a = () => K(Z).findIndex((t) => at(t, e.itemToStringValue).toLowerCase() === r || k(t).toLowerCase() === r);
|
|
887
|
+
D() && (un(), e.items && a() === -1 && X.setForceMounted(!0)), queueMicrotask(() => K(() => {
|
|
888
|
+
if (E()) return;
|
|
889
|
+
if (T() === "none") {
|
|
890
|
+
$(n, i);
|
|
891
|
+
return;
|
|
892
|
+
}
|
|
893
|
+
let e = a();
|
|
894
|
+
e === -1 && (e = qt().findIndex((e) => e != null && e.toLowerCase() === r));
|
|
895
|
+
let t = e === -1 ? void 0 : Z()[e];
|
|
896
|
+
t != null && sn(t, i);
|
|
897
|
+
}));
|
|
898
|
+
}
|
|
899
|
+
return G(() => {
|
|
900
|
+
t.registerFieldControl(m, void 0), X.clearInteractionProps(), delete X.context.floatingRoot.context.data.insideElements;
|
|
901
|
+
}), P(ht, {
|
|
902
|
+
value: bn,
|
|
903
|
+
get children() {
|
|
904
|
+
return P(oe, {
|
|
905
|
+
value: u,
|
|
906
|
+
get children() {
|
|
907
|
+
return P(le, {
|
|
908
|
+
get value() {
|
|
909
|
+
return Wt.id ?? null;
|
|
910
|
+
},
|
|
911
|
+
get children() {
|
|
912
|
+
return [
|
|
913
|
+
Ue(() => e.children),
|
|
914
|
+
(() => {
|
|
915
|
+
var n = F(yt);
|
|
916
|
+
return n.addEventListener("change", En), n.addEventListener("focus", () => {
|
|
917
|
+
if (X.inputInsidePopup()) {
|
|
918
|
+
Te()?.focus();
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
(N() ?? Te())?.focus();
|
|
922
|
+
}), We(() => [((e) => I(e)), e.inputRef], n), He(() => ({
|
|
923
|
+
e: tn() == null ? `${L()}-hidden-input` : void 0,
|
|
924
|
+
t: ft(),
|
|
925
|
+
a: tn(),
|
|
926
|
+
o: e.formAutoComplete,
|
|
927
|
+
i: en(),
|
|
928
|
+
n: z(),
|
|
929
|
+
s: Je() && !(E() && Zt()),
|
|
930
|
+
h: B(),
|
|
931
|
+
r: tn() ? St : xt,
|
|
932
|
+
d: o.getAriaDescribedBy(void 0),
|
|
933
|
+
l: t.state().valid === !1 && !z() ? "true" : void 0
|
|
934
|
+
}), ({ e, t, a: r, o: i, i: a, n: o, s, h: c, r: l, d: u, l: d }, f) => {
|
|
935
|
+
e !== f?.e && R(n, "id", e), t !== f?.t && R(n, "form", t), r !== f?.a && R(n, "name", r), i !== f?.o && R(n, "autocomplete", i), Ge(n, "value", a), o !== f?.n && R(n, "disabled", o), s !== f?.s && R(n, "required", s), c !== f?.h && R(n, "readonly", c), Ke(n, l, f?.r), u !== f?.d && R(n, "aria-describedby", u), d !== f?.l && R(n, "aria-invalid", d);
|
|
936
|
+
}), n;
|
|
937
|
+
})(),
|
|
938
|
+
P(qe, {
|
|
939
|
+
get each() {
|
|
940
|
+
return Ue(() => !!(E() && dt()))() ? j() ?? [] : [];
|
|
941
|
+
},
|
|
942
|
+
children: (t) => (() => {
|
|
943
|
+
var n = F(bt);
|
|
944
|
+
return He(() => ({
|
|
945
|
+
e: ft(),
|
|
946
|
+
t: dt(),
|
|
947
|
+
a: at(t, e.itemToStringValue),
|
|
948
|
+
o: z()
|
|
949
|
+
}), ({ e, t, a: r, o: i }, a) => {
|
|
950
|
+
e !== a?.e && R(n, "form", e), t !== a?.t && R(n, "name", t), Ge(n, "value", r), i !== a?.o && R(n, "disabled", i);
|
|
951
|
+
}), n;
|
|
952
|
+
})()
|
|
953
|
+
})
|
|
954
|
+
];
|
|
955
|
+
}
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
function Et(e) {
|
|
963
|
+
return Array.isArray(e) ? e.slice() : e;
|
|
964
|
+
}
|
|
965
|
+
function Dt(e, t, n) {
|
|
966
|
+
return Array.isArray(e) && Array.isArray(t) ? Fe(e, t, n) : Object.is(e, t);
|
|
967
|
+
}
|
|
968
|
+
function Ot(e, t, n) {
|
|
969
|
+
return Array.isArray(e) && Array.isArray(t) ? Fe(e, t, n) : e === t;
|
|
970
|
+
}
|
|
971
|
+
//#endregion
|
|
972
|
+
//#region src/combobox/utils/comboboxPopupId.ts
|
|
973
|
+
function kt(e) {
|
|
974
|
+
return e == null ? void 0 : `${e}-popup`;
|
|
975
|
+
}
|
|
976
|
+
//#endregion
|
|
977
|
+
//#region src/combobox/utils/stateAttributesMapping.ts
|
|
978
|
+
var At = {
|
|
979
|
+
...j,
|
|
980
|
+
...Ee,
|
|
981
|
+
popupSide: (e) => e ? { "data-popup-side": e } : null,
|
|
982
|
+
listEmpty: (e) => e ? { "data-list-empty": "" } : null
|
|
983
|
+
}, jt = { ...ge }, Mt = {
|
|
984
|
+
...ve,
|
|
985
|
+
instant: (e) => e ? { "data-instant": e } : null
|
|
986
|
+
}, Nt = { "data-open": "" }, Pt = { "data-closed": "" }, Ft = {
|
|
987
|
+
open: (e) => e ? Nt : Pt,
|
|
988
|
+
...v
|
|
989
|
+
}, It = {
|
|
990
|
+
...he,
|
|
991
|
+
...v
|
|
992
|
+
}, Lt = /* @__PURE__ */ B("<button>");
|
|
993
|
+
function Rt(n) {
|
|
994
|
+
let i = Y(), a = Re(), o = n, s = n, c = Symbol("ComboboxTrigger"), [l, d] = U(null, { ownedWrite: !0 }), p = H(() => o.nativeButton ?? !0), _ = H(() => i.disabled() || (o.disabled ?? !1)), v = H(() => i.store.inputInsidePopup()), b = H(() => v() ? o.id ?? i.id() : o.id), x = H(() => {
|
|
995
|
+
if (i.store.open()) return v() ? i.store.popupId() ?? kt(i.id()) : i.store.listElement()?.id;
|
|
996
|
+
}), ee = H(() => o["aria-labelledby"] ?? a.labelId() ?? i.store.labelId()), S = H(() => ({
|
|
997
|
+
...i.field.state(),
|
|
998
|
+
readOnly: i.readOnly(),
|
|
999
|
+
open: i.store.open(),
|
|
1000
|
+
disabled: _(),
|
|
1001
|
+
popupSide: i.store.resolvedPopupSide(),
|
|
1002
|
+
listEmpty: i.listEmpty(),
|
|
1003
|
+
placeholder: i.selectionMode() !== "none" && !i.hasSelectedValue()
|
|
1004
|
+
})), w = H(() => m(n.class, S())), E = H(() => h(n.style, S())), D = H(() => t(S(), At)), O = W(s, "aria-labelledby", "render", "class", "disabled", "id", "nativeButton", "onBlur", "onClick", "onFocus", "onKeyDown", "onKeyUp", "onMouseDown", "onPointerDown", "onPointerEnter", "ref", "style"), te = re({
|
|
1005
|
+
context: i.store.context.floatingRoot,
|
|
1006
|
+
enabled: () => !i.disabled(),
|
|
1007
|
+
event: () => "mousedown"
|
|
1008
|
+
}), k = $e({
|
|
1009
|
+
context: i.store.context.floatingRoot,
|
|
1010
|
+
enabled: () => !i.store.open() && !i.readOnly() && !i.disabled() && i.selectionMode() === "single",
|
|
1011
|
+
list: i.itemLabels,
|
|
1012
|
+
elements: () => i.store.collection.elements(),
|
|
1013
|
+
activeIndex: i.store.activeIndex,
|
|
1014
|
+
selectedIndex: i.store.selectedIndex,
|
|
1015
|
+
onMatch(e) {
|
|
1016
|
+
let t = i.itemValues()[e];
|
|
1017
|
+
t !== void 0 && i.setSelectedValue(t, g(f));
|
|
1018
|
+
}
|
|
1019
|
+
}), ne = "", A, ie;
|
|
1020
|
+
de(() => i.store, b, l);
|
|
1021
|
+
function ae(e) {
|
|
1022
|
+
ne = e.pointerType || "", te.onPointerDown(e);
|
|
1023
|
+
}
|
|
1024
|
+
function oe() {
|
|
1025
|
+
i.field.setFocused(!0), !_() && (clearTimeout(A), A = setTimeout(() => i.forceMount(), 0));
|
|
1026
|
+
}
|
|
1027
|
+
function se(e) {
|
|
1028
|
+
K(() => {
|
|
1029
|
+
C(i.store.track().positionerElement, e.relatedTarget) || (i.field.setTouched(!0), i.field.setFocused(!1), i.field.validationMode() === "onBlur" && i.field.validation.commit(i.selectionMode() === "none" ? i.inputValue() : i.selectedValue()), k.onBlur(e));
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
function ce(e) {
|
|
1033
|
+
ie?.();
|
|
1034
|
+
let t = T(e), n = (t) => {
|
|
1035
|
+
ie = void 0;
|
|
1036
|
+
let n = t.target;
|
|
1037
|
+
if (C(e, n) || C(i.store.track().positionerElement, n) || C(i.store.listElement(), n)) return;
|
|
1038
|
+
let r = e.getBoundingClientRect();
|
|
1039
|
+
t.clientX >= r.left && t.clientX <= r.right && t.clientY >= r.top && t.clientY <= r.bottom || i.setOpen(!1, g(u, t));
|
|
1040
|
+
};
|
|
1041
|
+
t.addEventListener("mouseup", n, { once: !0 }), ie = () => t.removeEventListener("mouseup", n);
|
|
1042
|
+
}
|
|
1043
|
+
function le(e) {
|
|
1044
|
+
if (_()) return;
|
|
1045
|
+
let t = e.currentTarget;
|
|
1046
|
+
v() || i.store.context.floatingRoot.update({ domReferenceElement: t }), i.forceMount(), ne !== "touch" && (i.focusInput(), v() || e.preventDefault()), i.store.open() || (i.store.setOpenMethod(ne || "mouse"), v() && ce(t)), te.onMouseDown(e);
|
|
1047
|
+
}
|
|
1048
|
+
function ue(e) {
|
|
1049
|
+
e.detail === 0 && i.store.setOpenMethod("keyboard"), te.onClick(e);
|
|
1050
|
+
}
|
|
1051
|
+
function fe(e) {
|
|
1052
|
+
_() || (k.onKeyDown(e), (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), e.stopPropagation(), i.store.setOpenMethod("keyboard"), i.setOpen(!0, g(r, e)), i.focusInput()));
|
|
1053
|
+
}
|
|
1054
|
+
let pe = y(() => o.onBlur, () => se), me = y(() => K(() => _() ? N : void 0), () => o.onClick, () => ue), he = y(() => o.onFocus, () => oe), j = y(() => K(() => _() ? xe : void 0), () => o.onKeyDown, () => fe, () => K(() => p() ? void 0 : Ce)), ge = y(() => K(() => _() ? be : void 0), () => o.onKeyUp, () => K(() => p() ? void 0 : Se)), _e = y(() => K(() => _() ? be : void 0), () => o.onMouseDown, () => le), ve = y(() => K(() => _() ? N : void 0), () => o.onPointerDown, () => ae), M = y(() => o.onPointerEnter, () => (e) => {
|
|
1055
|
+
ne = e.pointerType || "";
|
|
1056
|
+
});
|
|
1057
|
+
V(() => ({
|
|
1058
|
+
id: b(),
|
|
1059
|
+
element: l(),
|
|
1060
|
+
insidePopup: v()
|
|
1061
|
+
}), (e) => (i.setTriggerElement(e.element), a.registerControlId(c, e.insidePopup ? e.id : void 0), () => {
|
|
1062
|
+
K(i.triggerElement) === e.element && i.setTriggerElement(null);
|
|
1063
|
+
})), G(() => {
|
|
1064
|
+
clearTimeout(A), ie?.(), a.registerControlId(c, void 0);
|
|
1065
|
+
});
|
|
1066
|
+
let ye = e(n, () => S(), (e) => (() => {
|
|
1067
|
+
var t = F(Lt);
|
|
1068
|
+
return z(t, e, !1), L(), t;
|
|
1069
|
+
})());
|
|
1070
|
+
return P(ye, I({
|
|
1071
|
+
ref: [((e) => d(e)), o.ref],
|
|
1072
|
+
get id() {
|
|
1073
|
+
return b();
|
|
1074
|
+
},
|
|
1075
|
+
get type() {
|
|
1076
|
+
return p() ? "button" : void 0;
|
|
1077
|
+
},
|
|
1078
|
+
get tabindex() {
|
|
1079
|
+
return v() ? 0 : -1;
|
|
1080
|
+
},
|
|
1081
|
+
get role() {
|
|
1082
|
+
return v() ? "combobox" : void 0;
|
|
1083
|
+
},
|
|
1084
|
+
get disabled() {
|
|
1085
|
+
return p() && _() ? !0 : void 0;
|
|
1086
|
+
},
|
|
1087
|
+
get "aria-disabled"() {
|
|
1088
|
+
return !p() && _() ? "true" : void 0;
|
|
1089
|
+
},
|
|
1090
|
+
get "aria-expanded"() {
|
|
1091
|
+
return i.store.open() ? "true" : "false";
|
|
1092
|
+
},
|
|
1093
|
+
get "aria-haspopup"() {
|
|
1094
|
+
return v() ? "dialog" : "listbox";
|
|
1095
|
+
},
|
|
1096
|
+
get "aria-controls"() {
|
|
1097
|
+
return x();
|
|
1098
|
+
},
|
|
1099
|
+
get "aria-required"() {
|
|
1100
|
+
return v() && i.required() ? "true" : void 0;
|
|
1101
|
+
},
|
|
1102
|
+
get "aria-readonly"() {
|
|
1103
|
+
return v() && i.readOnly() ? "true" : void 0;
|
|
1104
|
+
},
|
|
1105
|
+
get "aria-labelledby"() {
|
|
1106
|
+
return ee();
|
|
1107
|
+
},
|
|
1108
|
+
get "aria-invalid"() {
|
|
1109
|
+
return S().valid === !1 && !_() ? "true" : void 0;
|
|
1110
|
+
},
|
|
1111
|
+
"data-base-ui-click-trigger": "",
|
|
1112
|
+
get class() {
|
|
1113
|
+
return w();
|
|
1114
|
+
},
|
|
1115
|
+
get style() {
|
|
1116
|
+
return E();
|
|
1117
|
+
},
|
|
1118
|
+
onBlur: pe,
|
|
1119
|
+
onClick: me,
|
|
1120
|
+
onFocus: he,
|
|
1121
|
+
onKeyDown: j,
|
|
1122
|
+
onKeyUp: ge,
|
|
1123
|
+
onMouseDown: _e,
|
|
1124
|
+
onPointerDown: ve,
|
|
1125
|
+
onPointerEnter: M
|
|
1126
|
+
}, D, O));
|
|
1127
|
+
}
|
|
1128
|
+
//#endregion
|
|
1129
|
+
//#region src/combobox/chips/ComboboxChipsContext.ts
|
|
1130
|
+
var zt = class {
|
|
1131
|
+
registrations = /* @__PURE__ */ new Map();
|
|
1132
|
+
revision;
|
|
1133
|
+
setRevision;
|
|
1134
|
+
order = 0;
|
|
1135
|
+
orders = /* @__PURE__ */ new Map();
|
|
1136
|
+
constructor() {
|
|
1137
|
+
let [e, t] = U(0, { ownedWrite: !0 });
|
|
1138
|
+
this.revision = e, this.setRevision = t;
|
|
1139
|
+
}
|
|
1140
|
+
register(e, t) {
|
|
1141
|
+
return this.registrations.set(e, t), this.orders.set(e, this.order), this.order += 1, this.touch(), () => {
|
|
1142
|
+
this.registrations.delete(e) && (this.orders.delete(e), this.touch());
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1145
|
+
touch() {
|
|
1146
|
+
this.setRevision((e) => e + 1);
|
|
1147
|
+
}
|
|
1148
|
+
tokens() {
|
|
1149
|
+
return this.revision(), Array.from(this.registrations.keys()).sort((e, t) => {
|
|
1150
|
+
let n = this.registrations.get(e)?.() ?? null, r = this.registrations.get(t)?.() ?? null;
|
|
1151
|
+
if (n && r && n !== r) {
|
|
1152
|
+
let e = n.compareDocumentPosition(r);
|
|
1153
|
+
if (e & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
|
|
1154
|
+
if (e & Node.DOCUMENT_POSITION_PRECEDING) return 1;
|
|
1155
|
+
}
|
|
1156
|
+
return (this.orders.get(e) ?? 0) - (this.orders.get(t) ?? 0);
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
elements() {
|
|
1160
|
+
return this.tokens().map((e) => this.registrations.get(e)?.() ?? null);
|
|
1161
|
+
}
|
|
1162
|
+
indexOf(e) {
|
|
1163
|
+
return this.tokens().indexOf(e);
|
|
1164
|
+
}
|
|
1165
|
+
size() {
|
|
1166
|
+
return this.tokens().length;
|
|
1167
|
+
}
|
|
1168
|
+
}, Bt = Symbol("ComboboxChipsContext"), Vt = Ye(Bt);
|
|
1169
|
+
function Ht() {
|
|
1170
|
+
let e = q(Vt);
|
|
1171
|
+
return e === Bt ? void 0 : e;
|
|
1172
|
+
}
|
|
1173
|
+
function Ut() {
|
|
1174
|
+
let e = Ht();
|
|
1175
|
+
if (!e) throw Error("Base UI: ComboboxChipsContext is missing. Chip parts must be placed within <Combobox.Chips>.");
|
|
1176
|
+
return e;
|
|
1177
|
+
}
|
|
1178
|
+
//#endregion
|
|
1179
|
+
//#region src/combobox/positioner/ComboboxPositionerContext.ts
|
|
1180
|
+
var X = Symbol("ComboboxPositionerContext"), Wt = Ye(X);
|
|
1181
|
+
function Gt(e = !1) {
|
|
1182
|
+
let t = q(Wt);
|
|
1183
|
+
if (t === X) {
|
|
1184
|
+
if (e) return;
|
|
1185
|
+
throw Error("Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component.");
|
|
1186
|
+
}
|
|
1187
|
+
return t;
|
|
1188
|
+
}
|
|
1189
|
+
//#endregion
|
|
1190
|
+
//#region src/combobox/utils/ComboboxInternalDismissButton.tsx
|
|
1191
|
+
var Kt = /* @__PURE__ */ B("<span role=button aria-label=Dismiss>"), Z = {
|
|
1192
|
+
"clip-path": "inset(50%)",
|
|
1193
|
+
overflow: "hidden",
|
|
1194
|
+
"white-space": "nowrap",
|
|
1195
|
+
border: "0",
|
|
1196
|
+
padding: "0",
|
|
1197
|
+
width: "1px",
|
|
1198
|
+
height: "1px",
|
|
1199
|
+
margin: "-1px",
|
|
1200
|
+
position: "absolute",
|
|
1201
|
+
top: "0",
|
|
1202
|
+
left: "0"
|
|
1203
|
+
};
|
|
1204
|
+
function qt(e) {
|
|
1205
|
+
let t = Y();
|
|
1206
|
+
function n(e) {
|
|
1207
|
+
t.setOpen(!1, g(s, e, e.currentTarget));
|
|
1208
|
+
}
|
|
1209
|
+
var r = F(Kt);
|
|
1210
|
+
return r.$$keydown = (e) => {
|
|
1211
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
|
|
1212
|
+
}, r.$$click = n, We(() => (t) => e.ref?.(t), r), He(() => Z, (e, t) => {
|
|
1213
|
+
Ke(r, e, t);
|
|
1214
|
+
}), L(), r;
|
|
1215
|
+
}
|
|
1216
|
+
Ve(["click", "keydown"]);
|
|
1217
|
+
//#endregion
|
|
1218
|
+
//#region src/combobox/utils/parts.ts
|
|
1219
|
+
function Jt(e) {
|
|
1220
|
+
return e === "rtl" ? ["ArrowRight", "ArrowLeft"] : ["ArrowLeft", "ArrowRight"];
|
|
1221
|
+
}
|
|
1222
|
+
function Yt(e, t) {
|
|
1223
|
+
let n = e >= t - 1 ? t - 2 : e;
|
|
1224
|
+
return n >= 0 ? n : void 0;
|
|
1225
|
+
}
|
|
1226
|
+
//#endregion
|
|
1227
|
+
//#region src/combobox/input/ComboboxInput.tsx
|
|
1228
|
+
var Xt = /* @__PURE__ */ B("<input>");
|
|
1229
|
+
function Zt(r) {
|
|
1230
|
+
let s = Y(), l = Ht(), u = Gt(!0), d = Re(), p = we(), _ = r, v = r, b = `base-ui-${Xe()}`, x = u !== void 0, ee = H(() => x || s.inline()), S = H(() => !ee() || s.modal()), C = H(() => _.id ?? (ee() ? b : s.id())), w = H(() => s.field.disabled() || s.disabled() || (_.disabled ?? !1)), T = H(() => s.selectionMode() === "none" && !x), [E, D] = U(null), O = !1, te = null, k = !1, ne = H(() => x ? {
|
|
1231
|
+
...s.field.state(),
|
|
1232
|
+
...Te
|
|
1233
|
+
} : s.field.state()), A = H(() => ({
|
|
1234
|
+
...ne(),
|
|
1235
|
+
open: s.store.open(),
|
|
1236
|
+
disabled: w(),
|
|
1237
|
+
readOnly: s.readOnly(),
|
|
1238
|
+
popupSide: s.store.resolvedPopupSide(),
|
|
1239
|
+
listEmpty: s.listEmpty()
|
|
1240
|
+
})), re = H(() => m(r.class, A())), ie = H(() => h(r.style, A())), ae = H(() => t(A(), At)), oe = H(() => {
|
|
1241
|
+
let e = s.store.activeIndex();
|
|
1242
|
+
return e == null ? void 0 : `${s.id()}-${e}`;
|
|
1243
|
+
}), se = W(v, "render", "class", "disabled", "id", "onBlur", "onCompositionEnd", "onCompositionStart", "onFocus", "onInput", "onKeyDown", "onMouseDown", "onPointerDown", "onPointerMove", "ref", "style");
|
|
1244
|
+
function ce() {
|
|
1245
|
+
s.setIndices({
|
|
1246
|
+
activeIndex: null,
|
|
1247
|
+
selectedIndex: null,
|
|
1248
|
+
type: s.store.keyboardActive ? i : n
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
function le() {
|
|
1252
|
+
if (s.field.setFocused(!0), !s.inline() || !k) return;
|
|
1253
|
+
k = !1;
|
|
1254
|
+
let e = te;
|
|
1255
|
+
e != null && s.itemValues()[e] !== void 0 && s.setIndices({ activeIndex: e });
|
|
1256
|
+
}
|
|
1257
|
+
function ue() {
|
|
1258
|
+
s.field.setTouched(!0), s.field.setFocused(!1);
|
|
1259
|
+
let e = s.store.activeIndex();
|
|
1260
|
+
s.inline() && e !== null && s.autoHighlight() !== "always" && (te = e, k = !0, s.setIndices({ activeIndex: null })), s.field.validationMode() === "onBlur" && s.field.validation.commit(s.selectionMode() === "none" ? s.inputValue() : s.selectedValue());
|
|
1261
|
+
}
|
|
1262
|
+
function de(e) {
|
|
1263
|
+
Be() || (O = !0, D(e.currentTarget.value));
|
|
1264
|
+
}
|
|
1265
|
+
function fe(e) {
|
|
1266
|
+
O = !1;
|
|
1267
|
+
let t = e.currentTarget.value;
|
|
1268
|
+
D(null), s.setInputValue(t, g(o, e));
|
|
1269
|
+
}
|
|
1270
|
+
function pe(e, t, n) {
|
|
1271
|
+
s.readOnly() || w() || !e || !n || (s.setOpen(!0, g(o, t)), s.autoHighlight() || ce());
|
|
1272
|
+
}
|
|
1273
|
+
function me(e) {
|
|
1274
|
+
let t = e.currentTarget, n = !e.inputType || e.inputType === "insertReplacementText", r = O || !n;
|
|
1275
|
+
if (O) {
|
|
1276
|
+
let n = t.value;
|
|
1277
|
+
D(n), n === "" && !s.openOnInputClick() && !s.store.inputInsidePopup() && s.setOpen(!1, g(a, e));
|
|
1278
|
+
let i = n.trim(), o = !!s.autoHighlight() && i !== "";
|
|
1279
|
+
pe(i, e, r), s.store.open() && s.store.activeIndex() !== null && !o && ce();
|
|
1280
|
+
return;
|
|
1281
|
+
}
|
|
1282
|
+
let i = g(o, e);
|
|
1283
|
+
if (s.setInputValue(t.value, i), i.isCanceled) {
|
|
1284
|
+
t.value = s.inputValue();
|
|
1285
|
+
return;
|
|
1286
|
+
}
|
|
1287
|
+
let c = t.value === "", l = g(a, e);
|
|
1288
|
+
c && !s.store.inputInsidePopup() && (s.selectionMode() === "single" && s.setSelectedValue(null, l), s.openOnInputClick() || s.setOpen(!1, l)), pe(t.value.trim(), e, r), s.store.open() && s.store.activeIndex() !== null && !s.autoHighlight() && ce();
|
|
1289
|
+
}
|
|
1290
|
+
function he(e) {
|
|
1291
|
+
if (!l) return;
|
|
1292
|
+
let t = e.currentTarget, n = l.highlightedChipIndex(), r = l.chips.size(), [i, a] = Jt(p()), o = s.selectedValue(), c = Array.isArray(o) ? o : [];
|
|
1293
|
+
if (n !== void 0) {
|
|
1294
|
+
if (e.key === i) return e.preventDefault(), n > 0 ? n - 1 : void 0;
|
|
1295
|
+
if (e.key === a) return e.preventDefault(), n < r - 1 ? n + 1 : void 0;
|
|
1296
|
+
if (e.key === "Backspace" || e.key === "Delete") {
|
|
1297
|
+
e.preventDefault();
|
|
1298
|
+
let t = Yt(n, c.length);
|
|
1299
|
+
return ce(), t;
|
|
1300
|
+
}
|
|
1301
|
+
return;
|
|
1302
|
+
}
|
|
1303
|
+
if (e.key === i && (t.selectionStart ?? 0) === 0 && c.length > 0) return e.preventDefault(), r > 0 ? r - 1 : void 0;
|
|
1304
|
+
}
|
|
1305
|
+
function j(e) {
|
|
1306
|
+
let t = s.selectedValue(), n = s.selectionMode() === "multiple" && Array.isArray(t) ? t.length === 0 : t === null, r = g(c, e);
|
|
1307
|
+
s.setInputValue("", r), s.setSelectedValue(s.selectionMode() === "multiple" ? [] : null, r), !n && !s.inline() && !r.isPropagationAllowed && e.stopPropagation();
|
|
1308
|
+
}
|
|
1309
|
+
function ge(e) {
|
|
1310
|
+
let t = !w() && !s.readOnly(), n = e.ctrlKey || e.shiftKey || e.altKey || e.metaKey;
|
|
1311
|
+
if (!w() && !n && (s.store.keyboardActive = !0), s.grid() && s.store.activeIndex() == null && (e.key === "ArrowLeft" || e.key === "ArrowRight") || s.listNavigation.onKeyDown(e), s.dismiss.onKeyDown(e), !t || n) {
|
|
1312
|
+
s.readOnly() && e.key === "Enter" && s.store.open() && s.store.activeIndex() !== null && (e.preventDefault(), e.stopPropagation());
|
|
1313
|
+
return;
|
|
1314
|
+
}
|
|
1315
|
+
let r = e.currentTarget, i = p() === "rtl";
|
|
1316
|
+
if (e.key === "Home" || e.key === "End") {
|
|
1317
|
+
e.preventDefault(), e.stopPropagation();
|
|
1318
|
+
let t = r.scrollWidth - r.clientWidth, n = e.key === "Home", a = Qt() && i === n ? r.value.length : n ? 0 : r.value.length;
|
|
1319
|
+
r.setSelectionRange(a, a), r.scrollLeft = n ? 0 : i ? -t : t;
|
|
1320
|
+
return;
|
|
1321
|
+
}
|
|
1322
|
+
if (!s.presence.mounted() && e.key === "Escape") {
|
|
1323
|
+
j(e);
|
|
1324
|
+
return;
|
|
1325
|
+
}
|
|
1326
|
+
if (l && e.key === "Backspace" && r.value === "" && l.highlightedChipIndex() === void 0 && Array.isArray(s.selectedValue()) && s.selectedValue().length > 0) {
|
|
1327
|
+
let t = s.selectedValue(), n = l.chips.size(), r = n > 0 ? n - 1 : t.length - 1;
|
|
1328
|
+
ce(), s.setSelectedValue(t.filter((e, t) => t !== r), g(f, e));
|
|
1329
|
+
return;
|
|
1330
|
+
}
|
|
1331
|
+
if (l) {
|
|
1332
|
+
let t = l.highlightedChipIndex() !== void 0, n = he(e);
|
|
1333
|
+
l.setHighlightedChipIndex(n), n === void 0 ? t && s.focusInput() : l.chips.elements()[n]?.focus();
|
|
1334
|
+
}
|
|
1335
|
+
if (e.keyCode !== 229 && e.key === "Enter" && s.store.open()) {
|
|
1336
|
+
let t = s.store.activeIndex();
|
|
1337
|
+
if (t === null) {
|
|
1338
|
+
if (s.inline()) return;
|
|
1339
|
+
s.setOpen(!1, g(f, e));
|
|
1340
|
+
return;
|
|
1341
|
+
}
|
|
1342
|
+
e.preventDefault(), e.stopPropagation(), s.clickHighlightedItem(t, e);
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
function _e() {
|
|
1346
|
+
s.store.keyboardActive = !1;
|
|
1347
|
+
}
|
|
1348
|
+
let ve = y(() => _.onBlur, () => ue), M = y(() => _.onCompositionEnd, () => fe), ye = y(() => _.onCompositionStart, () => de), be = y(() => _.onFocus, () => le), xe = y(() => _.onInput, () => me), Se = y(() => _.onKeyDown, () => ge), N = y(() => _.onMouseDown, () => (e) => s.click.onMouseDown(e)), Ce = y(() => _.onPointerDown, () => (e) => {
|
|
1349
|
+
_e(), s.click.onPointerDown(e);
|
|
1350
|
+
}), Ee = y(() => _.onPointerMove, () => _e);
|
|
1351
|
+
V(() => ({
|
|
1352
|
+
insidePopup: ee(),
|
|
1353
|
+
owns: T()
|
|
1354
|
+
}), (e) => {
|
|
1355
|
+
s.store.setInputInsidePopup(e.insidePopup), s.store.setInputOwnsFormValue(e.owns), e.insidePopup && !s.hasInputValueProp() && K(() => s.setInputValue("", g(f)));
|
|
1356
|
+
}), G(() => {
|
|
1357
|
+
K(s.inputElement) === De && s.setInputElement(null);
|
|
1358
|
+
});
|
|
1359
|
+
let De = null, Oe = e(r, () => A(), (e) => (() => {
|
|
1360
|
+
var t = F(Xt);
|
|
1361
|
+
return z(t, e, !1), L(), t;
|
|
1362
|
+
})());
|
|
1363
|
+
return [P(Je, {
|
|
1364
|
+
get when() {
|
|
1365
|
+
return Ue(() => !!s.store.open())() ? S() : s.store.open();
|
|
1366
|
+
},
|
|
1367
|
+
get children() {
|
|
1368
|
+
return P(qt, { ref: (e) => {
|
|
1369
|
+
s.store.startDismissElement = e;
|
|
1370
|
+
} });
|
|
1371
|
+
}
|
|
1372
|
+
}), P(Oe, I({
|
|
1373
|
+
ref: [((e) => {
|
|
1374
|
+
De = e, s.setInputElement(e);
|
|
1375
|
+
}), _.ref],
|
|
1376
|
+
get id() {
|
|
1377
|
+
return C();
|
|
1378
|
+
},
|
|
1379
|
+
get value() {
|
|
1380
|
+
return E() ?? s.inputValue();
|
|
1381
|
+
},
|
|
1382
|
+
get disabled() {
|
|
1383
|
+
return w();
|
|
1384
|
+
},
|
|
1385
|
+
get readonly() {
|
|
1386
|
+
return s.readOnly();
|
|
1387
|
+
},
|
|
1388
|
+
get required() {
|
|
1389
|
+
return Ue(() => s.selectionMode() === "none")() ? s.required() : void 0;
|
|
1390
|
+
},
|
|
1391
|
+
get form() {
|
|
1392
|
+
return s.form();
|
|
1393
|
+
},
|
|
1394
|
+
get name() {
|
|
1395
|
+
return Ue(() => !!T())() ? s.name() : void 0;
|
|
1396
|
+
},
|
|
1397
|
+
get "aria-readonly"() {
|
|
1398
|
+
return s.readOnly() ? "true" : void 0;
|
|
1399
|
+
},
|
|
1400
|
+
get "aria-required"() {
|
|
1401
|
+
return s.required() ? "true" : void 0;
|
|
1402
|
+
},
|
|
1403
|
+
get "aria-labelledby"() {
|
|
1404
|
+
return d.labelId();
|
|
1405
|
+
},
|
|
1406
|
+
get "aria-describedby"() {
|
|
1407
|
+
return d.getAriaDescribedBy(void 0);
|
|
1408
|
+
},
|
|
1409
|
+
get "aria-activedescendant"() {
|
|
1410
|
+
return oe();
|
|
1411
|
+
},
|
|
1412
|
+
get "aria-invalid"() {
|
|
1413
|
+
return A().valid === !1 && !w() ? "true" : void 0;
|
|
1414
|
+
},
|
|
1415
|
+
"data-base-ui-click-trigger": "",
|
|
1416
|
+
get class() {
|
|
1417
|
+
return re();
|
|
1418
|
+
},
|
|
1419
|
+
get style() {
|
|
1420
|
+
return ie();
|
|
1421
|
+
},
|
|
1422
|
+
onBlur: ve,
|
|
1423
|
+
onCompositionEnd: M,
|
|
1424
|
+
onCompositionStart: ye,
|
|
1425
|
+
onFocus: be,
|
|
1426
|
+
onInput: xe,
|
|
1427
|
+
onKeyDown: Se,
|
|
1428
|
+
onMouseDown: N,
|
|
1429
|
+
onPointerDown: Ce,
|
|
1430
|
+
onPointerMove: Ee
|
|
1431
|
+
}, () => s.referenceAria(), ae, se))];
|
|
1432
|
+
}
|
|
1433
|
+
function Qt() {
|
|
1434
|
+
return typeof navigator < "u" && navigator.userAgent.includes("Firefox");
|
|
1435
|
+
}
|
|
1436
|
+
//#endregion
|
|
1437
|
+
//#region src/combobox/utils/handleInputPress.ts
|
|
1438
|
+
function $t(e, t, n, r, i) {
|
|
1439
|
+
if (e.baseUIHandlerPrevented || r) return;
|
|
1440
|
+
let a = e.target, o = x(a) ? a : null;
|
|
1441
|
+
o !== e.currentTarget && (i?.(o) || S(o)) || (e.preventDefault(), !n && (t.focusInput(), t.openOnInputClick() && t.setOpen(!0, g(d, e))));
|
|
1442
|
+
}
|
|
1443
|
+
//#endregion
|
|
1444
|
+
//#region src/combobox/input-group/ComboboxInputGroup.tsx
|
|
1445
|
+
var en = /* @__PURE__ */ B("<div>");
|
|
1446
|
+
function tn(n) {
|
|
1447
|
+
let r = Y(), i = n, a = n, o = H(() => ({
|
|
1448
|
+
...r.field.state(),
|
|
1449
|
+
open: r.store.open(),
|
|
1450
|
+
disabled: r.disabled(),
|
|
1451
|
+
readOnly: r.readOnly(),
|
|
1452
|
+
popupSide: r.store.resolvedPopupSide(),
|
|
1453
|
+
listEmpty: r.listEmpty(),
|
|
1454
|
+
placeholder: r.selectionMode() !== "none" && !r.hasSelectedValue()
|
|
1455
|
+
})), s = H(() => m(n.class, o())), c = H(() => h(n.style, o())), l = H(() => t(o(), At)), u = W(a, "render", "class", "onMouseDown", "ref", "style"), d = y(() => i.onMouseDown, () => (e) => $t(e, r, r.disabled(), r.readOnly(), (e) => C(r.store.chipsContainerElement, e)));
|
|
1456
|
+
G(() => {
|
|
1457
|
+
K(r.inputGroupElement) === f && r.setInputGroupElement(null);
|
|
1458
|
+
});
|
|
1459
|
+
let f = null, p = e(n, () => o(), (e) => (() => {
|
|
1460
|
+
var t = F(en);
|
|
1461
|
+
return z(t, e, !1), L(), t;
|
|
1462
|
+
})());
|
|
1463
|
+
return P(p, I({
|
|
1464
|
+
ref: [((e) => {
|
|
1465
|
+
f = e, r.setInputGroupElement(e);
|
|
1466
|
+
}), i.ref],
|
|
1467
|
+
role: "group",
|
|
1468
|
+
get class() {
|
|
1469
|
+
return s();
|
|
1470
|
+
},
|
|
1471
|
+
get style() {
|
|
1472
|
+
return c();
|
|
1473
|
+
},
|
|
1474
|
+
onMouseDown: d
|
|
1475
|
+
}, l, u));
|
|
1476
|
+
}
|
|
1477
|
+
//#endregion
|
|
1478
|
+
//#region src/combobox/icon/ComboboxIcon.tsx
|
|
1479
|
+
var nn = /* @__PURE__ */ B("<span>");
|
|
1480
|
+
function Q(n) {
|
|
1481
|
+
let r = Y(), i = n, a = n, o = H(() => ({ open: r.store.open() })), s = H(() => m(n.class, o())), c = H(() => h(n.style, o())), l = H(() => t(o(), he)), u = W(a, "render", "class", "ref", "style"), d = e(n, () => o(), (e) => (() => {
|
|
1482
|
+
var t = F(nn);
|
|
1483
|
+
return z(t, e, !1), L(), t;
|
|
1484
|
+
})());
|
|
1485
|
+
return P(d, I({
|
|
1486
|
+
ref: [i.ref],
|
|
1487
|
+
"aria-hidden": "true",
|
|
1488
|
+
get class() {
|
|
1489
|
+
return s();
|
|
1490
|
+
},
|
|
1491
|
+
get style() {
|
|
1492
|
+
return c();
|
|
1493
|
+
}
|
|
1494
|
+
}, l, u, { get children() {
|
|
1495
|
+
return n.children ?? "▼";
|
|
1496
|
+
} }));
|
|
1497
|
+
}
|
|
1498
|
+
//#endregion
|
|
1499
|
+
//#region src/combobox/clear/ComboboxClear.tsx
|
|
1500
|
+
var rn = /* @__PURE__ */ B("<button>");
|
|
1501
|
+
function $(r) {
|
|
1502
|
+
let a = Y(), o = r, s = r, c = H(() => o.nativeButton ?? !0), u = H(() => a.field.disabled() || a.disabled() || (o.disabled ?? !1)), d = H(() => {
|
|
1503
|
+
let e = a.selectionMode();
|
|
1504
|
+
return e === "none" ? a.inputValue() !== "" : e === "single" ? a.selectedValue() != null : a.hasSelectionChips();
|
|
1505
|
+
}), f = me(() => d()), p = H(() => (o.keepMounted ?? !1) || f.mounted()), _ = H(() => ({
|
|
1506
|
+
open: a.store.open(),
|
|
1507
|
+
disabled: u(),
|
|
1508
|
+
visible: d(),
|
|
1509
|
+
transitionStatus: f.transitionStatus()
|
|
1510
|
+
})), v = H(() => m(r.class, _())), x = H(() => h(r.style, _())), ee = H(() => t(_(), It)), S = W(s, "render", "class", "disabled", "keepMounted", "nativeButton", "onClick", "onKeyDown", "onKeyUp", "onMouseDown", "ref", "style"), C = null;
|
|
1511
|
+
V(() => ({
|
|
1512
|
+
visible: d(),
|
|
1513
|
+
status: f.transitionStatus(),
|
|
1514
|
+
element: C
|
|
1515
|
+
}), (e) => {
|
|
1516
|
+
if (e.visible || e.status !== "ending" || !e.element) return;
|
|
1517
|
+
let t = new AbortController();
|
|
1518
|
+
return b(e.element, () => {
|
|
1519
|
+
K(d) || f.setMounted(!1);
|
|
1520
|
+
}, t.signal), () => t.abort();
|
|
1521
|
+
});
|
|
1522
|
+
function w(e) {
|
|
1523
|
+
if (u() || a.readOnly()) return;
|
|
1524
|
+
let t = a.store.keyboardActive ? i : n;
|
|
1525
|
+
a.setInputValue("", g(l, e)), a.selectionMode() === "none" ? a.setIndices({
|
|
1526
|
+
activeIndex: null,
|
|
1527
|
+
type: t
|
|
1528
|
+
}) : (a.setSelectedValue(Array.isArray(a.selectedValue()) ? [] : null, g(l, e)), a.setIndices({
|
|
1529
|
+
activeIndex: null,
|
|
1530
|
+
selectedIndex: null,
|
|
1531
|
+
type: t
|
|
1532
|
+
})), a.focusInput();
|
|
1533
|
+
}
|
|
1534
|
+
let T = y(() => K(() => u() ? N : void 0), () => o.onClick, () => w), E = y(() => o.onKeyDown, () => K(() => c() ? void 0 : Ce)), D = y(() => K(() => u() ? be : void 0), () => o.onKeyUp, () => K(() => c() ? void 0 : Se)), O = y(() => o.onMouseDown, () => (e) => e.preventDefault()), te = e(r, () => _(), (e) => (() => {
|
|
1535
|
+
var t = F(rn);
|
|
1536
|
+
return z(t, e, !1), L(), t;
|
|
1537
|
+
})());
|
|
1538
|
+
return P(Je, {
|
|
1539
|
+
get when() {
|
|
1540
|
+
return p();
|
|
1541
|
+
},
|
|
1542
|
+
get children() {
|
|
1543
|
+
return P(te, I({
|
|
1544
|
+
ref: [((e) => {
|
|
1545
|
+
C = e, a.store.clearElement = e;
|
|
1546
|
+
}), o.ref],
|
|
1547
|
+
get type() {
|
|
1548
|
+
return c() ? "button" : void 0;
|
|
1549
|
+
},
|
|
1550
|
+
tabindex: -1,
|
|
1551
|
+
get disabled() {
|
|
1552
|
+
return c() && u() ? !0 : void 0;
|
|
1553
|
+
},
|
|
1554
|
+
get "aria-disabled"() {
|
|
1555
|
+
return !c() && u() ? "true" : void 0;
|
|
1556
|
+
},
|
|
1557
|
+
get class() {
|
|
1558
|
+
return v();
|
|
1559
|
+
},
|
|
1560
|
+
get style() {
|
|
1561
|
+
return x();
|
|
1562
|
+
},
|
|
1563
|
+
onClick: T,
|
|
1564
|
+
onKeyDown: E,
|
|
1565
|
+
onKeyUp: D,
|
|
1566
|
+
onMouseDown: O
|
|
1567
|
+
}, ee, S, { get children() {
|
|
1568
|
+
return r.children ?? "x";
|
|
1569
|
+
} }));
|
|
1570
|
+
}
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
//#endregion
|
|
1574
|
+
//#region src/combobox/collection/ComboboxCollection.tsx
|
|
1575
|
+
function an(e) {
|
|
1576
|
+
let t = Y(), n = vt(), r = H(() => n?.items() ?? t.filteredItems());
|
|
1577
|
+
return P(qe, {
|
|
1578
|
+
get each() {
|
|
1579
|
+
return r();
|
|
1580
|
+
},
|
|
1581
|
+
get children() {
|
|
1582
|
+
return e.children;
|
|
1583
|
+
}
|
|
1584
|
+
});
|
|
1585
|
+
}
|
|
1586
|
+
//#endregion
|
|
1587
|
+
//#region src/combobox/list/ComboboxList.tsx
|
|
1588
|
+
var on = /* @__PURE__ */ B("<div>");
|
|
1589
|
+
function sn(t) {
|
|
1590
|
+
let n = Y(), r = Gt(!0), i = t, a = t, o = H(() => ({ empty: n.listEmpty() })), s = H(() => m(t.class, o())), c = H(() => h(t.style, o())), l = W(a, "render", "children", "class", "id", "onKeyDown", "ref", "style");
|
|
1591
|
+
function u(e) {
|
|
1592
|
+
if (n.disabled() || n.readOnly() || (n.store.keyboardActive = !0, e.key !== "Enter")) return;
|
|
1593
|
+
let t = n.store.activeIndex();
|
|
1594
|
+
t != null && (e.preventDefault(), e.stopPropagation(), n.clickHighlightedItem(t, e));
|
|
1595
|
+
}
|
|
1596
|
+
let d = y(() => i.onKeyDown, () => u), [f, p] = U(null, { ownedWrite: !0 });
|
|
1597
|
+
V(f, (e) => {
|
|
1598
|
+
if (!e) return;
|
|
1599
|
+
let t = () => {
|
|
1600
|
+
n.store.keyboardActive = !1;
|
|
1601
|
+
}, r = () => {
|
|
1602
|
+
n.store.keyboardActive = !0;
|
|
1603
|
+
};
|
|
1604
|
+
return e.addEventListener("pointermove", t, !0), e.addEventListener("keydown", r, !0), () => {
|
|
1605
|
+
e.removeEventListener("pointermove", t, !0), e.removeEventListener("keydown", r, !0);
|
|
1606
|
+
};
|
|
1607
|
+
}), G(() => {
|
|
1608
|
+
let e = K(f);
|
|
1609
|
+
n.store.listElement() === e && n.store.setListElement(null), !r && n.store.state.positionerElement === e && n.store.setPositionerElement(null);
|
|
1610
|
+
});
|
|
1611
|
+
let g = H(() => {
|
|
1612
|
+
let e = t.children;
|
|
1613
|
+
return typeof e == "function" && !Ne(e) ? P(an, { children: e }) : e;
|
|
1614
|
+
}), _ = e(t, () => o(), (e) => (() => {
|
|
1615
|
+
var t = F(on);
|
|
1616
|
+
return z(t, e, !1), L(), t;
|
|
1617
|
+
})());
|
|
1618
|
+
return P(_, I({
|
|
1619
|
+
ref: [((e) => {
|
|
1620
|
+
p(e), n.store.setListElement(e), r || n.store.setPositionerElement(e);
|
|
1621
|
+
}), i.ref],
|
|
1622
|
+
get id() {
|
|
1623
|
+
return i.id ?? n.store.context.floatingId;
|
|
1624
|
+
},
|
|
1625
|
+
get role() {
|
|
1626
|
+
return n.grid() ? "grid" : "listbox";
|
|
1627
|
+
},
|
|
1628
|
+
tabindex: -1,
|
|
1629
|
+
get "aria-multiselectable"() {
|
|
1630
|
+
return n.multiple() ? "true" : void 0;
|
|
1631
|
+
},
|
|
1632
|
+
get "aria-readonly"() {
|
|
1633
|
+
return !n.grid() && n.readOnly() ? "true" : void 0;
|
|
1634
|
+
},
|
|
1635
|
+
get class() {
|
|
1636
|
+
return s();
|
|
1637
|
+
},
|
|
1638
|
+
get style() {
|
|
1639
|
+
return c();
|
|
1640
|
+
},
|
|
1641
|
+
onKeyDown: d
|
|
1642
|
+
}, l, { get children() {
|
|
1643
|
+
return g();
|
|
1644
|
+
} }));
|
|
1645
|
+
}
|
|
1646
|
+
//#endregion
|
|
1647
|
+
//#region src/combobox/utils/createInitialLiveRegionTextMutation.ts
|
|
1648
|
+
var cn = "";
|
|
1649
|
+
function ln(e) {
|
|
1650
|
+
let t = e.ownerDocument.createTreeWalker(e, NodeFilter.SHOW_TEXT), n = null;
|
|
1651
|
+
for (; t.nextNode();) {
|
|
1652
|
+
let e = t.currentNode;
|
|
1653
|
+
e.nodeValue !== "" && (n = e);
|
|
1654
|
+
}
|
|
1655
|
+
return n;
|
|
1656
|
+
}
|
|
1657
|
+
function un() {
|
|
1658
|
+
if (typeof navigator > "u") return !1;
|
|
1659
|
+
let e = navigator.platform.toLowerCase();
|
|
1660
|
+
return /^i(os$|p)/.test(e) || e === "macintel" && navigator.maxTouchPoints > 1;
|
|
1661
|
+
}
|
|
1662
|
+
function dn(e) {
|
|
1663
|
+
V(e, (e) => {
|
|
1664
|
+
if (!e || un()) return;
|
|
1665
|
+
let t = ln(e);
|
|
1666
|
+
if (!t) return;
|
|
1667
|
+
let n = t.data, r = `${n}${cn}`;
|
|
1668
|
+
t.nodeValue = r;
|
|
1669
|
+
let i = () => {
|
|
1670
|
+
t.nodeValue === r && (t.nodeValue = n);
|
|
1671
|
+
}, a = setTimeout(i, 200);
|
|
1672
|
+
return () => {
|
|
1673
|
+
clearTimeout(a), i();
|
|
1674
|
+
};
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
//#endregion
|
|
1678
|
+
//#region src/combobox/status/ComboboxStatus.tsx
|
|
1679
|
+
var fn = /* @__PURE__ */ B("<div>");
|
|
1680
|
+
function pn(t) {
|
|
1681
|
+
let n = t, r = t, i = {}, a = H(() => m(t.class, i)), o = H(() => h(t.style, i)), s = W(r, "render", "class", "ref", "style"), [c, l] = U(null, { ownedWrite: !0 });
|
|
1682
|
+
dn(c);
|
|
1683
|
+
let u = e(t, () => i, (e) => (() => {
|
|
1684
|
+
var t = F(fn);
|
|
1685
|
+
return z(t, e, !1), L(), t;
|
|
1686
|
+
})());
|
|
1687
|
+
return P(u, I({
|
|
1688
|
+
ref: [((e) => l(e)), n.ref],
|
|
1689
|
+
role: "status",
|
|
1690
|
+
"aria-live": "polite",
|
|
1691
|
+
"aria-atomic": "true",
|
|
1692
|
+
get class() {
|
|
1693
|
+
return a();
|
|
1694
|
+
},
|
|
1695
|
+
get style() {
|
|
1696
|
+
return o();
|
|
1697
|
+
}
|
|
1698
|
+
}, s));
|
|
1699
|
+
}
|
|
1700
|
+
//#endregion
|
|
1701
|
+
//#region src/combobox/portal/ComboboxPortalContext.ts
|
|
1702
|
+
var mn = Symbol("ComboboxPortalContext"), hn = Ye(mn);
|
|
1703
|
+
function gn() {
|
|
1704
|
+
let e = q(hn);
|
|
1705
|
+
if (e === mn) throw Error("Base UI: <Combobox.Portal> is missing.");
|
|
1706
|
+
return e;
|
|
1707
|
+
}
|
|
1708
|
+
//#endregion
|
|
1709
|
+
//#region src/combobox/portal/ComboboxPortal.tsx
|
|
1710
|
+
function _n(e) {
|
|
1711
|
+
let t = Y(), n = e, r = e, i = H(() => n.keepMounted ?? !1), a = H(() => t.presence.mounted() || i() || t.store.forceMounted()), o = {}, s = H(() => m(e.class, o)), c = H(() => h(e.style, o)), l = W(r, "render", "class", "container", "keepMounted", "ref", "style");
|
|
1712
|
+
return P(Je, {
|
|
1713
|
+
get when() {
|
|
1714
|
+
return a();
|
|
1715
|
+
},
|
|
1716
|
+
get children() {
|
|
1717
|
+
return P(hn, {
|
|
1718
|
+
get value() {
|
|
1719
|
+
return K(i);
|
|
1720
|
+
},
|
|
1721
|
+
get children() {
|
|
1722
|
+
return P(_e, I({
|
|
1723
|
+
get render() {
|
|
1724
|
+
return e.render;
|
|
1725
|
+
},
|
|
1726
|
+
get container() {
|
|
1727
|
+
return n.container;
|
|
1728
|
+
},
|
|
1729
|
+
ref: (e) => ye(n.ref, e),
|
|
1730
|
+
get class() {
|
|
1731
|
+
return s();
|
|
1732
|
+
},
|
|
1733
|
+
get style() {
|
|
1734
|
+
return c();
|
|
1735
|
+
}
|
|
1736
|
+
}, l, { get children() {
|
|
1737
|
+
return e.children;
|
|
1738
|
+
} }));
|
|
1739
|
+
}
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
//#endregion
|
|
1745
|
+
//#region src/combobox/backdrop/ComboboxBackdrop.tsx
|
|
1746
|
+
var vn = /* @__PURE__ */ B("<div>");
|
|
1747
|
+
function yn(n) {
|
|
1748
|
+
let r = Y(), i = n, a = n, o = H(() => ({
|
|
1749
|
+
open: r.store.open(),
|
|
1750
|
+
transitionStatus: r.store.track().transitionStatus
|
|
1751
|
+
})), s = H(() => m(n.class, o())), c = H(() => Le({
|
|
1752
|
+
"user-select": "none",
|
|
1753
|
+
"-webkit-user-select": "none"
|
|
1754
|
+
}, h(n.style, o()))), l = H(() => t(o(), Ft)), u = W(a, "render", "class", "ref", "style"), d = e(n, () => o(), (e) => (() => {
|
|
1755
|
+
var t = F(vn);
|
|
1756
|
+
return z(t, e, !1), L(), t;
|
|
1757
|
+
})());
|
|
1758
|
+
return P(d, I({
|
|
1759
|
+
ref: [i.ref],
|
|
1760
|
+
role: "presentation",
|
|
1761
|
+
get hidden() {
|
|
1762
|
+
return !r.presence.mounted();
|
|
1763
|
+
},
|
|
1764
|
+
get class() {
|
|
1765
|
+
return s();
|
|
1766
|
+
},
|
|
1767
|
+
get style() {
|
|
1768
|
+
return c();
|
|
1769
|
+
}
|
|
1770
|
+
}, l, u));
|
|
1771
|
+
}
|
|
1772
|
+
//#endregion
|
|
1773
|
+
//#region src/combobox/positioner/ComboboxPositioner.tsx
|
|
1774
|
+
var bn = /* @__PURE__ */ B("<div>"), xn = {
|
|
1775
|
+
side: "flip",
|
|
1776
|
+
align: "flip",
|
|
1777
|
+
fallbackAxisSide: "none"
|
|
1778
|
+
};
|
|
1779
|
+
function Sn(n) {
|
|
1780
|
+
let r = gn(), i = Y(), a = we(), o = n, s = n, [c, l] = U(null, { ownedWrite: !0 }), u = H(() => Cn(o.anchor) ?? (i.store.inputInsidePopup() ? i.triggerElement() : i.inputGroupElement() ?? i.inputElement()) ?? null), d = k({
|
|
1781
|
+
reference: u,
|
|
1782
|
+
floating: c,
|
|
1783
|
+
mounted: () => i.presence.mounted() || r,
|
|
1784
|
+
direction: a,
|
|
1785
|
+
positionMethod: () => o.positionMethod ?? "absolute",
|
|
1786
|
+
side: () => o.side ?? "bottom",
|
|
1787
|
+
sideOffset: () => o.sideOffset ?? 0,
|
|
1788
|
+
align: () => o.align ?? "center",
|
|
1789
|
+
alignOffset: () => o.alignOffset ?? 0,
|
|
1790
|
+
collisionBoundary: () => o.collisionBoundary ?? "clipping-ancestors",
|
|
1791
|
+
collisionPadding: () => o.collisionPadding ?? 5,
|
|
1792
|
+
arrowPadding: () => o.arrowPadding ?? 5,
|
|
1793
|
+
sticky: () => o.sticky ?? !1,
|
|
1794
|
+
disableAnchorTracking: () => o.disableAnchorTracking ?? !1,
|
|
1795
|
+
collisionAvoidance: () => o.collisionAvoidance ?? xn
|
|
1796
|
+
}), f = H(() => ({
|
|
1797
|
+
open: i.store.open(),
|
|
1798
|
+
side: d.renderedSide(),
|
|
1799
|
+
align: d.renderedAlign(),
|
|
1800
|
+
anchorHidden: d.anchorHidden(),
|
|
1801
|
+
empty: i.listEmpty()
|
|
1802
|
+
})), p = H(() => m(n.class, f())), g = H(() => Le({
|
|
1803
|
+
...d.styles(),
|
|
1804
|
+
"pointer-events": i.store.open() ? void 0 : "none",
|
|
1805
|
+
transition: i.store.track().transitionStatus === "starting" ? "none" : void 0
|
|
1806
|
+
}, h(n.style, f()))), _ = H(() => t(f(), jt)), v = W(s, "align", "alignOffset", "anchor", "arrowPadding", "render", "class", "collisionAvoidance", "collisionBoundary", "collisionPadding", "disableAnchorTracking", "positionMethod", "ref", "side", "sideOffset", "sticky", "style");
|
|
1807
|
+
A({
|
|
1808
|
+
enabled: () => i.store.open() && i.modal(),
|
|
1809
|
+
touchOpen: () => i.store.openMethod() === "touch",
|
|
1810
|
+
positioner: c,
|
|
1811
|
+
reference: () => i.triggerElement() ?? i.inputElement()
|
|
1812
|
+
}), V(d.renderedSide, (e) => i.store.setPopupSide(e)), G(() => {
|
|
1813
|
+
i.store.state.positionerElement === K(c) && i.store.setPositionerElement(null);
|
|
1814
|
+
});
|
|
1815
|
+
let y = {
|
|
1816
|
+
...d,
|
|
1817
|
+
side: d.renderedSide,
|
|
1818
|
+
align: d.renderedAlign
|
|
1819
|
+
};
|
|
1820
|
+
function b() {
|
|
1821
|
+
let e = null;
|
|
1822
|
+
return G(() => {
|
|
1823
|
+
i.internalBackdropElement() === e && i.setInternalBackdropElement(null);
|
|
1824
|
+
}), P(ne, {
|
|
1825
|
+
ref: (t) => {
|
|
1826
|
+
e = t, i.setInternalBackdropElement(t);
|
|
1827
|
+
},
|
|
1828
|
+
get cutout() {
|
|
1829
|
+
return i.inputGroupElement() ?? i.inputElement() ?? i.triggerElement();
|
|
1830
|
+
},
|
|
1831
|
+
get open() {
|
|
1832
|
+
return i.store.open();
|
|
1833
|
+
}
|
|
1834
|
+
});
|
|
1835
|
+
}
|
|
1836
|
+
let x = e(n, () => f(), (e) => (() => {
|
|
1837
|
+
var t = F(bn);
|
|
1838
|
+
return z(t, e, !1), L(), t;
|
|
1839
|
+
})());
|
|
1840
|
+
return P(Wt, {
|
|
1841
|
+
value: y,
|
|
1842
|
+
get children() {
|
|
1843
|
+
return [P(Je, {
|
|
1844
|
+
get when() {
|
|
1845
|
+
return Ue(() => !!i.presence.mounted())() ? i.modal() : i.presence.mounted();
|
|
1846
|
+
},
|
|
1847
|
+
get children() {
|
|
1848
|
+
return P(b, {});
|
|
1849
|
+
}
|
|
1850
|
+
}), P(x, I({
|
|
1851
|
+
ref: [((e) => {
|
|
1852
|
+
l(e), i.store.setPositionerElement(e);
|
|
1853
|
+
}), o.ref],
|
|
1854
|
+
role: "presentation",
|
|
1855
|
+
get hidden() {
|
|
1856
|
+
return !i.presence.mounted();
|
|
1857
|
+
},
|
|
1858
|
+
get inert() {
|
|
1859
|
+
return !i.store.open() || void 0;
|
|
1860
|
+
},
|
|
1861
|
+
get class() {
|
|
1862
|
+
return p();
|
|
1863
|
+
},
|
|
1864
|
+
get style() {
|
|
1865
|
+
return g();
|
|
1866
|
+
}
|
|
1867
|
+
}, _, v))];
|
|
1868
|
+
}
|
|
1869
|
+
});
|
|
1870
|
+
}
|
|
1871
|
+
function Cn(e) {
|
|
1872
|
+
return typeof e == "function" ? e() : e && "current" in e ? e.current : e;
|
|
1873
|
+
}
|
|
1874
|
+
//#endregion
|
|
1875
|
+
//#region src/combobox/popup/ComboboxPopup.tsx
|
|
1876
|
+
var wn = /* @__PURE__ */ B("<div>");
|
|
1877
|
+
function Tn(n) {
|
|
1878
|
+
let r = Y(), i = Gt(), a = n, o = n, s = H(() => a.id ?? (r.store.inputInsidePopup() ? kt(r.id()) : void 0)), c = H(() => ({
|
|
1879
|
+
open: r.store.open(),
|
|
1880
|
+
side: i.side(),
|
|
1881
|
+
align: i.align(),
|
|
1882
|
+
anchorHidden: i.anchorHidden(),
|
|
1883
|
+
transitionStatus: r.store.track().transitionStatus,
|
|
1884
|
+
empty: r.listEmpty(),
|
|
1885
|
+
instant: r.store.track().instantType
|
|
1886
|
+
})), l = H(() => m(n.class, c())), u = H(() => Le({ transition: c().transitionStatus === "starting" ? "none" : void 0 }, h(n.style, c()))), d = H(() => t(c(), Mt)), f = W(o, "render", "class", "finalFocus", "id", "initialFocus", "onFocus", "ref", "style"), p = H(() => !r.store.inputInsidePopup() || r.modal()), g = H(() => a.initialFocus === void 0 ? r.store.inputInsidePopup() ? (e) => e === "touch" ? r.store.track().popupElement : r.inputElement() : !1 : a.initialFocus), _ = H(() => a.finalFocus == null ? !!r.store.inputInsidePopup() : a.finalFocus);
|
|
1887
|
+
function v(e) {
|
|
1888
|
+
let t = e.target;
|
|
1889
|
+
r.store.openMethod() !== "touch" && (C(r.store.listElement(), t) || t === e.currentTarget) && r.focusInput();
|
|
1890
|
+
}
|
|
1891
|
+
let y = null;
|
|
1892
|
+
V(s, (e) => (r.store.setPopupId(y?.id || e), () => r.store.setPopupId(void 0))), G(() => {
|
|
1893
|
+
r.store.state.popupElement === y && r.store.setPopupElement(null);
|
|
1894
|
+
});
|
|
1895
|
+
let b = e(n, () => c(), (e) => (() => {
|
|
1896
|
+
var t = F(wn);
|
|
1897
|
+
return z(t, e, !1), L(), t;
|
|
1898
|
+
})());
|
|
1899
|
+
return P(M, {
|
|
1900
|
+
get context() {
|
|
1901
|
+
return r.store.context.floatingRoot;
|
|
1902
|
+
},
|
|
1903
|
+
get tree() {
|
|
1904
|
+
return r.tree;
|
|
1905
|
+
},
|
|
1906
|
+
get disabled() {
|
|
1907
|
+
return !r.presence.mounted();
|
|
1908
|
+
},
|
|
1909
|
+
get modal() {
|
|
1910
|
+
return p();
|
|
1911
|
+
},
|
|
1912
|
+
get openInteractionType() {
|
|
1913
|
+
return r.store.openMethod();
|
|
1914
|
+
},
|
|
1915
|
+
get initialFocus() {
|
|
1916
|
+
return g();
|
|
1917
|
+
},
|
|
1918
|
+
get returnFocus() {
|
|
1919
|
+
return _();
|
|
1920
|
+
},
|
|
1921
|
+
get previousFocusableElement() {
|
|
1922
|
+
return r.triggerElement;
|
|
1923
|
+
},
|
|
1924
|
+
referenceElement: () => r.store.inputInsidePopup() ? r.triggerElement() : r.inputElement(),
|
|
1925
|
+
getInsideElements: () => [r.store.startDismissElement, r.store.endDismissElement],
|
|
1926
|
+
get children() {
|
|
1927
|
+
return [P(b, I({
|
|
1928
|
+
ref: [((e) => {
|
|
1929
|
+
y = e, r.store.setPopupElement(e);
|
|
1930
|
+
}), a.ref],
|
|
1931
|
+
get id() {
|
|
1932
|
+
return s();
|
|
1933
|
+
},
|
|
1934
|
+
get role() {
|
|
1935
|
+
return r.store.inputInsidePopup() ? "dialog" : "presentation";
|
|
1936
|
+
},
|
|
1937
|
+
"data-base-ui-focusable": "",
|
|
1938
|
+
get "data-rootownerid"() {
|
|
1939
|
+
return r.node.id;
|
|
1940
|
+
},
|
|
1941
|
+
get class() {
|
|
1942
|
+
return l();
|
|
1943
|
+
},
|
|
1944
|
+
get style() {
|
|
1945
|
+
return u();
|
|
1946
|
+
},
|
|
1947
|
+
get onFocus() {
|
|
1948
|
+
return a.onFocus;
|
|
1949
|
+
},
|
|
1950
|
+
onFocusIn: v
|
|
1951
|
+
}, d, f)), P(Je, {
|
|
1952
|
+
get when() {
|
|
1953
|
+
return p();
|
|
1954
|
+
},
|
|
1955
|
+
get children() {
|
|
1956
|
+
return P(qt, { ref: (e) => {
|
|
1957
|
+
K(() => {
|
|
1958
|
+
r.store.endDismissElement = e;
|
|
1959
|
+
});
|
|
1960
|
+
} });
|
|
1961
|
+
}
|
|
1962
|
+
})];
|
|
1963
|
+
}
|
|
1964
|
+
});
|
|
1965
|
+
}
|
|
1966
|
+
//#endregion
|
|
1967
|
+
//#region src/combobox/arrow/ComboboxArrow.tsx
|
|
1968
|
+
var En = /* @__PURE__ */ B("<div>");
|
|
1969
|
+
function Dn(n) {
|
|
1970
|
+
let r = Y(), i = Gt(), a = n, o = n, s = H(() => ({
|
|
1971
|
+
open: r.store.open(),
|
|
1972
|
+
side: i.side(),
|
|
1973
|
+
align: i.align(),
|
|
1974
|
+
uncentered: i.arrowUncentered()
|
|
1975
|
+
})), c = H(() => m(n.class, s())), l = H(() => Le(i.arrowStyles(), h(n.style, s()))), u = H(() => t(s(), ge)), d = W(o, "render", "class", "ref", "style"), f = null;
|
|
1976
|
+
G(() => {
|
|
1977
|
+
f && i.setArrowElement(null);
|
|
1978
|
+
});
|
|
1979
|
+
let p = e(n, () => s(), (e) => (() => {
|
|
1980
|
+
var t = F(En);
|
|
1981
|
+
return z(t, e, !1), L(), t;
|
|
1982
|
+
})());
|
|
1983
|
+
return P(p, I({
|
|
1984
|
+
ref: [((e) => {
|
|
1985
|
+
f = e, i.setArrowElement(e);
|
|
1986
|
+
}), a.ref],
|
|
1987
|
+
"aria-hidden": "true",
|
|
1988
|
+
get class() {
|
|
1989
|
+
return c();
|
|
1990
|
+
},
|
|
1991
|
+
get style() {
|
|
1992
|
+
return l();
|
|
1993
|
+
}
|
|
1994
|
+
}, u, d));
|
|
1995
|
+
}
|
|
1996
|
+
//#endregion
|
|
1997
|
+
//#region src/combobox/group/ComboboxGroupContext.ts
|
|
1998
|
+
var On = Symbol("ComboboxGroupContext"), kn = Ye(On);
|
|
1999
|
+
function An() {
|
|
2000
|
+
let e = q(kn);
|
|
2001
|
+
if (e === On) throw Error("Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>.");
|
|
2002
|
+
return e;
|
|
2003
|
+
}
|
|
2004
|
+
//#endregion
|
|
2005
|
+
//#region src/combobox/group/ComboboxGroup.tsx
|
|
2006
|
+
var jn = /* @__PURE__ */ B("<div>");
|
|
2007
|
+
function Mn(t) {
|
|
2008
|
+
let n = Y(), r = t, i = t, [a, o] = U(void 0, { ownedWrite: !0 }), s = {}, c = H(() => m(t.class, s)), l = H(() => h(t.style, s)), u = W(i, "render", "class", "items", "ref", "style"), d = e(t, () => s, (e) => (() => {
|
|
2009
|
+
var t = F(jn);
|
|
2010
|
+
return z(t, e, !1), L(), t;
|
|
2011
|
+
})());
|
|
2012
|
+
return P(_t, {
|
|
2013
|
+
value: { items: () => r.items },
|
|
2014
|
+
get children() {
|
|
2015
|
+
return P(kn, {
|
|
2016
|
+
value: {
|
|
2017
|
+
labelId: a,
|
|
2018
|
+
setLabelId: o
|
|
2019
|
+
},
|
|
2020
|
+
get children() {
|
|
2021
|
+
return P(d, I({
|
|
2022
|
+
ref: [r.ref],
|
|
2023
|
+
get role() {
|
|
2024
|
+
return n.grid() ? "rowgroup" : "group";
|
|
2025
|
+
},
|
|
2026
|
+
get "aria-labelledby"() {
|
|
2027
|
+
return a();
|
|
2028
|
+
},
|
|
2029
|
+
get class() {
|
|
2030
|
+
return c();
|
|
2031
|
+
},
|
|
2032
|
+
get style() {
|
|
2033
|
+
return l();
|
|
2034
|
+
}
|
|
2035
|
+
}, u));
|
|
2036
|
+
}
|
|
2037
|
+
});
|
|
2038
|
+
}
|
|
2039
|
+
});
|
|
2040
|
+
}
|
|
2041
|
+
//#endregion
|
|
2042
|
+
//#region src/combobox/group-label/ComboboxGroupLabel.tsx
|
|
2043
|
+
var Nn = /* @__PURE__ */ B("<div>");
|
|
2044
|
+
function Pn(t) {
|
|
2045
|
+
let n = An(), r = t, i = t, a = `base-ui-${Xe()}`, o = H(() => r.id ?? a), s = {}, c = H(() => m(t.class, s)), l = H(() => h(t.style, s)), u = W(i, "render", "class", "id", "ref", "style");
|
|
2046
|
+
V(o, (e) => (n.setLabelId(e), () => {
|
|
2047
|
+
n.labelId() === e && n.setLabelId(void 0);
|
|
2048
|
+
}));
|
|
2049
|
+
let d = e(t, () => s, (e) => (() => {
|
|
2050
|
+
var t = F(Nn);
|
|
2051
|
+
return z(t, e, !1), L(), t;
|
|
2052
|
+
})());
|
|
2053
|
+
return P(d, I({
|
|
2054
|
+
ref: [r.ref],
|
|
2055
|
+
get id() {
|
|
2056
|
+
return o();
|
|
2057
|
+
},
|
|
2058
|
+
"aria-hidden": "true",
|
|
2059
|
+
get class() {
|
|
2060
|
+
return c();
|
|
2061
|
+
},
|
|
2062
|
+
get style() {
|
|
2063
|
+
return l();
|
|
2064
|
+
}
|
|
2065
|
+
}, u));
|
|
2066
|
+
}
|
|
2067
|
+
//#endregion
|
|
2068
|
+
//#region src/combobox/row/ComboboxRowContext.ts
|
|
2069
|
+
var Fn = Ye(!1);
|
|
2070
|
+
function In() {
|
|
2071
|
+
return q(Fn);
|
|
2072
|
+
}
|
|
2073
|
+
//#endregion
|
|
2074
|
+
//#region src/combobox/item/ComboboxItemContext.ts
|
|
2075
|
+
var Ln = Symbol("ComboboxItemContext"), Rn = Ye(Ln);
|
|
2076
|
+
function zn() {
|
|
2077
|
+
let e = q(Rn);
|
|
2078
|
+
if (e === Ln) throw Error("Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.");
|
|
2079
|
+
return e;
|
|
2080
|
+
}
|
|
2081
|
+
//#endregion
|
|
2082
|
+
//#region src/combobox/item/ComboboxItem.tsx
|
|
2083
|
+
var Bn = /* @__PURE__ */ B("<div>");
|
|
2084
|
+
function Vn(n) {
|
|
2085
|
+
let r = Y(), i = In(), a = n, o = n, s = Symbol("ComboboxItem"), [c, l] = U(null, { ownedWrite: !0 }), u = H(() => a.value ?? null), d = H(() => r.disabled() || (a.disabled ?? !1)), f = H(() => a.nativeButton ?? !1), p = H(() => r.selectionMode() !== "none"), g = H(() => {
|
|
2086
|
+
if (a.index != null) return a.index;
|
|
2087
|
+
if (!r.virtualized()) return;
|
|
2088
|
+
let e = Pe(r.itemValues(), u(), r.comparator());
|
|
2089
|
+
return e === -1 ? void 0 : e;
|
|
2090
|
+
}), _ = r.store.collection.register({
|
|
2091
|
+
token: s,
|
|
2092
|
+
element: c,
|
|
2093
|
+
value: u,
|
|
2094
|
+
index: g,
|
|
2095
|
+
disabled: d
|
|
2096
|
+
}), v = H(() => g() ?? r.store.collection.indexOf(s)), b = H(() => v() !== -1), x = H(() => b() ? `${r.id()}-${v()}` : void 0), ee = H(() => {
|
|
2097
|
+
if (!p()) return !1;
|
|
2098
|
+
let e = r.selectedValue();
|
|
2099
|
+
return Array.isArray(e) ? Me(e, u(), r.comparator()) : je(u(), e, r.comparator());
|
|
2100
|
+
}), S = H(() => r.store.activeIndex() === v()), C = H(() => ({
|
|
2101
|
+
disabled: d(),
|
|
2102
|
+
selected: ee(),
|
|
2103
|
+
highlighted: S()
|
|
2104
|
+
})), w = H(() => m(n.class, C())), T = H(() => h(n.style, C())), E = H(() => t(C())), D = W(o, "render", "class", "disabled", "id", "index", "nativeButton", "onClick", "onMouseDown", "onMouseUp", "onPointerDown", "onPointerLeave", "onPointerMove", "ref", "style", "value");
|
|
2105
|
+
function O(e) {
|
|
2106
|
+
if (r.submitOnItemClick()) {
|
|
2107
|
+
r.handleSelection(e, u()), Ze(), r.requestSubmit();
|
|
2108
|
+
return;
|
|
2109
|
+
}
|
|
2110
|
+
r.handleSelection(e, u());
|
|
2111
|
+
}
|
|
2112
|
+
function te(e) {
|
|
2113
|
+
e.isPrimary && (r.store.pointerDownItem = e.currentTarget), e.preventDefault();
|
|
2114
|
+
}
|
|
2115
|
+
function k(e) {
|
|
2116
|
+
e.preventDefault();
|
|
2117
|
+
}
|
|
2118
|
+
function ne(e) {
|
|
2119
|
+
d() || r.readOnly() || O(e);
|
|
2120
|
+
}
|
|
2121
|
+
function A(e) {
|
|
2122
|
+
let t = r.store.pointerDownItem === e.currentTarget;
|
|
2123
|
+
r.store.pointerDownItem = null, !(d() || r.readOnly() || e.button !== 0 || t || !S()) && O(e);
|
|
2124
|
+
}
|
|
2125
|
+
function re(e) {
|
|
2126
|
+
e.pointerType !== "touch" && (r.store.keyboardActive = !1, !d() && r.listNavigation.onItemPointerMove(e, v()));
|
|
2127
|
+
}
|
|
2128
|
+
function ie(e) {
|
|
2129
|
+
r.keepHighlight() || r.listNavigation.onItemPointerLeave(e);
|
|
2130
|
+
}
|
|
2131
|
+
let ae = y(() => K(() => d() ? N : void 0), () => a.onClick, () => ne), oe = y(() => a.onMouseDown, () => k), se = y(() => a.onMouseUp, () => A), ce = y(() => a.onPointerDown, () => te), le = y(() => a.onPointerMove, () => re), ue = y(() => a.onPointerLeave, () => ie);
|
|
2132
|
+
V(() => ({
|
|
2133
|
+
registered: b(),
|
|
2134
|
+
hasItems: r.hasItems(),
|
|
2135
|
+
index: v(),
|
|
2136
|
+
value: u(),
|
|
2137
|
+
selected: r.selectedValue(),
|
|
2138
|
+
compare: r.comparator()
|
|
2139
|
+
}), (e) => {
|
|
2140
|
+
!e.registered || e.hasItems || K(() => r.store.setSelectedIndex(Ie(r.store.collection.values(), e.selected, e.compare, r.multiple())));
|
|
2141
|
+
}), V(c, () => r.store.collection.touch()), G(_);
|
|
2142
|
+
let de = {
|
|
2143
|
+
selected: ee,
|
|
2144
|
+
index: v
|
|
2145
|
+
}, fe = e(n, () => C(), (e) => (() => {
|
|
2146
|
+
var t = F(Bn);
|
|
2147
|
+
return z(t, e, !1), L(), t;
|
|
2148
|
+
})());
|
|
2149
|
+
return P(Rn, {
|
|
2150
|
+
value: de,
|
|
2151
|
+
get children() {
|
|
2152
|
+
return P(fe, I({
|
|
2153
|
+
ref: [((e) => {
|
|
2154
|
+
l(e), r.store.collection.touch();
|
|
2155
|
+
}), a.ref],
|
|
2156
|
+
get id() {
|
|
2157
|
+
return x();
|
|
2158
|
+
},
|
|
2159
|
+
get type() {
|
|
2160
|
+
return f() ? "button" : void 0;
|
|
2161
|
+
},
|
|
2162
|
+
role: i ? "gridcell" : "option",
|
|
2163
|
+
get "aria-selected"() {
|
|
2164
|
+
return Ue(() => !!p())() ? ee() ? "true" : "false" : void 0;
|
|
2165
|
+
},
|
|
2166
|
+
get "aria-disabled"() {
|
|
2167
|
+
return d() ? "true" : void 0;
|
|
2168
|
+
},
|
|
2169
|
+
get class() {
|
|
2170
|
+
return w();
|
|
2171
|
+
},
|
|
2172
|
+
get style() {
|
|
2173
|
+
return T();
|
|
2174
|
+
},
|
|
2175
|
+
onClick: ae,
|
|
2176
|
+
onMouseDown: oe,
|
|
2177
|
+
onMouseUp: se,
|
|
2178
|
+
onPointerDown: ce,
|
|
2179
|
+
onPointerLeave: ue,
|
|
2180
|
+
onPointerMove: le
|
|
2181
|
+
}, E, D));
|
|
2182
|
+
}
|
|
2183
|
+
});
|
|
2184
|
+
}
|
|
2185
|
+
//#endregion
|
|
2186
|
+
//#region src/combobox/row/ComboboxRow.tsx
|
|
2187
|
+
var Hn = /* @__PURE__ */ B("<div>");
|
|
2188
|
+
function Un(t) {
|
|
2189
|
+
let n = t, r = t, i = {}, a = H(() => m(t.class, i)), o = H(() => h(t.style, i)), s = W(r, "render", "class", "ref", "style"), c = e(t, () => i, (e) => (() => {
|
|
2190
|
+
var t = F(Hn);
|
|
2191
|
+
return z(t, e, !1), L(), t;
|
|
2192
|
+
})());
|
|
2193
|
+
return P(Fn, {
|
|
2194
|
+
value: !0,
|
|
2195
|
+
get children() {
|
|
2196
|
+
return P(c, I({
|
|
2197
|
+
ref: [n.ref],
|
|
2198
|
+
role: "row",
|
|
2199
|
+
get class() {
|
|
2200
|
+
return a();
|
|
2201
|
+
},
|
|
2202
|
+
get style() {
|
|
2203
|
+
return o();
|
|
2204
|
+
}
|
|
2205
|
+
}, s));
|
|
2206
|
+
}
|
|
2207
|
+
});
|
|
2208
|
+
}
|
|
2209
|
+
//#endregion
|
|
2210
|
+
//#region src/combobox/empty/ComboboxEmpty.tsx
|
|
2211
|
+
var Wn = /* @__PURE__ */ B("<div>");
|
|
2212
|
+
function Gn(t) {
|
|
2213
|
+
let n = Y(), r = t, i = t, a = {}, o = H(() => m(t.class, a)), s = H(() => h(t.style, a)), c = W(i, "render", "children", "class", "ref", "style"), [l, u] = U(null, { ownedWrite: !0 });
|
|
2214
|
+
dn(l), G(() => {
|
|
2215
|
+
n.store.emptyElement === l() && (n.store.emptyElement = null);
|
|
2216
|
+
});
|
|
2217
|
+
let d = e(t, () => a, (e) => (() => {
|
|
2218
|
+
var t = F(Wn);
|
|
2219
|
+
return z(t, e, !1), L(), t;
|
|
2220
|
+
})());
|
|
2221
|
+
return P(d, I({
|
|
2222
|
+
ref: [((e) => {
|
|
2223
|
+
u(e), n.store.emptyElement = e;
|
|
2224
|
+
}), r.ref],
|
|
2225
|
+
role: "status",
|
|
2226
|
+
"aria-live": "polite",
|
|
2227
|
+
"aria-atomic": "true",
|
|
2228
|
+
get class() {
|
|
2229
|
+
return o();
|
|
2230
|
+
},
|
|
2231
|
+
get style() {
|
|
2232
|
+
return s();
|
|
2233
|
+
}
|
|
2234
|
+
}, c, { get children() {
|
|
2235
|
+
return P(Je, {
|
|
2236
|
+
get when() {
|
|
2237
|
+
return n.listEmpty();
|
|
2238
|
+
},
|
|
2239
|
+
get children() {
|
|
2240
|
+
return t.children;
|
|
2241
|
+
}
|
|
2242
|
+
});
|
|
2243
|
+
} }));
|
|
2244
|
+
}
|
|
2245
|
+
//#endregion
|
|
2246
|
+
//#region src/combobox/separator/ComboboxSeparator.tsx
|
|
2247
|
+
var Kn = /* @__PURE__ */ B("<div>");
|
|
2248
|
+
function qn(n) {
|
|
2249
|
+
let r = n, i = n, a = H(() => r.orientation ?? "horizontal"), o = H(() => ({ orientation: a() })), s = H(() => m(n.class, o())), c = H(() => h(n.style, o())), l = H(() => t(o())), u = W(i, "render", "class", "orientation", "ref", "style"), d = e(n, () => o(), (e) => (() => {
|
|
2250
|
+
var t = F(Kn);
|
|
2251
|
+
return z(t, e, !1), L(), t;
|
|
2252
|
+
})());
|
|
2253
|
+
return P(d, I({
|
|
2254
|
+
ref: [r.ref],
|
|
2255
|
+
role: "presentation",
|
|
2256
|
+
get class() {
|
|
2257
|
+
return s();
|
|
2258
|
+
},
|
|
2259
|
+
get style() {
|
|
2260
|
+
return c();
|
|
2261
|
+
}
|
|
2262
|
+
}, l, u));
|
|
2263
|
+
}
|
|
2264
|
+
//#endregion
|
|
2265
|
+
//#region src/combobox/root/utils/useFilteredItems.ts
|
|
2266
|
+
function Jn() {
|
|
2267
|
+
return Y().filteredItems;
|
|
2268
|
+
}
|
|
2269
|
+
//#endregion
|
|
2270
|
+
export { ut as A, Yt as C, Rt as D, Ut as E, it as F, rt as M, st as N, Tt as O, ot as P, Jt as S, Vt as T, $ as _, Vn as a, $t as b, Mn as c, Sn as d, yn as f, an as g, sn as h, Un as i, nt as j, Y as k, Dn as l, pn as m, qn as n, zn as o, _n as p, Gn as r, Pn as s, Jn as t, Tn as u, Q as v, zt as w, Zt as x, tn as y };
|