akar 2.0.22 → 2.0.24
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/README.md +8 -6
- package/dist/Avatar/utils.cjs.map +1 -1
- package/dist/Avatar/utils.js.map +1 -1
- package/dist/Calendar/CalendarCellTrigger.cjs.map +1 -1
- package/dist/Calendar/CalendarCellTrigger.js.map +1 -1
- package/dist/Calendar/CalendarRoot.cjs.map +1 -1
- package/dist/Calendar/CalendarRoot.js.map +1 -1
- package/dist/Calendar/useCalendar.cjs.map +1 -1
- package/dist/Calendar/useCalendar.js.map +1 -1
- package/dist/Checkbox/CheckboxGroupRoot.cjs.map +1 -1
- package/dist/Checkbox/CheckboxGroupRoot.js.map +1 -1
- package/dist/Checkbox/CheckboxRoot.cjs.map +1 -1
- package/dist/Checkbox/CheckboxRoot.js.map +1 -1
- package/dist/Checkbox/utils.cjs.map +1 -1
- package/dist/Checkbox/utils.js.map +1 -1
- package/dist/Collection/Collection.cjs.map +1 -1
- package/dist/Collection/Collection.js.map +1 -1
- package/dist/ColorArea/ColorAreaArea.cjs +1 -1
- package/dist/ColorArea/ColorAreaArea.cjs.map +1 -1
- package/dist/ColorArea/ColorAreaArea.js +1 -1
- package/dist/ColorArea/ColorAreaArea.js.map +1 -1
- package/dist/ColorArea/ColorAreaRoot.cjs.map +1 -1
- package/dist/ColorArea/ColorAreaRoot.js.map +1 -1
- package/dist/ColorArea/utils.cjs +1 -0
- package/dist/ColorArea/utils.cjs.map +1 -1
- package/dist/ColorArea/utils.js +1 -0
- package/dist/ColorArea/utils.js.map +1 -1
- package/dist/ColorSlider/ColorSliderRoot.cjs.map +1 -1
- package/dist/ColorSlider/ColorSliderRoot.js.map +1 -1
- package/dist/ColorSwatchPicker/ColorSwatchPickerRoot.cjs.map +1 -1
- package/dist/ColorSwatchPicker/ColorSwatchPickerRoot.js.map +1 -1
- package/dist/Combobox/ComboboxCancel.cjs +1 -1
- package/dist/Combobox/ComboboxCancel.cjs.map +1 -1
- package/dist/Combobox/ComboboxCancel.js +1 -1
- package/dist/Combobox/ComboboxCancel.js.map +1 -1
- package/dist/Combobox/ComboboxContentImpl.cjs.map +1 -1
- package/dist/Combobox/ComboboxContentImpl.js.map +1 -1
- package/dist/Combobox/ComboboxGroup.cjs.map +1 -1
- package/dist/Combobox/ComboboxGroup.js.map +1 -1
- package/dist/Combobox/ComboboxRoot.cjs.map +1 -1
- package/dist/Combobox/ComboboxRoot.js.map +1 -1
- package/dist/DateField/DateFieldRoot.cjs +3 -1
- package/dist/DateField/DateFieldRoot.cjs.map +1 -1
- package/dist/DateField/DateFieldRoot.js +3 -1
- package/dist/DateField/DateFieldRoot.js.map +1 -1
- package/dist/DatePicker/DatePickerRoot.cjs.map +1 -1
- package/dist/DatePicker/DatePickerRoot.js.map +1 -1
- package/dist/DateRangeField/DateRangeFieldInput.cjs.map +1 -1
- package/dist/DateRangeField/DateRangeFieldInput.js.map +1 -1
- package/dist/DateRangeField/DateRangeFieldRoot.cjs.map +1 -1
- package/dist/DateRangeField/DateRangeFieldRoot.js.map +1 -1
- package/dist/DateRangePicker/DateRangePickerRoot.cjs.map +1 -1
- package/dist/DateRangePicker/DateRangePickerRoot.js.map +1 -1
- package/dist/Dialog/utils.cjs +1 -1
- package/dist/Dialog/utils.cjs.map +1 -1
- package/dist/Dialog/utils.js +1 -1
- package/dist/Dialog/utils.js.map +1 -1
- package/dist/DismissableLayer/DismissableLayer.cjs +6 -8
- package/dist/DismissableLayer/DismissableLayer.cjs.map +1 -1
- package/dist/DismissableLayer/DismissableLayer.js +6 -8
- package/dist/DismissableLayer/DismissableLayer.js.map +1 -1
- package/dist/DismissableLayer/DismissableLayerBranch.cjs +1 -1
- package/dist/DismissableLayer/DismissableLayerBranch.js +1 -1
- package/dist/DismissableLayer/context.cjs +1 -1
- package/dist/DismissableLayer/context.cjs.map +1 -1
- package/dist/DismissableLayer/context.js +1 -1
- package/dist/DismissableLayer/context.js.map +1 -1
- package/dist/DismissableLayer/utils.cjs.map +1 -1
- package/dist/DismissableLayer/utils.js.map +1 -1
- package/dist/Drawer/DrawerContent.cjs.map +1 -1
- package/dist/Drawer/DrawerContent.js.map +1 -1
- package/dist/Drawer/DrawerContentImpl.cjs.map +1 -1
- package/dist/Drawer/DrawerContentImpl.js.map +1 -1
- package/dist/Drawer/DrawerIndent.cjs.map +1 -1
- package/dist/Drawer/DrawerIndent.js.map +1 -1
- package/dist/Drawer/DrawerProvider.cjs.map +1 -1
- package/dist/Drawer/DrawerProvider.js.map +1 -1
- package/dist/Drawer/utils.cjs.map +1 -1
- package/dist/Drawer/utils.js.map +1 -1
- package/dist/Editable/EditableRoot.cjs.map +1 -1
- package/dist/Editable/EditableRoot.js.map +1 -1
- package/dist/Field/FieldControl.cjs.map +1 -1
- package/dist/Field/FieldControl.js.map +1 -1
- package/dist/Field/FieldRoot.cjs.map +1 -1
- package/dist/Field/FieldRoot.js.map +1 -1
- package/dist/Field/useFieldValidation.cjs.map +1 -1
- package/dist/Field/useFieldValidation.js.map +1 -1
- package/dist/FocusScope/FocusScope.cjs.map +1 -1
- package/dist/FocusScope/FocusScope.js.map +1 -1
- package/dist/HoverCard/HoverCardContentImpl.cjs +3 -1
- package/dist/HoverCard/HoverCardContentImpl.cjs.map +1 -1
- package/dist/HoverCard/HoverCardContentImpl.js +3 -1
- package/dist/HoverCard/HoverCardContentImpl.js.map +1 -1
- package/dist/HoverCard/utils.cjs.map +1 -1
- package/dist/HoverCard/utils.js.map +1 -1
- package/dist/Listbox/ListboxRoot.cjs.map +1 -1
- package/dist/Listbox/ListboxRoot.js.map +1 -1
- package/dist/Listbox/ListboxVirtualizer.cjs.map +1 -1
- package/dist/Listbox/ListboxVirtualizer.js.map +1 -1
- package/dist/Menu/MenuContentImpl.cjs +1 -1
- package/dist/Menu/MenuContentImpl.cjs.map +1 -1
- package/dist/Menu/MenuContentImpl.js +2 -2
- package/dist/Menu/MenuContentImpl.js.map +1 -1
- package/dist/Menu/MenuSub.cjs +3 -1
- package/dist/Menu/MenuSub.cjs.map +1 -1
- package/dist/Menu/MenuSub.js +3 -1
- package/dist/Menu/MenuSub.js.map +1 -1
- package/dist/Menu/MenuSubTrigger.cjs +4 -2
- package/dist/Menu/MenuSubTrigger.cjs.map +1 -1
- package/dist/Menu/MenuSubTrigger.js +4 -2
- package/dist/Menu/MenuSubTrigger.js.map +1 -1
- package/dist/Menu/utils.cjs +4 -0
- package/dist/Menu/utils.cjs.map +1 -1
- package/dist/Menu/utils.js +4 -0
- package/dist/Menu/utils.js.map +1 -1
- package/dist/Menubar/MenubarContent.cjs.map +1 -1
- package/dist/Menubar/MenubarContent.js.map +1 -1
- package/dist/MonthPicker/MonthPickerCellTrigger.cjs.map +1 -1
- package/dist/MonthPicker/MonthPickerCellTrigger.js.map +1 -1
- package/dist/MonthPicker/MonthPickerRoot.cjs.map +1 -1
- package/dist/MonthPicker/MonthPickerRoot.js.map +1 -1
- package/dist/MonthPicker/useMonthPicker.cjs.map +1 -1
- package/dist/MonthPicker/useMonthPicker.js.map +1 -1
- package/dist/MonthRangePicker/MonthRangePickerCellTrigger.cjs.map +1 -1
- package/dist/MonthRangePicker/MonthRangePickerCellTrigger.js.map +1 -1
- package/dist/MonthRangePicker/MonthRangePickerRoot.cjs.map +1 -1
- package/dist/MonthRangePicker/MonthRangePickerRoot.js.map +1 -1
- package/dist/MonthRangePicker/useRangeMonthPicker.cjs.map +1 -1
- package/dist/MonthRangePicker/useRangeMonthPicker.js.map +1 -1
- package/dist/NavigationMenu/NavigationMenuContentImpl.cjs.map +1 -1
- package/dist/NavigationMenu/NavigationMenuContentImpl.js.map +1 -1
- package/dist/NavigationMenu/NavigationMenuItem.cjs +17 -10
- package/dist/NavigationMenu/NavigationMenuItem.cjs.map +1 -1
- package/dist/NavigationMenu/NavigationMenuItem.js +17 -10
- package/dist/NavigationMenu/NavigationMenuItem.js.map +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.cjs +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.cjs.map +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.js +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.js.map +1 -1
- package/dist/NavigationMenu/utils.cjs.map +1 -1
- package/dist/NavigationMenu/utils.js.map +1 -1
- package/dist/NumberField/NumberFieldInput.cjs.map +1 -1
- package/dist/NumberField/NumberFieldInput.js.map +1 -1
- package/dist/NumberField/NumberFieldRoot.cjs.map +1 -1
- package/dist/NumberField/NumberFieldRoot.js.map +1 -1
- package/dist/NumberField/utils.cjs.map +1 -1
- package/dist/NumberField/utils.js.map +1 -1
- package/dist/Pagination/utils.cjs.map +1 -1
- package/dist/Pagination/utils.js.map +1 -1
- package/dist/PinInput/PinInputInput.cjs.map +1 -1
- package/dist/PinInput/PinInputInput.js.map +1 -1
- package/dist/PinInput/PinInputRoot.cjs.map +1 -1
- package/dist/PinInput/PinInputRoot.js.map +1 -1
- package/dist/Popper/PopperContent.cjs.map +1 -1
- package/dist/Popper/PopperContent.js.map +1 -1
- package/dist/Popper/PopperRoot.cjs +3 -1
- package/dist/Popper/PopperRoot.cjs.map +1 -1
- package/dist/Popper/PopperRoot.js +3 -1
- package/dist/Popper/PopperRoot.js.map +1 -1
- package/dist/Popper/utils.cjs.map +1 -1
- package/dist/Popper/utils.js.map +1 -1
- package/dist/Presence/usePresence.cjs.map +1 -1
- package/dist/Presence/usePresence.js.map +1 -1
- package/dist/Primitive/usePrimitiveElement.cjs.map +1 -1
- package/dist/Primitive/usePrimitiveElement.js.map +1 -1
- package/dist/Progress/ProgressRoot.cjs.map +1 -1
- package/dist/Progress/ProgressRoot.js.map +1 -1
- package/dist/RadioGroup/Radio.cjs.map +1 -1
- package/dist/RadioGroup/Radio.js.map +1 -1
- package/dist/RadioGroup/RadioGroupItem.cjs.map +1 -1
- package/dist/RadioGroup/RadioGroupItem.js.map +1 -1
- package/dist/RangeCalendar/RangeCalendarCellTrigger.cjs.map +1 -1
- package/dist/RangeCalendar/RangeCalendarCellTrigger.js.map +1 -1
- package/dist/RangeCalendar/RangeCalendarRoot.cjs.map +1 -1
- package/dist/RangeCalendar/RangeCalendarRoot.js.map +1 -1
- package/dist/RangeCalendar/useRangeCalendar.cjs.map +1 -1
- package/dist/RangeCalendar/useRangeCalendar.js.map +1 -1
- package/dist/RovingFocus/RovingFocusGroup.cjs.map +1 -1
- package/dist/RovingFocus/RovingFocusGroup.js.map +1 -1
- package/dist/RovingFocus/RovingFocusItem.cjs +13 -2
- package/dist/RovingFocus/RovingFocusItem.cjs.map +1 -1
- package/dist/RovingFocus/RovingFocusItem.js +14 -3
- package/dist/RovingFocus/RovingFocusItem.js.map +1 -1
- package/dist/RovingFocus/utils.cjs.map +1 -1
- package/dist/RovingFocus/utils.js.map +1 -1
- package/dist/ScrollArea/ScrollAreaThumb.cjs +1 -1
- package/dist/ScrollArea/ScrollAreaThumb.cjs.map +1 -1
- package/dist/ScrollArea/ScrollAreaThumb.js +1 -1
- package/dist/ScrollArea/ScrollAreaThumb.js.map +1 -1
- package/dist/ScrollArea/utils.cjs +4 -0
- package/dist/ScrollArea/utils.cjs.map +1 -1
- package/dist/ScrollArea/utils.js +4 -0
- package/dist/ScrollArea/utils.js.map +1 -1
- package/dist/Select/SelectItemAlignedPosition.cjs.map +1 -1
- package/dist/Select/SelectItemAlignedPosition.js.map +1 -1
- package/dist/Select/SelectRoot.cjs.map +1 -1
- package/dist/Select/SelectRoot.js.map +1 -1
- package/dist/Select/SelectValue.cjs.map +1 -1
- package/dist/Select/SelectValue.js.map +1 -1
- package/dist/Select/SelectViewport.cjs.map +1 -1
- package/dist/Select/SelectViewport.js.map +1 -1
- package/dist/Slider/SliderHorizontal.cjs.map +1 -1
- package/dist/Slider/SliderHorizontal.js.map +1 -1
- package/dist/Slider/SliderRange.cjs.map +1 -1
- package/dist/Slider/SliderRange.js.map +1 -1
- package/dist/Slider/SliderRoot.cjs.map +1 -1
- package/dist/Slider/SliderRoot.js.map +1 -1
- package/dist/Slider/SliderThumb.cjs.map +1 -1
- package/dist/Slider/SliderThumb.js.map +1 -1
- package/dist/Slider/SliderThumbImpl.cjs.map +1 -1
- package/dist/Slider/SliderThumbImpl.js.map +1 -1
- package/dist/Slider/SliderVertical.cjs.map +1 -1
- package/dist/Slider/SliderVertical.js.map +1 -1
- package/dist/Slider/utils.cjs +1 -0
- package/dist/Slider/utils.cjs.map +1 -1
- package/dist/Slider/utils.js +1 -0
- package/dist/Slider/utils.js.map +1 -1
- package/dist/Splitter/SplitterGroup.cjs.map +1 -1
- package/dist/Splitter/SplitterGroup.js.map +1 -1
- package/dist/Stepper/StepperRoot.cjs.map +1 -1
- package/dist/Stepper/StepperRoot.js.map +1 -1
- package/dist/Stepper/StepperTrigger.cjs.map +1 -1
- package/dist/Stepper/StepperTrigger.js.map +1 -1
- package/dist/Switch/SwitchRoot.cjs.map +1 -1
- package/dist/Switch/SwitchRoot.js.map +1 -1
- package/dist/Tabs/TabsTrigger.cjs.map +1 -1
- package/dist/Tabs/TabsTrigger.js.map +1 -1
- package/dist/TagGroup/TagGroupItemDelete.cjs.map +1 -1
- package/dist/TagGroup/TagGroupItemDelete.js.map +1 -1
- package/dist/TagGroup/TagGroupRoot.cjs.map +1 -1
- package/dist/TagGroup/TagGroupRoot.js.map +1 -1
- package/dist/TagsInput/TagsInputInput.cjs +2 -1
- package/dist/TagsInput/TagsInputInput.cjs.map +1 -1
- package/dist/TagsInput/TagsInputInput.js +2 -1
- package/dist/TagsInput/TagsInputInput.js.map +1 -1
- package/dist/TagsInput/TagsInputRoot.cjs.map +1 -1
- package/dist/TagsInput/TagsInputRoot.js.map +1 -1
- package/dist/TimeField/TimeFieldRoot.cjs.map +1 -1
- package/dist/TimeField/TimeFieldRoot.js.map +1 -1
- package/dist/TimeRangeField/TimeRangeFieldInput.cjs.map +1 -1
- package/dist/TimeRangeField/TimeRangeFieldInput.js.map +1 -1
- package/dist/TimeRangeField/TimeRangeFieldRoot.cjs.map +1 -1
- package/dist/TimeRangeField/TimeRangeFieldRoot.js.map +1 -1
- package/dist/Toast/ToastAction.cjs +1 -1
- package/dist/Toast/ToastAction.cjs.map +1 -1
- package/dist/Toast/ToastAction.js +1 -1
- package/dist/Toast/ToastAction.js.map +1 -1
- package/dist/Toast/ToastDescription.cjs +2 -2
- package/dist/Toast/ToastDescription.cjs.map +1 -1
- package/dist/Toast/ToastDescription.js +3 -3
- package/dist/Toast/ToastDescription.js.map +1 -1
- package/dist/Toast/ToastRoot.cjs.map +1 -1
- package/dist/Toast/ToastRoot.js.map +1 -1
- package/dist/Toast/ToastRootImpl.cjs.map +1 -1
- package/dist/Toast/ToastRootImpl.js.map +1 -1
- package/dist/Toast/ToastTitle.cjs +2 -2
- package/dist/Toast/ToastTitle.cjs.map +1 -1
- package/dist/Toast/ToastTitle.js +3 -3
- package/dist/Toast/ToastTitle.js.map +1 -1
- package/dist/Toast/ToastViewport.cjs.map +1 -1
- package/dist/Toast/ToastViewport.js.map +1 -1
- package/dist/Toast/createToastManager.cjs.map +1 -1
- package/dist/Toast/createToastManager.js.map +1 -1
- package/dist/Toast/useToastStore.cjs +3 -1
- package/dist/Toast/useToastStore.cjs.map +1 -1
- package/dist/Toast/useToastStore.js +3 -1
- package/dist/Toast/useToastStore.js.map +1 -1
- package/dist/Tree/TreeItem.cjs.map +1 -1
- package/dist/Tree/TreeItem.js.map +1 -1
- package/dist/Tree/TreeRoot.cjs.map +1 -1
- package/dist/Tree/TreeRoot.js.map +1 -1
- package/dist/Tree/TreeVirtualizer.cjs.map +1 -1
- package/dist/Tree/TreeVirtualizer.js.map +1 -1
- package/dist/VisuallyHidden/VisuallyHiddenInput.cjs.map +1 -1
- package/dist/VisuallyHidden/VisuallyHiddenInput.js.map +1 -1
- package/dist/YearPicker/YearPickerCellTrigger.cjs.map +1 -1
- package/dist/YearPicker/YearPickerCellTrigger.js.map +1 -1
- package/dist/YearPicker/YearPickerRoot.cjs.map +1 -1
- package/dist/YearPicker/YearPickerRoot.js.map +1 -1
- package/dist/YearPicker/useYearPicker.cjs.map +1 -1
- package/dist/YearPicker/useYearPicker.js.map +1 -1
- package/dist/YearRangePicker/YearRangePickerCellTrigger.cjs.map +1 -1
- package/dist/YearRangePicker/YearRangePickerCellTrigger.js.map +1 -1
- package/dist/YearRangePicker/YearRangePickerRoot.cjs.map +1 -1
- package/dist/YearRangePicker/YearRangePickerRoot.js.map +1 -1
- package/dist/YearRangePicker/useRangeYearPicker.cjs.map +1 -1
- package/dist/YearRangePicker/useRangeYearPicker.js.map +1 -1
- package/dist/color/channel.cjs.map +1 -1
- package/dist/color/channel.js.map +1 -1
- package/dist/color/convert.cjs.map +1 -1
- package/dist/color/convert.js.map +1 -1
- package/dist/color/gradient.cjs +2 -2
- package/dist/color/gradient.cjs.map +1 -1
- package/dist/color/gradient.js +2 -2
- package/dist/color/gradient.js.map +1 -1
- package/dist/color/parse.cjs.map +1 -1
- package/dist/color/parse.js.map +1 -1
- package/dist/color/utils.cjs.map +1 -1
- package/dist/color/utils.js.map +1 -1
- package/dist/component/BaseSeparator.cjs.map +1 -1
- package/dist/component/BaseSeparator.js.map +1 -1
- package/dist/composables/useDrawerSnapPoints.cjs.map +1 -1
- package/dist/composables/useDrawerSnapPoints.js.map +1 -1
- package/dist/composables/useDrawerVirtualKeyboard.cjs.map +1 -1
- package/dist/composables/useDrawerVirtualKeyboard.js.map +1 -1
- package/dist/composables/useSwipeDismiss.cjs.map +1 -1
- package/dist/composables/useSwipeDismiss.js.map +1 -1
- package/dist/composables/useWindowSplitterBehavior.cjs +1 -0
- package/dist/composables/useWindowSplitterBehavior.cjs.map +1 -1
- package/dist/composables/useWindowSplitterBehavior.js +1 -0
- package/dist/composables/useWindowSplitterBehavior.js.map +1 -1
- package/dist/composables/useWindowSplitterPanelGroupBehavior.cjs +7 -4
- package/dist/composables/useWindowSplitterPanelGroupBehavior.cjs.map +1 -1
- package/dist/composables/useWindowSplitterPanelGroupBehavior.js +7 -4
- package/dist/composables/useWindowSplitterPanelGroupBehavior.js.map +1 -1
- package/dist/date/calendar.cjs.map +1 -1
- package/dist/date/calendar.js.map +1 -1
- package/dist/date/comparators.cjs.map +1 -1
- package/dist/date/comparators.js.map +1 -1
- package/dist/date/parser.cjs.map +1 -1
- package/dist/date/parser.js.map +1 -1
- package/dist/date/parts.cjs.map +1 -1
- package/dist/date/parts.js.map +1 -1
- package/dist/date/useDateField.cjs.map +1 -1
- package/dist/date/useDateField.js.map +1 -1
- package/dist/date/useSegmentNavigation.cjs.map +1 -1
- package/dist/date/useSegmentNavigation.js.map +1 -1
- package/dist/date/utils.cjs.map +1 -1
- package/dist/date/utils.js.map +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -1
- package/dist/index2.d.cts +18 -16
- package/dist/index2.d.cts.map +1 -1
- package/dist/index2.d.ts +14 -12
- package/dist/index2.d.ts.map +1 -1
- package/dist/index3.d.cts +706 -703
- package/dist/index3.d.cts.map +1 -1
- package/dist/index3.d.ts +733 -730
- package/dist/index3.d.ts.map +1 -1
- package/dist/internal.cjs +2 -1
- package/dist/internal.d.cts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -1
- package/dist/shared/bodyPointerEvents.cjs +46 -0
- package/dist/shared/bodyPointerEvents.cjs.map +1 -0
- package/dist/shared/bodyPointerEvents.js +34 -0
- package/dist/shared/bodyPointerEvents.js.map +1 -0
- package/dist/shared/clamp.cjs.map +1 -1
- package/dist/shared/clamp.js.map +1 -1
- package/dist/shared/useArrowNavigation.cjs.map +1 -1
- package/dist/shared/useArrowNavigation.js.map +1 -1
- package/dist/shared/useBodyScrollLock.cjs +8 -7
- package/dist/shared/useBodyScrollLock.cjs.map +1 -1
- package/dist/shared/useBodyScrollLock.js +8 -7
- package/dist/shared/useBodyScrollLock.js.map +1 -1
- package/dist/shared/useCalendarKeyboardNavigation.cjs +21 -2
- package/dist/shared/useCalendarKeyboardNavigation.cjs.map +1 -1
- package/dist/shared/useCalendarKeyboardNavigation.js +21 -2
- package/dist/shared/useCalendarKeyboardNavigation.js.map +1 -1
- package/dist/shared/useComposing.cjs.map +1 -1
- package/dist/shared/useComposing.js.map +1 -1
- package/dist/shared/useDateFormatter.cjs.map +1 -1
- package/dist/shared/useDateFormatter.js.map +1 -1
- package/dist/shared/useFocusGuards.cjs +3 -1
- package/dist/shared/useFocusGuards.cjs.map +1 -1
- package/dist/shared/useFocusGuards.js +3 -1
- package/dist/shared/useFocusGuards.js.map +1 -1
- package/dist/shared/useFormControl.cjs.map +1 -1
- package/dist/shared/useFormControl.js.map +1 -1
- package/dist/shared/useForwardExpose.cjs.map +1 -1
- package/dist/shared/useForwardExpose.js.map +1 -1
- package/dist/shared/useForwardProps.cjs.map +1 -1
- package/dist/shared/useForwardProps.js.map +1 -1
- package/dist/shared/useForwardPropsEmits.cjs.map +1 -1
- package/dist/shared/useForwardPropsEmits.js.map +1 -1
- package/dist/shared/useForwardScopeId.cjs.map +1 -1
- package/dist/shared/useForwardScopeId.js.map +1 -1
- package/dist/shared/useGraceArea.cjs.map +1 -1
- package/dist/shared/useGraceArea.js.map +1 -1
- package/dist/shared/useId.cjs.map +1 -1
- package/dist/shared/useId.js.map +1 -1
- package/dist/shared/useSelectionBehavior.cjs.map +1 -1
- package/dist/shared/useSelectionBehavior.js.map +1 -1
- package/dist/shared/useSingleOrMultipleValue.cjs.map +1 -1
- package/dist/shared/useSingleOrMultipleValue.js.map +1 -1
- package/dist/shared/useTypeahead.cjs.map +1 -1
- package/dist/shared/useTypeahead.js.map +1 -1
- package/dist/shared/withDefault.cjs.map +1 -1
- package/dist/shared/withDefault.js.map +1 -1
- package/dist/shared.cjs +1 -1
- package/dist/shared.js +1 -1
- package/dist/utils/calculate.cjs +1 -0
- package/dist/utils/calculate.cjs.map +1 -1
- package/dist/utils/calculate.js +1 -0
- package/dist/utils/calculate.js.map +1 -1
- package/dist/utils/callPanelCallbacks.cjs +1 -0
- package/dist/utils/callPanelCallbacks.cjs.map +1 -1
- package/dist/utils/callPanelCallbacks.js +1 -0
- package/dist/utils/callPanelCallbacks.js.map +1 -1
- package/dist/utils/compare.cjs.map +1 -1
- package/dist/utils/compare.js.map +1 -1
- package/dist/utils/dom.cjs.map +1 -1
- package/dist/utils/dom.js.map +1 -1
- package/dist/utils/layout.cjs +1 -0
- package/dist/utils/layout.cjs.map +1 -1
- package/dist/utils/layout.js +1 -0
- package/dist/utils/layout.js.map +1 -1
- package/dist/utils/pivot.cjs.map +1 -1
- package/dist/utils/pivot.js.map +1 -1
- package/dist/utils/registry.cjs.map +1 -1
- package/dist/utils/registry.js.map +1 -1
- package/dist/utils/resizePanel.cjs +1 -0
- package/dist/utils/resizePanel.cjs.map +1 -1
- package/dist/utils/resizePanel.js +1 -0
- package/dist/utils/resizePanel.js.map +1 -1
- package/dist/utils/stackingOrder.cjs +10 -10
- package/dist/utils/stackingOrder.cjs.map +1 -1
- package/dist/utils/stackingOrder.js +10 -10
- package/dist/utils/stackingOrder.js.map +1 -1
- package/dist/utils/storage.cjs +7 -1
- package/dist/utils/storage.cjs.map +1 -1
- package/dist/utils/storage.js +7 -1
- package/dist/utils/storage.js.map +1 -1
- package/dist/utils/style.cjs +1 -0
- package/dist/utils/style.cjs.map +1 -1
- package/dist/utils/style.js +1 -0
- package/dist/utils/style.js.map +1 -1
- package/dist/utils/units.cjs +0 -1
- package/dist/utils/units.cjs.map +1 -1
- package/dist/utils/units.js +0 -1
- package/dist/utils/units.js.map +1 -1
- package/dist/utils/validation.cjs +1 -0
- package/dist/utils/validation.cjs.map +1 -1
- package/dist/utils/validation.js +1 -0
- package/dist/utils/validation.js.map +1 -1
- package/package.json +13 -10
- package/src/Avatar/utils.ts +3 -1
- package/src/Calendar/CalendarCellTrigger.vue +3 -1
- package/src/Calendar/CalendarRoot.vue +3 -1
- package/src/Calendar/useCalendar.ts +18 -5
- package/src/Checkbox/CheckboxGroupRoot.vue +3 -1
- package/src/Checkbox/CheckboxRoot.test-d.ts +91 -0
- package/src/Checkbox/CheckboxRoot.vue +19 -15
- package/src/Checkbox/utils.ts +3 -1
- package/src/Collection/Collection.ts +11 -2
- package/src/ColorArea/ColorAreaArea.vue +1 -1
- package/src/ColorArea/ColorAreaRoot.vue +14 -2
- package/src/ColorArea/utils.ts +1 -1
- package/src/ColorSlider/ColorSliderRoot.vue +3 -1
- package/src/ColorSlider/utils.ts +31 -6
- package/src/ColorSwatchPicker/ColorSwatchPickerRoot.vue +3 -1
- package/src/Combobox/ComboboxCancel.vue +7 -4
- package/src/Combobox/ComboboxContentImpl.vue +7 -2
- package/src/Combobox/ComboboxGroup.vue +5 -1
- package/src/Combobox/ComboboxRoot.vue +3 -1
- package/src/DateField/DateFieldRoot.vue +24 -7
- package/src/DatePicker/DatePickerRoot.vue +6 -1
- package/src/DateRangeField/DateRangeFieldInput.vue +3 -1
- package/src/DateRangeField/DateRangeFieldRoot.vue +30 -8
- package/src/DateRangePicker/DateRangePickerRoot.vue +4 -1
- package/src/Dialog/utils.ts +1 -1
- package/src/DismissableLayer/DismissableLayer.vue +30 -29
- package/src/DismissableLayer/context.ts +1 -1
- package/src/DismissableLayer/utils.ts +1 -0
- package/src/Drawer/DrawerContentImpl.vue +18 -5
- package/src/Drawer/DrawerIndent.vue +3 -1
- package/src/Drawer/DrawerProvider.vue +6 -2
- package/src/Drawer/composables/useDrawerSnapPoints.ts +23 -7
- package/src/Drawer/composables/useDrawerVirtualKeyboard.ts +37 -12
- package/src/Drawer/composables/useSwipeDismiss.ts +30 -10
- package/src/Drawer/utils.ts +18 -4
- package/src/Editable/EditableRoot.vue +3 -1
- package/src/Field/FieldControl.vue +3 -1
- package/src/Field/FieldRoot.vue +23 -7
- package/src/Field/useFieldValidation.ts +31 -9
- package/src/FocusScope/FocusScope.vue +3 -1
- package/src/HoverCard/HoverCardContentImpl.vue +3 -1
- package/src/HoverCard/index.ts +1 -0
- package/src/HoverCard/utils.ts +6 -2
- package/src/Listbox/ListboxRoot.vue +24 -8
- package/src/Listbox/ListboxVirtualizer.vue +9 -3
- package/src/Menu/MenuContentImpl.vue +9 -3
- package/src/Menu/MenuSub.vue +3 -1
- package/src/Menu/MenuSubTrigger.vue +13 -5
- package/src/Menu/utils.ts +8 -3
- package/src/Menubar/MenubarContent.vue +3 -1
- package/src/MonthPicker/MonthPickerCellTrigger.vue +3 -1
- package/src/MonthPicker/MonthPickerRoot.vue +7 -2
- package/src/MonthPicker/useMonthPicker.ts +3 -1
- package/src/MonthRangePicker/MonthRangePickerCellTrigger.vue +6 -2
- package/src/MonthRangePicker/MonthRangePickerRoot.vue +20 -5
- package/src/MonthRangePicker/useRangeMonthPicker.ts +12 -4
- package/src/NavigationMenu/NavigationMenuContentImpl.vue +6 -2
- package/src/NavigationMenu/NavigationMenuItem.vue +15 -4
- package/src/NavigationMenu/NavigationMenuTrigger.vue +4 -2
- package/src/NavigationMenu/utils.ts +3 -1
- package/src/NumberField/NumberFieldInput.vue +6 -2
- package/src/NumberField/NumberFieldRoot.vue +15 -5
- package/src/NumberField/utils.ts +6 -2
- package/src/Pagination/utils.ts +7 -1
- package/src/PinInput/PinInputInput.vue +3 -1
- package/src/PinInput/PinInputRoot.vue +3 -1
- package/src/Popper/PopperContent.vue +13 -3
- package/src/Popper/PopperRoot.vue +3 -1
- package/src/Popper/utils.ts +21 -7
- package/src/Presence/usePresence.ts +9 -3
- package/src/Primitive/Primitive.ts +1 -1
- package/src/Primitive/usePrimitiveElement.ts +3 -1
- package/src/Progress/ProgressRoot.vue +3 -1
- package/src/RadioGroup/Radio.vue +3 -1
- package/src/RadioGroup/RadioGroupItem.vue +6 -1
- package/src/RangeCalendar/RangeCalendarCellTrigger.vue +3 -1
- package/src/RangeCalendar/RangeCalendarRoot.vue +20 -5
- package/src/RangeCalendar/useRangeCalendar.ts +11 -3
- package/src/RovingFocus/RovingFocusGroup.vue +6 -1
- package/src/RovingFocus/RovingFocusItem.vue +27 -17
- package/src/RovingFocus/utils.ts +1 -0
- package/src/ScrollArea/ScrollAreaThumb.vue +1 -1
- package/src/ScrollArea/utils.ts +16 -6
- package/src/Select/SelectItemAlignedPosition.vue +8 -2
- package/src/Select/SelectRoot.vue +12 -4
- package/src/Select/SelectValue.vue +3 -1
- package/src/Select/SelectViewport.vue +3 -1
- package/src/Slider/SliderHorizontal.vue +9 -3
- package/src/Slider/SliderRange.vue +3 -1
- package/src/Slider/SliderRoot.vue +3 -1
- package/src/Slider/SliderThumb.vue +3 -1
- package/src/Slider/SliderThumbImpl.vue +3 -1
- package/src/Slider/SliderVertical.vue +9 -3
- package/src/Slider/utils.ts +31 -6
- package/src/Splitter/SplitterGroup.vue +18 -6
- package/src/Splitter/utils/calculate.ts +7 -3
- package/src/Splitter/utils/callPanelCallbacks.ts +1 -1
- package/src/Splitter/utils/compare.ts +3 -1
- package/src/Splitter/utils/composables/useWindowSplitterBehavior.ts +2 -2
- package/src/Splitter/utils/composables/useWindowSplitterPanelGroupBehavior.ts +7 -5
- package/src/Splitter/utils/dom.ts +3 -1
- package/src/Splitter/utils/layout.ts +32 -11
- package/src/Splitter/utils/pivot.ts +3 -1
- package/src/Splitter/utils/registry.ts +3 -1
- package/src/Splitter/utils/resizePanel.ts +1 -1
- package/src/Splitter/utils/stackingOrder.ts +10 -10
- package/src/Splitter/utils/storage.ts +7 -5
- package/src/Splitter/utils/style.ts +7 -3
- package/src/Splitter/utils/units.ts +0 -2
- package/src/Splitter/utils/validation.ts +4 -2
- package/src/Stepper/StepperRoot.vue +18 -6
- package/src/Stepper/StepperTrigger.vue +6 -1
- package/src/Switch/SwitchRoot.test-d.ts +87 -0
- package/src/Switch/SwitchRoot.vue +15 -13
- package/src/Tabs/TabsTrigger.vue +3 -1
- package/src/TagGroup/TagGroupItemDelete.vue +3 -1
- package/src/TagGroup/TagGroupRoot.vue +25 -7
- package/src/TagsInput/TagsInputInput.vue +11 -5
- package/src/TagsInput/TagsInputRoot.vue +12 -4
- package/src/TimeField/TimeFieldRoot.vue +29 -8
- package/src/TimeRangeField/TimeRangeFieldInput.vue +3 -1
- package/src/TimeRangeField/TimeRangeFieldRoot.vue +39 -11
- package/src/Toast/ToastAction.vue +2 -1
- package/src/Toast/ToastDescription.vue +3 -1
- package/src/Toast/ToastRoot.vue +4 -1
- package/src/Toast/ToastRootImpl.vue +20 -6
- package/src/Toast/ToastTitle.vue +3 -1
- package/src/Toast/ToastViewport.vue +7 -2
- package/src/Toast/createToastManager.ts +21 -6
- package/src/Toast/useToastStore.ts +36 -8
- package/src/Tree/TreeItem.vue +12 -2
- package/src/Tree/TreeRoot.vue +16 -5
- package/src/Tree/TreeVirtualizer.vue +15 -5
- package/src/VisuallyHidden/VisuallyHiddenInput.vue +3 -1
- package/src/YearPicker/YearPickerCellTrigger.vue +6 -2
- package/src/YearPicker/YearPickerRoot.vue +7 -2
- package/src/YearPicker/useYearPicker.ts +3 -1
- package/src/YearRangePicker/YearRangePickerCellTrigger.vue +6 -2
- package/src/YearRangePicker/YearRangePickerRoot.vue +20 -5
- package/src/YearRangePicker/useRangeYearPicker.ts +12 -4
- package/src/date/calendar.ts +13 -3
- package/src/date/comparators.ts +6 -2
- package/src/shared/bodyPointerEvents.ts +41 -0
- package/src/shared/clamp.ts +6 -2
- package/src/shared/color/channel.ts +57 -16
- package/src/shared/color/convert.ts +27 -9
- package/src/shared/color/gradient.ts +166 -33
- package/src/shared/color/parse.ts +10 -4
- package/src/shared/color/utils.ts +9 -3
- package/src/shared/component/BaseSeparator.vue +6 -2
- package/src/shared/date/parser.ts +15 -4
- package/src/shared/date/parts.ts +10 -2
- package/src/shared/date/segment.ts +1 -1
- package/src/shared/date/types.ts +2 -2
- package/src/shared/date/useDateField.ts +113 -28
- package/src/shared/date/useSegmentNavigation.ts +12 -4
- package/src/shared/date/utils.ts +12 -4
- package/src/shared/useArrowNavigation.ts +15 -4
- package/src/shared/useBodyScrollLock.ts +19 -14
- package/src/shared/useCalendarKeyboardNavigation.ts +49 -11
- package/src/shared/useComposing.ts +7 -1
- package/src/shared/useDateFormatter.ts +38 -9
- package/src/shared/useEmitAsProps.test-d.ts +0 -1
- package/src/shared/useFocusGuards.ts +3 -1
- package/src/shared/useFormControl.ts +3 -1
- package/src/shared/useForwardExpose.ts +4 -1
- package/src/shared/useForwardProps.ts +4 -1
- package/src/shared/useForwardPropsEmits.ts +3 -1
- package/src/shared/useForwardScopeId.ts +3 -1
- package/src/shared/useGraceArea.ts +4 -1
- package/src/shared/useId.ts +3 -1
- package/src/shared/useSelectionBehavior.ts +2 -3
- package/src/shared/useSingleOrMultipleValue.ts +14 -4
- package/src/shared/useTypeahead.ts +6 -2
- package/src/shared/withDefault.ts +5 -3
|
@@ -18,7 +18,9 @@ export interface ResolvedSnapPoint {
|
|
|
18
18
|
function parseSnapPoint(value: DrawerSnapPoint, viewportHeight: number, rootFontSize: number): number | null {
|
|
19
19
|
let result: number | null = null;
|
|
20
20
|
if (typeof value === 'number') {
|
|
21
|
-
result = (value >= 0 && value <= 1)
|
|
21
|
+
result = (value >= 0 && value <= 1)
|
|
22
|
+
? value * viewportHeight
|
|
23
|
+
: value;
|
|
22
24
|
} else if (value.endsWith('rem')) {
|
|
23
25
|
result = Number.parseFloat(value) * rootFontSize;
|
|
24
26
|
} else if (value.endsWith('px')) {
|
|
@@ -42,7 +44,9 @@ export function useDrawerSnapPoints(options: {
|
|
|
42
44
|
}) {
|
|
43
45
|
const { snapPoints, activeSnapPoint, popupHeight, onSnapPointChange } = options;
|
|
44
46
|
|
|
45
|
-
const viewportHeight = ref(typeof window !== 'undefined'
|
|
47
|
+
const viewportHeight = ref(typeof window !== 'undefined'
|
|
48
|
+
? window.innerHeight
|
|
49
|
+
: 0);
|
|
46
50
|
const rootFontSize = ref(
|
|
47
51
|
typeof document !== 'undefined'
|
|
48
52
|
? Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16
|
|
@@ -74,7 +78,11 @@ export function useDrawerSnapPoints(options: {
|
|
|
74
78
|
continue;
|
|
75
79
|
}
|
|
76
80
|
const clampedHeight = Math.min(height, Math.min(ph, vh));
|
|
77
|
-
resolved.push({
|
|
81
|
+
resolved.push({
|
|
82
|
+
value: pt,
|
|
83
|
+
height: clampedHeight,
|
|
84
|
+
offset: Math.max(0, ph - clampedHeight),
|
|
85
|
+
});
|
|
78
86
|
}
|
|
79
87
|
return resolved.sort((a, b) => a.height - b.height);
|
|
80
88
|
});
|
|
@@ -128,8 +136,12 @@ export function useDrawerSnapPoints(options: {
|
|
|
128
136
|
// Convert raw velocity into a dismiss-signed scalar:
|
|
129
137
|
// positive = moving in dismiss direction (collapsing)
|
|
130
138
|
// negative = moving in open direction (expanding)
|
|
131
|
-
const axisVel = (direction === 'up' || direction === 'down')
|
|
132
|
-
|
|
139
|
+
const axisVel = (direction === 'up' || direction === 'down')
|
|
140
|
+
? velocity.y
|
|
141
|
+
: velocity.x;
|
|
142
|
+
const velSigned = (direction === 'up' || direction === 'left')
|
|
143
|
+
? -axisVel
|
|
144
|
+
: axisVel;
|
|
133
145
|
|
|
134
146
|
// Current offset (from fully open): 0 = fully open, `ph` = fully closed.
|
|
135
147
|
// Match by value OR parsed-height equivalence so equivalent representations
|
|
@@ -171,7 +183,9 @@ export function useDrawerSnapPoints(options: {
|
|
|
171
183
|
// if (a) velocity direction matches drag direction and is fast enough, OR
|
|
172
184
|
// (b) the projected target has physically crossed the adjacent snap.
|
|
173
185
|
const sorted = [...points].sort((a, b) => a.offset - b.offset);
|
|
174
|
-
const currentIdx = activePoint
|
|
186
|
+
const currentIdx = activePoint
|
|
187
|
+
? sorted.indexOf(activePoint)
|
|
188
|
+
: -1;
|
|
175
189
|
if (currentIdx < 0) {
|
|
176
190
|
onSnapPointChange(closest.value);
|
|
177
191
|
return;
|
|
@@ -191,7 +205,9 @@ export function useDrawerSnapPoints(options: {
|
|
|
191
205
|
const crossed = dragDir > 0
|
|
192
206
|
? targetOffset > adjacent.offset
|
|
193
207
|
: targetOffset < adjacent.offset;
|
|
194
|
-
onSnapPointChange(crossed
|
|
208
|
+
onSnapPointChange(crossed
|
|
209
|
+
? adjacent.value
|
|
210
|
+
: (activeSnapPoint.value ?? closest.value));
|
|
195
211
|
return;
|
|
196
212
|
}
|
|
197
213
|
|
|
@@ -87,21 +87,29 @@ export function resolveKeyboardInputTarget(target: EventTarget | null): HTMLElem
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
if (isKeyboardInputElement(target)) {
|
|
90
|
-
return target.isContentEditable
|
|
90
|
+
return target.isContentEditable
|
|
91
|
+
? getContentEditableHost(target)
|
|
92
|
+
: target;
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
const control = (target.closest('label') as HTMLLabelElement | null)?.control;
|
|
94
|
-
return control instanceof HTMLElement && isKeyboardInputElement(control)
|
|
96
|
+
return control instanceof HTMLElement && isKeyboardInputElement(control)
|
|
97
|
+
? control
|
|
98
|
+
: null;
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
function resolveKeyboardTouchTarget(target: EventTarget | null): KeyboardTouchTarget | null {
|
|
98
102
|
const focusTarget = resolveKeyboardInputTarget(target);
|
|
99
|
-
return focusTarget
|
|
103
|
+
return focusTarget
|
|
104
|
+
? { focusTarget, clickTarget: target as HTMLElement }
|
|
105
|
+
: null;
|
|
100
106
|
}
|
|
101
107
|
|
|
102
108
|
function getElementAtPoint(root: Node, x: number, y: number): Element | null {
|
|
103
109
|
const elementFromPoint = (root as Partial<Document>).elementFromPoint;
|
|
104
|
-
return typeof elementFromPoint === 'function'
|
|
110
|
+
return typeof elementFromPoint === 'function'
|
|
111
|
+
? elementFromPoint.call(root, x, y)
|
|
112
|
+
: null;
|
|
105
113
|
}
|
|
106
114
|
|
|
107
115
|
/**
|
|
@@ -206,7 +214,9 @@ function isVerticallyScrollable(element: HTMLElement, allowOverflowIntent: boole
|
|
|
206
214
|
return false;
|
|
207
215
|
}
|
|
208
216
|
// With intent, a container that overflows only once slack is added counts too.
|
|
209
|
-
return allowOverflowIntent
|
|
217
|
+
return allowOverflowIntent
|
|
218
|
+
? element.clientHeight > 0
|
|
219
|
+
: element.scrollHeight > element.clientHeight;
|
|
210
220
|
}
|
|
211
221
|
|
|
212
222
|
/** The parent in the flat tree: crosses slots and shadow roots. */
|
|
@@ -215,7 +225,9 @@ function getParentNode(node: Node): Node | null {
|
|
|
215
225
|
return node.assignedSlot;
|
|
216
226
|
}
|
|
217
227
|
const parent = node.parentNode;
|
|
218
|
-
return parent instanceof ShadowRoot
|
|
228
|
+
return parent instanceof ShadowRoot
|
|
229
|
+
? parent.host
|
|
230
|
+
: parent;
|
|
219
231
|
}
|
|
220
232
|
|
|
221
233
|
function findScrollableAncestor(
|
|
@@ -230,7 +242,9 @@ function findScrollableAncestor(
|
|
|
230
242
|
}
|
|
231
243
|
node = getParentNode(node);
|
|
232
244
|
}
|
|
233
|
-
return isVerticallyScrollable(root, allowOverflowIntent)
|
|
245
|
+
return isVerticallyScrollable(root, allowOverflowIntent)
|
|
246
|
+
? root
|
|
247
|
+
: null;
|
|
234
248
|
}
|
|
235
249
|
|
|
236
250
|
/**
|
|
@@ -331,7 +345,10 @@ export function useDrawerVirtualKeyboard(options: UseDrawerVirtualKeyboardOption
|
|
|
331
345
|
function animateScroll(element: HTMLElement, scrollTop: number) {
|
|
332
346
|
const win = element.ownerDocument.defaultView ?? window;
|
|
333
347
|
const reducedMotion = win.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches;
|
|
334
|
-
element.scrollTo?.({
|
|
348
|
+
element.scrollTo?.({
|
|
349
|
+
top: scrollTop,
|
|
350
|
+
behavior: reducedMotion ? 'auto' : 'smooth',
|
|
351
|
+
});
|
|
335
352
|
}
|
|
336
353
|
|
|
337
354
|
function cancelPendingAlignment() {
|
|
@@ -403,7 +420,9 @@ export function useDrawerVirtualKeyboard(options: UseDrawerVirtualKeyboardOption
|
|
|
403
420
|
return {
|
|
404
421
|
top,
|
|
405
422
|
// Fixed content already sits above the keyboard, so an inset would lift it twice.
|
|
406
|
-
bottom: layoutFollowsKeyboard
|
|
423
|
+
bottom: layoutFollowsKeyboard
|
|
424
|
+
? layoutHeight
|
|
425
|
+
: Math.min(layoutHeight, top + visualHeight),
|
|
407
426
|
resizing: layoutFollowsKeyboard && Math.abs(layoutHeight - visualHeight) >= 1,
|
|
408
427
|
};
|
|
409
428
|
}
|
|
@@ -541,7 +560,9 @@ export function useDrawerVirtualKeyboard(options: UseDrawerVirtualKeyboardOption
|
|
|
541
560
|
if (!settled) {
|
|
542
561
|
// Commit only once the destination holds across two checks — layout may
|
|
543
562
|
// still be transitioning, and a mid-transition destination overshoots.
|
|
544
|
-
const checks = scrollElement === scrollTarget
|
|
563
|
+
const checks = scrollElement === scrollTarget
|
|
564
|
+
? scrollChecks + 1
|
|
565
|
+
: 1;
|
|
545
566
|
scrollElement = scrollTarget;
|
|
546
567
|
scrollDestination = destination;
|
|
547
568
|
scrollChecks = checks;
|
|
@@ -590,7 +611,9 @@ export function useDrawerVirtualKeyboard(options: UseDrawerVirtualKeyboardOption
|
|
|
590
611
|
const pass = () => {
|
|
591
612
|
align();
|
|
592
613
|
remaining -= 1;
|
|
593
|
-
realignTimer = remaining > 0
|
|
614
|
+
realignTimer = remaining > 0
|
|
615
|
+
? setTimeout(pass, KEYBOARD_REALIGN_INTERVAL)
|
|
616
|
+
: undefined;
|
|
594
617
|
};
|
|
595
618
|
realignTimer = setTimeout(pass, KEYBOARD_REALIGN_INTERVAL);
|
|
596
619
|
}
|
|
@@ -671,7 +694,9 @@ export function useDrawerVirtualKeyboard(options: UseDrawerVirtualKeyboardOption
|
|
|
671
694
|
function onTouchStart(event: TouchEvent) {
|
|
672
695
|
const touch = event.touches[0];
|
|
673
696
|
touchMoved = false;
|
|
674
|
-
touchStart = touch
|
|
697
|
+
touchStart = touch
|
|
698
|
+
? { x: touch.clientX, y: touch.clientY }
|
|
699
|
+
: null;
|
|
675
700
|
}
|
|
676
701
|
|
|
677
702
|
function onTouchMove(event: TouchEvent) {
|
|
@@ -190,7 +190,9 @@ export function useSwipeDismiss(options: UseSwipeDismissOptions) {
|
|
|
190
190
|
if (typeof swipeThresholdProp === 'function') {
|
|
191
191
|
return Math.max(0, swipeThresholdProp({ element: el, direction: dir }));
|
|
192
192
|
}
|
|
193
|
-
return typeof swipeThresholdProp === 'number'
|
|
193
|
+
return typeof swipeThresholdProp === 'number'
|
|
194
|
+
? swipeThresholdProp
|
|
195
|
+
: DEFAULT_SWIPE_THRESHOLD;
|
|
194
196
|
}
|
|
195
197
|
|
|
196
198
|
function setSwiping(next: boolean) {
|
|
@@ -277,7 +279,9 @@ export function useSwipeDismiss(options: UseSwipeDismissOptions) {
|
|
|
277
279
|
* Ported from BaseUI `useSwipeDismiss.ts:applyDirectionalDamping`.
|
|
278
280
|
*/
|
|
279
281
|
function applyDirectionalDamping(deltaX: number, deltaY: number) {
|
|
280
|
-
const exponent = (value: number) => (value >= 0
|
|
282
|
+
const exponent = (value: number) => (value >= 0
|
|
283
|
+
? value ** 0.5
|
|
284
|
+
: -((Math.abs(value)) ** 0.5));
|
|
281
285
|
const dampAxis = (delta: number, allowNegative: boolean, allowPositive: boolean) => {
|
|
282
286
|
if (!allowNegative && delta < 0) {
|
|
283
287
|
return exponent(delta);
|
|
@@ -320,8 +324,12 @@ export function useSwipeDismiss(options: UseSwipeDismissOptions) {
|
|
|
320
324
|
}
|
|
321
325
|
|
|
322
326
|
const isVerticalDrawerAxis = drawerAxis.value === 'vertical';
|
|
323
|
-
const drawerAxisDelta = isVerticalDrawerAxis
|
|
324
|
-
|
|
327
|
+
const drawerAxisDelta = isVerticalDrawerAxis
|
|
328
|
+
? pos.y - dragStartPos.y
|
|
329
|
+
: pos.x - dragStartPos.x;
|
|
330
|
+
const crossAxisDelta = isVerticalDrawerAxis
|
|
331
|
+
? pos.x - dragStartPos.x
|
|
332
|
+
: pos.y - dragStartPos.y;
|
|
325
333
|
const absDrawerAxisDelta = Math.abs(drawerAxisDelta);
|
|
326
334
|
const absCrossAxisDelta = Math.abs(crossAxisDelta);
|
|
327
335
|
|
|
@@ -354,7 +362,9 @@ export function useSwipeDismiss(options: UseSwipeDismissOptions) {
|
|
|
354
362
|
const absX = Math.abs(rawDx);
|
|
355
363
|
const absY = Math.abs(rawDy);
|
|
356
364
|
if (hasVertical.value && hasHorizontal.value) {
|
|
357
|
-
lockedAxis = absX > absY
|
|
365
|
+
lockedAxis = absX > absY
|
|
366
|
+
? 'horizontal'
|
|
367
|
+
: 'vertical';
|
|
358
368
|
} else if (hasVertical.value) {
|
|
359
369
|
lockedAxis = 'vertical';
|
|
360
370
|
} else {
|
|
@@ -363,8 +373,12 @@ export function useSwipeDismiss(options: UseSwipeDismissOptions) {
|
|
|
363
373
|
}
|
|
364
374
|
|
|
365
375
|
// Axis-locked deltas for direction detection
|
|
366
|
-
const dx = lockedAxis === 'vertical'
|
|
367
|
-
|
|
376
|
+
const dx = lockedAxis === 'vertical'
|
|
377
|
+
? 0
|
|
378
|
+
: rawDx;
|
|
379
|
+
const dy = lockedAxis === 'horizontal'
|
|
380
|
+
? 0
|
|
381
|
+
: rawDy;
|
|
368
382
|
|
|
369
383
|
const dir: SwipeDirection | undefined = toValue(directions).find((d) => getDisplacement(d, dx, dy) > 0);
|
|
370
384
|
|
|
@@ -456,8 +470,12 @@ export function useSwipeDismiss(options: UseSwipeDismissOptions) {
|
|
|
456
470
|
const threshold = getThreshold(el, intendedDirection ?? toValue(directions)[0]);
|
|
457
471
|
|
|
458
472
|
const now = performance.now();
|
|
459
|
-
const velAge = lastDragSample
|
|
460
|
-
|
|
473
|
+
const velAge = lastDragSample
|
|
474
|
+
? now - lastDragSample.time
|
|
475
|
+
: Infinity;
|
|
476
|
+
const velocity = velAge > MAX_RELEASE_VELOCITY_AGE_MS
|
|
477
|
+
? { x: 0, y: 0 }
|
|
478
|
+
: lastVelocity;
|
|
461
479
|
|
|
462
480
|
// When onRelease returns true (snap-point release), it owns the open/close
|
|
463
481
|
// and transform outcome — don't run the dismiss-vs-cancel branch, which
|
|
@@ -631,7 +649,9 @@ export function useSwipeDismiss(options: UseSwipeDismissOptions) {
|
|
|
631
649
|
// on `ignoreScrollableAncestors`: that option is about starting a swipe from
|
|
632
650
|
// inside a scroller on the dismiss axis.
|
|
633
651
|
if (drawerAxis.value) {
|
|
634
|
-
const crossAxis = drawerAxis.value === 'vertical'
|
|
652
|
+
const crossAxis = drawerAxis.value === 'vertical'
|
|
653
|
+
? 'horizontal'
|
|
654
|
+
: 'vertical';
|
|
635
655
|
crossAxisScrollable = findScrollableAncestor(target, crossAxis);
|
|
636
656
|
}
|
|
637
657
|
|
package/src/Drawer/utils.ts
CHANGED
|
@@ -104,14 +104,18 @@ export function computeSwipeReleaseScalar(params: {
|
|
|
104
104
|
|
|
105
105
|
const translation = baseOffset + axisDelta;
|
|
106
106
|
const translationAlongDirection
|
|
107
|
-
= (direction === 'left' || direction === 'up')
|
|
107
|
+
= (direction === 'left' || direction === 'up')
|
|
108
|
+
? -translation
|
|
109
|
+
: translation;
|
|
108
110
|
const remainingDistance = Math.max(0, size - translationAlongDirection);
|
|
109
111
|
if (!Number.isFinite(remainingDistance) || remainingDistance <= 0) {
|
|
110
112
|
return null;
|
|
111
113
|
}
|
|
112
114
|
|
|
113
115
|
const directionalVelocity
|
|
114
|
-
= (direction === 'left' || direction === 'up')
|
|
116
|
+
= (direction === 'left' || direction === 'up')
|
|
117
|
+
? -releaseVelocity
|
|
118
|
+
: releaseVelocity;
|
|
115
119
|
if (!Number.isFinite(directionalVelocity) || directionalVelocity <= MIN_SWIPE_RELEASE_VELOCITY) {
|
|
116
120
|
return null;
|
|
117
121
|
}
|
|
@@ -194,7 +198,12 @@ export function registerDrawerCssProperties() {
|
|
|
194
198
|
];
|
|
195
199
|
for (const name of lengthVars) {
|
|
196
200
|
try {
|
|
197
|
-
CSS.registerProperty({
|
|
201
|
+
CSS.registerProperty({
|
|
202
|
+
name,
|
|
203
|
+
syntax: '<length>',
|
|
204
|
+
inherits: false,
|
|
205
|
+
initialValue: '0px',
|
|
206
|
+
});
|
|
198
207
|
} catch {}
|
|
199
208
|
}
|
|
200
209
|
|
|
@@ -204,7 +213,12 @@ export function registerDrawerCssProperties() {
|
|
|
204
213
|
];
|
|
205
214
|
for (const { name, initialValue } of numberVars) {
|
|
206
215
|
try {
|
|
207
|
-
CSS.registerProperty({
|
|
216
|
+
CSS.registerProperty({
|
|
217
|
+
name,
|
|
218
|
+
syntax: '<number>',
|
|
219
|
+
inherits: false,
|
|
220
|
+
initialValue,
|
|
221
|
+
});
|
|
208
222
|
} catch {}
|
|
209
223
|
}
|
|
210
224
|
|
|
@@ -143,7 +143,9 @@ const { primitiveElement, currentElement } = usePrimitiveElement();
|
|
|
143
143
|
const isFormControl = useFormControl(currentElement);
|
|
144
144
|
|
|
145
145
|
const placeholder = computed(() => {
|
|
146
|
-
return isString(propPlaceholder.value)
|
|
146
|
+
return isString(propPlaceholder.value)
|
|
147
|
+
? { edit: propPlaceholder.value, preview: propPlaceholder.value }
|
|
148
|
+
: propPlaceholder.value;
|
|
147
149
|
});
|
|
148
150
|
|
|
149
151
|
const inputValue = ref(modelValue.value);
|
|
@@ -120,7 +120,9 @@ function handleInput() {
|
|
|
120
120
|
// Flushed after render, so the element's value (and validity) is up to date.
|
|
121
121
|
watch(() => props.modelValue, (value, previous) => {
|
|
122
122
|
if (value !== undefined && value !== previous) {
|
|
123
|
-
fieldContext.handleControlInput({
|
|
123
|
+
fieldContext.handleControlInput({
|
|
124
|
+
value: String(value),
|
|
125
|
+
});
|
|
124
126
|
}
|
|
125
127
|
}, { flush: 'post' });
|
|
126
128
|
|
package/src/Field/FieldRoot.vue
CHANGED
|
@@ -243,7 +243,10 @@ const serverError = computed(() => {
|
|
|
243
243
|
// leaves `serverError` unchanged by value, so that watcher alone would never
|
|
244
244
|
// fire. Also watch the parent `errors` object's identity so a fresh object —
|
|
245
245
|
// even with identical contents — re-shows the error.
|
|
246
|
-
watch([
|
|
246
|
+
watch([
|
|
247
|
+
serverError,
|
|
248
|
+
() => formContext?.serverErrors.value,
|
|
249
|
+
], () => {
|
|
247
250
|
clearedServerError.value = false;
|
|
248
251
|
});
|
|
249
252
|
|
|
@@ -251,10 +254,15 @@ const serverErrors = computed(() => {
|
|
|
251
254
|
if (clearedServerError.value || !serverError.value) {
|
|
252
255
|
return [];
|
|
253
256
|
}
|
|
254
|
-
return (Array.isArray(serverError.value)
|
|
257
|
+
return (Array.isArray(serverError.value)
|
|
258
|
+
? serverError.value
|
|
259
|
+
: [serverError.value]).filter(Boolean);
|
|
255
260
|
});
|
|
256
261
|
|
|
257
|
-
const errors = computed(() => [
|
|
262
|
+
const errors = computed(() => [
|
|
263
|
+
...validationErrors.value,
|
|
264
|
+
...serverErrors.value,
|
|
265
|
+
]);
|
|
258
266
|
|
|
259
267
|
// App-controlled invalidity (the `invalid` prop and server errors) applies even
|
|
260
268
|
// while disabled. Computed validity (native constraints and `validate`) doesn't,
|
|
@@ -271,8 +279,12 @@ const validity = computed<FieldValidityState>(() => ({ ...validationValidity.val
|
|
|
271
279
|
|
|
272
280
|
const dataAttributes = computed<FieldDataAttributes>(() => ({
|
|
273
281
|
'data-disabled': disabled.value ? '' : undefined,
|
|
274
|
-
'data-valid': valid.value === true
|
|
275
|
-
|
|
282
|
+
'data-valid': valid.value === true
|
|
283
|
+
? ''
|
|
284
|
+
: undefined,
|
|
285
|
+
'data-invalid': valid.value === false
|
|
286
|
+
? ''
|
|
287
|
+
: undefined,
|
|
276
288
|
'data-dirty': dirty.value ? '' : undefined,
|
|
277
289
|
'data-touched': touched.value ? '' : undefined,
|
|
278
290
|
'data-filled': filled.value ? '' : undefined,
|
|
@@ -281,7 +293,9 @@ const dataAttributes = computed<FieldDataAttributes>(() => ({
|
|
|
281
293
|
|
|
282
294
|
// --- Description / error id accumulation (deterministic: registration order) ---
|
|
283
295
|
const describedByIds = ref<Array<string>>([]);
|
|
284
|
-
const describedBy = computed(() => describedByIds.value.length
|
|
296
|
+
const describedBy = computed(() => describedByIds.value.length
|
|
297
|
+
? describedByIds.value.join(' ')
|
|
298
|
+
: undefined);
|
|
285
299
|
|
|
286
300
|
function registerDescription(id: string) {
|
|
287
301
|
describedByIds.value.push(id);
|
|
@@ -358,7 +372,9 @@ function resolveValue(detail?: FieldControlDetail) {
|
|
|
358
372
|
if (detail) {
|
|
359
373
|
return detail.value;
|
|
360
374
|
}
|
|
361
|
-
return control.value
|
|
375
|
+
return control.value
|
|
376
|
+
? control.value.getValue()
|
|
377
|
+
: lastReportedValue.value;
|
|
362
378
|
}
|
|
363
379
|
|
|
364
380
|
function getValiditySource() {
|
|
@@ -39,8 +39,14 @@ export const DEFAULT_VALIDITY_STATE: FieldValidityState = {
|
|
|
39
39
|
* `ValidityState` of their own, and to snapshot a native element's live one.
|
|
40
40
|
*/
|
|
41
41
|
export function createValidityState(flags: Partial<Record<ValidityKey, boolean>> = {}): ValidityState {
|
|
42
|
-
const state = Object.fromEntries(VALIDITY_KEYS.map((key) => [
|
|
43
|
-
|
|
42
|
+
const state = Object.fromEntries(VALIDITY_KEYS.map((key) => [
|
|
43
|
+
key,
|
|
44
|
+
Boolean(flags[key]),
|
|
45
|
+
])) as Record<ValidityKey, boolean>;
|
|
46
|
+
return {
|
|
47
|
+
...state,
|
|
48
|
+
valid: VALIDITY_KEYS.every((key) => !state[key]),
|
|
49
|
+
};
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
type NativeControl = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;
|
|
@@ -72,7 +78,9 @@ function normalizeErrors(result: FieldValidateResult): Array<string> {
|
|
|
72
78
|
if (!result) {
|
|
73
79
|
return [];
|
|
74
80
|
}
|
|
75
|
-
return (Array.isArray(result)
|
|
81
|
+
return (Array.isArray(result)
|
|
82
|
+
? result
|
|
83
|
+
: [result]).filter(Boolean);
|
|
76
84
|
}
|
|
77
85
|
|
|
78
86
|
function isPromiseLike<T>(value: unknown): value is PromiseLike<T> {
|
|
@@ -80,7 +88,9 @@ function isPromiseLike<T>(value: unknown): value is PromiseLike<T> {
|
|
|
80
88
|
}
|
|
81
89
|
|
|
82
90
|
function getNativeErrors(element: NativeControl | undefined) {
|
|
83
|
-
return element?.validationMessage
|
|
91
|
+
return element?.validationMessage
|
|
92
|
+
? [element.validationMessage]
|
|
93
|
+
: [];
|
|
84
94
|
}
|
|
85
95
|
|
|
86
96
|
/**
|
|
@@ -138,10 +148,15 @@ export function useFieldValidation(options: UseFieldValidationOptions) {
|
|
|
138
148
|
|
|
139
149
|
// Barred controls (disabled, `type="button"`, …) have no usable state.
|
|
140
150
|
if (!live) {
|
|
141
|
-
return {
|
|
151
|
+
return {
|
|
152
|
+
...createValidityState(),
|
|
153
|
+
};
|
|
142
154
|
}
|
|
143
155
|
|
|
144
|
-
const state: FieldValidityState = {
|
|
156
|
+
const state: FieldValidityState = {
|
|
157
|
+
...createValidityState(live),
|
|
158
|
+
valid: live.valid,
|
|
159
|
+
};
|
|
145
160
|
|
|
146
161
|
// Only let `valueMissing` mark the field invalid once the value has been
|
|
147
162
|
// changed (or validation was forced), to reduce error noise.
|
|
@@ -156,7 +171,9 @@ export function useFieldValidation(options: UseFieldValidationOptions) {
|
|
|
156
171
|
|
|
157
172
|
function publish(state: FieldValidityState, messages: Array<string>, committedValue: unknown) {
|
|
158
173
|
validity.value = state;
|
|
159
|
-
errors.value = state.valid === false
|
|
174
|
+
errors.value = state.valid === false
|
|
175
|
+
? messages
|
|
176
|
+
: [];
|
|
160
177
|
value.value = committedValue;
|
|
161
178
|
}
|
|
162
179
|
|
|
@@ -173,7 +190,9 @@ export function useFieldValidation(options: UseFieldValidationOptions) {
|
|
|
173
190
|
clearCustomValidity();
|
|
174
191
|
|
|
175
192
|
let state = readState(source, currentValue);
|
|
176
|
-
const nativeErrors = state.valid === false
|
|
193
|
+
const nativeErrors = state.valid === false
|
|
194
|
+
? getNativeErrors(source.element)
|
|
195
|
+
: [];
|
|
177
196
|
const validateFn = options.validate.value;
|
|
178
197
|
|
|
179
198
|
if (!validateFn || (state.valid === false && !options.shouldValidateOnChange())) {
|
|
@@ -255,7 +274,10 @@ export function useFieldValidation(options: UseFieldValidationOptions) {
|
|
|
255
274
|
return;
|
|
256
275
|
}
|
|
257
276
|
|
|
258
|
-
publish({
|
|
277
|
+
publish({
|
|
278
|
+
...createValidityState(),
|
|
279
|
+
valid: true,
|
|
280
|
+
}, [], currentValue);
|
|
259
281
|
}
|
|
260
282
|
|
|
261
283
|
/** Runs on a value change: validates (debounced) when on-change validation applies. */
|
|
@@ -100,7 +100,9 @@ watchEffect((cleanupFn) => {
|
|
|
100
100
|
// originating inside a shadow root are retargeted to the host, so
|
|
101
101
|
// `container.contains(target)` never matches and focus escapes the trap.
|
|
102
102
|
const ownerDocument = container?.ownerDocument ?? document;
|
|
103
|
-
const root = container
|
|
103
|
+
const root = container
|
|
104
|
+
? (container.getRootNode() as Document | ShadowRoot)
|
|
105
|
+
: ownerDocument;
|
|
104
106
|
|
|
105
107
|
function handleFocusIn(event: FocusEvent) {
|
|
106
108
|
if (focusScope.paused || !container) {
|
|
@@ -68,7 +68,9 @@ onMounted(() => {
|
|
|
68
68
|
document.addEventListener('pointerup', handlePointerUp);
|
|
69
69
|
|
|
70
70
|
const tabbables = getTabbableNodes(contentElement.value);
|
|
71
|
-
tabbables.forEach((tabbable) =>
|
|
71
|
+
tabbables.forEach((tabbable) => {
|
|
72
|
+
tabbable.setAttribute('tabindex', '-1');
|
|
73
|
+
});
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
useEventListener(window, 'scroll', (event: Event) => {
|
package/src/HoverCard/index.ts
CHANGED
package/src/HoverCard/utils.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export function excludeTouch(eventHandler: () => void) {
|
|
2
|
-
return (event: PointerEvent) => event.pointerType === 'touch'
|
|
2
|
+
return (event: PointerEvent) => event.pointerType === 'touch'
|
|
3
|
+
? undefined
|
|
4
|
+
: eventHandler();
|
|
3
5
|
}
|
|
4
6
|
|
|
5
7
|
/**
|
|
@@ -13,7 +15,9 @@ export function getTabbableNodes(container: HTMLElement) {
|
|
|
13
15
|
// `.tabIndex` is not the same as the `tabindex` attribute. It works on the
|
|
14
16
|
// runtime's understanding of tabbability, so this automatically accounts
|
|
15
17
|
// for any kind of element that could be tabbed to.
|
|
16
|
-
return node.tabIndex >= 0
|
|
18
|
+
return node.tabIndex >= 0
|
|
19
|
+
? NodeFilter.FILTER_ACCEPT
|
|
20
|
+
: NodeFilter.FILTER_SKIP;
|
|
17
21
|
},
|
|
18
22
|
});
|
|
19
23
|
while (walker.nextNode()) {
|
|
@@ -131,7 +131,9 @@ const firstValue = ref<T>();
|
|
|
131
131
|
const isUserAction = ref(false);
|
|
132
132
|
const focusable = ref(true);
|
|
133
133
|
const modelValue = useVModel(props, 'modelValue', emits, {
|
|
134
|
-
defaultValue: props.defaultValue ?? (multiple.value
|
|
134
|
+
defaultValue: props.defaultValue ?? (multiple.value
|
|
135
|
+
? []
|
|
136
|
+
: undefined),
|
|
135
137
|
passive: (props.modelValue === undefined) as false,
|
|
136
138
|
deep: true,
|
|
137
139
|
}) as Ref<T | Array<T> | undefined>;
|
|
@@ -139,10 +141,14 @@ const modelValue = useVModel(props, 'modelValue', emits, {
|
|
|
139
141
|
function onValueChange(val: T) {
|
|
140
142
|
isUserAction.value = true;
|
|
141
143
|
if (props.multiple) {
|
|
142
|
-
const modelArray = Array.isArray(modelValue.value)
|
|
144
|
+
const modelArray = Array.isArray(modelValue.value)
|
|
145
|
+
? [...modelValue.value]
|
|
146
|
+
: [];
|
|
143
147
|
const index = modelArray.findIndex((i) => compare(i, val, props.by));
|
|
144
148
|
if (props.selectionBehavior === 'toggle') {
|
|
145
|
-
index === -1
|
|
149
|
+
index === -1
|
|
150
|
+
? modelArray.push(val)
|
|
151
|
+
: modelArray.splice(index, 1);
|
|
146
152
|
modelValue.value = modelArray;
|
|
147
153
|
} else {
|
|
148
154
|
modelValue.value = [val];
|
|
@@ -318,13 +324,17 @@ function isAtVirtualBoundary(intent: 'prev' | 'next') {
|
|
|
318
324
|
// window reaches the end of the full options list; any rendered items past
|
|
319
325
|
// the highlighted one are disabled.
|
|
320
326
|
const rendered = getItems(true).map((i) => i.ref);
|
|
321
|
-
const edge = intent === 'next'
|
|
327
|
+
const edge = intent === 'next'
|
|
328
|
+
? rendered.at(-1)
|
|
329
|
+
: rendered[0];
|
|
322
330
|
if (!edge) {
|
|
323
331
|
return false;
|
|
324
332
|
}
|
|
325
333
|
const position = Number(edge.getAttribute('aria-posinset'));
|
|
326
334
|
const size = Number(edge.getAttribute('aria-setsize'));
|
|
327
|
-
return intent === 'next'
|
|
335
|
+
return intent === 'next'
|
|
336
|
+
? position === size
|
|
337
|
+
: position === 1;
|
|
328
338
|
}
|
|
329
339
|
|
|
330
340
|
function onKeydownNavigation(event: KeyboardEvent) {
|
|
@@ -347,19 +357,25 @@ function onKeydownNavigation(event: KeyboardEvent) {
|
|
|
347
357
|
if (shouldLoop && isVirtual.value) {
|
|
348
358
|
if (isAtVirtualBoundary(intent)) {
|
|
349
359
|
// Let the virtualizer scroll to and highlight the opposite end.
|
|
350
|
-
const key = intent === 'next'
|
|
360
|
+
const key = intent === 'next'
|
|
361
|
+
? KEY_CODES.HOME
|
|
362
|
+
: KEY_CODES.END;
|
|
351
363
|
return virtualKeydownHook.trigger(new KeyboardEvent('keydown', { key, shiftKey: event.shiftKey }));
|
|
352
364
|
}
|
|
353
365
|
collection = [];
|
|
354
366
|
} else {
|
|
355
|
-
collection = shouldLoop
|
|
367
|
+
collection = shouldLoop
|
|
368
|
+
? collection.slice(0, 1)
|
|
369
|
+
: collection.slice(currentIndex + 1);
|
|
356
370
|
}
|
|
357
371
|
}
|
|
358
372
|
handleMultipleReplace(event, collection[0]);
|
|
359
373
|
}
|
|
360
374
|
|
|
361
375
|
if (collection.length) {
|
|
362
|
-
const index = !highlightedElement.value && intent === 'prev'
|
|
376
|
+
const index = !highlightedElement.value && intent === 'prev'
|
|
377
|
+
? collection.length - 1
|
|
378
|
+
: 0;
|
|
363
379
|
changeHighlight(collection[index]);
|
|
364
380
|
}
|
|
365
381
|
|
|
@@ -137,7 +137,9 @@ rootContext.virtualFocusHook.on(({ event, scroll }) => {
|
|
|
137
137
|
const item = queryCheckedElement(parentEl.value);
|
|
138
138
|
if (item) {
|
|
139
139
|
// eslint-disable-next-line no-nested-ternary
|
|
140
|
-
const focus = event
|
|
140
|
+
const focus = event
|
|
141
|
+
? true
|
|
142
|
+
: scroll ? undefined : false;
|
|
141
143
|
rootContext.changeHighlight(item, scroll, focus);
|
|
142
144
|
}
|
|
143
145
|
});
|
|
@@ -238,11 +240,15 @@ rootContext.virtualKeydownHook.on((event) => {
|
|
|
238
240
|
if (['first', 'last'].includes(intent)) {
|
|
239
241
|
event.preventDefault();
|
|
240
242
|
|
|
241
|
-
const index = intent === 'first'
|
|
243
|
+
const index = intent === 'first'
|
|
244
|
+
? 0
|
|
245
|
+
: props.options.length - 1;
|
|
242
246
|
virtualizer.value.scrollToIndex(index);
|
|
243
247
|
requestAnimationFrame(() => {
|
|
244
248
|
const items = getItems();
|
|
245
|
-
const item = intent === 'first'
|
|
249
|
+
const item = intent === 'first'
|
|
250
|
+
? items[0]
|
|
251
|
+
: items.at(-1);
|
|
246
252
|
if (item) {
|
|
247
253
|
rootContext.changeHighlight(item.ref);
|
|
248
254
|
}
|