solid-baseui 0.1.0-alpha.0
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/LICENSE +26 -0
- package/README.md +150 -0
- package/dist/lib/client/CSPContext-faVzToiT.js +10 -0
- package/dist/lib/client/CheckboxGroupContext-1CRRHK0T.js +8 -0
- package/dist/lib/client/DialogHandle-DrN2YWCv.js +518 -0
- package/dist/lib/client/DialogPopup-ZlqmGfdk.js +136 -0
- package/dist/lib/client/DirectionContext-BwMabICS.js +7 -0
- package/dist/lib/client/FieldControl-Bc-z2og6.js +116 -0
- package/dist/lib/client/FieldItemContext-Bwzf-4tL.js +7 -0
- package/dist/lib/client/FieldRootContext-izCEh80D.js +32 -0
- package/dist/lib/client/FieldsetRootContext-BgThSAcd.js +13 -0
- package/dist/lib/client/FloatingTree-23B7KKPD.js +83 -0
- package/dist/lib/client/FocusManager-grSdNHqW.js +360 -0
- package/dist/lib/client/FormContext-BB05lWOI.js +16 -0
- package/dist/lib/client/InternalBackdrop-cSK13gaM.js +160 -0
- package/dist/lib/client/LabelableContext-DKsB0fIx.js +48 -0
- package/dist/lib/client/MenuSubmenuTrigger-QZkQ0F2v.js +1570 -0
- package/dist/lib/client/MenubarContext-BYt3fkt-.js +13 -0
- package/dist/lib/client/PopupHandle-CcJG4NMy.js +101 -0
- package/dist/lib/client/PopupStore-DjB-wO88.js +468 -0
- package/dist/lib/client/PopupViewport-DgrIqQea.js +152 -0
- package/dist/lib/client/RadioGroupContext-CZexBsPa.js +9 -0
- package/dist/lib/client/Separator-9DboD_Si.js +25 -0
- package/dist/lib/client/ToggleGroupContext-_THxLgJU.js +9 -0
- package/dist/lib/client/ToolbarGroupContext-Dpc3_mFx.js +9 -0
- package/dist/lib/client/ToolbarItemOwnerContext-DtVqVnSE.js +9 -0
- package/dist/lib/client/ToolbarRootContext-88yZoAOy.js +13 -0
- package/dist/lib/client/TriggerFocusGuards-CQ-JuASy.js +56 -0
- package/dist/lib/client/accordion/index.js +2 -0
- package/dist/lib/client/accordion-sOXt9AlG.js +399 -0
- package/dist/lib/client/alert-dialog/index.js +2 -0
- package/dist/lib/client/alert-dialog-BH_3ndio.js +30 -0
- package/dist/lib/client/autocomplete/index.js +2 -0
- package/dist/lib/client/autocomplete-Cob_FZEP.js +113 -0
- package/dist/lib/client/avatar/index.js +2 -0
- package/dist/lib/client/avatar-AF9vyD4q.js +146 -0
- package/dist/lib/client/button/index.js +2 -0
- package/dist/lib/client/button-DpUi-2g8.js +82 -0
- package/dist/lib/client/buttonSemantics-paljfpOX.js +39 -0
- package/dist/lib/client/checkbox/index.js +2 -0
- package/dist/lib/client/checkbox-BbAwOptH.js +441 -0
- package/dist/lib/client/checkbox-group/index.js +2 -0
- package/dist/lib/client/checkbox-group-CSSp_805.js +128 -0
- package/dist/lib/client/collapsible/index.js +2 -0
- package/dist/lib/client/collapsible-BIbje_ub.js +232 -0
- package/dist/lib/client/combobox/index.js +2 -0
- package/dist/lib/client/combobox-8O-vgTLL.js +352 -0
- package/dist/lib/client/compositeNavigation-sxniYTc7.js +58 -0
- package/dist/lib/client/constants-BYjBUIIi.js +424 -0
- package/dist/lib/client/context-menu/index.js +2 -0
- package/dist/lib/client/context-menu-BTMkXtrs.js +217 -0
- package/dist/lib/client/createAnchorPositioning-DcxDXUgB.js +1058 -0
- package/dist/lib/client/createAnchoredPopupScrollLock-Cx0cbh1_.js +19 -0
- package/dist/lib/client/createClickInteraction-CTaIFBiV.js +45 -0
- package/dist/lib/client/createCollapsiblePanel-DeDu0O2t.js +231 -0
- package/dist/lib/client/createFocusInteraction-D4w1-235.js +50 -0
- package/dist/lib/client/createPopupAutoResize-CGNiLhGq.js +60 -0
- package/dist/lib/client/createTransitionStatus-B1L-whed.js +53 -0
- package/dist/lib/client/csp-provider/index.js +2 -0
- package/dist/lib/client/csp-provider-C7nRHDKK.js +16 -0
- package/dist/lib/client/dialog/index.js +2 -0
- package/dist/lib/client/dialog-DkaQwIgP.js +19 -0
- package/dist/lib/client/direction-provider/index.js +3 -0
- package/dist/lib/client/direction-provider-DYhRN-8f.js +13 -0
- package/dist/lib/client/dom-BEAeQ9Eb.js +58 -0
- package/dist/lib/client/drawer/index.js +2 -0
- package/dist/lib/client/drawer-Ce2cChLt.js +1550 -0
- package/dist/lib/client/field/index.js +2 -0
- package/dist/lib/client/field-C-o7jzKW.js +469 -0
- package/dist/lib/client/fieldset/index.js +2 -0
- package/dist/lib/client/fieldset-BQTAWv2L.js +65 -0
- package/dist/lib/client/form/index.js +2 -0
- package/dist/lib/client/form-BINBiW5L.js +106 -0
- package/dist/lib/client/form-types-DFBxc1LF.js +8 -0
- package/dist/lib/client/index.js +43 -0
- package/dist/lib/client/input/index.js +2 -0
- package/dist/lib/client/input-gb0ejxkm.js +7 -0
- package/dist/lib/client/internals/composeEventHandlers.js +50 -0
- package/dist/lib/client/internals/createBaseUIEventDetails.js +31 -0
- package/dist/lib/client/internals/csp-context/index.js +2 -0
- package/dist/lib/client/internals/direction-context/index.js +2 -0
- package/dist/lib/client/internals/field-constants.js +56 -0
- package/dist/lib/client/internals/field-root-context/index.js +2 -0
- package/dist/lib/client/internals/form-context/index.js +2 -0
- package/dist/lib/client/internals/getStateAttributesProps.js +21 -0
- package/dist/lib/client/internals/labelable-provider/index.js +19 -0
- package/dist/lib/client/internals/mergeStyles.js +9 -0
- package/dist/lib/client/internals/reasons.js +2 -0
- package/dist/lib/client/internals/stateAttributesMapping.js +8 -0
- package/dist/lib/client/internals/types.js +0 -0
- package/dist/lib/client/menu/index.js +2 -0
- package/dist/lib/client/menu-DeMT08oD.js +326 -0
- package/dist/lib/client/menubar/index.js +2 -0
- package/dist/lib/client/menubar-C4aomSYv.js +185 -0
- package/dist/lib/client/mergeStyleValue-C4ITiiIV.js +42 -0
- package/dist/lib/client/meter/index.js +2 -0
- package/dist/lib/client/meter-xSU37Q0m.js +171 -0
- package/dist/lib/client/navigation-menu/index.js +2 -0
- package/dist/lib/client/navigation-menu-ZILQmdn6.js +1083 -0
- package/dist/lib/client/number-field/index.js +2 -0
- package/dist/lib/client/number-field-B8CsTb_8.js +1035 -0
- package/dist/lib/client/otp-field/index.js +2 -0
- package/dist/lib/client/otp-field-DBkMcnog.js +582 -0
- package/dist/lib/client/platform-Bk5Q32mf.js +13 -0
- package/dist/lib/client/popover/index.js +2 -0
- package/dist/lib/client/popover-CQwyp-fs.js +929 -0
- package/dist/lib/client/popupStateMapping-C9eZl19i.js +367 -0
- package/dist/lib/client/preview-card/index.js +2 -0
- package/dist/lib/client/preview-card-D_2Q8lpC.js +625 -0
- package/dist/lib/client/progress/index.js +2 -0
- package/dist/lib/client/progress-D7r0xAC9.js +188 -0
- package/dist/lib/client/radio/index.js +2 -0
- package/dist/lib/client/radio-CzGQ81z1.js +299 -0
- package/dist/lib/client/radio-group/index.js +2 -0
- package/dist/lib/client/radio-group-DpHlBKA6.js +193 -0
- package/dist/lib/client/reasons-Co5CzjKq.js +41 -0
- package/dist/lib/client/resolveStyle-XcgAuaKR.js +11 -0
- package/dist/lib/client/rolldown-runtime-Dy4uBu1J.js +11 -0
- package/dist/lib/client/runOnceAnimationsFinish-15EM-Z4l.js +48 -0
- package/dist/lib/client/safePolygon--bbKn0c8.js +316 -0
- package/dist/lib/client/scroll-area/index.js +2 -0
- package/dist/lib/client/scroll-area-CffM4U0R.js +701 -0
- package/dist/lib/client/scrollable-SRNYlhF7.js +42 -0
- package/dist/lib/client/select/index.js +2 -0
- package/dist/lib/client/select-IFhiEg73.js +1940 -0
- package/dist/lib/client/separator/index.js +2 -0
- package/dist/lib/client/setRef-fXF6OIo3.js +7 -0
- package/dist/lib/client/slider/index.js +2 -0
- package/dist/lib/client/slider-BCagYmGp.js +921 -0
- package/dist/lib/client/switch/index.js +2 -0
- package/dist/lib/client/switch-RIJeDnvS.js +308 -0
- package/dist/lib/client/tabs/index.js +2 -0
- package/dist/lib/client/tabs-fOAKs7r3.js +696 -0
- package/dist/lib/client/toast/index.js +2 -0
- package/dist/lib/client/toast-D2P8UqUs.js +1108 -0
- package/dist/lib/client/toggle/index.js +2 -0
- package/dist/lib/client/toggle-group/index.js +2 -0
- package/dist/lib/client/toggle-group-0Aue0owJ.js +129 -0
- package/dist/lib/client/toggle-momVEIBL.js +138 -0
- package/dist/lib/client/toolbar/index.js +2 -0
- package/dist/lib/client/toolbar-Du22aKCv.js +492 -0
- package/dist/lib/client/tooltip/index.js +2 -0
- package/dist/lib/client/tooltip-CyK61fl1.js +844 -0
- package/dist/lib/client/types/index.js +0 -0
- package/dist/lib/client/useFilteredItems-DTekHz39.js +2223 -0
- package/dist/lib/client/withoutComponentBinding-CcCW7fSc.js +13 -0
- package/dist/lib/server/CSPContext-DOxR0PO7.js +10 -0
- package/dist/lib/server/CheckboxGroupContext-DTP679kK.js +8 -0
- package/dist/lib/server/DialogHandle-ATZlm9RC.js +689 -0
- package/dist/lib/server/DialogPopup-BebI-w5P.js +159 -0
- package/dist/lib/server/DirectionContext-YORWLF08.js +10 -0
- package/dist/lib/server/FieldControl-Y_kI7ARp.js +174 -0
- package/dist/lib/server/FieldItemContext-x-C7ZlmX.js +7 -0
- package/dist/lib/server/FieldRootContext-IC-LWzVp.js +34 -0
- package/dist/lib/server/FieldsetRootContext-DyNqCjK6.js +14 -0
- package/dist/lib/server/FloatingTree-z1JPD1dR.js +101 -0
- package/dist/lib/server/FocusManager-BrbZVWME.js +538 -0
- package/dist/lib/server/FormContext-pvESt85v.js +17 -0
- package/dist/lib/server/InternalBackdrop-C_iDPVR-.js +260 -0
- package/dist/lib/server/LabelableContext-DZP3rgAY.js +59 -0
- package/dist/lib/server/MenuSubmenuTrigger-DA4gsv6z.js +2072 -0
- package/dist/lib/server/MenubarContext-C-62rMnO.js +14 -0
- package/dist/lib/server/PopupHandle-DthPgNjy.js +115 -0
- package/dist/lib/server/PopupStore-DEs3FAEe.js +645 -0
- package/dist/lib/server/PopupViewport-3r_KTFwX.js +220 -0
- package/dist/lib/server/RadioGroupContext-D5xmTkDz.js +10 -0
- package/dist/lib/server/Separator-vhhYxWGr.js +31 -0
- package/dist/lib/server/ToggleGroupContext-COor8gYc.js +10 -0
- package/dist/lib/server/ToolbarGroupContext-CzdHxijX.js +10 -0
- package/dist/lib/server/ToolbarItemOwnerContext-L5dsZ_vS.js +10 -0
- package/dist/lib/server/ToolbarRootContext-DD-qe7s8.js +14 -0
- package/dist/lib/server/TriggerFocusGuards-sbGwf45f.js +63 -0
- package/dist/lib/server/accordion/index.js +566 -0
- package/dist/lib/server/alert-dialog/index.js +36 -0
- package/dist/lib/server/autocomplete/index.js +173 -0
- package/dist/lib/server/avatar/index.js +199 -0
- package/dist/lib/server/button/index.js +119 -0
- package/dist/lib/server/buttonSemantics-BSwDxJhh.js +49 -0
- package/dist/lib/server/checkbox/index.js +537 -0
- package/dist/lib/server/checkbox-group/index.js +198 -0
- package/dist/lib/server/collapsible/index.js +307 -0
- package/dist/lib/server/combobox/index.js +480 -0
- package/dist/lib/server/compositeNavigation-BRVT1C38.js +68 -0
- package/dist/lib/server/constants-9H__9xbS.js +706 -0
- package/dist/lib/server/context-menu/index.js +263 -0
- package/dist/lib/server/createAnchorPositioning-C-cVOPwz.js +381 -0
- package/dist/lib/server/createAnchoredPopupScrollLock-DFuUrykR.js +20 -0
- package/dist/lib/server/createClickInteraction-BYsMgvup.js +68 -0
- package/dist/lib/server/createCollapsiblePanel-DTyVJz0G.js +297 -0
- package/dist/lib/server/createFocusInteraction-EIS0QOel.js +77 -0
- package/dist/lib/server/createPopupAutoResize-DO50jjNX.js +111 -0
- package/dist/lib/server/createTransitionStatus-BTlrerSS.js +61 -0
- package/dist/lib/server/csp-provider/index.js +15 -0
- package/dist/lib/server/dialog/index.js +19 -0
- package/dist/lib/server/direction-provider/index.js +13 -0
- package/dist/lib/server/dom-Crg_2R-j.js +67 -0
- package/dist/lib/server/drawer/index.js +2351 -0
- package/dist/lib/server/field/index.js +677 -0
- package/dist/lib/server/fieldset/index.js +91 -0
- package/dist/lib/server/form/index.js +136 -0
- package/dist/lib/server/form-types-P7-SCWyr.js +8 -0
- package/dist/lib/server/index.js +43 -0
- package/dist/lib/server/input/index.js +11 -0
- package/dist/lib/server/internals/composeEventHandlers.js +60 -0
- package/dist/lib/server/internals/createBaseUIEventDetails.js +33 -0
- package/dist/lib/server/internals/csp-context/index.js +2 -0
- package/dist/lib/server/internals/direction-context/index.js +2 -0
- package/dist/lib/server/internals/field-constants.js +64 -0
- package/dist/lib/server/internals/field-root-context/index.js +2 -0
- package/dist/lib/server/internals/form-context/index.js +2 -0
- package/dist/lib/server/internals/getStateAttributesProps.js +23 -0
- package/dist/lib/server/internals/labelable-provider/index.js +20 -0
- package/dist/lib/server/internals/mergeStyles.js +15 -0
- package/dist/lib/server/internals/reasons.js +76 -0
- package/dist/lib/server/internals/stateAttributesMapping.js +15 -0
- package/dist/lib/server/internals/types.js +1 -0
- package/dist/lib/server/menu/index.js +423 -0
- package/dist/lib/server/menubar/index.js +242 -0
- package/dist/lib/server/mergeStyleValue-Db8bRCM4.js +67 -0
- package/dist/lib/server/meter/index.js +217 -0
- package/dist/lib/server/navigation-menu/index.js +1436 -0
- package/dist/lib/server/number-field/index.js +1497 -0
- package/dist/lib/server/otp-field/index.js +811 -0
- package/dist/lib/server/platform-DYukKUir.js +13 -0
- package/dist/lib/server/popover/index.js +1187 -0
- package/dist/lib/server/popupStateMapping-nKoUwoke.js +459 -0
- package/dist/lib/server/preview-card/index.js +797 -0
- package/dist/lib/server/progress/index.js +252 -0
- package/dist/lib/server/radio/index.js +364 -0
- package/dist/lib/server/radio-group/index.js +282 -0
- package/dist/lib/server/resolveStyle-XCSFDHAL.js +11 -0
- package/dist/lib/server/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/lib/server/runOnceAnimationsFinish-DCHzXWZU.js +59 -0
- package/dist/lib/server/safePolygon-CAm5RJGv.js +474 -0
- package/dist/lib/server/scroll-area/index.js +993 -0
- package/dist/lib/server/scrollable-CjsSxbGr.js +54 -0
- package/dist/lib/server/select/index.js +2630 -0
- package/dist/lib/server/separator/index.js +2 -0
- package/dist/lib/server/setRef-Bt70sW7c.js +7 -0
- package/dist/lib/server/slider/index.js +1333 -0
- package/dist/lib/server/switch/index.js +389 -0
- package/dist/lib/server/tabs/index.js +1007 -0
- package/dist/lib/server/toast/index.js +1588 -0
- package/dist/lib/server/toggle/index.js +201 -0
- package/dist/lib/server/toggle-group/index.js +192 -0
- package/dist/lib/server/toolbar/index.js +685 -0
- package/dist/lib/server/tooltip/index.js +1092 -0
- package/dist/lib/server/types/index.js +1 -0
- package/dist/lib/server/useFilteredItems-DvuctLt3.js +3157 -0
- package/dist/lib/server/withoutComponentBinding-BHaWr5kU.js +20 -0
- package/dist/lib/types/accordion/header/AccordionHeader.d.ts +12 -0
- package/dist/lib/types/accordion/index.d.ts +6 -0
- package/dist/lib/types/accordion/index.parts.d.ts +5 -0
- package/dist/lib/types/accordion/item/AccordionItem.d.ts +29 -0
- package/dist/lib/types/accordion/item/AccordionItemContext.d.ts +22 -0
- package/dist/lib/types/accordion/item/AccordionItemDataAttributes.d.ts +5 -0
- package/dist/lib/types/accordion/item/stateAttributesMapping.d.ts +13 -0
- package/dist/lib/types/accordion/panel/AccordionPanel.d.ts +20 -0
- package/dist/lib/types/accordion/panel/AccordionPanelCssVars.d.ts +4 -0
- package/dist/lib/types/accordion/root/AccordionRoot.d.ts +46 -0
- package/dist/lib/types/accordion/root/AccordionRootContext.d.ts +22 -0
- package/dist/lib/types/accordion/root/stateAttributesMapping.d.ts +3 -0
- package/dist/lib/types/accordion/trigger/AccordionTrigger.d.ts +27 -0
- package/dist/lib/types/accordion/trigger/AccordionTriggerDataAttributes.d.ts +4 -0
- package/dist/lib/types/alert-dialog/handle.d.ts +6 -0
- package/dist/lib/types/alert-dialog/index.d.ts +10 -0
- package/dist/lib/types/alert-dialog/index.parts.d.ts +10 -0
- package/dist/lib/types/alert-dialog/root/AlertDialogRoot.d.ts +29 -0
- package/dist/lib/types/alert-dialog/trigger/AlertDialogTrigger.d.ts +19 -0
- package/dist/lib/types/autocomplete/index.d.ts +24 -0
- package/dist/lib/types/autocomplete/index.parts.d.ts +23 -0
- package/dist/lib/types/autocomplete/input-group/AutocompleteInputGroup.d.ts +26 -0
- package/dist/lib/types/autocomplete/item/AutocompleteItem.d.ts +18 -0
- package/dist/lib/types/autocomplete/root/AutocompleteRoot.d.ts +195 -0
- package/dist/lib/types/autocomplete/root/utils/useFilter.d.ts +9 -0
- package/dist/lib/types/autocomplete/separator/AutocompleteSeparator.d.ts +17 -0
- package/dist/lib/types/autocomplete/trigger/AutocompleteTrigger.d.ts +24 -0
- package/dist/lib/types/autocomplete/value/AutocompleteValue.d.ts +15 -0
- package/dist/lib/types/avatar/fallback/AvatarFallback.d.ts +16 -0
- package/dist/lib/types/avatar/image/AvatarImage.d.ts +17 -0
- package/dist/lib/types/avatar/image/createImageLoadingStatus.d.ts +10 -0
- package/dist/lib/types/avatar/index.d.ts +4 -0
- package/dist/lib/types/avatar/index.parts.d.ts +3 -0
- package/dist/lib/types/avatar/root/AvatarRoot.d.ts +13 -0
- package/dist/lib/types/avatar/root/AvatarRootContext.d.ts +10 -0
- package/dist/lib/types/button/Button.d.ts +34 -0
- package/dist/lib/types/button/index.d.ts +2 -0
- package/dist/lib/types/checkbox/index.d.ts +3 -0
- package/dist/lib/types/checkbox/index.parts.d.ts +2 -0
- package/dist/lib/types/checkbox/indicator/CheckboxIndicator.d.ts +20 -0
- package/dist/lib/types/checkbox/root/CheckboxRoot.d.ts +56 -0
- package/dist/lib/types/checkbox/root/CheckboxRootContext.d.ts +7 -0
- package/dist/lib/types/checkbox/utils/getCheckboxStateAttributesMapping.d.ts +3 -0
- package/dist/lib/types/checkbox-group/CheckboxGroup.d.ts +32 -0
- package/dist/lib/types/checkbox-group/CheckboxGroupContext.d.ts +30 -0
- package/dist/lib/types/checkbox-group/index.d.ts +2 -0
- package/dist/lib/types/collapsible/index.d.ts +4 -0
- package/dist/lib/types/collapsible/index.parts.d.ts +3 -0
- package/dist/lib/types/collapsible/panel/CollapsiblePanel.d.ts +25 -0
- package/dist/lib/types/collapsible/panel/createCollapsiblePanel.d.ts +26 -0
- package/dist/lib/types/collapsible/root/CollapsibleRoot.d.ts +34 -0
- package/dist/lib/types/collapsible/root/CollapsibleRootContext.d.ts +19 -0
- package/dist/lib/types/collapsible/root/createCollapsibleTransitionStatus.d.ts +9 -0
- package/dist/lib/types/collapsible/root/stateAttributesMapping.d.ts +14 -0
- package/dist/lib/types/collapsible/trigger/CollapsibleTrigger.d.ts +28 -0
- package/dist/lib/types/combobox/arrow/ComboboxArrow.d.ts +16 -0
- package/dist/lib/types/combobox/backdrop/ComboboxBackdrop.d.ts +14 -0
- package/dist/lib/types/combobox/chip/ComboboxChip.d.ts +17 -0
- package/dist/lib/types/combobox/chip/ComboboxChipContext.d.ts +8 -0
- package/dist/lib/types/combobox/chip-remove/ComboboxChipRemove.d.ts +26 -0
- package/dist/lib/types/combobox/chips/ComboboxChips.d.ts +16 -0
- package/dist/lib/types/combobox/chips/ComboboxChipsContext.d.ts +26 -0
- package/dist/lib/types/combobox/clear/ComboboxClear.d.ts +35 -0
- package/dist/lib/types/combobox/collection/ComboboxCollection.d.ts +19 -0
- package/dist/lib/types/combobox/empty/ComboboxEmpty.d.ts +16 -0
- package/dist/lib/types/combobox/group/ComboboxGroup.d.ts +19 -0
- package/dist/lib/types/combobox/group/ComboboxGroupContext.d.ts +9 -0
- package/dist/lib/types/combobox/group-label/ComboboxGroupLabel.d.ts +11 -0
- package/dist/lib/types/combobox/icon/ComboboxIcon.d.ts +12 -0
- package/dist/lib/types/combobox/index.d.ts +29 -0
- package/dist/lib/types/combobox/index.parts.d.ts +28 -0
- package/dist/lib/types/combobox/input/ComboboxInput.d.ts +36 -0
- package/dist/lib/types/combobox/input-group/ComboboxInputGroup.d.ts +24 -0
- package/dist/lib/types/combobox/item/ComboboxItem.d.ts +40 -0
- package/dist/lib/types/combobox/item/ComboboxItemContext.d.ts +9 -0
- package/dist/lib/types/combobox/item-indicator/ComboboxItemIndicator.d.ts +22 -0
- package/dist/lib/types/combobox/label/ComboboxLabel.d.ts +22 -0
- package/dist/lib/types/combobox/list/ComboboxList.d.ts +24 -0
- package/dist/lib/types/combobox/popup/ComboboxPopup.d.ts +35 -0
- package/dist/lib/types/combobox/portal/ComboboxPortal.d.ts +25 -0
- package/dist/lib/types/combobox/portal/ComboboxPortalContext.d.ts +5 -0
- package/dist/lib/types/combobox/positioner/ComboboxPositioner.d.ts +37 -0
- package/dist/lib/types/combobox/positioner/ComboboxPositionerContext.d.ts +11 -0
- package/dist/lib/types/combobox/root/AriaCombobox.d.ts +82 -0
- package/dist/lib/types/combobox/root/ComboboxRoot.d.ts +180 -0
- package/dist/lib/types/combobox/root/ComboboxRootContext.d.ts +99 -0
- package/dist/lib/types/combobox/root/utils/useFilter.d.ts +25 -0
- package/dist/lib/types/combobox/root/utils/useFilteredItems.d.ts +5 -0
- package/dist/lib/types/combobox/row/ComboboxRow.d.ts +14 -0
- package/dist/lib/types/combobox/row/ComboboxRowContext.d.ts +3 -0
- package/dist/lib/types/combobox/separator/ComboboxSeparator.d.ts +21 -0
- package/dist/lib/types/combobox/status/ComboboxStatus.d.ts +17 -0
- package/dist/lib/types/combobox/store/ComboboxItemRegistry.d.ts +39 -0
- package/dist/lib/types/combobox/store/ComboboxStore.d.ts +65 -0
- package/dist/lib/types/combobox/trigger/ComboboxTrigger.d.ts +36 -0
- package/dist/lib/types/combobox/types.d.ts +15 -0
- package/dist/lib/types/combobox/utils/ComboboxInternalDismissButton.d.ts +9 -0
- package/dist/lib/types/combobox/utils/comboboxPopupId.d.ts +5 -0
- package/dist/lib/types/combobox/utils/createInitialLiveRegionTextMutation.d.ts +7 -0
- package/dist/lib/types/combobox/utils/handleInputPress.d.ts +7 -0
- package/dist/lib/types/combobox/utils/parts.d.ts +4 -0
- package/dist/lib/types/combobox/utils/stateAttributesMapping.d.ts +58 -0
- package/dist/lib/types/combobox/value/ComboboxValue.d.ts +20 -0
- package/dist/lib/types/context-menu/index.d.ts +19 -0
- package/dist/lib/types/context-menu/index.parts.d.ts +19 -0
- package/dist/lib/types/context-menu/root/ContextMenuRoot.d.ts +21 -0
- package/dist/lib/types/context-menu/root/ContextMenuRootContext.d.ts +19 -0
- package/dist/lib/types/context-menu/trigger/ContextMenuTrigger.d.ts +21 -0
- package/dist/lib/types/csp-provider/CSPProvider.d.ts +14 -0
- package/dist/lib/types/csp-provider/index.d.ts +2 -0
- package/dist/lib/types/dialog/backdrop/DialogBackdrop.d.ts +18 -0
- package/dist/lib/types/dialog/close/DialogClose.d.ts +26 -0
- package/dist/lib/types/dialog/description/DialogDescription.d.ts +11 -0
- package/dist/lib/types/dialog/index.d.ts +10 -0
- package/dist/lib/types/dialog/index.parts.d.ts +10 -0
- package/dist/lib/types/dialog/popup/DialogPopup.d.ts +24 -0
- package/dist/lib/types/dialog/portal/DialogPortal.d.ts +17 -0
- package/dist/lib/types/dialog/portal/DialogPortalContext.d.ts +8 -0
- package/dist/lib/types/dialog/root/DialogRoot.d.ts +44 -0
- package/dist/lib/types/dialog/root/DialogRootContext.d.ts +38 -0
- package/dist/lib/types/dialog/store/DialogHandle.d.ts +11 -0
- package/dist/lib/types/dialog/store/DialogStore.d.ts +20 -0
- package/dist/lib/types/dialog/title/DialogTitle.d.ts +11 -0
- package/dist/lib/types/dialog/trigger/DialogTrigger.d.ts +30 -0
- package/dist/lib/types/dialog/utils/mergeDialogStyles.d.ts +2 -0
- package/dist/lib/types/dialog/utils/stateAttributesMapping.d.ts +20 -0
- package/dist/lib/types/dialog/viewport/DialogViewport.d.ts +16 -0
- package/dist/lib/types/direction-provider/DirectionProvider.d.ts +13 -0
- package/dist/lib/types/direction-provider/index.d.ts +4 -0
- package/dist/lib/types/drawer/backdrop/DrawerBackdrop.d.ts +24 -0
- package/dist/lib/types/drawer/backdrop/DrawerBackdropCssVars.d.ts +7 -0
- package/dist/lib/types/drawer/content/DrawerContent.d.ts +14 -0
- package/dist/lib/types/drawer/content/DrawerContentDataAttributes.d.ts +1 -0
- package/dist/lib/types/drawer/handle.d.ts +14 -0
- package/dist/lib/types/drawer/indent/DrawerIndent.d.ts +16 -0
- package/dist/lib/types/drawer/indent-background/DrawerIndentBackground.d.ts +23 -0
- package/dist/lib/types/drawer/index.d.ts +17 -0
- package/dist/lib/types/drawer/index.parts.d.ts +16 -0
- package/dist/lib/types/drawer/popup/DrawerPopup.d.ts +46 -0
- package/dist/lib/types/drawer/popup/DrawerPopupCssVars.d.ts +37 -0
- package/dist/lib/types/drawer/popup/DrawerPopupDataAttributes.d.ts +25 -0
- package/dist/lib/types/drawer/provider/DrawerProvider.d.ts +15 -0
- package/dist/lib/types/drawer/provider/DrawerProviderContext.d.ts +21 -0
- package/dist/lib/types/drawer/root/DrawerRoot.d.ts +65 -0
- package/dist/lib/types/drawer/root/DrawerRootContext.d.ts +68 -0
- package/dist/lib/types/drawer/root/createDrawerSnapPoints.d.ts +24 -0
- package/dist/lib/types/drawer/swipe-area/DrawerSwipeArea.d.ts +43 -0
- package/dist/lib/types/drawer/swipe-area/DrawerSwipeAreaDataAttributes.d.ts +15 -0
- package/dist/lib/types/drawer/viewport/DrawerViewport.d.ts +31 -0
- package/dist/lib/types/drawer/viewport/DrawerViewportContext.d.ts +12 -0
- package/dist/lib/types/drawer/viewport/DrawerViewportCssVars.d.ts +8 -0
- package/dist/lib/types/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardContext.d.ts +14 -0
- package/dist/lib/types/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardProvider.d.ts +14 -0
- package/dist/lib/types/field/control/FieldControl.d.ts +35 -0
- package/dist/lib/types/field/description/FieldDescription.d.ts +16 -0
- package/dist/lib/types/field/error/FieldError.d.ts +19 -0
- package/dist/lib/types/field/index.d.ts +8 -0
- package/dist/lib/types/field/index.parts.d.ts +8 -0
- package/dist/lib/types/field/item/FieldItem.d.ts +16 -0
- package/dist/lib/types/field/item/FieldItemContext.d.ts +6 -0
- package/dist/lib/types/field/label/FieldLabel.d.ts +24 -0
- package/dist/lib/types/field/root/FieldRoot.d.ts +30 -0
- package/dist/lib/types/field/root/createFieldValidation.d.ts +22 -0
- package/dist/lib/types/field/validity/FieldValidity.d.ts +16 -0
- package/dist/lib/types/fieldset/index.d.ts +3 -0
- package/dist/lib/types/fieldset/index.parts.d.ts +2 -0
- package/dist/lib/types/fieldset/legend/FieldsetLegend.d.ts +21 -0
- package/dist/lib/types/fieldset/root/FieldsetRoot.d.ts +21 -0
- package/dist/lib/types/fieldset/root/FieldsetRootContext.d.ts +11 -0
- package/dist/lib/types/form/Form.d.ts +39 -0
- package/dist/lib/types/form/index.d.ts +2 -0
- package/dist/lib/types/index.d.ts +41 -0
- package/dist/lib/types/input/Input.d.ts +20 -0
- package/dist/lib/types/input/index.d.ts +2 -0
- package/dist/lib/types/internals/buttonSemantics.d.ts +10 -0
- package/dist/lib/types/internals/clamp.d.ts +1 -0
- package/dist/lib/types/internals/composeEventHandlers.d.ts +11 -0
- package/dist/lib/types/internals/constants.d.ts +4 -0
- package/dist/lib/types/internals/createBaseUIEventDetails.d.ts +57 -0
- package/dist/lib/types/internals/createTransitionStatus.d.ts +9 -0
- package/dist/lib/types/internals/csp-context/CSPContext.d.ts +7 -0
- package/dist/lib/types/internals/csp-context/index.d.ts +2 -0
- package/dist/lib/types/internals/direction-context/DirectionContext.d.ts +6 -0
- package/dist/lib/types/internals/direction-context/index.d.ts +2 -0
- package/dist/lib/types/internals/field-constants.d.ts +44 -0
- package/dist/lib/types/internals/field-root-context/FieldRootContext.d.ts +31 -0
- package/dist/lib/types/internals/field-root-context/index.d.ts +2 -0
- package/dist/lib/types/internals/filter.d.ts +18 -0
- package/dist/lib/types/internals/form-context/FormContext.d.ts +13 -0
- package/dist/lib/types/internals/form-context/index.d.ts +3 -0
- package/dist/lib/types/internals/form-types.d.ts +11 -0
- package/dist/lib/types/internals/getStateAttributesProps.d.ts +4 -0
- package/dist/lib/types/internals/installOwnedEventHandlers.d.ts +3 -0
- package/dist/lib/types/internals/isSolidAccessor.d.ts +6 -0
- package/dist/lib/types/internals/itemEquality.d.ts +17 -0
- package/dist/lib/types/internals/labelable-provider/LabelableContext.d.ts +18 -0
- package/dist/lib/types/internals/labelable-provider/LabelableProvider.d.ts +11 -0
- package/dist/lib/types/internals/labelable-provider/index.d.ts +2 -0
- package/dist/lib/types/internals/mergeStyleValue.d.ts +8 -0
- package/dist/lib/types/internals/mergeStyles.d.ts +6 -0
- package/dist/lib/types/internals/overlay/FloatingRootStore.d.ts +49 -0
- package/dist/lib/types/internals/overlay/FloatingTree.d.ts +48 -0
- package/dist/lib/types/internals/overlay/FocusGuard.d.ts +2 -0
- package/dist/lib/types/internals/overlay/FocusManager.d.ts +30 -0
- package/dist/lib/types/internals/overlay/InternalBackdrop.d.ts +6 -0
- package/dist/lib/types/internals/overlay/PopupHandle.d.ts +47 -0
- package/dist/lib/types/internals/overlay/PopupPortal.d.ts +37 -0
- package/dist/lib/types/internals/overlay/PopupStore.d.ts +89 -0
- package/dist/lib/types/internals/overlay/PopupTriggerMap.d.ts +11 -0
- package/dist/lib/types/internals/overlay/PopupViewport.d.ts +16 -0
- package/dist/lib/types/internals/overlay/ReactiveStore.d.ts +26 -0
- package/dist/lib/types/internals/overlay/TriggerFocusGuards.d.ts +14 -0
- package/dist/lib/types/internals/overlay/adaptiveOrigin.d.ts +2 -0
- package/dist/lib/types/internals/overlay/compositeNavigation.d.ts +20 -0
- package/dist/lib/types/internals/overlay/createAnchorPositioning.d.ts +57 -0
- package/dist/lib/types/internals/overlay/createAnchoredPopupScrollLock.d.ts +12 -0
- package/dist/lib/types/internals/overlay/createClickInteraction.d.ts +20 -0
- package/dist/lib/types/internals/overlay/createClientPoint.d.ts +12 -0
- package/dist/lib/types/internals/overlay/createContextMenuInteraction.d.ts +17 -0
- package/dist/lib/types/internals/overlay/createDelayGroup.d.ts +18 -0
- package/dist/lib/types/internals/overlay/createDismiss.d.ts +27 -0
- package/dist/lib/types/internals/overlay/createFloatingPosition.d.ts +22 -0
- package/dist/lib/types/internals/overlay/createFocusInteraction.d.ts +14 -0
- package/dist/lib/types/internals/overlay/createHoverInteraction.d.ts +30 -0
- package/dist/lib/types/internals/overlay/createInitialPositioning.d.ts +3 -0
- package/dist/lib/types/internals/overlay/createListNavigation.d.ts +26 -0
- package/dist/lib/types/internals/overlay/createPopupAutoResize.d.ts +18 -0
- package/dist/lib/types/internals/overlay/createPopupPresence.d.ts +18 -0
- package/dist/lib/types/internals/overlay/createSwipeDismiss.d.ts +107 -0
- package/dist/lib/types/internals/overlay/createTypeahead.d.ts +20 -0
- package/dist/lib/types/internals/overlay/dom.d.ts +19 -0
- package/dist/lib/types/internals/overlay/eventEmitter.d.ts +7 -0
- package/dist/lib/types/internals/overlay/getElementAtPoint.d.ts +8 -0
- package/dist/lib/types/internals/overlay/index.d.ts +37 -0
- package/dist/lib/types/internals/overlay/inlineRect.d.ts +32 -0
- package/dist/lib/types/internals/overlay/markOthers.d.ts +6 -0
- package/dist/lib/types/internals/overlay/popupStateMapping.d.ts +46 -0
- package/dist/lib/types/internals/overlay/safePolygon.d.ts +24 -0
- package/dist/lib/types/internals/overlay/scrollLock.d.ts +10 -0
- package/dist/lib/types/internals/overlay/tabbable.d.ts +11 -0
- package/dist/lib/types/internals/platform.d.ts +1 -0
- package/dist/lib/types/internals/reason-parts.d.ts +35 -0
- package/dist/lib/types/internals/reasons.d.ts +4 -0
- package/dist/lib/types/internals/resolveClass.d.ts +3 -0
- package/dist/lib/types/internals/resolveStyle.d.ts +3 -0
- package/dist/lib/types/internals/runOnceAnimationsFinish.d.ts +4 -0
- package/dist/lib/types/internals/scrollable.d.ts +18 -0
- package/dist/lib/types/internals/setRef.d.ts +2 -0
- package/dist/lib/types/internals/stateAttributesMapping.d.ts +8 -0
- package/dist/lib/types/internals/types.d.ts +2 -0
- package/dist/lib/types/internals/valueLabel.d.ts +28 -0
- package/dist/lib/types/internals/withoutComponentBinding.d.ts +7 -0
- package/dist/lib/types/menu/arrow/MenuArrow.d.ts +16 -0
- package/dist/lib/types/menu/backdrop/MenuBackdrop.d.ts +14 -0
- package/dist/lib/types/menu/checkbox-item/MenuCheckboxItem.d.ts +37 -0
- package/dist/lib/types/menu/checkbox-item/MenuCheckboxItemContext.d.ts +6 -0
- package/dist/lib/types/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +18 -0
- package/dist/lib/types/menu/group/MenuGroup.d.ts +11 -0
- package/dist/lib/types/menu/group/MenuGroupContext.d.ts +9 -0
- package/dist/lib/types/menu/group-label/MenuGroupLabel.d.ts +11 -0
- package/dist/lib/types/menu/index.d.ts +20 -0
- package/dist/lib/types/menu/index.parts.d.ts +21 -0
- package/dist/lib/types/menu/item/MenuItem.d.ts +28 -0
- package/dist/lib/types/menu/item/createMenuItem.d.ts +24 -0
- package/dist/lib/types/menu/link-item/MenuLinkItem.d.ts +25 -0
- package/dist/lib/types/menu/popup/MenuPopup.d.ts +28 -0
- package/dist/lib/types/menu/portal/MenuPortal.d.ts +17 -0
- package/dist/lib/types/menu/portal/MenuPortalContext.d.ts +8 -0
- package/dist/lib/types/menu/positioner/MenuPositioner.d.ts +39 -0
- package/dist/lib/types/menu/positioner/MenuPositionerContext.d.ts +5 -0
- package/dist/lib/types/menu/radio-group/MenuRadioGroup.d.ts +24 -0
- package/dist/lib/types/menu/radio-group/MenuRadioGroupContext.d.ts +11 -0
- package/dist/lib/types/menu/radio-item/MenuRadioItem.d.ts +30 -0
- package/dist/lib/types/menu/radio-item/MenuRadioItemContext.d.ts +6 -0
- package/dist/lib/types/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +18 -0
- package/dist/lib/types/menu/root/MenuRoot.d.ts +56 -0
- package/dist/lib/types/menu/root/MenuRootContext.d.ts +23 -0
- package/dist/lib/types/menu/store/MenuCollection.d.ts +19 -0
- package/dist/lib/types/menu/store/MenuHandle.d.ts +10 -0
- package/dist/lib/types/menu/store/MenuStore.d.ts +110 -0
- package/dist/lib/types/menu/submenu-root/MenuSubmenuRoot.d.ts +17 -0
- package/dist/lib/types/menu/submenu-root/MenuSubmenuRootContext.d.ts +8 -0
- package/dist/lib/types/menu/submenu-trigger/MenuSubmenuTrigger.d.ts +33 -0
- package/dist/lib/types/menu/trigger/MenuTrigger.d.ts +36 -0
- package/dist/lib/types/menu/utils/mergeMenuStyles.d.ts +2 -0
- package/dist/lib/types/menu/utils/stateAttributesMapping.d.ts +39 -0
- package/dist/lib/types/menu/viewport/MenuViewport.d.ts +15 -0
- package/dist/lib/types/menubar/Menubar.d.ts +23 -0
- package/dist/lib/types/menubar/MenubarContext.d.ts +34 -0
- package/dist/lib/types/menubar/index.d.ts +2 -0
- package/dist/lib/types/meter/index.d.ts +6 -0
- package/dist/lib/types/meter/index.parts.d.ts +5 -0
- package/dist/lib/types/meter/indicator/MeterIndicator.d.ts +12 -0
- package/dist/lib/types/meter/label/MeterLabel.d.ts +17 -0
- package/dist/lib/types/meter/root/MeterRoot.d.ts +28 -0
- package/dist/lib/types/meter/root/MeterRootContext.d.ts +12 -0
- package/dist/lib/types/meter/track/MeterTrack.d.ts +12 -0
- package/dist/lib/types/meter/value/MeterValue.d.ts +16 -0
- package/dist/lib/types/navigation-menu/arrow/NavigationMenuArrow.d.ts +16 -0
- package/dist/lib/types/navigation-menu/backdrop/NavigationMenuBackdrop.d.ts +14 -0
- package/dist/lib/types/navigation-menu/composite/NavigationMenuCompositeContext.d.ts +22 -0
- package/dist/lib/types/navigation-menu/content/NavigationMenuContent.d.ts +21 -0
- package/dist/lib/types/navigation-menu/icon/NavigationMenuIcon.d.ts +12 -0
- package/dist/lib/types/navigation-menu/index.d.ts +14 -0
- package/dist/lib/types/navigation-menu/index.parts.d.ts +13 -0
- package/dist/lib/types/navigation-menu/item/NavigationMenuItem.d.ts +15 -0
- package/dist/lib/types/navigation-menu/item/NavigationMenuItemContext.d.ts +8 -0
- package/dist/lib/types/navigation-menu/link/NavigationMenuLink.d.ts +20 -0
- package/dist/lib/types/navigation-menu/list/NavigationMenuList.d.ts +12 -0
- package/dist/lib/types/navigation-menu/popup/NavigationMenuPopup.d.ts +23 -0
- package/dist/lib/types/navigation-menu/portal/NavigationMenuPortal.d.ts +17 -0
- package/dist/lib/types/navigation-menu/portal/NavigationMenuPortalContext.d.ts +8 -0
- package/dist/lib/types/navigation-menu/positioner/NavigationMenuPositioner.d.ts +37 -0
- package/dist/lib/types/navigation-menu/positioner/NavigationMenuPositionerContext.d.ts +5 -0
- package/dist/lib/types/navigation-menu/root/NavigationMenuRoot.d.ts +39 -0
- package/dist/lib/types/navigation-menu/root/NavigationMenuRootContext.d.ts +19 -0
- package/dist/lib/types/navigation-menu/store/NavigationMenuStore.d.ts +64 -0
- package/dist/lib/types/navigation-menu/trigger/NavigationMenuTrigger.d.ts +27 -0
- package/dist/lib/types/navigation-menu/utils/mergeNavigationMenuStyles.d.ts +2 -0
- package/dist/lib/types/navigation-menu/viewport/NavigationMenuViewport.d.ts +11 -0
- package/dist/lib/types/number-field/decrement/NumberFieldDecrement.d.ts +12 -0
- package/dist/lib/types/number-field/group/NumberFieldGroup.d.ts +12 -0
- package/dist/lib/types/number-field/increment/NumberFieldIncrement.d.ts +12 -0
- package/dist/lib/types/number-field/increment/NumberFieldStepperButton.d.ts +26 -0
- package/dist/lib/types/number-field/index.d.ts +8 -0
- package/dist/lib/types/number-field/index.parts.d.ts +7 -0
- package/dist/lib/types/number-field/input/NumberFieldInput.d.ts +25 -0
- package/dist/lib/types/number-field/root/NumberFieldRoot.d.ts +55 -0
- package/dist/lib/types/number-field/root/NumberFieldRootContext.d.ts +39 -0
- package/dist/lib/types/number-field/root/createPressAndHold.d.ts +24 -0
- package/dist/lib/types/number-field/scrub-area/NumberFieldScrubArea.d.ts +20 -0
- package/dist/lib/types/number-field/scrub-area/NumberFieldScrubAreaContext.d.ts +13 -0
- package/dist/lib/types/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.d.ts +12 -0
- package/dist/lib/types/number-field/utils/format.d.ts +2 -0
- package/dist/lib/types/number-field/utils/getViewportRect.d.ts +6 -0
- package/dist/lib/types/number-field/utils/parse.d.ts +40 -0
- package/dist/lib/types/number-field/utils/platform.d.ts +3 -0
- package/dist/lib/types/number-field/utils/stateAttributesMapping.d.ts +10 -0
- package/dist/lib/types/number-field/utils/types.d.ts +16 -0
- package/dist/lib/types/number-field/utils/validate.d.ts +9 -0
- package/dist/lib/types/otp-field/index.d.ts +3 -0
- package/dist/lib/types/otp-field/index.parts.d.ts +3 -0
- package/dist/lib/types/otp-field/input/OTPFieldInput.d.ts +29 -0
- package/dist/lib/types/otp-field/root/OTPFieldRoot.d.ts +56 -0
- package/dist/lib/types/otp-field/root/OTPFieldRootContext.d.ts +45 -0
- package/dist/lib/types/otp-field/utils/otp.d.ts +14 -0
- package/dist/lib/types/otp-field/utils/stateAttributesMapping.d.ts +5 -0
- package/dist/lib/types/popover/arrow/PopoverArrow.d.ts +16 -0
- package/dist/lib/types/popover/backdrop/PopoverBackdrop.d.ts +14 -0
- package/dist/lib/types/popover/close/PopoverClose.d.ts +25 -0
- package/dist/lib/types/popover/description/PopoverDescription.d.ts +11 -0
- package/dist/lib/types/popover/index.d.ts +12 -0
- package/dist/lib/types/popover/index.parts.d.ts +12 -0
- package/dist/lib/types/popover/popup/PopoverPopup.d.ts +26 -0
- package/dist/lib/types/popover/portal/PopoverPortal.d.ts +17 -0
- package/dist/lib/types/popover/portal/PopoverPortalContext.d.ts +8 -0
- package/dist/lib/types/popover/positioner/PopoverPositioner.d.ts +38 -0
- package/dist/lib/types/popover/positioner/PopoverPositionerContext.d.ts +5 -0
- package/dist/lib/types/popover/root/PopoverRoot.d.ts +38 -0
- package/dist/lib/types/popover/root/PopoverRootContext.d.ts +25 -0
- package/dist/lib/types/popover/store/PopoverHandle.d.ts +10 -0
- package/dist/lib/types/popover/store/PopoverStore.d.ts +65 -0
- package/dist/lib/types/popover/title/PopoverTitle.d.ts +11 -0
- package/dist/lib/types/popover/trigger/PopoverTrigger.d.ts +33 -0
- package/dist/lib/types/popover/utils/ClosePartContext.d.ts +10 -0
- package/dist/lib/types/popover/utils/mergePopoverStyles.d.ts +2 -0
- package/dist/lib/types/popover/utils/stateAttributesMapping.d.ts +26 -0
- package/dist/lib/types/popover/viewport/PopoverViewport.d.ts +15 -0
- package/dist/lib/types/preview-card/arrow/PreviewCardArrow.d.ts +16 -0
- package/dist/lib/types/preview-card/backdrop/PreviewCardBackdrop.d.ts +14 -0
- package/dist/lib/types/preview-card/index.d.ts +9 -0
- package/dist/lib/types/preview-card/index.parts.d.ts +9 -0
- package/dist/lib/types/preview-card/popup/PreviewCardPopup.d.ts +23 -0
- package/dist/lib/types/preview-card/portal/PreviewCardPortal.d.ts +17 -0
- package/dist/lib/types/preview-card/portal/PreviewCardPortalContext.d.ts +8 -0
- package/dist/lib/types/preview-card/positioner/PreviewCardPositioner.d.ts +38 -0
- package/dist/lib/types/preview-card/positioner/PreviewCardPositionerContext.d.ts +5 -0
- package/dist/lib/types/preview-card/root/PreviewCardRoot.d.ts +37 -0
- package/dist/lib/types/preview-card/root/PreviewCardRootContext.d.ts +12 -0
- package/dist/lib/types/preview-card/store/PreviewCardHandle.d.ts +10 -0
- package/dist/lib/types/preview-card/store/PreviewCardStore.d.ts +34 -0
- package/dist/lib/types/preview-card/trigger/PreviewCardTrigger.d.ts +20 -0
- package/dist/lib/types/preview-card/utils/mergePreviewCardStyles.d.ts +2 -0
- package/dist/lib/types/preview-card/utils/stateAttributesMapping.d.ts +32 -0
- package/dist/lib/types/preview-card/viewport/PreviewCardViewport.d.ts +14 -0
- package/dist/lib/types/progress/index.d.ts +6 -0
- package/dist/lib/types/progress/index.parts.d.ts +6 -0
- package/dist/lib/types/progress/indicator/ProgressIndicator.d.ts +12 -0
- package/dist/lib/types/progress/label/ProgressLabel.d.ts +17 -0
- package/dist/lib/types/progress/root/ProgressRoot.d.ts +31 -0
- package/dist/lib/types/progress/root/ProgressRootContext.d.ts +13 -0
- package/dist/lib/types/progress/root/stateAttributesMapping.d.ts +3 -0
- package/dist/lib/types/progress/track/ProgressTrack.d.ts +12 -0
- package/dist/lib/types/progress/value/ProgressValue.d.ts +16 -0
- package/dist/lib/types/radio/index.d.ts +3 -0
- package/dist/lib/types/radio/index.parts.d.ts +2 -0
- package/dist/lib/types/radio/indicator/RadioIndicator.d.ts +20 -0
- package/dist/lib/types/radio/root/RadioRoot.d.ts +39 -0
- package/dist/lib/types/radio/root/RadioRootContext.d.ts +7 -0
- package/dist/lib/types/radio-group/RadioGroup.d.ts +43 -0
- package/dist/lib/types/radio-group/RadioGroupContext.d.ts +33 -0
- package/dist/lib/types/radio-group/index.d.ts +2 -0
- package/dist/lib/types/scroll-area/constants.d.ts +2 -0
- package/dist/lib/types/scroll-area/content/ScrollAreaContent.d.ts +12 -0
- package/dist/lib/types/scroll-area/corner/ScrollAreaCorner.d.ts +11 -0
- package/dist/lib/types/scroll-area/index.d.ts +7 -0
- package/dist/lib/types/scroll-area/index.parts.d.ts +6 -0
- package/dist/lib/types/scroll-area/root/ScrollAreaRoot.d.ts +58 -0
- package/dist/lib/types/scroll-area/root/ScrollAreaRootContext.d.ts +44 -0
- package/dist/lib/types/scroll-area/root/stateAttributes.d.ts +3 -0
- package/dist/lib/types/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +28 -0
- package/dist/lib/types/scroll-area/scrollbar/ScrollAreaScrollbarContext.d.ts +7 -0
- package/dist/lib/types/scroll-area/thumb/ScrollAreaThumb.d.ts +22 -0
- package/dist/lib/types/scroll-area/utils/dom.d.ts +2 -0
- package/dist/lib/types/scroll-area/utils/eventTarget.d.ts +2 -0
- package/dist/lib/types/scroll-area/utils/getOffset.d.ts +1 -0
- package/dist/lib/types/scroll-area/utils/scrollEdges.d.ts +1 -0
- package/dist/lib/types/scroll-area/viewport/ScrollAreaViewport.d.ts +22 -0
- package/dist/lib/types/scroll-area/viewport/ScrollAreaViewportContext.d.ts +7 -0
- package/dist/lib/types/select/arrow/SelectArrow.d.ts +16 -0
- package/dist/lib/types/select/backdrop/SelectBackdrop.d.ts +14 -0
- package/dist/lib/types/select/group/SelectGroup.d.ts +11 -0
- package/dist/lib/types/select/group/SelectGroupContext.d.ts +9 -0
- package/dist/lib/types/select/group-label/SelectGroupLabel.d.ts +11 -0
- package/dist/lib/types/select/icon/SelectIcon.d.ts +12 -0
- package/dist/lib/types/select/index.d.ts +20 -0
- package/dist/lib/types/select/index.parts.d.ts +19 -0
- package/dist/lib/types/select/item/SelectItem.d.ts +32 -0
- package/dist/lib/types/select/item/SelectItemContext.d.ts +12 -0
- package/dist/lib/types/select/item-indicator/SelectItemIndicator.d.ts +18 -0
- package/dist/lib/types/select/item-text/SelectItemText.d.ts +11 -0
- package/dist/lib/types/select/label/SelectLabel.d.ts +17 -0
- package/dist/lib/types/select/list/SelectList.d.ts +16 -0
- package/dist/lib/types/select/popup/SelectPopup.d.ts +26 -0
- package/dist/lib/types/select/portal/SelectPortal.d.ts +16 -0
- package/dist/lib/types/select/portal/SelectPortalContext.d.ts +4 -0
- package/dist/lib/types/select/positioner/SelectPositioner.d.ts +37 -0
- package/dist/lib/types/select/positioner/SelectPositionerContext.d.ts +16 -0
- package/dist/lib/types/select/root/SelectRoot.d.ts +52 -0
- package/dist/lib/types/select/root/SelectRootContext.d.ts +63 -0
- package/dist/lib/types/select/scroll-arrow/SelectScrollArrow.d.ts +22 -0
- package/dist/lib/types/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +15 -0
- package/dist/lib/types/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +15 -0
- package/dist/lib/types/select/separator/SelectSeparator.d.ts +17 -0
- package/dist/lib/types/select/store/SelectCollection.d.ts +25 -0
- package/dist/lib/types/select/store/SelectStore.d.ts +82 -0
- package/dist/lib/types/select/trigger/SelectTrigger.d.ts +35 -0
- package/dist/lib/types/select/types.d.ts +10 -0
- package/dist/lib/types/select/utils/equality.d.ts +2 -0
- package/dist/lib/types/select/utils/mergeSelectStyles.d.ts +1 -0
- package/dist/lib/types/select/utils/scrollEdges.d.ts +3 -0
- package/dist/lib/types/select/utils/stateAttributesMapping.d.ts +37 -0
- package/dist/lib/types/select/utils/value.d.ts +7 -0
- package/dist/lib/types/select/value/SelectValue.d.ts +18 -0
- package/dist/lib/types/separator/Separator.d.ts +19 -0
- package/dist/lib/types/separator/index.d.ts +2 -0
- package/dist/lib/types/slider/control/SliderControl.d.ts +18 -0
- package/dist/lib/types/slider/index.d.ts +8 -0
- package/dist/lib/types/slider/index.parts.d.ts +7 -0
- package/dist/lib/types/slider/indicator/SliderIndicator.d.ts +12 -0
- package/dist/lib/types/slider/label/SliderLabel.d.ts +17 -0
- package/dist/lib/types/slider/root/SliderRoot.d.ts +57 -0
- package/dist/lib/types/slider/root/SliderRootContext.d.ts +63 -0
- package/dist/lib/types/slider/stateAttributesMapping.d.ts +14 -0
- package/dist/lib/types/slider/thumb/SliderThumb.d.ts +31 -0
- package/dist/lib/types/slider/thumb/SliderThumbDataAttributes.d.ts +11 -0
- package/dist/lib/types/slider/thumb/prehydrationScript.d.ts +1 -0
- package/dist/lib/types/slider/track/SliderTrack.d.ts +12 -0
- package/dist/lib/types/slider/utils/dom.d.ts +4 -0
- package/dist/lib/types/slider/utils/getPushedThumbValues.d.ts +1 -0
- package/dist/lib/types/slider/utils/getSliderValue.d.ts +1 -0
- package/dist/lib/types/slider/utils/math.d.ts +4 -0
- package/dist/lib/types/slider/utils/resolveThumbCollision.d.ts +7 -0
- package/dist/lib/types/slider/utils/roundValueToStep.d.ts +2 -0
- package/dist/lib/types/slider/utils/validateMinimumDistance.d.ts +1 -0
- package/dist/lib/types/slider/value/SliderValue.d.ts +16 -0
- package/dist/lib/types/switch/index.d.ts +3 -0
- package/dist/lib/types/switch/index.parts.d.ts +2 -0
- package/dist/lib/types/switch/root/SwitchRoot.d.ts +55 -0
- package/dist/lib/types/switch/root/SwitchRootContext.d.ts +7 -0
- package/dist/lib/types/switch/stateAttributesMapping.d.ts +9 -0
- package/dist/lib/types/switch/thumb/SwitchThumb.d.ts +12 -0
- package/dist/lib/types/tabs/index.d.ts +6 -0
- package/dist/lib/types/tabs/index.parts.d.ts +5 -0
- package/dist/lib/types/tabs/indicator/TabsIndicator.d.ts +22 -0
- package/dist/lib/types/tabs/indicator/TabsIndicatorCssVars.d.ts +8 -0
- package/dist/lib/types/tabs/indicator/prehydrationScript.d.ts +1 -0
- package/dist/lib/types/tabs/list/TabsList.d.ts +21 -0
- package/dist/lib/types/tabs/list/TabsListContext.d.ts +14 -0
- package/dist/lib/types/tabs/panel/TabsPanel.d.ts +30 -0
- package/dist/lib/types/tabs/panel/TabsPanelDataAttributes.d.ts +6 -0
- package/dist/lib/types/tabs/root/TabsRoot.d.ts +38 -0
- package/dist/lib/types/tabs/root/TabsRootContext.d.ts +43 -0
- package/dist/lib/types/tabs/root/TabsRootDataAttributes.d.ts +4 -0
- package/dist/lib/types/tabs/root/stateAttributesMapping.d.ts +8 -0
- package/dist/lib/types/tabs/tab/TabsTab.d.ts +59 -0
- package/dist/lib/types/tabs/tab/TabsTabDataAttributes.d.ts +6 -0
- package/dist/lib/types/toast/action/ToastAction.d.ts +30 -0
- package/dist/lib/types/toast/arrow/ToastArrow.d.ts +18 -0
- package/dist/lib/types/toast/close/ToastClose.d.ts +29 -0
- package/dist/lib/types/toast/content/ToastContent.d.ts +15 -0
- package/dist/lib/types/toast/createToastManager.d.ts +15 -0
- package/dist/lib/types/toast/description/ToastDescription.d.ts +16 -0
- package/dist/lib/types/toast/index.d.ts +17 -0
- package/dist/lib/types/toast/index.parts.d.ts +11 -0
- package/dist/lib/types/toast/portal/ToastPortal.d.ts +20 -0
- package/dist/lib/types/toast/positioner/ToastPositioner.d.ts +42 -0
- package/dist/lib/types/toast/positioner/ToastPositionerContext.d.ts +6 -0
- package/dist/lib/types/toast/provider/ToastProvider.d.ts +28 -0
- package/dist/lib/types/toast/provider/ToastProviderContext.d.ts +5 -0
- package/dist/lib/types/toast/root/ToastRoot.d.ts +39 -0
- package/dist/lib/types/toast/root/ToastRootContext.d.ts +14 -0
- package/dist/lib/types/toast/store/ToastStore.d.ts +60 -0
- package/dist/lib/types/toast/title/ToastTitle.d.ts +13 -0
- package/dist/lib/types/toast/types.d.ts +77 -0
- package/dist/lib/types/toast/useToastManager.d.ts +11 -0
- package/dist/lib/types/toast/utils/createToastLabelPart.d.ts +17 -0
- package/dist/lib/types/toast/utils/focusVisible.d.ts +6 -0
- package/dist/lib/types/toast/utils/generateToastId.d.ts +5 -0
- package/dist/lib/types/toast/utils/isRenderableNode.d.ts +6 -0
- package/dist/lib/types/toast/utils/mergeToastStyles.d.ts +2 -0
- package/dist/lib/types/toast/utils/resolvePromiseOptions.d.ts +2 -0
- package/dist/lib/types/toast/viewport/ToastViewport.d.ts +13 -0
- package/dist/lib/types/toggle/Toggle.d.ts +40 -0
- package/dist/lib/types/toggle/index.d.ts +2 -0
- package/dist/lib/types/toggle-group/ToggleGroup.d.ts +37 -0
- package/dist/lib/types/toggle-group/ToggleGroupContext.d.ts +25 -0
- package/dist/lib/types/toggle-group/index.d.ts +2 -0
- package/dist/lib/types/toolbar/ToolbarItemOwnerContext.d.ts +10 -0
- package/dist/lib/types/toolbar/button/ToolbarButton.d.ts +32 -0
- package/dist/lib/types/toolbar/createToolbarItem.d.ts +13 -0
- package/dist/lib/types/toolbar/group/ToolbarGroup.d.ts +16 -0
- package/dist/lib/types/toolbar/group/ToolbarGroupContext.d.ts +8 -0
- package/dist/lib/types/toolbar/index.d.ts +8 -0
- package/dist/lib/types/toolbar/index.parts.d.ts +7 -0
- package/dist/lib/types/toolbar/input/ToolbarInput.d.ts +29 -0
- package/dist/lib/types/toolbar/link/ToolbarLink.d.ts +14 -0
- package/dist/lib/types/toolbar/root/ToolbarRoot.d.ts +29 -0
- package/dist/lib/types/toolbar/root/ToolbarRootContext.d.ts +23 -0
- package/dist/lib/types/toolbar/separator/ToolbarSeparator.d.ts +16 -0
- package/dist/lib/types/tooltip/arrow/TooltipArrow.d.ts +17 -0
- package/dist/lib/types/tooltip/index.d.ts +9 -0
- package/dist/lib/types/tooltip/index.parts.d.ts +9 -0
- package/dist/lib/types/tooltip/popup/TooltipPopup.d.ts +23 -0
- package/dist/lib/types/tooltip/portal/TooltipPortal.d.ts +17 -0
- package/dist/lib/types/tooltip/portal/TooltipPortalContext.d.ts +8 -0
- package/dist/lib/types/tooltip/positioner/TooltipPositioner.d.ts +37 -0
- package/dist/lib/types/tooltip/positioner/TooltipPositionerContext.d.ts +14 -0
- package/dist/lib/types/tooltip/provider/TooltipProvider.d.ts +15 -0
- package/dist/lib/types/tooltip/provider/TooltipProviderContext.d.ts +10 -0
- package/dist/lib/types/tooltip/root/TooltipRoot.d.ts +40 -0
- package/dist/lib/types/tooltip/root/TooltipRootContext.d.ts +11 -0
- package/dist/lib/types/tooltip/store/TooltipHandle.d.ts +10 -0
- package/dist/lib/types/tooltip/store/TooltipStore.d.ts +60 -0
- package/dist/lib/types/tooltip/trigger/TooltipTrigger.d.ts +35 -0
- package/dist/lib/types/tooltip/utils/mergeTooltipStyles.d.ts +2 -0
- package/dist/lib/types/tooltip/utils/stateAttributesMapping.d.ts +68 -0
- package/dist/lib/types/tooltip/viewport/TooltipViewport.d.ts +14 -0
- package/dist/lib/types/types/index.d.ts +29 -0
- package/package.json +583 -0
|
@@ -0,0 +1,1940 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { getStateAttributesProps as t } from "./internals/getStateAttributesProps.js";
|
|
3
|
+
import { I as n, S as r, t as i, w as a, y as o } from "./reasons-Co5CzjKq.js";
|
|
4
|
+
import { n as s, t as c } from "./resolveStyle-XcgAuaKR.js";
|
|
5
|
+
import { createChangeEventDetails as l } from "./internals/createBaseUIEventDetails.js";
|
|
6
|
+
import { transitionStatusMapping as u } from "./internals/stateAttributesMapping.js";
|
|
7
|
+
import { composeEventHandlers as d } from "./internals/composeEventHandlers.js";
|
|
8
|
+
import { t as f } from "./runOnceAnimationsFinish-15EM-Z4l.js";
|
|
9
|
+
import { m as p, n as m, p as h } from "./dom-BEAeQ9Eb.js";
|
|
10
|
+
import { t as g } from "./createAnchorPositioning-DcxDXUgB.js";
|
|
11
|
+
import { t as _ } from "./InternalBackdrop-cSK13gaM.js";
|
|
12
|
+
import { t as v } from "./createAnchoredPopupScrollLock-Cx0cbh1_.js";
|
|
13
|
+
import { t as y } from "./createClickInteraction-CTaIFBiV.js";
|
|
14
|
+
import { c as b, i as x, n as S, r as C, s as w, t as T } from "./FloatingTree-23B7KKPD.js";
|
|
15
|
+
import { a as E, n as D, o as O, t as k } from "./PopupStore-DjB-wO88.js";
|
|
16
|
+
import { t as A } from "./createTransitionStatus-B1L-whed.js";
|
|
17
|
+
import { a as j, i as M, n as N, o as ee, r as te } from "./popupStateMapping-C9eZl19i.js";
|
|
18
|
+
import { t as ne } from "./FocusManager-grSdNHqW.js";
|
|
19
|
+
import { t as re } from "./TriggerFocusGuards-CQ-JuASy.js";
|
|
20
|
+
import { a as ie, i as ae, n as oe, r as se, t as ce } from "./buttonSemantics-paljfpOX.js";
|
|
21
|
+
import { t as le } from "./setRef-fXF6OIo3.js";
|
|
22
|
+
import { n as ue } from "./DirectionContext-BwMabICS.js";
|
|
23
|
+
import { fieldStateAttributesMapping as de } from "./internals/field-constants.js";
|
|
24
|
+
import { n as fe } from "./FieldRootContext-izCEh80D.js";
|
|
25
|
+
import { n as pe } from "./FormContext-BB05lWOI.js";
|
|
26
|
+
import { a as me, c as he, i as P, n as ge, o as _e, r as F, t as I } from "./mergeStyleValue-C4ITiiIV.js";
|
|
27
|
+
import { r as ve } from "./LabelableContext-DKsB0fIx.js";
|
|
28
|
+
import { n as ye } from "./ToolbarRootContext-88yZoAOy.js";
|
|
29
|
+
import { Dynamic as L, createComponent as R, effect as be, getNextElement as xe, insert as Se, memo as Ce, mergeProps as z, ref as we, runHydrationEvents as Te, scope as Ee, setAttribute as B, spread as De, style as Oe, template as ke } from "@solidjs/web";
|
|
30
|
+
import { For as Ae, Show as V, createContext as H, createEffect as U, createMemo as W, createSignal as G, createUniqueId as je, flush as Me, merge as K, omit as q, onCleanup as J, untrack as Y, useContext as X } from "solid-js";
|
|
31
|
+
//#region src/select/utils/value.ts
|
|
32
|
+
function Ne(e, t) {
|
|
33
|
+
return e == null ? "" : t ? t(e) ?? "" : typeof e == "object" && Q(e, "value") && Q(e, "label") ? ze(e.value) : ze(e);
|
|
34
|
+
}
|
|
35
|
+
function Pe(e, t) {
|
|
36
|
+
if (e == null) return "";
|
|
37
|
+
if (t) return t(e) ?? "";
|
|
38
|
+
if (typeof e == "object") {
|
|
39
|
+
if (Q(e, "label") && e.label != null) return String(e.label);
|
|
40
|
+
if (Q(e, "value") && e.value != null) return String(e.value);
|
|
41
|
+
}
|
|
42
|
+
return ze(e);
|
|
43
|
+
}
|
|
44
|
+
function Fe(e, t, n) {
|
|
45
|
+
if (e != null && n) return n(e);
|
|
46
|
+
if (typeof e == "object" && e && Q(e, "label") && e.label != null) return e.label;
|
|
47
|
+
let r = Re(e, t);
|
|
48
|
+
return r.found ? r.label : Pe(e, n);
|
|
49
|
+
}
|
|
50
|
+
function Ie(e, t, n) {
|
|
51
|
+
return e.map((e) => Fe(e, t, n)).flatMap((e, t) => t === 0 ? [e] : [", ", e]);
|
|
52
|
+
}
|
|
53
|
+
function Le(e) {
|
|
54
|
+
return Re(null, e).found && Re(null, e).label != null;
|
|
55
|
+
}
|
|
56
|
+
function Re(e, t) {
|
|
57
|
+
if (!t) return {
|
|
58
|
+
found: !1,
|
|
59
|
+
label: void 0
|
|
60
|
+
};
|
|
61
|
+
if (!Array.isArray(t)) {
|
|
62
|
+
let n = String(e);
|
|
63
|
+
return Object.prototype.hasOwnProperty.call(t, n) ? {
|
|
64
|
+
found: !0,
|
|
65
|
+
label: t[n]
|
|
66
|
+
} : {
|
|
67
|
+
found: !1,
|
|
68
|
+
label: void 0
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
let n = Z(t);
|
|
72
|
+
for (let t of n) if (Object.is(t.value, e) || typeof e == "object" && e && Q(e, "value") && Object.is(t.value, e.value)) return {
|
|
73
|
+
found: !0,
|
|
74
|
+
label: t.label
|
|
75
|
+
};
|
|
76
|
+
return {
|
|
77
|
+
found: !1,
|
|
78
|
+
label: void 0
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function Z(e) {
|
|
82
|
+
let t = e[0];
|
|
83
|
+
return t && typeof t == "object" && "items" in t ? e.flatMap((e) => e.items) : e;
|
|
84
|
+
}
|
|
85
|
+
function ze(e) {
|
|
86
|
+
if (typeof e == "string") return e;
|
|
87
|
+
try {
|
|
88
|
+
return JSON.stringify(e) ?? String(e);
|
|
89
|
+
} catch {
|
|
90
|
+
return String(e);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function Q(e, t) {
|
|
94
|
+
return Object.prototype.hasOwnProperty.call(e, t);
|
|
95
|
+
}
|
|
96
|
+
function Be(e, t) {
|
|
97
|
+
return Math.max(0, e - t);
|
|
98
|
+
}
|
|
99
|
+
function Ve(e, t) {
|
|
100
|
+
return e <= 1 ? 0 : t - e <= 1 ? t : Math.max(0, Math.min(t, e));
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/select/store/SelectCollection.ts
|
|
104
|
+
var He = class {
|
|
105
|
+
registrations = /* @__PURE__ */ new Map();
|
|
106
|
+
revision;
|
|
107
|
+
setRevision;
|
|
108
|
+
order = 0;
|
|
109
|
+
constructor() {
|
|
110
|
+
let [e, t] = G(0, { ownedWrite: !0 });
|
|
111
|
+
this.revision = e, this.setRevision = t;
|
|
112
|
+
}
|
|
113
|
+
register(e) {
|
|
114
|
+
let t = {
|
|
115
|
+
...e,
|
|
116
|
+
order: this.order
|
|
117
|
+
};
|
|
118
|
+
return this.order += 1, this.registrations.set(e.token, t), this.touch(), () => {
|
|
119
|
+
this.registrations.delete(e.token) && this.touch();
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
touch() {
|
|
123
|
+
this.setRevision((e) => e + 1);
|
|
124
|
+
}
|
|
125
|
+
items() {
|
|
126
|
+
return this.revision(), Array.from(this.registrations.values()).sort(Ue);
|
|
127
|
+
}
|
|
128
|
+
indexOf(e) {
|
|
129
|
+
return this.items().findIndex((t) => t.token === e);
|
|
130
|
+
}
|
|
131
|
+
elements() {
|
|
132
|
+
return this.items().map((e) => e.element());
|
|
133
|
+
}
|
|
134
|
+
labels() {
|
|
135
|
+
return this.items().map((e) => {
|
|
136
|
+
let t = e.label();
|
|
137
|
+
return t === void 0 ? e.textElement()?.textContent ?? e.element()?.textContent ?? null : t;
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
values() {
|
|
141
|
+
return this.items().map((e) => e.value());
|
|
142
|
+
}
|
|
143
|
+
disabledIndices() {
|
|
144
|
+
return this.items().flatMap((e, t) => e.disabled() ? [t] : []);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
function Ue(e, t) {
|
|
148
|
+
let n = e.element(), r = t.element();
|
|
149
|
+
if (n && r && n !== r) {
|
|
150
|
+
let e = n.compareDocumentPosition(r);
|
|
151
|
+
if (e & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
|
|
152
|
+
if (e & Node.DOCUMENT_POSITION_PRECEDING) return 1;
|
|
153
|
+
}
|
|
154
|
+
return e.order - t.order;
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/select/store/SelectStore.ts
|
|
158
|
+
var We = class extends k {
|
|
159
|
+
collection = new He();
|
|
160
|
+
selection = {
|
|
161
|
+
allowSelectedMouseUp: !1,
|
|
162
|
+
allowUnselectedMouseUp: !1,
|
|
163
|
+
dragY: 0
|
|
164
|
+
};
|
|
165
|
+
activeElementAccessor;
|
|
166
|
+
setActiveElementSignal;
|
|
167
|
+
activeElementValue = null;
|
|
168
|
+
openMethodAccessor;
|
|
169
|
+
setOpenMethodSignal;
|
|
170
|
+
openReasonAccessor;
|
|
171
|
+
setOpenReasonSignal;
|
|
172
|
+
forceMountAccessor;
|
|
173
|
+
setForceMountSignal;
|
|
174
|
+
labelIdAccessor;
|
|
175
|
+
setLabelIdSignal;
|
|
176
|
+
listElementAccessor;
|
|
177
|
+
setListElementSignal;
|
|
178
|
+
popupSideAccessor;
|
|
179
|
+
setPopupSideSignal;
|
|
180
|
+
scrollUpVisibleAccessor;
|
|
181
|
+
setScrollUpVisibleSignal;
|
|
182
|
+
scrollDownVisibleAccessor;
|
|
183
|
+
setScrollDownVisibleSignal;
|
|
184
|
+
hasScrollArrowsAccessor;
|
|
185
|
+
setHasScrollArrowsSignal;
|
|
186
|
+
alignItemAccessor;
|
|
187
|
+
setAlignItemSignal;
|
|
188
|
+
typingAccessor;
|
|
189
|
+
setTypingSignal;
|
|
190
|
+
forceMountAllowed = !0;
|
|
191
|
+
focusSequence = 0;
|
|
192
|
+
scrollFrame;
|
|
193
|
+
pointerX = null;
|
|
194
|
+
pointerY = null;
|
|
195
|
+
pointerHoverBlocked = !1;
|
|
196
|
+
pointerMovements = /* @__PURE__ */ new WeakMap();
|
|
197
|
+
pointerHoverFrame;
|
|
198
|
+
constructor(e) {
|
|
199
|
+
super(e);
|
|
200
|
+
let [t, n] = G(null, { ownedWrite: !0 });
|
|
201
|
+
this.activeElementAccessor = t, this.setActiveElementSignal = n;
|
|
202
|
+
let [r, i] = G(null, { ownedWrite: !0 });
|
|
203
|
+
this.openMethodAccessor = r, this.setOpenMethodSignal = i;
|
|
204
|
+
let [a, o] = G(null, { ownedWrite: !0 });
|
|
205
|
+
this.openReasonAccessor = a, this.setOpenReasonSignal = o;
|
|
206
|
+
let [s, c] = G(!1, { ownedWrite: !0 });
|
|
207
|
+
this.forceMountAccessor = s, this.setForceMountSignal = c;
|
|
208
|
+
let [l, u] = G();
|
|
209
|
+
this.labelIdAccessor = l, this.setLabelIdSignal = u;
|
|
210
|
+
let [d, f] = G(null, { ownedWrite: !0 });
|
|
211
|
+
this.listElementAccessor = d, this.setListElementSignal = f;
|
|
212
|
+
let [p, m] = G(null, { ownedWrite: !0 });
|
|
213
|
+
this.popupSideAccessor = p, this.setPopupSideSignal = m;
|
|
214
|
+
let [h, g] = G(!1, { ownedWrite: !0 });
|
|
215
|
+
this.scrollUpVisibleAccessor = h, this.setScrollUpVisibleSignal = g;
|
|
216
|
+
let [_, v] = G(!1, { ownedWrite: !0 });
|
|
217
|
+
this.scrollDownVisibleAccessor = _, this.setScrollDownVisibleSignal = v;
|
|
218
|
+
let [y, b] = G(!1, { ownedWrite: !0 });
|
|
219
|
+
this.hasScrollArrowsAccessor = y, this.setHasScrollArrowsSignal = b;
|
|
220
|
+
let [x, S] = G(!1, { ownedWrite: !0 });
|
|
221
|
+
this.alignItemAccessor = x, this.setAlignItemSignal = S;
|
|
222
|
+
let [C, w] = G(!1, { ownedWrite: !0 });
|
|
223
|
+
this.typingAccessor = C, this.setTypingSignal = w;
|
|
224
|
+
}
|
|
225
|
+
activeIndex() {
|
|
226
|
+
this.activeElementAccessor();
|
|
227
|
+
let e = this.activeElementValue;
|
|
228
|
+
if (!e) return null;
|
|
229
|
+
let t = this.collection.elements().indexOf(e);
|
|
230
|
+
return t === -1 ? null : t;
|
|
231
|
+
}
|
|
232
|
+
activeElement() {
|
|
233
|
+
return this.activeElementAccessor(), this.activeElementValue;
|
|
234
|
+
}
|
|
235
|
+
setActiveIndex(e, t = !1) {
|
|
236
|
+
let n = e === null ? null : this.collection.elements()[e] ?? null, r = ++this.focusSequence;
|
|
237
|
+
if (this.activeElementValue = n, this.setActiveElementSignal(n), this.scrollFrame &&= (this.scrollFrame.window.cancelAnimationFrame(this.scrollFrame.id), void 0), t && n) {
|
|
238
|
+
Me(), n.focus({ preventScroll: !0 });
|
|
239
|
+
let e = n.ownerDocument.defaultView;
|
|
240
|
+
if (e) {
|
|
241
|
+
let t = e.requestAnimationFrame(() => {
|
|
242
|
+
r === this.focusSequence && this.activeElementValue === n && n.isConnected && n.scrollIntoView?.({
|
|
243
|
+
block: "nearest",
|
|
244
|
+
inline: "nearest"
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
this.scrollFrame = {
|
|
248
|
+
window: e,
|
|
249
|
+
id: t
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
setActiveElement(e) {
|
|
255
|
+
this.activeElementValue = e, this.setActiveElementSignal(e), Me();
|
|
256
|
+
}
|
|
257
|
+
trackPointer(e) {
|
|
258
|
+
if ("pointerType" in e && e.pointerType !== "mouse") return;
|
|
259
|
+
let t = this.pointerX !== null && this.pointerY !== null ? e.clientX !== this.pointerX || e.clientY !== this.pointerY : !this.pointerHoverBlocked;
|
|
260
|
+
this.pointerX = e.clientX, this.pointerY = e.clientY, this.pointerMovements.set(e, t);
|
|
261
|
+
}
|
|
262
|
+
pointerMoved(e) {
|
|
263
|
+
this.pointerMovements.has(e) || this.trackPointer(e);
|
|
264
|
+
let t = this.pointerMovements.get(e) ?? !1;
|
|
265
|
+
return this.pointerHoverBlocked && !t ? !1 : (t && (this.pointerHoverBlocked = !1), t);
|
|
266
|
+
}
|
|
267
|
+
blockPointerHover(e) {
|
|
268
|
+
if (this.pointerHoverBlocked = !0, this.pointerHoverFrame &&= (this.pointerHoverFrame.window.cancelAnimationFrame(this.pointerHoverFrame.id), void 0), this.pointerX !== null || !e) return;
|
|
269
|
+
let t = e.requestAnimationFrame(() => {
|
|
270
|
+
let t = e.requestAnimationFrame(() => {
|
|
271
|
+
this.pointerHoverFrame = void 0, this.pointerX === null && (this.pointerHoverBlocked = !1);
|
|
272
|
+
});
|
|
273
|
+
this.pointerHoverFrame = {
|
|
274
|
+
window: e,
|
|
275
|
+
id: t
|
|
276
|
+
};
|
|
277
|
+
});
|
|
278
|
+
this.pointerHoverFrame = {
|
|
279
|
+
window: e,
|
|
280
|
+
id: t
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
openMethod() {
|
|
284
|
+
return this.openMethodAccessor();
|
|
285
|
+
}
|
|
286
|
+
setOpenMethod(e) {
|
|
287
|
+
this.setOpenMethodSignal(e);
|
|
288
|
+
}
|
|
289
|
+
openChangeReason() {
|
|
290
|
+
return this.openReasonAccessor();
|
|
291
|
+
}
|
|
292
|
+
forceMount() {
|
|
293
|
+
return this.forceMountAccessor();
|
|
294
|
+
}
|
|
295
|
+
setForceMount(e) {
|
|
296
|
+
(!e || this.forceMountAllowed) && this.setForceMountSignal(e);
|
|
297
|
+
}
|
|
298
|
+
suppressForceMount() {
|
|
299
|
+
this.forceMountAllowed = !1, this.setForceMountSignal(!1);
|
|
300
|
+
}
|
|
301
|
+
labelId() {
|
|
302
|
+
return this.labelIdAccessor();
|
|
303
|
+
}
|
|
304
|
+
setLabelId(e) {
|
|
305
|
+
this.setLabelIdSignal(e);
|
|
306
|
+
}
|
|
307
|
+
listElement() {
|
|
308
|
+
return this.listElementAccessor();
|
|
309
|
+
}
|
|
310
|
+
setListElement(e) {
|
|
311
|
+
this.setListElementSignal(e);
|
|
312
|
+
}
|
|
313
|
+
popupSide() {
|
|
314
|
+
return this.popupSideAccessor();
|
|
315
|
+
}
|
|
316
|
+
setPopupSide(e) {
|
|
317
|
+
this.setPopupSideSignal(e);
|
|
318
|
+
}
|
|
319
|
+
scrollUpVisible() {
|
|
320
|
+
return this.scrollUpVisibleAccessor();
|
|
321
|
+
}
|
|
322
|
+
setScrollUpVisible(e) {
|
|
323
|
+
this.setScrollUpVisibleSignal(e);
|
|
324
|
+
}
|
|
325
|
+
scrollDownVisible() {
|
|
326
|
+
return this.scrollDownVisibleAccessor();
|
|
327
|
+
}
|
|
328
|
+
setScrollDownVisible(e) {
|
|
329
|
+
this.setScrollDownVisibleSignal(e);
|
|
330
|
+
}
|
|
331
|
+
hasScrollArrows() {
|
|
332
|
+
return this.hasScrollArrowsAccessor();
|
|
333
|
+
}
|
|
334
|
+
setHasScrollArrows(e) {
|
|
335
|
+
this.setHasScrollArrowsSignal(e);
|
|
336
|
+
}
|
|
337
|
+
alignItemWithTrigger() {
|
|
338
|
+
return this.alignItemAccessor();
|
|
339
|
+
}
|
|
340
|
+
setAlignItemWithTrigger(e) {
|
|
341
|
+
this.setAlignItemSignal(e);
|
|
342
|
+
}
|
|
343
|
+
typing() {
|
|
344
|
+
return this.typingAccessor();
|
|
345
|
+
}
|
|
346
|
+
setTyping(e) {
|
|
347
|
+
this.setTypingSignal(e);
|
|
348
|
+
}
|
|
349
|
+
resetAfterClose() {
|
|
350
|
+
this.setActiveIndex(null), this.setOpenMethod(null), this.setScrollUpVisible(!1), this.setScrollDownVisible(!1), this.setTyping(!1), this.selection.allowSelectedMouseUp = !1, this.selection.allowUnselectedMouseUp = !1, this.selection.dragY = 0;
|
|
351
|
+
}
|
|
352
|
+
dispose() {
|
|
353
|
+
this.focusSequence += 1, this.scrollFrame &&= (this.scrollFrame.window.cancelAnimationFrame(this.scrollFrame.id), void 0), this.pointerHoverFrame &&= (this.pointerHoverFrame.window.cancelAnimationFrame(this.pointerHoverFrame.id), void 0);
|
|
354
|
+
}
|
|
355
|
+
setOpen(e, t) {
|
|
356
|
+
let n = super.setOpen(e, t);
|
|
357
|
+
return n && (e && (this.forceMountAllowed = !0), this.setOpenReasonSignal(t.reason)), n;
|
|
358
|
+
}
|
|
359
|
+
}, Ge = Symbol("SelectRootContext"), Ke = H(Ge);
|
|
360
|
+
function $() {
|
|
361
|
+
let e = X(Ke);
|
|
362
|
+
if (e === Ge) throw Error("Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.");
|
|
363
|
+
return e;
|
|
364
|
+
}
|
|
365
|
+
//#endregion
|
|
366
|
+
//#region src/select/root/SelectRoot.tsx
|
|
367
|
+
var qe = /* @__PURE__ */ ke("<input tabindex=-1 aria-hidden=true>"), Je = /* @__PURE__ */ ke("<input type=hidden>"), Ye = {
|
|
368
|
+
"clip-path": "inset(50%)",
|
|
369
|
+
overflow: "hidden",
|
|
370
|
+
"white-space": "nowrap",
|
|
371
|
+
border: "0",
|
|
372
|
+
padding: "0",
|
|
373
|
+
width: "1px",
|
|
374
|
+
height: "1px",
|
|
375
|
+
margin: "-1px",
|
|
376
|
+
position: "fixed",
|
|
377
|
+
top: "0",
|
|
378
|
+
left: "0"
|
|
379
|
+
}, Xe = {
|
|
380
|
+
...Ye,
|
|
381
|
+
position: "absolute"
|
|
382
|
+
};
|
|
383
|
+
function Ze(e) {
|
|
384
|
+
let t = fe(!0), n = pe(), i = ve(), o = b(), s = w(), c = o ?? new C(), u = Symbol("Select"), d = `base-ui-${je()}`, f = `base-ui-${je()}`, p = je(), m = Y(() => e.value !== void 0), h = Y(() => e.open !== void 0), g = W(() => e.multiple ?? !1), _ = Y(() => {
|
|
385
|
+
let t = e.defaultValue;
|
|
386
|
+
return t == null ? e.multiple ? [] : null : Qe(t);
|
|
387
|
+
}), [v, y] = G(() => _), [D, k] = G(null, { ownedWrite: !0 }), [A, j] = G(null, { ownedWrite: !0 }), [M, N] = G(null, { ownedWrite: !0 }), [ee, te] = G(null, { ownedWrite: !0 }), [ne, re] = G(null, { ownedWrite: !0 }), [ie, ae] = G(null, { ownedWrite: !0 }), [oe, se] = G(null, { ownedWrite: !0 }), [ce, le] = G(null, { ownedWrite: !0 }), [ue, de] = G(null, { ownedWrite: !0 }), he = W(() => e.id ?? d), P = W(() => m ? e.value : v()), ge = W(() => e.isItemEqualToValue ?? me), F = W(() => t.disabled() || (e.disabled ?? !1)), I = W(() => e.readOnly ?? !1), ye = W(() => e.required ?? !1), L = W(() => e.modal ?? !0), Se = W(() => e.highlightItemOnHover ?? !0), z = W(() => t.name() ?? e.name), Te = W(() => g() ? "" : Ne(P(), e.itemToStringValue)), Ee = W(() => {
|
|
388
|
+
let t = P();
|
|
389
|
+
return g() && Array.isArray(t) ? t.map((t) => Ne(t, e.itemToStringValue)) : Ne(t, e.itemToStringValue);
|
|
390
|
+
}), De = W(() => {
|
|
391
|
+
let e = P();
|
|
392
|
+
return g() ? Array.isArray(e) && e.length > 0 : e != null && Te() !== "";
|
|
393
|
+
}), ke = Qe(Y(P)), V = !!Y(() => e.open ?? e.defaultOpen), H, Me, K = "", q = -1, X = null, Fe = !1, Ie = 0, Le = [], Re = { current: null }, Z = new We({
|
|
394
|
+
controlledOpen: () => h ? e.open : void 0,
|
|
395
|
+
floatingId: f,
|
|
396
|
+
nodeId: p,
|
|
397
|
+
onOpenChange: () => (n, r) => {
|
|
398
|
+
!n && e.actionsRef && r.preventUnmountOnClose(), e.onOpenChange?.(n, r), !r.isCanceled && !n && (r.reason === "focus-out" || r.reason === "outside-press") && (t.setTouched(!0), t.setFocused(!1), t.validationMode() === "onBlur" && t.validation.commit(Y(P)));
|
|
399
|
+
},
|
|
400
|
+
onOpenChangeComplete: () => e.onOpenChangeComplete
|
|
401
|
+
});
|
|
402
|
+
Z.update({ open: V }), Z.configureTriggerUnmount({ closeOnActiveTriggerUnmount: !1 });
|
|
403
|
+
let ze = x({
|
|
404
|
+
tree: c,
|
|
405
|
+
id: p,
|
|
406
|
+
parentId: s,
|
|
407
|
+
context: () => Z.context.floatingRoot
|
|
408
|
+
}), Q = E(Z, () => Z.track().popupElement, { onUnmount: () => Z.resetAfterClose() }), He = W(() => {
|
|
409
|
+
let e = Z.collection.values(), t = P();
|
|
410
|
+
if (g()) {
|
|
411
|
+
if (!Array.isArray(t) || t.length === 0) return null;
|
|
412
|
+
let n = _e(e, t[t.length - 1], ge());
|
|
413
|
+
return n === -1 ? null : n;
|
|
414
|
+
}
|
|
415
|
+
let n = _e(e, t, ge());
|
|
416
|
+
return n === -1 ? null : n;
|
|
417
|
+
});
|
|
418
|
+
function Ue(t, n) {
|
|
419
|
+
return e.onValueChange?.(t, n), !n.isCanceled && (m || y(() => t), !0);
|
|
420
|
+
}
|
|
421
|
+
function Ge(e, t) {
|
|
422
|
+
return Z.setOpen(e, t);
|
|
423
|
+
}
|
|
424
|
+
let $ = O({
|
|
425
|
+
context: Z.context.floatingRoot,
|
|
426
|
+
tree: () => c,
|
|
427
|
+
outsidePressEvent: () => ({
|
|
428
|
+
mouse: "sloppy",
|
|
429
|
+
touch: "sloppy"
|
|
430
|
+
})
|
|
431
|
+
});
|
|
432
|
+
function Ze(e) {
|
|
433
|
+
Z.blockPointerHover(e.currentTarget?.ownerDocument.defaultView ?? null), $.onKeyDown(e), !(e.baseUIHandlerPrevented || e.key === "Escape" && e.defaultPrevented) && (rt(e), tt(e));
|
|
434
|
+
}
|
|
435
|
+
function tt(e) {
|
|
436
|
+
if (F() || I() || ![
|
|
437
|
+
"ArrowDown",
|
|
438
|
+
"ArrowUp",
|
|
439
|
+
"Home",
|
|
440
|
+
"End"
|
|
441
|
+
].includes(e.key)) return;
|
|
442
|
+
if (e.preventDefault(), e.stopPropagation(), !Z.open()) {
|
|
443
|
+
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
444
|
+
X = e.key === "ArrowDown" ? "first" : "last", Z.setOpenMethod("keyboard"), Ge(!0, l(r, e, D() ?? void 0));
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
let t = Z.collection.elements();
|
|
448
|
+
if (t.length === 0) return;
|
|
449
|
+
let n = Z.activeIndex() ?? He() ?? -1, i = e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : Math.max(0, Math.min(t.length - 1, n + (e.key === "ArrowDown" ? 1 : -1)));
|
|
450
|
+
Z.setActiveIndex(i, !0);
|
|
451
|
+
}
|
|
452
|
+
function nt() {
|
|
453
|
+
clearTimeout(Me), K = "", q = -1, Z.setTyping(!1);
|
|
454
|
+
}
|
|
455
|
+
function rt(e) {
|
|
456
|
+
if (F() || I() || !Z.open() && g() || e.key.length !== 1 || e.ctrlKey || e.metaKey || e.altKey) return;
|
|
457
|
+
K && e.key === " " && (e.preventDefault(), e.stopPropagation()), K = K.length > 0 && [...K].every((t) => t.toLocaleLowerCase() === e.key.toLocaleLowerCase()) ? e.key : K + e.key, Z.setTyping(!0), clearTimeout(Me), Me = setTimeout(nt, 750);
|
|
458
|
+
let t = Z.collection.labels(), n = new Set(Z.collection.disabledIndices()), r = (q >= 0 ? q : Z.activeIndex() ?? He() ?? -1) + 1, i = K.toLocaleLowerCase();
|
|
459
|
+
for (let o = 0; o < t.length; o += 1) {
|
|
460
|
+
let s = (r + o) % t.length;
|
|
461
|
+
if (!n.has(s) && t[s]?.toLocaleLowerCase().startsWith(i)) {
|
|
462
|
+
if (q = s, Z.open()) e.preventDefault(), e.stopPropagation(), Z.setActiveIndex(s, !0);
|
|
463
|
+
else {
|
|
464
|
+
let t = Z.collection.values()[s];
|
|
465
|
+
t !== void 0 && Ue(t, l(a, e));
|
|
466
|
+
}
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
function it(e) {
|
|
472
|
+
Y(() => {
|
|
473
|
+
let t = e.relatedTarget, n = Z.track().positionerElement;
|
|
474
|
+
!D()?.contains(t) && !n?.contains(t) && nt();
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
function at(e) {
|
|
478
|
+
if (Re.current) {
|
|
479
|
+
Re.current(e);
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
ot(e);
|
|
483
|
+
}
|
|
484
|
+
function ot(e) {
|
|
485
|
+
let t = Be(e.scrollHeight, e.clientHeight), n = Ve(e.scrollTop, t);
|
|
486
|
+
n !== e.scrollTop && (e.scrollTop = n), Z.setScrollUpVisible(n > 0), Z.setScrollDownVisible(n < t);
|
|
487
|
+
}
|
|
488
|
+
let st = {
|
|
489
|
+
store: Z,
|
|
490
|
+
tree: c,
|
|
491
|
+
node: ze,
|
|
492
|
+
presence: Q,
|
|
493
|
+
id: he,
|
|
494
|
+
value: P,
|
|
495
|
+
items: () => e.items,
|
|
496
|
+
multiple: g,
|
|
497
|
+
disabled: F,
|
|
498
|
+
readOnly: I,
|
|
499
|
+
required: ye,
|
|
500
|
+
modal: L,
|
|
501
|
+
highlightItemOnHover: Se,
|
|
502
|
+
itemToStringLabel: () => e.itemToStringLabel,
|
|
503
|
+
itemToStringValue: () => e.itemToStringValue,
|
|
504
|
+
comparator: ge,
|
|
505
|
+
hasSelectedValue: De,
|
|
506
|
+
selectedIndex: He,
|
|
507
|
+
setValue: Ue,
|
|
508
|
+
setOpen: Ge,
|
|
509
|
+
triggerElement: D,
|
|
510
|
+
setTriggerElement: k,
|
|
511
|
+
valueElement: M,
|
|
512
|
+
setValueElement: N,
|
|
513
|
+
firstItemText: ee,
|
|
514
|
+
selectedItemText: ne,
|
|
515
|
+
setFirstItemText: te,
|
|
516
|
+
setSelectedItemText: re,
|
|
517
|
+
handleKeyDown: Ze,
|
|
518
|
+
handleTypeaheadBlur: it,
|
|
519
|
+
handleScroll: at,
|
|
520
|
+
updateScrollArrowVisibility: ot,
|
|
521
|
+
scrollHandler: Re,
|
|
522
|
+
scrollArrowsMounted: { count: 0 },
|
|
523
|
+
field: t,
|
|
524
|
+
formContext: n,
|
|
525
|
+
backdropElement: ie,
|
|
526
|
+
setBackdropElement: ae,
|
|
527
|
+
internalBackdropElement: oe,
|
|
528
|
+
setInternalBackdropElement: se,
|
|
529
|
+
beforeContentGuard: ce,
|
|
530
|
+
setBeforeContentGuard: le,
|
|
531
|
+
afterTriggerGuard: ue,
|
|
532
|
+
setAfterTriggerGuard: de,
|
|
533
|
+
initialValue: _
|
|
534
|
+
}, ct = {
|
|
535
|
+
id: d,
|
|
536
|
+
name: void 0,
|
|
537
|
+
value: P,
|
|
538
|
+
getValue: Ee,
|
|
539
|
+
getControl: () => D()
|
|
540
|
+
}, lt = { unmount() {
|
|
541
|
+
Z.suppressForceMount(), Q.forceUnmount();
|
|
542
|
+
} };
|
|
543
|
+
Z.context.floatingRoot.context.data.insideElements = () => [ie(), oe()], Z.setInteractionProps({
|
|
544
|
+
activeTriggerProps: { onKeyDown: Ze },
|
|
545
|
+
inactiveTriggerProps: { onKeyDown: Ze },
|
|
546
|
+
popupProps: { onKeyDown: Ze }
|
|
547
|
+
}), U(() => ({
|
|
548
|
+
open: Z.open(),
|
|
549
|
+
activeTriggerId: Z.activeTriggerId()
|
|
550
|
+
}), () => Y(() => Z.reconcileTriggers())), U(() => D()?.ownerDocument, (e) => {
|
|
551
|
+
if (!e) return;
|
|
552
|
+
let t = (e) => Z.trackPointer(e);
|
|
553
|
+
return e.addEventListener("pointermove", t, !0), e.addEventListener("mousemove", t, !0), () => {
|
|
554
|
+
e.removeEventListener("pointermove", t, !0), e.removeEventListener("mousemove", t, !0);
|
|
555
|
+
};
|
|
556
|
+
}), U(() => Z.open(), (e) => {
|
|
557
|
+
clearTimeout(H), e ? H = setTimeout(() => {
|
|
558
|
+
Z.selection.allowSelectedMouseUp = !0, Z.selection.allowUnselectedMouseUp = !0;
|
|
559
|
+
}, 400) : V && (Z.selection.allowSelectedMouseUp = !1, Z.selection.allowUnselectedMouseUp = !1, Z.selection.dragY = 0), V = e;
|
|
560
|
+
}), U(() => ({
|
|
561
|
+
open: Z.open(),
|
|
562
|
+
reason: Z.openChangeReason(),
|
|
563
|
+
trigger: D()
|
|
564
|
+
}), (e, t) => {
|
|
565
|
+
t?.open && !e.open && e.trigger && (e.reason === "item-press" || e.reason === "escape-key") && queueMicrotask(() => e.trigger?.focus({ preventScroll: !0 }));
|
|
566
|
+
}), U(() => ({
|
|
567
|
+
open: Z.open(),
|
|
568
|
+
mounted: Q.mounted(),
|
|
569
|
+
itemCount: Z.collection.items().length
|
|
570
|
+
}), ({ open: e, mounted: t, itemCount: n }) => {
|
|
571
|
+
if (!e) {
|
|
572
|
+
Fe = !1, Ie += 1;
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
if (!t || n === 0 || Fe) return;
|
|
576
|
+
Fe = !0;
|
|
577
|
+
let r = ++Ie;
|
|
578
|
+
queueMicrotask(() => {
|
|
579
|
+
Y(() => {
|
|
580
|
+
if (r !== Ie || !Z.open()) return;
|
|
581
|
+
let e = He(), t = Z.collection.items().flatMap((e, t) => e.disabled() ? [] : [t]), n = e ?? (X === "last" ? t[t.length - 1] : t[0]) ?? null;
|
|
582
|
+
X = null, Z.setActiveIndex(n, !0);
|
|
583
|
+
});
|
|
584
|
+
});
|
|
585
|
+
}), U(() => Z.collection.elements(), (e) => {
|
|
586
|
+
let t = Le;
|
|
587
|
+
Le = e, Y(() => {
|
|
588
|
+
let n = Z.activeElement();
|
|
589
|
+
if (!Z.open() || !Q.mounted() || !n || e.includes(n)) return;
|
|
590
|
+
let r = t.indexOf(n), i = Z.collection.items().flatMap((e, t) => e.disabled() ? [] : [t]), a = i.find((e) => e >= Math.max(0, r)) ?? i[i.length - 1] ?? null;
|
|
591
|
+
Z.setActiveIndex(a, a !== null);
|
|
592
|
+
});
|
|
593
|
+
}), U(() => ({
|
|
594
|
+
current: P(),
|
|
595
|
+
filled: De(),
|
|
596
|
+
comparator: ge()
|
|
597
|
+
}), ({ current: e, filled: r, comparator: i }) => {
|
|
598
|
+
t.setFilled(r), !$e(e, ke, i) && (ke = Qe(e), Y(() => {
|
|
599
|
+
n.clearError(z()), t.setDirty(!et(e, t.validityData().initialValue, i)), t.validation.change(e);
|
|
600
|
+
}));
|
|
601
|
+
}), U(() => ({
|
|
602
|
+
disabled: F(),
|
|
603
|
+
id: he(),
|
|
604
|
+
name: e.name,
|
|
605
|
+
trigger: D()
|
|
606
|
+
}), (e) => {
|
|
607
|
+
ct.id = e.id, ct.name = e.name, t.registerFieldControl(u, e.disabled || !e.trigger ? void 0 : ct);
|
|
608
|
+
}), U(A, (e) => {
|
|
609
|
+
if (e) return t.validation.registerInput(u, e, () => D());
|
|
610
|
+
}), U(() => e.actionsRef, (e) => {
|
|
611
|
+
e?.(lt);
|
|
612
|
+
});
|
|
613
|
+
function ut(t) {
|
|
614
|
+
if (t.defaultPrevented || F() || I()) return;
|
|
615
|
+
Z.setForceMount(!0);
|
|
616
|
+
let n = t.currentTarget.value.toLocaleLowerCase();
|
|
617
|
+
queueMicrotask(() => {
|
|
618
|
+
if (g()) return;
|
|
619
|
+
let r = Z.collection.items(), i = r[r.findIndex((t) => {
|
|
620
|
+
let r = t.value(), i = t.label() ?? t.textElement()?.textContent ?? t.element()?.textContent;
|
|
621
|
+
return Ne(r, e.itemToStringValue).toLocaleLowerCase() === n || Pe(r, e.itemToStringLabel).toLocaleLowerCase() === n || i?.toLocaleLowerCase() === n;
|
|
622
|
+
})]?.value();
|
|
623
|
+
i != null && Ue(i, l(a, t));
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
return J(() => {
|
|
627
|
+
clearTimeout(H), clearTimeout(Me), t.registerFieldControl(u, void 0), Z.dispose(), Z.clearInteractionProps(), delete Z.context.floatingRoot.context.data.insideElements;
|
|
628
|
+
}), R(Ke, {
|
|
629
|
+
value: st,
|
|
630
|
+
get children() {
|
|
631
|
+
return R(S, {
|
|
632
|
+
value: c,
|
|
633
|
+
get children() {
|
|
634
|
+
return R(T, {
|
|
635
|
+
get value() {
|
|
636
|
+
return ze.id ?? null;
|
|
637
|
+
},
|
|
638
|
+
get children() {
|
|
639
|
+
return [
|
|
640
|
+
Ce(() => e.children),
|
|
641
|
+
(() => {
|
|
642
|
+
var n = xe(qe);
|
|
643
|
+
return n.addEventListener("change", ut), n.addEventListener("focus", () => D()?.focus({ focusVisible: !0 })), we(() => [((e) => j(e)), e.inputRef], n), be(() => ({
|
|
644
|
+
e: z() == null ? `${he()}-hidden-input` : void 0,
|
|
645
|
+
t: e.form,
|
|
646
|
+
a: g() ? void 0 : z(),
|
|
647
|
+
o: e.autoComplete,
|
|
648
|
+
i: Te(),
|
|
649
|
+
n: F(),
|
|
650
|
+
s: ye() && !(g() && De()),
|
|
651
|
+
h: I(),
|
|
652
|
+
r: z() ? Xe : Ye,
|
|
653
|
+
d: i.getAriaDescribedBy(void 0),
|
|
654
|
+
l: t.state().valid === !1 && !F() ? "true" : void 0
|
|
655
|
+
}), ({ e, t, a: r, o: i, i: a, n: o, s, h: c, r: l, d: u, l: d }, f) => {
|
|
656
|
+
e !== f?.e && B(n, "id", e), t !== f?.t && B(n, "form", t), r !== f?.a && B(n, "name", r), i !== f?.o && B(n, "autocomplete", i), n.value = a ?? "", o !== f?.n && B(n, "disabled", o), s !== f?.s && B(n, "required", s), c !== f?.h && B(n, "readonly", c), Oe(n, l, f?.r), u !== f?.d && B(n, "aria-describedby", u), d !== f?.l && B(n, "aria-invalid", d);
|
|
657
|
+
}), n;
|
|
658
|
+
})(),
|
|
659
|
+
R(Ae, {
|
|
660
|
+
get each() {
|
|
661
|
+
return Ce(() => !!(g() && Array.isArray(P())))() ? P() : [];
|
|
662
|
+
},
|
|
663
|
+
children: (t) => (() => {
|
|
664
|
+
var n = xe(Je);
|
|
665
|
+
return be(() => ({
|
|
666
|
+
e: e.form,
|
|
667
|
+
t: z(),
|
|
668
|
+
a: Ne(t, e.itemToStringValue),
|
|
669
|
+
o: F()
|
|
670
|
+
}), ({ e, t, a: r, o: i }, a) => {
|
|
671
|
+
e !== a?.e && B(n, "form", e), t !== a?.t && B(n, "name", t), n.value = r ?? "", i !== a?.o && B(n, "disabled", i);
|
|
672
|
+
}), n;
|
|
673
|
+
})()
|
|
674
|
+
})
|
|
675
|
+
];
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
function Qe(e) {
|
|
684
|
+
return Array.isArray(e) ? e.slice() : e;
|
|
685
|
+
}
|
|
686
|
+
function $e(e, t, n) {
|
|
687
|
+
return Array.isArray(e) && Array.isArray(t) ? F(e, t, n) : Object.is(e, t);
|
|
688
|
+
}
|
|
689
|
+
function et(e, t, n) {
|
|
690
|
+
return Array.isArray(e) && Array.isArray(t) ? F(e, t, n) : e === t;
|
|
691
|
+
}
|
|
692
|
+
//#endregion
|
|
693
|
+
//#region src/select/label/SelectLabel.tsx
|
|
694
|
+
function tt(e) {
|
|
695
|
+
let n = $(), r = ve(), i = e, a = e, o = W(() => `${n.id()}-label`), l = W(() => n.field.state()), u = W(() => s(e.class, l())), f = W(() => c(e.style, l())), p = W(() => t(l(), de)), m = q(a, "as", "class", "id", "onClick", "onPointerDown", "ref", "style");
|
|
696
|
+
function h(e) {
|
|
697
|
+
let t = e.composedPath()[0];
|
|
698
|
+
t instanceof Element && t.closest("button,input,select,textarea,a[href]") || (!e.defaultPrevented && e.detail > 1 && e.preventDefault(), n.triggerElement()?.focus({ focusVisible: !0 }));
|
|
699
|
+
}
|
|
700
|
+
function g(e) {
|
|
701
|
+
e.preventDefault();
|
|
702
|
+
}
|
|
703
|
+
let _ = d(() => i.onClick, () => h), v = d(() => i.onPointerDown, () => g);
|
|
704
|
+
return U(o, (e) => {
|
|
705
|
+
n.store.setLabelId(e);
|
|
706
|
+
let t = r.registerLabelId(e);
|
|
707
|
+
return () => {
|
|
708
|
+
t(), Y(() => n.store.labelId()) === e && n.store.setLabelId(void 0);
|
|
709
|
+
};
|
|
710
|
+
}), R(L, z({
|
|
711
|
+
get component() {
|
|
712
|
+
return e.as ?? "div";
|
|
713
|
+
},
|
|
714
|
+
ref: [i.ref],
|
|
715
|
+
get id() {
|
|
716
|
+
return o();
|
|
717
|
+
},
|
|
718
|
+
get class() {
|
|
719
|
+
return u();
|
|
720
|
+
},
|
|
721
|
+
get style() {
|
|
722
|
+
return f();
|
|
723
|
+
},
|
|
724
|
+
onClick: _,
|
|
725
|
+
onPointerDown: v
|
|
726
|
+
}, p, m));
|
|
727
|
+
}
|
|
728
|
+
//#endregion
|
|
729
|
+
//#region src/select/utils/stateAttributesMapping.ts
|
|
730
|
+
var nt = {
|
|
731
|
+
...M,
|
|
732
|
+
...de,
|
|
733
|
+
popupSide: (e) => e ? { "data-popup-side": e } : null,
|
|
734
|
+
value: () => null
|
|
735
|
+
}, rt = { ...N }, it = { ...te };
|
|
736
|
+
//#endregion
|
|
737
|
+
//#region src/select/trigger/SelectTrigger.tsx
|
|
738
|
+
function at(e) {
|
|
739
|
+
let n = $(), r = ve(), o = e, u = e, f = Symbol("SelectTrigger"), [p, h] = G(null, { ownedWrite: !0 }), g = W(() => o.id ?? n.id()), _ = W(() => o.nativeButton ?? !0), v = W(() => n.disabled() || (o.disabled ?? !1)), b = W(() => n.store.open()), x = W(() => n.presence.mounted() && n.store.track().positionerElement ? n.store.popupSide() : null), S = W(() => ({
|
|
740
|
+
...n.field.state(),
|
|
741
|
+
open: b(),
|
|
742
|
+
disabled: v(),
|
|
743
|
+
readOnly: n.readOnly(),
|
|
744
|
+
popupSide: x(),
|
|
745
|
+
value: n.value(),
|
|
746
|
+
placeholder: !n.hasSelectedValue()
|
|
747
|
+
})), C = W(() => s(e.class, S())), w = W(() => c(e.style, S())), T = W(() => t(S(), nt)), E = W(() => o["aria-labelledby"] ?? r.labelId() ?? n.store.labelId()), O = W(() => r.getAriaDescribedBy(o["aria-describedby"])), k = q(u, "aria-describedby", "aria-labelledby", "as", "class", "disabled", "id", "nativeButton", "onBlur", "onClick", "onFocus", "onKeyDown", "onKeyUp", "onMouseDown", "onPointerDown", "ref", "style"), A = y({
|
|
748
|
+
context: n.store.context.floatingRoot,
|
|
749
|
+
enabled: () => !v() && !n.readOnly(),
|
|
750
|
+
event: () => "mousedown"
|
|
751
|
+
}), j = "", M, N;
|
|
752
|
+
D(() => n.store, g, p);
|
|
753
|
+
function ee(e) {
|
|
754
|
+
j = e.pointerType || "", A.onPointerDown(e);
|
|
755
|
+
}
|
|
756
|
+
function te(e) {
|
|
757
|
+
b() || (n.store.setOpenMethod(j || (ot() ? "touch" : "mouse")), ne(e.currentTarget)), A.onMouseDown(e);
|
|
758
|
+
}
|
|
759
|
+
function ne(e) {
|
|
760
|
+
clearTimeout(M), N?.(), M = setTimeout(() => {
|
|
761
|
+
let t = (t) => {
|
|
762
|
+
let r = t.target, a = n.store.track().positionerElement;
|
|
763
|
+
if (m(e, r) || m(a, r)) return;
|
|
764
|
+
let o = e.getBoundingClientRect();
|
|
765
|
+
t.clientX >= o.left - 5 && t.clientX <= o.right + 5 && t.clientY >= o.top - 5 && t.clientY <= o.bottom + 5 || n.setOpen(!1, l(i, t));
|
|
766
|
+
};
|
|
767
|
+
e.ownerDocument.addEventListener("mouseup", t, { once: !0 }), N = () => e.ownerDocument.removeEventListener("mouseup", t);
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
function le(e) {
|
|
771
|
+
e.detail === 0 && n.store.setOpenMethod("keyboard"), A.onClick(e);
|
|
772
|
+
}
|
|
773
|
+
function ue() {
|
|
774
|
+
n.field.setFocused(!0), b() && n.store.alignItemWithTrigger() && n.setOpen(!1, l(a)), queueMicrotask(() => n.store.setForceMount(!0));
|
|
775
|
+
}
|
|
776
|
+
function de(e) {
|
|
777
|
+
Y(() => {
|
|
778
|
+
m(n.store.track().positionerElement, e.relatedTarget) || (n.field.setTouched(!0), n.field.setFocused(!1), n.field.validationMode() === "onBlur" && n.field.validation.commit(n.value()), n.handleTypeaheadBlur(e));
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
function fe(e) {
|
|
782
|
+
e.target === e.currentTarget && (j = "keyboard", n.handleKeyDown(e));
|
|
783
|
+
}
|
|
784
|
+
let pe = d(() => o.onBlur, () => de), me = d(() => Y(() => v() ? se : void 0), () => o.onClick, () => le), he = d(() => o.onFocus, () => ue), P = d(() => Y(() => v() ? ae : void 0), () => o.onKeyDown, () => fe, () => Y(() => _() ? void 0 : ce)), ge = d(() => Y(() => v() ? ie : void 0), () => o.onKeyUp, () => Y(() => _() ? void 0 : oe)), _e = d(() => Y(() => v() ? ie : void 0), () => o.onMouseDown, () => te), F = d(() => Y(() => v() ? se : void 0), () => o.onPointerDown, () => ee);
|
|
785
|
+
U(() => ({
|
|
786
|
+
id: g(),
|
|
787
|
+
element: p()
|
|
788
|
+
}), (e) => (n.setTriggerElement(e.element), r.registerControlId(f, e.id), () => {
|
|
789
|
+
n.triggerElement() === e.element && n.setTriggerElement(null);
|
|
790
|
+
})), J(() => {
|
|
791
|
+
clearTimeout(M), N?.(), r.registerControlId(f, void 0);
|
|
792
|
+
});
|
|
793
|
+
let I = R(L, z({
|
|
794
|
+
get component() {
|
|
795
|
+
return e.as ?? "button";
|
|
796
|
+
},
|
|
797
|
+
ref: [((e) => h(e)), o.ref],
|
|
798
|
+
get id() {
|
|
799
|
+
return g();
|
|
800
|
+
},
|
|
801
|
+
get type() {
|
|
802
|
+
return _() ? "button" : void 0;
|
|
803
|
+
},
|
|
804
|
+
role: "combobox",
|
|
805
|
+
get tabindex() {
|
|
806
|
+
return v() ? -1 : 0;
|
|
807
|
+
},
|
|
808
|
+
get disabled() {
|
|
809
|
+
return _() && v() ? !0 : void 0;
|
|
810
|
+
},
|
|
811
|
+
get "aria-disabled"() {
|
|
812
|
+
return !_() && v() ? "true" : void 0;
|
|
813
|
+
},
|
|
814
|
+
get "aria-expanded"() {
|
|
815
|
+
return b() ? "true" : "false";
|
|
816
|
+
},
|
|
817
|
+
"aria-haspopup": "listbox",
|
|
818
|
+
get "aria-controls"() {
|
|
819
|
+
return Ce(() => !!b())() ? n.store.listElement()?.id || n.store.popupId() : void 0;
|
|
820
|
+
},
|
|
821
|
+
get "aria-labelledby"() {
|
|
822
|
+
return E();
|
|
823
|
+
},
|
|
824
|
+
get "aria-describedby"() {
|
|
825
|
+
return O();
|
|
826
|
+
},
|
|
827
|
+
get "aria-readonly"() {
|
|
828
|
+
return n.readOnly() ? "true" : void 0;
|
|
829
|
+
},
|
|
830
|
+
get "aria-required"() {
|
|
831
|
+
return n.required() ? "true" : void 0;
|
|
832
|
+
},
|
|
833
|
+
get "aria-invalid"() {
|
|
834
|
+
return S().valid === !1 && !v() ? "true" : void 0;
|
|
835
|
+
},
|
|
836
|
+
"data-base-ui-click-trigger": "",
|
|
837
|
+
get "data-trigger-disabled"() {
|
|
838
|
+
return v() ? "" : void 0;
|
|
839
|
+
},
|
|
840
|
+
get class() {
|
|
841
|
+
return C();
|
|
842
|
+
},
|
|
843
|
+
get style() {
|
|
844
|
+
return w();
|
|
845
|
+
},
|
|
846
|
+
onBlur: pe,
|
|
847
|
+
onClick: me,
|
|
848
|
+
onFocus: he,
|
|
849
|
+
onKeyDown: P,
|
|
850
|
+
onKeyUp: ge,
|
|
851
|
+
onMouseDown: _e,
|
|
852
|
+
onPointerDown: F
|
|
853
|
+
}, T, k));
|
|
854
|
+
return R(re, {
|
|
855
|
+
get context() {
|
|
856
|
+
return n.store.context.floatingRoot;
|
|
857
|
+
},
|
|
858
|
+
get enabled() {
|
|
859
|
+
return n.presence.mounted();
|
|
860
|
+
},
|
|
861
|
+
trigger: p,
|
|
862
|
+
positioner: () => n.store.track().positionerElement,
|
|
863
|
+
get beforeContentGuard() {
|
|
864
|
+
return n.beforeContentGuard;
|
|
865
|
+
},
|
|
866
|
+
get afterGuardRef() {
|
|
867
|
+
return n.setAfterTriggerGuard;
|
|
868
|
+
},
|
|
869
|
+
children: I
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
function ot() {
|
|
873
|
+
if (typeof navigator > "u") return !1;
|
|
874
|
+
let e = navigator.platform.toLowerCase();
|
|
875
|
+
return /^i(os$|p)/.test(e) || e === "macintel" && navigator.maxTouchPoints > 1;
|
|
876
|
+
}
|
|
877
|
+
//#endregion
|
|
878
|
+
//#region src/select/value/SelectValue.tsx
|
|
879
|
+
var st = /* @__PURE__ */ ke("<span>");
|
|
880
|
+
function ct(e) {
|
|
881
|
+
let n = $(), r = e, i = e, a = W(() => ({
|
|
882
|
+
value: n.value(),
|
|
883
|
+
placeholder: !n.hasSelectedValue()
|
|
884
|
+
})), o = W(() => s(e.class, a())), l = W(() => c(e.style, a())), u = W(() => t(a(), { value: () => null })), d = q(i, "as", "children", "class", "placeholder", "ref", "style"), f = W(() => {
|
|
885
|
+
let t = e.children;
|
|
886
|
+
if (typeof t == "function") return ge(t) ? Y(() => t()) : t(n.value());
|
|
887
|
+
if (t != null) return t;
|
|
888
|
+
if (!n.hasSelectedValue() && e.placeholder != null && !Le(n.items())) return e.placeholder;
|
|
889
|
+
let r = n.value();
|
|
890
|
+
return Array.isArray(r) ? Ie(r, n.items(), n.itemToStringLabel()) : Fe(r, n.items(), n.itemToStringLabel());
|
|
891
|
+
}), p = [((e) => n.setValueElement(e)), r.ref];
|
|
892
|
+
return R(V, {
|
|
893
|
+
get when() {
|
|
894
|
+
return e.as;
|
|
895
|
+
},
|
|
896
|
+
get fallback() {
|
|
897
|
+
var e = xe(st);
|
|
898
|
+
return we(() => p, e), De(e, z({
|
|
899
|
+
get class() {
|
|
900
|
+
return o();
|
|
901
|
+
},
|
|
902
|
+
get style() {
|
|
903
|
+
return l();
|
|
904
|
+
}
|
|
905
|
+
}, u, d), !0), Se(e, Ee(() => f())), Te(), e;
|
|
906
|
+
},
|
|
907
|
+
children: (e) => R(L, z({
|
|
908
|
+
get component() {
|
|
909
|
+
return e();
|
|
910
|
+
},
|
|
911
|
+
ref: p,
|
|
912
|
+
get class() {
|
|
913
|
+
return o();
|
|
914
|
+
},
|
|
915
|
+
get style() {
|
|
916
|
+
return l();
|
|
917
|
+
}
|
|
918
|
+
}, u, d, { get children() {
|
|
919
|
+
return f();
|
|
920
|
+
} }))
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
//#endregion
|
|
924
|
+
//#region src/select/icon/SelectIcon.tsx
|
|
925
|
+
var lt = /* @__PURE__ */ ke("<span>");
|
|
926
|
+
function ut(e) {
|
|
927
|
+
let n = $(), r = e, i = e, a = W(() => ({ open: n.store.open() })), o = W(() => s(e.class, a())), l = W(() => c(e.style, a())), u = W(() => t(a(), j)), d = q(i, "as", "class", "ref", "style");
|
|
928
|
+
return R(V, {
|
|
929
|
+
get when() {
|
|
930
|
+
return e.as;
|
|
931
|
+
},
|
|
932
|
+
get fallback() {
|
|
933
|
+
var t = xe(lt);
|
|
934
|
+
return we(() => [r.ref], t), De(t, z({
|
|
935
|
+
"aria-hidden": "true",
|
|
936
|
+
get class() {
|
|
937
|
+
return o();
|
|
938
|
+
},
|
|
939
|
+
get style() {
|
|
940
|
+
return l();
|
|
941
|
+
}
|
|
942
|
+
}, u, d), !0), Se(t, () => e.children ?? "▼"), Te(), t;
|
|
943
|
+
},
|
|
944
|
+
children: (t) => R(L, z({
|
|
945
|
+
get component() {
|
|
946
|
+
return t();
|
|
947
|
+
},
|
|
948
|
+
ref: [r.ref],
|
|
949
|
+
"aria-hidden": "true",
|
|
950
|
+
get class() {
|
|
951
|
+
return o();
|
|
952
|
+
},
|
|
953
|
+
get style() {
|
|
954
|
+
return l();
|
|
955
|
+
}
|
|
956
|
+
}, u, d, { get children() {
|
|
957
|
+
return e.children ?? "▼";
|
|
958
|
+
} }))
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
//#endregion
|
|
962
|
+
//#region src/select/portal/SelectPortalContext.ts
|
|
963
|
+
var dt = Symbol("SelectPortalContext"), ft = H(dt);
|
|
964
|
+
function pt() {
|
|
965
|
+
if (X(ft) === dt) throw Error("Base UI: SelectPositioner must be placed within <Select.Portal>.");
|
|
966
|
+
}
|
|
967
|
+
//#endregion
|
|
968
|
+
//#region src/select/portal/SelectPortal.tsx
|
|
969
|
+
function mt(e) {
|
|
970
|
+
let t = $(), n = e, r = e, i = W(() => t.presence.mounted() || t.store.forceMount()), a = {}, o = W(() => s(e.class, a)), l = W(() => c(e.style, a)), u = q(r, "as", "class", "container", "ref", "style");
|
|
971
|
+
return R(V, {
|
|
972
|
+
get when() {
|
|
973
|
+
return i();
|
|
974
|
+
},
|
|
975
|
+
get children() {
|
|
976
|
+
return R(ft, {
|
|
977
|
+
value: !0,
|
|
978
|
+
get children() {
|
|
979
|
+
return R(ee, z({
|
|
980
|
+
get as() {
|
|
981
|
+
return e.as;
|
|
982
|
+
},
|
|
983
|
+
get container() {
|
|
984
|
+
return n.container;
|
|
985
|
+
},
|
|
986
|
+
ref: (e) => le(n.ref, e),
|
|
987
|
+
get class() {
|
|
988
|
+
return o();
|
|
989
|
+
},
|
|
990
|
+
get style() {
|
|
991
|
+
return l();
|
|
992
|
+
}
|
|
993
|
+
}, u, { get children() {
|
|
994
|
+
return e.children;
|
|
995
|
+
} }));
|
|
996
|
+
}
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
//#endregion
|
|
1002
|
+
//#region src/select/backdrop/SelectBackdrop.tsx
|
|
1003
|
+
function ht(e) {
|
|
1004
|
+
let n = $(), r = e, i = e, a = W(() => ({
|
|
1005
|
+
open: n.store.open(),
|
|
1006
|
+
transitionStatus: n.store.track().transitionStatus
|
|
1007
|
+
})), o = W(() => s(e.class, a())), l = W(() => I({
|
|
1008
|
+
"user-select": "none",
|
|
1009
|
+
"-webkit-user-select": "none"
|
|
1010
|
+
}, c(e.style, a()))), u = W(() => t(a(), te)), d = q(i, "as", "class", "ref", "style"), f = null;
|
|
1011
|
+
return J(() => {
|
|
1012
|
+
n.backdropElement() === f && n.setBackdropElement(null);
|
|
1013
|
+
}), R(L, z({
|
|
1014
|
+
get component() {
|
|
1015
|
+
return e.as ?? "div";
|
|
1016
|
+
},
|
|
1017
|
+
ref: [((e) => {
|
|
1018
|
+
f = e, n.setBackdropElement(e);
|
|
1019
|
+
}), r.ref],
|
|
1020
|
+
role: "presentation",
|
|
1021
|
+
get hidden() {
|
|
1022
|
+
return !n.presence.mounted();
|
|
1023
|
+
},
|
|
1024
|
+
get class() {
|
|
1025
|
+
return o();
|
|
1026
|
+
},
|
|
1027
|
+
get style() {
|
|
1028
|
+
return l();
|
|
1029
|
+
}
|
|
1030
|
+
}, u, d));
|
|
1031
|
+
}
|
|
1032
|
+
//#endregion
|
|
1033
|
+
//#region src/select/positioner/SelectPositionerContext.ts
|
|
1034
|
+
var gt = Symbol("SelectPositionerContext"), _t = H(gt);
|
|
1035
|
+
function vt() {
|
|
1036
|
+
let e = X(_t);
|
|
1037
|
+
if (e === gt) throw Error("Base UI: SelectPositionerContext is missing. Select popup parts must be placed within <Select.Positioner>.");
|
|
1038
|
+
return e;
|
|
1039
|
+
}
|
|
1040
|
+
//#endregion
|
|
1041
|
+
//#region src/select/positioner/SelectPositioner.tsx
|
|
1042
|
+
function yt(e) {
|
|
1043
|
+
pt();
|
|
1044
|
+
let n = $(), r = ue(), i = e, o = e, [u, d] = G(null, { ownedWrite: !0 }), [f, p] = G(Y(() => i.alignItemWithTrigger ?? !0)), [m, h] = G(null, { ownedWrite: !0 }), [y, b] = G(null, { ownedWrite: !0 }), x = W(() => bt(i.anchor) ?? n.store.context.floatingRoot.referenceElement()), S = W(() => n.presence.mounted() && f() && n.store.openMethod() !== "touch"), C = g({
|
|
1045
|
+
reference: x,
|
|
1046
|
+
floating: u,
|
|
1047
|
+
mounted: n.presence.mounted,
|
|
1048
|
+
direction: r,
|
|
1049
|
+
positionMethod: () => i.positionMethod ?? "absolute",
|
|
1050
|
+
side: () => i.side ?? "bottom",
|
|
1051
|
+
sideOffset: () => i.sideOffset ?? 0,
|
|
1052
|
+
align: () => i.align ?? "center",
|
|
1053
|
+
alignOffset: () => i.alignOffset ?? 0,
|
|
1054
|
+
collisionBoundary: () => i.collisionBoundary ?? "clipping-ancestors",
|
|
1055
|
+
collisionPadding: () => i.collisionPadding ?? 5,
|
|
1056
|
+
arrowPadding: () => i.arrowPadding ?? 5,
|
|
1057
|
+
sticky: () => i.sticky ?? !1,
|
|
1058
|
+
disableAnchorTracking: () => i.disableAnchorTracking ?? S(),
|
|
1059
|
+
collisionAvoidance: () => i.collisionAvoidance ?? {
|
|
1060
|
+
side: "flip",
|
|
1061
|
+
align: "flip",
|
|
1062
|
+
fallbackAxisSide: "none"
|
|
1063
|
+
}
|
|
1064
|
+
}), w = W(() => S() ? "none" : C.renderedSide()), T = W(() => ({
|
|
1065
|
+
open: n.store.open(),
|
|
1066
|
+
side: w(),
|
|
1067
|
+
align: C.renderedAlign(),
|
|
1068
|
+
anchorHidden: C.anchorHidden()
|
|
1069
|
+
})), E = W(() => s(e.class, T())), D = W(() => I({
|
|
1070
|
+
...C.styles(),
|
|
1071
|
+
position: S() ? "fixed" : C.styles().position,
|
|
1072
|
+
"pointer-events": n.store.open() ? void 0 : "none",
|
|
1073
|
+
transition: n.store.track().transitionStatus === "starting" ? "none" : void 0
|
|
1074
|
+
}, c(e.style, T()))), O = W(() => t(T(), rt)), k = q(o, "align", "alignItemWithTrigger", "alignOffset", "anchor", "arrowPadding", "as", "class", "collisionAvoidance", "collisionBoundary", "collisionPadding", "disableAnchorTracking", "positionMethod", "ref", "side", "sideOffset", "sticky", "style"), A = 0;
|
|
1075
|
+
v({
|
|
1076
|
+
enabled: () => n.store.open() && (S() || n.modal()),
|
|
1077
|
+
touchOpen: () => n.store.openMethod() === "touch",
|
|
1078
|
+
positioner: u,
|
|
1079
|
+
reference: n.triggerElement
|
|
1080
|
+
}), U(() => ({
|
|
1081
|
+
mounted: n.presence.mounted(),
|
|
1082
|
+
requested: i.alignItemWithTrigger
|
|
1083
|
+
}), (e) => {
|
|
1084
|
+
e.mounted || p(e.requested ?? !0);
|
|
1085
|
+
}), U(S, (e) => n.store.setAlignItemWithTrigger(e)), U(C.renderedSide, (e) => n.store.setPopupSide(e)), U(() => ({
|
|
1086
|
+
size: n.store.collection.items().length,
|
|
1087
|
+
values: n.store.collection.values()
|
|
1088
|
+
}), ({ size: e, values: t }) => {
|
|
1089
|
+
let r = A;
|
|
1090
|
+
A = e, r !== 0 && e !== r && t.length !== 0 && Y(() => {
|
|
1091
|
+
let e = n.value();
|
|
1092
|
+
if (n.multiple()) {
|
|
1093
|
+
if (!Array.isArray(e)) return;
|
|
1094
|
+
let r = e.filter((e) => _e(t, e, n.comparator()) !== -1);
|
|
1095
|
+
r.length !== e.length && (n.setValue(r, l(a)), r.length === 0 && n.setSelectedItemText(null));
|
|
1096
|
+
} else if (e !== null && _e(t, e, n.comparator()) === -1) {
|
|
1097
|
+
let e = n.initialValue, r = e != null && !Array.isArray(e) && _e(t, e, n.comparator()) !== -1 ? e : null;
|
|
1098
|
+
n.setValue(r, l(a)), r === null && n.setSelectedItemText(null);
|
|
1099
|
+
}
|
|
1100
|
+
n.store.open() && S() && (n.store.setScrollUpVisible(!1), n.store.setScrollDownVisible(!1), u()?.style.removeProperty("height"), n.store.track().popupElement?.style.removeProperty("height"));
|
|
1101
|
+
});
|
|
1102
|
+
}), J(() => {
|
|
1103
|
+
n.store.setAlignItemWithTrigger(!1), n.store.state.positionerElement === Y(u) && n.store.setPositionerElement(null);
|
|
1104
|
+
});
|
|
1105
|
+
let j = {
|
|
1106
|
+
...C,
|
|
1107
|
+
side: w,
|
|
1108
|
+
align: C.renderedAlign,
|
|
1109
|
+
alignItemWithTriggerActive: S,
|
|
1110
|
+
setControlledAlignItemWithTrigger: p,
|
|
1111
|
+
scrollUpArrow: m,
|
|
1112
|
+
setScrollUpArrow: h,
|
|
1113
|
+
scrollDownArrow: y,
|
|
1114
|
+
setScrollDownArrow: b
|
|
1115
|
+
};
|
|
1116
|
+
function M() {
|
|
1117
|
+
let e = null;
|
|
1118
|
+
return J(() => {
|
|
1119
|
+
n.internalBackdropElement() === e && n.setInternalBackdropElement(null);
|
|
1120
|
+
}), R(_, {
|
|
1121
|
+
ref: (t) => {
|
|
1122
|
+
e = t, n.setInternalBackdropElement(t);
|
|
1123
|
+
},
|
|
1124
|
+
get cutout() {
|
|
1125
|
+
return n.triggerElement();
|
|
1126
|
+
},
|
|
1127
|
+
get open() {
|
|
1128
|
+
return n.store.open();
|
|
1129
|
+
}
|
|
1130
|
+
});
|
|
1131
|
+
}
|
|
1132
|
+
return R(_t, {
|
|
1133
|
+
value: j,
|
|
1134
|
+
get children() {
|
|
1135
|
+
return [R(V, {
|
|
1136
|
+
get when() {
|
|
1137
|
+
return Ce(() => !!n.presence.mounted())() ? n.modal() : n.presence.mounted();
|
|
1138
|
+
},
|
|
1139
|
+
get children() {
|
|
1140
|
+
return R(M, {});
|
|
1141
|
+
}
|
|
1142
|
+
}), R(L, z({
|
|
1143
|
+
get component() {
|
|
1144
|
+
return e.as ?? "div";
|
|
1145
|
+
},
|
|
1146
|
+
ref: [((e) => {
|
|
1147
|
+
d(e), n.store.setPositionerElement(e);
|
|
1148
|
+
}), i.ref],
|
|
1149
|
+
role: "presentation",
|
|
1150
|
+
get hidden() {
|
|
1151
|
+
return !n.presence.mounted();
|
|
1152
|
+
},
|
|
1153
|
+
get inert() {
|
|
1154
|
+
return !n.store.open() || void 0;
|
|
1155
|
+
},
|
|
1156
|
+
get class() {
|
|
1157
|
+
return E();
|
|
1158
|
+
},
|
|
1159
|
+
get style() {
|
|
1160
|
+
return D();
|
|
1161
|
+
}
|
|
1162
|
+
}, O, k))];
|
|
1163
|
+
}
|
|
1164
|
+
});
|
|
1165
|
+
}
|
|
1166
|
+
function bt(e) {
|
|
1167
|
+
return typeof e == "function" ? e() : e && "current" in e ? e.current : e;
|
|
1168
|
+
}
|
|
1169
|
+
//#endregion
|
|
1170
|
+
//#region src/select/popup/SelectPopup.tsx
|
|
1171
|
+
var xt = /* @__PURE__ */ new Set([
|
|
1172
|
+
"ArrowUp",
|
|
1173
|
+
"ArrowDown",
|
|
1174
|
+
"ArrowLeft",
|
|
1175
|
+
"ArrowRight",
|
|
1176
|
+
"Home",
|
|
1177
|
+
"End"
|
|
1178
|
+
]), St = {
|
|
1179
|
+
position: "relative",
|
|
1180
|
+
"max-height": "100%",
|
|
1181
|
+
"overflow-x": "hidden",
|
|
1182
|
+
"overflow-y": "auto"
|
|
1183
|
+
};
|
|
1184
|
+
function Ct(e) {
|
|
1185
|
+
let r = $(), i = vt(), a = ye(!0) !== void 0, o = ue(), u = e, f = e, m = W(() => ({
|
|
1186
|
+
side: i.side(),
|
|
1187
|
+
align: i.align(),
|
|
1188
|
+
open: r.store.open(),
|
|
1189
|
+
transitionStatus: r.store.track().transitionStatus
|
|
1190
|
+
})), g = W(() => s(e.class, m())), _ = W(() => I({
|
|
1191
|
+
...i.alignItemWithTriggerActive() ? r.store.listElement() ? { height: "100%" } : {
|
|
1192
|
+
...St,
|
|
1193
|
+
"scrollbar-width": r.store.openMethod() === "touch" ? void 0 : "none"
|
|
1194
|
+
} : {},
|
|
1195
|
+
transition: m().transitionStatus === "starting" ? "none" : void 0
|
|
1196
|
+
}, c(e.style, m()))), v = W(() => t(m(), it)), y = W(() => u.id ?? `${r.id()}-list`), b = q(f, "as", "class", "finalFocus", "id", "onBlur", "onKeyDown", "onScroll", "ref", "style"), x = null, S = !1, C = !1, w, T;
|
|
1197
|
+
function E(e) {
|
|
1198
|
+
let t = Be(e.scrollHeight, e.clientHeight), n = Ve(e.scrollTop, t);
|
|
1199
|
+
n !== e.scrollTop && (e.scrollTop = n), r.store.setScrollUpVisible(n > 0), r.store.setScrollDownVisible(n < t);
|
|
1200
|
+
}
|
|
1201
|
+
function D(e) {
|
|
1202
|
+
let t = r.store.track().positionerElement;
|
|
1203
|
+
if (!t || !x || !S) return;
|
|
1204
|
+
let n = t.style.top === "0px", a = t.style.bottom === "0px";
|
|
1205
|
+
if (C || !i.alignItemWithTriggerActive() || !n && !a) {
|
|
1206
|
+
E(e);
|
|
1207
|
+
return;
|
|
1208
|
+
}
|
|
1209
|
+
let o = wt(t), s = t.getBoundingClientRect().height / o.y, c = p(t).getComputedStyle(t), l = parseFloat(c.marginTop) || 0, u = parseFloat(c.marginBottom) || 0, d = Math.min(h(t).documentElement.clientHeight - l - u, Et(p(x).getComputedStyle(x))), f = e.scrollTop, m = Be(e.scrollHeight, e.clientHeight), g = n ? m - f : f, _ = Math.min(s + g, d), v = null;
|
|
1210
|
+
if (g <= 1) {
|
|
1211
|
+
let r = Dt(g, 0, d - s);
|
|
1212
|
+
r > 0 && (t.style.height = `${s + r}px`), e.scrollTop = n ? m : 0, C = d - (s + r) <= 1, E(e);
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
let y = Math.ceil(_);
|
|
1216
|
+
if (y > 0 && (t.style.height = `${y}px`), d - _ > 1 ? v = n ? Infinity : 0 : a && f < m && (v = f - (g - (s + g - d))), v !== null) {
|
|
1217
|
+
let t = Dt(v, 0, Be(e.scrollHeight, e.clientHeight));
|
|
1218
|
+
Math.abs(e.scrollTop - t) > 1 && (e.scrollTop = t);
|
|
1219
|
+
}
|
|
1220
|
+
C = y >= d - 1, E(e);
|
|
1221
|
+
}
|
|
1222
|
+
let O = d(() => u.onBlur, () => r.handleTypeaheadBlur), k = d(() => u.onKeyDown, () => (e) => {
|
|
1223
|
+
let t = r.store.state.popupProps.onKeyDown;
|
|
1224
|
+
typeof t == "function" && Reflect.apply(t, e.currentTarget, [e]);
|
|
1225
|
+
}, () => (e) => {
|
|
1226
|
+
a && xt.has(e.key) && e.stopPropagation();
|
|
1227
|
+
}), A = d(() => u.onScroll, () => (e) => {
|
|
1228
|
+
r.store.listElement() || D(e.currentTarget);
|
|
1229
|
+
});
|
|
1230
|
+
U(() => y(), (e) => r.store.setPopupId(e)), U(() => ({
|
|
1231
|
+
open: r.store.open(),
|
|
1232
|
+
positioned: i.state().isPositioned,
|
|
1233
|
+
active: i.alignItemWithTriggerActive(),
|
|
1234
|
+
trigger: r.triggerElement(),
|
|
1235
|
+
positioner: r.store.track().positionerElement,
|
|
1236
|
+
popup: x,
|
|
1237
|
+
list: r.store.listElement(),
|
|
1238
|
+
selectedText: r.selectedItemText(),
|
|
1239
|
+
firstText: r.firstItemText(),
|
|
1240
|
+
valueElement: r.valueElement(),
|
|
1241
|
+
transitionStatus: r.store.track().transitionStatus,
|
|
1242
|
+
hasSelectedValue: r.hasSelectedValue(),
|
|
1243
|
+
direction: o()
|
|
1244
|
+
}), (e) => {
|
|
1245
|
+
if (!e.open || !e.trigger || !e.positioner || !e.popup || e.active && !e.positioned || e.transitionStatus === "ending") return;
|
|
1246
|
+
S = !0, e.popup.style.removeProperty("--transform-origin");
|
|
1247
|
+
let t = e.list ?? e.popup;
|
|
1248
|
+
if (!e.active) {
|
|
1249
|
+
requestAnimationFrame(() => E(t));
|
|
1250
|
+
return;
|
|
1251
|
+
}
|
|
1252
|
+
j({
|
|
1253
|
+
trigger: e.trigger,
|
|
1254
|
+
positioner: e.positioner,
|
|
1255
|
+
popup: e.popup,
|
|
1256
|
+
scroller: t,
|
|
1257
|
+
text: e.selectedText?.isConnected ? e.selectedText : !e.hasSelectedValue && e.firstText?.isConnected ? e.firstText : null,
|
|
1258
|
+
valueElement: e.valueElement,
|
|
1259
|
+
direction: e.direction
|
|
1260
|
+
});
|
|
1261
|
+
}), U(() => ({
|
|
1262
|
+
open: r.store.open(),
|
|
1263
|
+
active: i.alignItemWithTriggerActive(),
|
|
1264
|
+
positionerElement: r.store.track().positionerElement
|
|
1265
|
+
}), (e) => {
|
|
1266
|
+
!e.open && !e.active && (S = !1, C = !1, N(e.positionerElement));
|
|
1267
|
+
}), U(() => ({
|
|
1268
|
+
open: r.store.open(),
|
|
1269
|
+
active: i.alignItemWithTriggerActive(),
|
|
1270
|
+
positioner: r.store.track().positionerElement
|
|
1271
|
+
}), (e) => {
|
|
1272
|
+
if (!e.open || !e.active || !e.positioner) return;
|
|
1273
|
+
let t = p(e.positioner), i = (e) => r.setOpen(!1, l(n, e));
|
|
1274
|
+
return t.addEventListener("resize", i), () => t.removeEventListener("resize", i);
|
|
1275
|
+
}), U(() => r.store.track().popupElement, (e) => {
|
|
1276
|
+
if (!e || typeof MutationObserver > "u") return;
|
|
1277
|
+
let t = new MutationObserver(() => r.store.collection.touch());
|
|
1278
|
+
return t.observe(e, {
|
|
1279
|
+
childList: !0,
|
|
1280
|
+
subtree: !0,
|
|
1281
|
+
characterData: !0
|
|
1282
|
+
}), () => t.disconnect();
|
|
1283
|
+
}), r.scrollHandler.current = D, J(() => {
|
|
1284
|
+
Y(() => {
|
|
1285
|
+
N(r.store.track().positionerElement), r.scrollHandler.current === D && (r.scrollHandler.current = null), r.store.state.popupElement === x && r.store.setPopupElement(null);
|
|
1286
|
+
});
|
|
1287
|
+
});
|
|
1288
|
+
function j(e) {
|
|
1289
|
+
let { trigger: t, positioner: n, popup: r, scroller: a, text: o, valueElement: s } = e;
|
|
1290
|
+
M(n, r);
|
|
1291
|
+
let c = At(r);
|
|
1292
|
+
try {
|
|
1293
|
+
n.style.transform = "none", n.style.right = "";
|
|
1294
|
+
let c = wt(t), l = Tt(t.getBoundingClientRect(), c), u = Tt(n.getBoundingClientRect(), c), d = p(r).getComputedStyle(r), f = p(n).getComputedStyle(n), m = h(t), g = parseFloat(f.marginTop) || 10, _ = parseFloat(f.marginBottom) || 10, v = parseFloat(f.minHeight) || 100, y = m.documentElement.clientHeight - g - _, b = m.documentElement.clientWidth, x = y - l.bottom + l.height, S = e.direction === "rtl" ? l.right - u.width : l.left, w = 0, T;
|
|
1295
|
+
if (o && s) {
|
|
1296
|
+
T = Tt(o.getBoundingClientRect(), c);
|
|
1297
|
+
let t = Tt(s.getBoundingClientRect(), c);
|
|
1298
|
+
S = u.left + (e.direction === "rtl" ? t.right - T.right : t.left - T.left), w = T.top - u.top + T.height / 2 - (t.top - l.top + t.height / 2);
|
|
1299
|
+
}
|
|
1300
|
+
let D = x + w + _ + (parseFloat(d.borderBottomWidth) || 0), O = Math.min(y, D), k = D - O;
|
|
1301
|
+
if (n.style.left = `${Dt(S, 5, b - 5 - u.width)}px`, o && s) {
|
|
1302
|
+
let t = Tt(o.getBoundingClientRect(), c), r = Tt(s.getBoundingClientRect(), c), i = e.direction === "rtl" ? r.right - t.right : r.left - t.left, a = parseFloat(n.style.left) || 0;
|
|
1303
|
+
n.style.left = `${Dt(a + i, 5, b - 5 - u.width)}px`, requestAnimationFrame(() => {
|
|
1304
|
+
if (!o.isConnected || !s.isConnected || !n.isConnected) return;
|
|
1305
|
+
let t = o.getBoundingClientRect(), r = s.getBoundingClientRect(), i = e.direction === "rtl" ? r.right - t.right : r.left - t.left, a = parseFloat(n.style.left) || 0;
|
|
1306
|
+
n.style.left = `${Dt(a + i, 5, b - 5 - u.width)}px`;
|
|
1307
|
+
});
|
|
1308
|
+
}
|
|
1309
|
+
n.style.height = `${O}px`, n.style.maxHeight = "none", n.style.marginTop = `${g}px`, n.style.marginBottom = `${_}px`, r.style.height = "100%";
|
|
1310
|
+
let A = Be(a.scrollHeight, a.clientHeight), j = k >= A - 1;
|
|
1311
|
+
if (j && (O = Math.min(y, u.height) - (k - A)), l.top < 20 || l.bottom > y - 20 || Math.ceil(O) + 1 < Math.min(a.scrollHeight, v) || (p(n).visualViewport?.scale ?? 1) !== 1 && jt()) {
|
|
1312
|
+
N(n), i.setControlledAlignItemWithTrigger(!1);
|
|
1313
|
+
return;
|
|
1314
|
+
}
|
|
1315
|
+
if (j) {
|
|
1316
|
+
let e = Math.max(0, y - D);
|
|
1317
|
+
n.style.top = u.height >= y ? "0px" : `${e}px`, n.style.bottom = "", n.style.height = `${O}px`, a.scrollTop = Be(a.scrollHeight, a.clientHeight);
|
|
1318
|
+
} else n.style.top = "", n.style.bottom = "0px", a.scrollTop = k;
|
|
1319
|
+
if (T) {
|
|
1320
|
+
let e = u.height > 0 ? Dt((T.top + T.height / 2 - u.top) / u.height * 100, 0, 100) : 50;
|
|
1321
|
+
r.style.setProperty("--transform-origin", `50% ${e}%`);
|
|
1322
|
+
}
|
|
1323
|
+
C = O >= Et(d) || O >= y, E(a);
|
|
1324
|
+
} finally {
|
|
1325
|
+
c();
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
function M(e, t) {
|
|
1329
|
+
w ??= Ot(e, [
|
|
1330
|
+
"top",
|
|
1331
|
+
"left",
|
|
1332
|
+
"right",
|
|
1333
|
+
"bottom",
|
|
1334
|
+
"height",
|
|
1335
|
+
"min-height",
|
|
1336
|
+
"max-height",
|
|
1337
|
+
"margin-top",
|
|
1338
|
+
"margin-bottom",
|
|
1339
|
+
"transform"
|
|
1340
|
+
]), T ??= Ot(t, ["height", "--transform-origin"]);
|
|
1341
|
+
}
|
|
1342
|
+
function N(e) {
|
|
1343
|
+
e && w && kt(e, w), x && T && kt(x, T), w = void 0, T = void 0;
|
|
1344
|
+
}
|
|
1345
|
+
function ee() {
|
|
1346
|
+
let t = () => r.store.listElement();
|
|
1347
|
+
return R(L, z({
|
|
1348
|
+
get component() {
|
|
1349
|
+
return e.as ?? "div";
|
|
1350
|
+
},
|
|
1351
|
+
ref: [((e) => {
|
|
1352
|
+
x = e, r.store.setPopupElement(e);
|
|
1353
|
+
}), u.ref],
|
|
1354
|
+
get id() {
|
|
1355
|
+
return Ce(() => !!t())() ? u.id : y();
|
|
1356
|
+
},
|
|
1357
|
+
get role() {
|
|
1358
|
+
return t() ? "presentation" : "listbox";
|
|
1359
|
+
},
|
|
1360
|
+
tabindex: -1,
|
|
1361
|
+
"data-base-ui-focusable": "",
|
|
1362
|
+
get "data-rootownerid"() {
|
|
1363
|
+
return r.node.id;
|
|
1364
|
+
},
|
|
1365
|
+
get "aria-orientation"() {
|
|
1366
|
+
return t() ? void 0 : "vertical";
|
|
1367
|
+
},
|
|
1368
|
+
get "aria-multiselectable"() {
|
|
1369
|
+
return !t() && r.multiple() ? "true" : void 0;
|
|
1370
|
+
},
|
|
1371
|
+
get class() {
|
|
1372
|
+
return g();
|
|
1373
|
+
},
|
|
1374
|
+
get style() {
|
|
1375
|
+
return _();
|
|
1376
|
+
},
|
|
1377
|
+
onBlur: O,
|
|
1378
|
+
onKeyDown: k,
|
|
1379
|
+
onScroll: A
|
|
1380
|
+
}, v, b));
|
|
1381
|
+
}
|
|
1382
|
+
return R(ne, {
|
|
1383
|
+
get context() {
|
|
1384
|
+
return r.store.context.floatingRoot;
|
|
1385
|
+
},
|
|
1386
|
+
get tree() {
|
|
1387
|
+
return r.tree;
|
|
1388
|
+
},
|
|
1389
|
+
get disabled() {
|
|
1390
|
+
return !r.presence.mounted();
|
|
1391
|
+
},
|
|
1392
|
+
initialFocus: () => Y(() => r.store.activeElement()) ?? !0,
|
|
1393
|
+
get returnFocus() {
|
|
1394
|
+
return u.finalFocus ?? !0;
|
|
1395
|
+
},
|
|
1396
|
+
restoreFocus: !0,
|
|
1397
|
+
modal: !1,
|
|
1398
|
+
get openInteractionType() {
|
|
1399
|
+
return r.store.openMethod();
|
|
1400
|
+
},
|
|
1401
|
+
get previousFocusableElement() {
|
|
1402
|
+
return r.triggerElement;
|
|
1403
|
+
},
|
|
1404
|
+
get beforeContentGuardRef() {
|
|
1405
|
+
return r.setBeforeContentGuard;
|
|
1406
|
+
},
|
|
1407
|
+
get children() {
|
|
1408
|
+
return R(ee, {});
|
|
1409
|
+
}
|
|
1410
|
+
});
|
|
1411
|
+
}
|
|
1412
|
+
function wt(e) {
|
|
1413
|
+
let t = e.getBoundingClientRect();
|
|
1414
|
+
return {
|
|
1415
|
+
x: e.offsetWidth ? t.width / e.offsetWidth : 1,
|
|
1416
|
+
y: e.offsetHeight ? t.height / e.offsetHeight : 1
|
|
1417
|
+
};
|
|
1418
|
+
}
|
|
1419
|
+
function Tt(e, t) {
|
|
1420
|
+
let n = e.x / t.x, r = e.y / t.y, i = e.width / t.x, a = e.height / t.y;
|
|
1421
|
+
return {
|
|
1422
|
+
x: n,
|
|
1423
|
+
y: r,
|
|
1424
|
+
top: r,
|
|
1425
|
+
left: n,
|
|
1426
|
+
right: n + i,
|
|
1427
|
+
bottom: r + a,
|
|
1428
|
+
width: i,
|
|
1429
|
+
height: a
|
|
1430
|
+
};
|
|
1431
|
+
}
|
|
1432
|
+
function Et(e) {
|
|
1433
|
+
return e.maxHeight.endsWith("px") && parseFloat(e.maxHeight) || Infinity;
|
|
1434
|
+
}
|
|
1435
|
+
function Dt(e, t, n) {
|
|
1436
|
+
return Math.max(t, Math.min(n, e));
|
|
1437
|
+
}
|
|
1438
|
+
function Ot(e, t) {
|
|
1439
|
+
return Object.fromEntries(t.map((t) => [t, e.style.getPropertyValue(t)]));
|
|
1440
|
+
}
|
|
1441
|
+
function kt(e, t) {
|
|
1442
|
+
for (let [n, r] of Object.entries(t)) r ? e.style.setProperty(n, r) : e.style.removeProperty(n);
|
|
1443
|
+
}
|
|
1444
|
+
function At(e) {
|
|
1445
|
+
let t = Ot(e, [
|
|
1446
|
+
"transform",
|
|
1447
|
+
"scale",
|
|
1448
|
+
"translate"
|
|
1449
|
+
]);
|
|
1450
|
+
return e.style.setProperty("transform", "none", "important"), e.style.setProperty("scale", "1", "important"), e.style.setProperty("translate", "0 0", "important"), () => kt(e, t);
|
|
1451
|
+
}
|
|
1452
|
+
function jt() {
|
|
1453
|
+
return typeof navigator < "u" && /AppleWebKit/.test(navigator.userAgent) && !/Chrome|Chromium/.test(navigator.userAgent);
|
|
1454
|
+
}
|
|
1455
|
+
//#endregion
|
|
1456
|
+
//#region src/select/list/SelectList.tsx
|
|
1457
|
+
function Mt(e) {
|
|
1458
|
+
let t = $(), n = vt(), r = e, i = e, a = {}, o = W(() => s(e.class, a)), l = W(() => I({
|
|
1459
|
+
...n.alignItemWithTriggerActive() ? St : {},
|
|
1460
|
+
"scrollbar-width": t.store.hasScrollArrows() && t.store.openMethod() !== "touch" ? "none" : void 0
|
|
1461
|
+
}, c(e.style, a))), u = q(i, "as", "class", "id", "onScroll", "ref", "style"), f = d(() => r.onScroll, () => (e) => t.handleScroll(e.currentTarget)), p = null;
|
|
1462
|
+
return J(() => {
|
|
1463
|
+
t.store.listElement() === p && t.store.setListElement(null);
|
|
1464
|
+
}), R(L, z({
|
|
1465
|
+
get component() {
|
|
1466
|
+
return e.as ?? "div";
|
|
1467
|
+
},
|
|
1468
|
+
ref: [((e) => {
|
|
1469
|
+
p = e, t.store.setListElement(e);
|
|
1470
|
+
}), r.ref],
|
|
1471
|
+
get id() {
|
|
1472
|
+
return r.id ?? `${t.id()}-list`;
|
|
1473
|
+
},
|
|
1474
|
+
role: "listbox",
|
|
1475
|
+
get "aria-multiselectable"() {
|
|
1476
|
+
return t.multiple() ? "true" : void 0;
|
|
1477
|
+
},
|
|
1478
|
+
get class() {
|
|
1479
|
+
return o();
|
|
1480
|
+
},
|
|
1481
|
+
get style() {
|
|
1482
|
+
return l();
|
|
1483
|
+
},
|
|
1484
|
+
onScroll: f
|
|
1485
|
+
}, u));
|
|
1486
|
+
}
|
|
1487
|
+
//#endregion
|
|
1488
|
+
//#region src/select/item/SelectItemContext.ts
|
|
1489
|
+
var Nt = Symbol("SelectItemContext"), Pt = H(Nt);
|
|
1490
|
+
function Ft() {
|
|
1491
|
+
let e = X(Pt);
|
|
1492
|
+
if (e === Nt) throw Error("Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.");
|
|
1493
|
+
return e;
|
|
1494
|
+
}
|
|
1495
|
+
//#endregion
|
|
1496
|
+
//#region src/select/item/SelectItem.tsx
|
|
1497
|
+
function It(e) {
|
|
1498
|
+
let n = $(), r = e, i = e, a = Symbol("SelectItem"), u = W(() => r.value ?? null), f = W(() => n.disabled() || (r.disabled ?? !1)), p = W(() => r.nativeButton ?? !1), [m, h] = G(null, { ownedWrite: !0 }), [g, _] = G(null, { ownedWrite: !0 }), v = n.store.collection.register({
|
|
1499
|
+
token: a,
|
|
1500
|
+
element: m,
|
|
1501
|
+
textElement: g,
|
|
1502
|
+
value: u,
|
|
1503
|
+
label: () => r.label,
|
|
1504
|
+
disabled: f
|
|
1505
|
+
}), y = W(() => n.store.collection.indexOf(a)), b = W(() => {
|
|
1506
|
+
let e = n.value();
|
|
1507
|
+
return n.multiple() ? Array.isArray(e) && e.some((e) => P(u(), e, n.comparator())) : P(u(), e, n.comparator());
|
|
1508
|
+
}), x = W(() => n.store.activeElement() === m()), S = W(() => n.selectedIndex() === y()), C = W(() => ({
|
|
1509
|
+
disabled: f(),
|
|
1510
|
+
selected: b(),
|
|
1511
|
+
highlighted: x()
|
|
1512
|
+
})), w = W(() => s(e.class, C())), T = W(() => c(e.style, C())), E = W(() => t(C())), D = q(i, "as", "class", "disabled", "id", "label", "nativeButton", "onBlur", "onClick", "onFocus", "onKeyDown", "onKeyUp", "onMouseMove", "onMouseUp", "onPointerDown", "onPointerEnter", "onPointerMove", "ref", "style", "value"), O = "mouse", k = !1, A = !1;
|
|
1513
|
+
function j(e) {
|
|
1514
|
+
if (n.disabled() || n.readOnly()) return;
|
|
1515
|
+
let t = n.value();
|
|
1516
|
+
if (n.multiple()) {
|
|
1517
|
+
let r = Array.isArray(t) ? t : [], i = b() ? he(r, u(), n.comparator()) : [...r, u()];
|
|
1518
|
+
n.setValue(i, l(o, e));
|
|
1519
|
+
} else n.setValue(u(), l(o, e)), n.setOpen(!1, l(o, e));
|
|
1520
|
+
}
|
|
1521
|
+
function M(e) {
|
|
1522
|
+
A = !0;
|
|
1523
|
+
let t = e.pointerType, n = e.detail === 0 && (t !== void 0 || x() || m()?.ownerDocument.activeElement === m()), r = O !== "touch" && !n && !k;
|
|
1524
|
+
k = !1, !f() && !r && j(e);
|
|
1525
|
+
}
|
|
1526
|
+
function N(e) {
|
|
1527
|
+
n.store.setActiveElement(e.currentTarget), n.field.setFocused(!0);
|
|
1528
|
+
}
|
|
1529
|
+
function ee(e) {
|
|
1530
|
+
Y(() => {
|
|
1531
|
+
n.store.activeElement() === e.currentTarget && e.relatedTarget !== e.currentTarget && n.store.setActiveElement(null), n.handleTypeaheadBlur(e);
|
|
1532
|
+
});
|
|
1533
|
+
}
|
|
1534
|
+
function te(e) {
|
|
1535
|
+
if (n.store.setActiveElement(e.currentTarget), e.key === " " && n.store.typing()) {
|
|
1536
|
+
e.preventDefault(), e.preventBaseUIHandler();
|
|
1537
|
+
return;
|
|
1538
|
+
}
|
|
1539
|
+
if (n.handleKeyDown(e), e.defaultPrevented) {
|
|
1540
|
+
e.preventBaseUIHandler();
|
|
1541
|
+
return;
|
|
1542
|
+
}
|
|
1543
|
+
if (e.target !== e.currentTarget || e.key !== "Enter" && e.key !== " ") return;
|
|
1544
|
+
let t = e.currentTarget;
|
|
1545
|
+
if (p() && t.tagName === "BUTTON") return;
|
|
1546
|
+
e.preventDefault(), e.preventBaseUIHandler(), A = !1;
|
|
1547
|
+
let r = Lt(t, e);
|
|
1548
|
+
!A && !r.baseUIHandlerPrevented && j(e);
|
|
1549
|
+
}
|
|
1550
|
+
function ne(e) {
|
|
1551
|
+
p() && e.key === " " && e.preventDefault();
|
|
1552
|
+
}
|
|
1553
|
+
function re(e) {
|
|
1554
|
+
O = e.pointerType, e.pointerType === "mouse" && e.buttons === 1 && (n.store.selection.dragY += e.movementY, n.store.selection.dragY ** 2 >= 64 && (n.store.selection.allowUnselectedMouseUp = !0)), e.pointerType === "mouse" && n.store.pointerMoved(e) && ae(e.currentTarget);
|
|
1555
|
+
}
|
|
1556
|
+
function ie(e) {
|
|
1557
|
+
n.store.pointerMoved(e) && ae(e.currentTarget);
|
|
1558
|
+
}
|
|
1559
|
+
function ae(e) {
|
|
1560
|
+
n.highlightItemOnHover() && (n.store.setActiveElement(e), Me(), e.focus({ preventScroll: !0 }));
|
|
1561
|
+
}
|
|
1562
|
+
function oe(e) {
|
|
1563
|
+
O = e.pointerType, k = !0, n.store.selection.dragY = 0;
|
|
1564
|
+
}
|
|
1565
|
+
function ce() {
|
|
1566
|
+
n.store.selection.dragY = 0, !(f() || O === "touch" || k) && ((b() ? !n.store.selection.allowSelectedMouseUp : !n.store.selection.allowUnselectedMouseUp) || (k = !0, m()?.click(), k = !1));
|
|
1567
|
+
}
|
|
1568
|
+
let le = d(() => r.onBlur, () => ee), ue = d(() => Y(() => f() ? se : void 0), () => r.onClick, () => M), de = d(() => r.onFocus, () => N), fe = d(() => r.onKeyDown, () => te), pe = d(() => r.onKeyUp, () => ne), me = d(() => r.onMouseUp, () => ce), ge = d(() => r.onMouseMove, () => ie), _e = d(() => r.onPointerDown, () => oe), F = d(() => r.onPointerEnter, () => (e) => {
|
|
1569
|
+
O = e.pointerType;
|
|
1570
|
+
}), I = d(() => r.onPointerMove, () => re);
|
|
1571
|
+
return U(() => ({
|
|
1572
|
+
index: y(),
|
|
1573
|
+
selectedByFocus: S(),
|
|
1574
|
+
text: g()
|
|
1575
|
+
}), (e) => {
|
|
1576
|
+
e.index === 0 && n.setFirstItemText(e.text), e.selectedByFocus && e.text && n.setSelectedItemText(e.text);
|
|
1577
|
+
}), J(() => {
|
|
1578
|
+
v(), n.firstItemText() === Y(g) && n.setFirstItemText(null), n.selectedItemText() === Y(g) && n.setSelectedItemText(null);
|
|
1579
|
+
}), R(Pt, {
|
|
1580
|
+
value: {
|
|
1581
|
+
selected: b,
|
|
1582
|
+
selectedByFocus: S,
|
|
1583
|
+
index: y,
|
|
1584
|
+
textElement: g,
|
|
1585
|
+
setTextElement: _
|
|
1586
|
+
},
|
|
1587
|
+
get children() {
|
|
1588
|
+
return R(L, z({
|
|
1589
|
+
get component() {
|
|
1590
|
+
return e.as ?? "div";
|
|
1591
|
+
},
|
|
1592
|
+
ref: [((e) => {
|
|
1593
|
+
h(e), n.store.collection.touch();
|
|
1594
|
+
}), r.ref],
|
|
1595
|
+
get type() {
|
|
1596
|
+
return p() ? "button" : void 0;
|
|
1597
|
+
},
|
|
1598
|
+
role: "option",
|
|
1599
|
+
get tabindex() {
|
|
1600
|
+
return n.store.open() && x() ? 0 : -1;
|
|
1601
|
+
},
|
|
1602
|
+
get "aria-selected"() {
|
|
1603
|
+
return b() ? "true" : "false";
|
|
1604
|
+
},
|
|
1605
|
+
get "aria-disabled"() {
|
|
1606
|
+
return f() ? "true" : void 0;
|
|
1607
|
+
},
|
|
1608
|
+
get class() {
|
|
1609
|
+
return w();
|
|
1610
|
+
},
|
|
1611
|
+
get style() {
|
|
1612
|
+
return T();
|
|
1613
|
+
},
|
|
1614
|
+
onBlur: le,
|
|
1615
|
+
onClick: ue,
|
|
1616
|
+
onFocus: de,
|
|
1617
|
+
onKeyDown: fe,
|
|
1618
|
+
onKeyUp: pe,
|
|
1619
|
+
onMouseMove: ge,
|
|
1620
|
+
onMouseUp: me,
|
|
1621
|
+
onPointerDown: _e,
|
|
1622
|
+
onPointerEnter: F,
|
|
1623
|
+
onPointerMove: I
|
|
1624
|
+
}, E, D));
|
|
1625
|
+
}
|
|
1626
|
+
});
|
|
1627
|
+
}
|
|
1628
|
+
function Lt(e, t) {
|
|
1629
|
+
let n = new ((e.ownerDocument.defaultView?.MouseEvent) ?? MouseEvent)("click", {
|
|
1630
|
+
bubbles: !0,
|
|
1631
|
+
cancelable: !0,
|
|
1632
|
+
composed: !0,
|
|
1633
|
+
detail: 0,
|
|
1634
|
+
shiftKey: t.shiftKey,
|
|
1635
|
+
ctrlKey: t.ctrlKey,
|
|
1636
|
+
altKey: t.altKey,
|
|
1637
|
+
metaKey: t.metaKey
|
|
1638
|
+
});
|
|
1639
|
+
return e.dispatchEvent(n), n;
|
|
1640
|
+
}
|
|
1641
|
+
//#endregion
|
|
1642
|
+
//#region src/select/item-indicator/SelectItemIndicator.tsx
|
|
1643
|
+
function Rt(e) {
|
|
1644
|
+
let n = Ft(), r = e, i = e, a = A(n.selected), o = W(() => (r.keepMounted ?? !1) || a.mounted()), l = W(() => ({
|
|
1645
|
+
selected: n.selected(),
|
|
1646
|
+
transitionStatus: a.transitionStatus()
|
|
1647
|
+
})), d = W(() => s(e.class, l())), p = W(() => c(e.style, l())), m = W(() => t(l(), u)), h = q(i, "as", "class", "keepMounted", "ref", "style"), g;
|
|
1648
|
+
return U(() => ({
|
|
1649
|
+
selected: n.selected(),
|
|
1650
|
+
status: a.transitionStatus(),
|
|
1651
|
+
element: g
|
|
1652
|
+
}), (e) => {
|
|
1653
|
+
if (e.selected || e.status !== "ending" || !e.element) return;
|
|
1654
|
+
let t = new AbortController();
|
|
1655
|
+
return f(e.element, () => {
|
|
1656
|
+
Y(n.selected) || a.setMounted(!1);
|
|
1657
|
+
}, t.signal), () => t.abort();
|
|
1658
|
+
}), R(V, {
|
|
1659
|
+
get when() {
|
|
1660
|
+
return o();
|
|
1661
|
+
},
|
|
1662
|
+
get children() {
|
|
1663
|
+
return R(L, z({
|
|
1664
|
+
get component() {
|
|
1665
|
+
return e.as ?? "span";
|
|
1666
|
+
},
|
|
1667
|
+
ref: [((e) => g = e), r.ref],
|
|
1668
|
+
"aria-hidden": "true",
|
|
1669
|
+
get class() {
|
|
1670
|
+
return d();
|
|
1671
|
+
},
|
|
1672
|
+
get style() {
|
|
1673
|
+
return p();
|
|
1674
|
+
}
|
|
1675
|
+
}, m, h, { get children() {
|
|
1676
|
+
return e.children ?? "✔️";
|
|
1677
|
+
} }));
|
|
1678
|
+
}
|
|
1679
|
+
});
|
|
1680
|
+
}
|
|
1681
|
+
//#endregion
|
|
1682
|
+
//#region src/select/item-text/SelectItemText.tsx
|
|
1683
|
+
function zt(e) {
|
|
1684
|
+
let t = Ft(), n = $(), r = e, i = e, a = {}, o = W(() => s(e.class, a)), l = W(() => c(e.style, a)), u = q(i, "as", "class", "ref", "style");
|
|
1685
|
+
return U(() => ({
|
|
1686
|
+
index: t.index(),
|
|
1687
|
+
selected: t.selectedByFocus(),
|
|
1688
|
+
text: t.textElement()
|
|
1689
|
+
}), (e) => {
|
|
1690
|
+
n.store.collection.touch(), e.index === 0 && n.setFirstItemText(e.text), e.selected && e.text && n.setSelectedItemText(e.text);
|
|
1691
|
+
}), J(() => {
|
|
1692
|
+
Y(() => {
|
|
1693
|
+
let e = t.textElement();
|
|
1694
|
+
n.firstItemText() === e && n.setFirstItemText(null), n.selectedItemText() === e && n.setSelectedItemText(null);
|
|
1695
|
+
});
|
|
1696
|
+
}), R(L, z({
|
|
1697
|
+
get component() {
|
|
1698
|
+
return e.as ?? "div";
|
|
1699
|
+
},
|
|
1700
|
+
ref: [((e) => t.setTextElement(e)), r.ref],
|
|
1701
|
+
get class() {
|
|
1702
|
+
return o();
|
|
1703
|
+
},
|
|
1704
|
+
get style() {
|
|
1705
|
+
return l();
|
|
1706
|
+
}
|
|
1707
|
+
}, u));
|
|
1708
|
+
}
|
|
1709
|
+
//#endregion
|
|
1710
|
+
//#region src/select/arrow/SelectArrow.tsx
|
|
1711
|
+
function Bt(e) {
|
|
1712
|
+
let n = $(), r = vt(), i = e, a = e, o = W(() => ({
|
|
1713
|
+
open: n.store.open(),
|
|
1714
|
+
side: r.side(),
|
|
1715
|
+
align: r.align(),
|
|
1716
|
+
uncentered: r.arrowUncentered()
|
|
1717
|
+
})), l = W(() => s(e.class, o())), u = W(() => I(r.arrowStyles(), c(e.style, o()))), d = W(() => t(o(), N)), f = q(a, "as", "class", "ref", "style"), p = null;
|
|
1718
|
+
return J(() => {
|
|
1719
|
+
p && r.setArrowElement(null);
|
|
1720
|
+
}), R(V, {
|
|
1721
|
+
get when() {
|
|
1722
|
+
return !r.alignItemWithTriggerActive();
|
|
1723
|
+
},
|
|
1724
|
+
get children() {
|
|
1725
|
+
return R(L, z({
|
|
1726
|
+
get component() {
|
|
1727
|
+
return e.as ?? "div";
|
|
1728
|
+
},
|
|
1729
|
+
ref: [((e) => {
|
|
1730
|
+
p = e, r.setArrowElement(e);
|
|
1731
|
+
}), i.ref],
|
|
1732
|
+
"aria-hidden": "true",
|
|
1733
|
+
get class() {
|
|
1734
|
+
return l();
|
|
1735
|
+
},
|
|
1736
|
+
get style() {
|
|
1737
|
+
return u();
|
|
1738
|
+
}
|
|
1739
|
+
}, d, f));
|
|
1740
|
+
}
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1743
|
+
//#endregion
|
|
1744
|
+
//#region src/select/scroll-arrow/SelectScrollArrow.tsx
|
|
1745
|
+
function Vt(e) {
|
|
1746
|
+
let n = $(), r = vt(), i = e, a = e, o = W(() => i.direction === "up"), l = W(() => o() ? n.store.scrollUpVisible() : n.store.scrollDownVisible()), p = W(() => l() && n.store.openMethod() !== "touch"), m = A(p), h = W(() => (i.keepMounted ?? !1) || m.mounted()), g = W(() => ({
|
|
1747
|
+
direction: i.direction,
|
|
1748
|
+
visible: p(),
|
|
1749
|
+
side: r.side(),
|
|
1750
|
+
transitionStatus: m.transitionStatus()
|
|
1751
|
+
})), _ = W(() => s(e.class, g())), v = W(() => I({ position: "absolute" }, c(e.style, g()))), y = W(() => t(g(), u)), b = q(a, "as", "class", "direction", "keepMounted", "onMouseLeave", "onMouseMove", "ref", "style"), x = null, S;
|
|
1752
|
+
function C() {
|
|
1753
|
+
clearTimeout(S), S = void 0;
|
|
1754
|
+
}
|
|
1755
|
+
function w(e) {
|
|
1756
|
+
e.movementX === 0 && e.movementY === 0 || S !== void 0 || (n.store.setActiveIndex(null), S = setTimeout(T, 40));
|
|
1757
|
+
}
|
|
1758
|
+
function T() {
|
|
1759
|
+
S = void 0;
|
|
1760
|
+
let e = n.store.listElement() ?? n.store.track().popupElement;
|
|
1761
|
+
if (!e) return;
|
|
1762
|
+
n.store.setActiveIndex(null), n.updateScrollArrowVisibility(e);
|
|
1763
|
+
let t = Be(e.scrollHeight, e.clientHeight), r = Ve(e.scrollTop, t);
|
|
1764
|
+
if (r !== e.scrollTop && (e.scrollTop = r), r === (o() ? 0 : t)) return;
|
|
1765
|
+
let i = n.store.collection.elements();
|
|
1766
|
+
i.length > 0 && (e.scrollTop = Ht(i, o(), r, e.clientHeight, x?.offsetHeight ?? 0, t)), S = setTimeout(T, 40);
|
|
1767
|
+
}
|
|
1768
|
+
let E = d(() => i.onMouseLeave, () => C), D = d(() => i.onMouseMove, () => w);
|
|
1769
|
+
return n.scrollArrowsMounted.count += 1, n.store.setHasScrollArrows(!0), U(() => ({
|
|
1770
|
+
visible: p(),
|
|
1771
|
+
status: m.transitionStatus(),
|
|
1772
|
+
element: x
|
|
1773
|
+
}), (e) => {
|
|
1774
|
+
if (e.visible || e.status !== "ending" || !e.element) return;
|
|
1775
|
+
let t = new AbortController();
|
|
1776
|
+
return f(e.element, () => {
|
|
1777
|
+
Y(p) || m.setMounted(!1);
|
|
1778
|
+
}, t.signal), () => t.abort();
|
|
1779
|
+
}), J(() => {
|
|
1780
|
+
C(), n.scrollArrowsMounted.count = Math.max(0, n.scrollArrowsMounted.count - 1), n.scrollArrowsMounted.count === 0 && n.store.setHasScrollArrows(!1), o() ? r.setScrollUpArrow(null) : r.setScrollDownArrow(null);
|
|
1781
|
+
}), R(V, {
|
|
1782
|
+
get when() {
|
|
1783
|
+
return h();
|
|
1784
|
+
},
|
|
1785
|
+
get children() {
|
|
1786
|
+
return R(L, z({
|
|
1787
|
+
get component() {
|
|
1788
|
+
return e.as ?? "div";
|
|
1789
|
+
},
|
|
1790
|
+
ref: [((e) => {
|
|
1791
|
+
x = e, o() ? r.setScrollUpArrow(e) : r.setScrollDownArrow(e);
|
|
1792
|
+
}), i.ref],
|
|
1793
|
+
"aria-hidden": "true",
|
|
1794
|
+
get class() {
|
|
1795
|
+
return _();
|
|
1796
|
+
},
|
|
1797
|
+
get style() {
|
|
1798
|
+
return v();
|
|
1799
|
+
},
|
|
1800
|
+
onMouseLeave: E,
|
|
1801
|
+
onMouseMove: D
|
|
1802
|
+
}, y, b, { get children() {
|
|
1803
|
+
return e.children ?? (o() ? "▲" : "▼");
|
|
1804
|
+
} }));
|
|
1805
|
+
}
|
|
1806
|
+
});
|
|
1807
|
+
}
|
|
1808
|
+
function Ht(e, t, n, r, i, a) {
|
|
1809
|
+
if (t) {
|
|
1810
|
+
let t = 0, r = n + i - 1;
|
|
1811
|
+
for (let n = 0; n < e.length; n += 1) if (e[n] && e[n].offsetTop >= r) {
|
|
1812
|
+
t = n;
|
|
1813
|
+
break;
|
|
1814
|
+
}
|
|
1815
|
+
let o = Math.max(0, t - 1), s = e[o];
|
|
1816
|
+
return o < t && s ? Ve(s.offsetTop - i, a) : 0;
|
|
1817
|
+
}
|
|
1818
|
+
let o = e.length - 1, s = n + r - i + 1;
|
|
1819
|
+
for (let t = 0; t < e.length; t += 1) {
|
|
1820
|
+
let n = e[t];
|
|
1821
|
+
if (n && n.offsetTop + n.offsetHeight > s) {
|
|
1822
|
+
o = Math.max(0, t - 1);
|
|
1823
|
+
break;
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
let c = Math.min(e.length - 1, o + 1), l = e[c];
|
|
1827
|
+
return c > o && l ? Ve(l.offsetTop + l.offsetHeight - r + i, a) : a;
|
|
1828
|
+
}
|
|
1829
|
+
//#endregion
|
|
1830
|
+
//#region src/select/scroll-down-arrow/SelectScrollDownArrow.tsx
|
|
1831
|
+
function Ut(e) {
|
|
1832
|
+
return Vt(K(e, { direction: "down" }));
|
|
1833
|
+
}
|
|
1834
|
+
//#endregion
|
|
1835
|
+
//#region src/select/scroll-up-arrow/SelectScrollUpArrow.tsx
|
|
1836
|
+
function Wt(e) {
|
|
1837
|
+
return Vt(K(e, { direction: "up" }));
|
|
1838
|
+
}
|
|
1839
|
+
//#endregion
|
|
1840
|
+
//#region src/select/group/SelectGroupContext.ts
|
|
1841
|
+
var Gt = Symbol("SelectGroupContext"), Kt = H(Gt);
|
|
1842
|
+
function qt() {
|
|
1843
|
+
let e = X(Kt);
|
|
1844
|
+
if (e === Gt) throw Error("Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>.");
|
|
1845
|
+
return e;
|
|
1846
|
+
}
|
|
1847
|
+
//#endregion
|
|
1848
|
+
//#region src/select/group/SelectGroup.tsx
|
|
1849
|
+
function Jt(e) {
|
|
1850
|
+
let t = e, n = e, [r, i] = G(), a = {}, o = W(() => s(e.class, a)), l = W(() => c(e.style, a)), u = q(n, "as", "class", "ref", "style");
|
|
1851
|
+
return R(Kt, {
|
|
1852
|
+
value: {
|
|
1853
|
+
labelId: r,
|
|
1854
|
+
setLabelId: i
|
|
1855
|
+
},
|
|
1856
|
+
get children() {
|
|
1857
|
+
return R(L, z({
|
|
1858
|
+
get component() {
|
|
1859
|
+
return e.as ?? "div";
|
|
1860
|
+
},
|
|
1861
|
+
ref: [t.ref],
|
|
1862
|
+
role: "group",
|
|
1863
|
+
get "aria-labelledby"() {
|
|
1864
|
+
return r();
|
|
1865
|
+
},
|
|
1866
|
+
get class() {
|
|
1867
|
+
return o();
|
|
1868
|
+
},
|
|
1869
|
+
get style() {
|
|
1870
|
+
return l();
|
|
1871
|
+
}
|
|
1872
|
+
}, u));
|
|
1873
|
+
}
|
|
1874
|
+
});
|
|
1875
|
+
}
|
|
1876
|
+
//#endregion
|
|
1877
|
+
//#region src/select/group-label/SelectGroupLabel.tsx
|
|
1878
|
+
function Yt(e) {
|
|
1879
|
+
let t = qt(), n = e, r = e, i = `base-ui-${je()}`, a = W(() => n.id ?? i), o = {}, l = W(() => s(e.class, o)), u = W(() => c(e.style, o)), d = q(r, "as", "class", "id", "ref", "style");
|
|
1880
|
+
return U(a, (e) => (t.setLabelId(e), () => {
|
|
1881
|
+
t.labelId() === e && t.setLabelId(void 0);
|
|
1882
|
+
})), R(L, z({
|
|
1883
|
+
get component() {
|
|
1884
|
+
return e.as ?? "div";
|
|
1885
|
+
},
|
|
1886
|
+
ref: [n.ref],
|
|
1887
|
+
get id() {
|
|
1888
|
+
return a();
|
|
1889
|
+
},
|
|
1890
|
+
get class() {
|
|
1891
|
+
return l();
|
|
1892
|
+
},
|
|
1893
|
+
get style() {
|
|
1894
|
+
return u();
|
|
1895
|
+
}
|
|
1896
|
+
}, d));
|
|
1897
|
+
}
|
|
1898
|
+
//#endregion
|
|
1899
|
+
//#region src/select/separator/SelectSeparator.tsx
|
|
1900
|
+
function Xt(e) {
|
|
1901
|
+
let n = e, r = e, i = W(() => n.orientation ?? "horizontal"), a = W(() => ({ orientation: i() })), o = W(() => s(e.class, a())), l = W(() => c(e.style, a())), u = W(() => t(a())), d = q(r, "as", "class", "orientation", "ref", "style");
|
|
1902
|
+
return R(L, z({
|
|
1903
|
+
get component() {
|
|
1904
|
+
return e.as ?? "div";
|
|
1905
|
+
},
|
|
1906
|
+
ref: [n.ref],
|
|
1907
|
+
role: "presentation",
|
|
1908
|
+
get class() {
|
|
1909
|
+
return o();
|
|
1910
|
+
},
|
|
1911
|
+
get style() {
|
|
1912
|
+
return l();
|
|
1913
|
+
}
|
|
1914
|
+
}, u, d));
|
|
1915
|
+
}
|
|
1916
|
+
//#endregion
|
|
1917
|
+
//#region src/select/index.parts.ts
|
|
1918
|
+
var Zt = /* @__PURE__ */ e({
|
|
1919
|
+
Arrow: () => Bt,
|
|
1920
|
+
Backdrop: () => ht,
|
|
1921
|
+
Group: () => Jt,
|
|
1922
|
+
GroupLabel: () => Yt,
|
|
1923
|
+
Icon: () => ut,
|
|
1924
|
+
Item: () => It,
|
|
1925
|
+
ItemIndicator: () => Rt,
|
|
1926
|
+
ItemText: () => zt,
|
|
1927
|
+
Label: () => tt,
|
|
1928
|
+
List: () => Mt,
|
|
1929
|
+
Popup: () => Ct,
|
|
1930
|
+
Portal: () => mt,
|
|
1931
|
+
Positioner: () => yt,
|
|
1932
|
+
Root: () => Ze,
|
|
1933
|
+
ScrollDownArrow: () => Ut,
|
|
1934
|
+
ScrollUpArrow: () => Wt,
|
|
1935
|
+
Separator: () => Xt,
|
|
1936
|
+
Trigger: () => at,
|
|
1937
|
+
Value: () => ct
|
|
1938
|
+
});
|
|
1939
|
+
//#endregion
|
|
1940
|
+
export { Zt as t };
|