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
|
@@ -94,6 +94,7 @@ export interface MenuRootContentTypeProps
|
|
|
94
94
|
import {
|
|
95
95
|
onUnmounted,
|
|
96
96
|
ref,
|
|
97
|
+
shallowRef,
|
|
97
98
|
toRefs,
|
|
98
99
|
watch,
|
|
99
100
|
} from 'vue';
|
|
@@ -166,7 +167,8 @@ function onKeydownEnter() {
|
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
const filterElement = ref<HTMLElement>();
|
|
169
|
-
|
|
170
|
+
// A deep `ref` would unwrap `trigger` to the element, so `trigger.value` would always be `undefined`.
|
|
171
|
+
const activeSubmenuContext = shallowRef<{ onOpenChange: (open: boolean) => void; trigger: Ref<HTMLElement | undefined> }>();
|
|
170
172
|
|
|
171
173
|
watch(highlightedElement, (el) => {
|
|
172
174
|
if (activeSubmenuContext.value && (el === undefined || el !== activeSubmenuContext.value.trigger.value)) {
|
|
@@ -266,7 +268,9 @@ function handleKeyDown(event: KeyboardEvent) {
|
|
|
266
268
|
return;
|
|
267
269
|
}
|
|
268
270
|
event.preventDefault();
|
|
269
|
-
const candidateNodes = [
|
|
271
|
+
const candidateNodes = [
|
|
272
|
+
...collectionItems.map((item) => item.ref),
|
|
273
|
+
];
|
|
270
274
|
if (LAST_KEYS.includes(event.key)) {
|
|
271
275
|
candidateNodes.reverse();
|
|
272
276
|
}
|
|
@@ -295,7 +299,9 @@ function handlePointerMove(event: PointerEvent) {
|
|
|
295
299
|
(event?.currentTarget as HTMLElement)?.contains(target)
|
|
296
300
|
&& pointerXHasChanged
|
|
297
301
|
) {
|
|
298
|
-
const newDir = event.clientX > lastPointerXRef.value
|
|
302
|
+
const newDir = event.clientX > lastPointerXRef.value
|
|
303
|
+
? 'right'
|
|
304
|
+
: 'left';
|
|
299
305
|
pointerDirRef.value = newDir;
|
|
300
306
|
lastPointerXRef.value = event.clientX;
|
|
301
307
|
}
|
package/src/Menu/MenuSub.vue
CHANGED
|
@@ -4,8 +4,9 @@ import type { Side } from './utils';
|
|
|
4
4
|
|
|
5
5
|
export interface MenuSubTriggerProps extends MenuItemImplProps {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* How long (in milliseconds) the pointer is given to reach the submenu after leaving the trigger.
|
|
8
|
+
* While it moves towards the submenu within this time, hovering other items won't close the submenu.
|
|
9
|
+
* Increase it for users who move the pointer slowly or on devices under heavy load.
|
|
9
10
|
* @defaultValue 300
|
|
10
11
|
*/
|
|
11
12
|
graceDuration?: number;
|
|
@@ -14,6 +15,7 @@ export interface MenuSubTriggerProps extends MenuItemImplProps {
|
|
|
14
15
|
|
|
15
16
|
<script setup lang="ts">
|
|
16
17
|
import type { ComponentPublicInstance } from 'vue';
|
|
18
|
+
import { reactiveOmit } from '@vueuse/shared';
|
|
17
19
|
import { nextTick, onUnmounted, ref, watch } from 'vue';
|
|
18
20
|
import { useId } from '@/shared';
|
|
19
21
|
import MenuAnchor from './MenuAnchor.vue';
|
|
@@ -26,6 +28,8 @@ import { getOpenState, isMouseEvent, SUB_OPEN_KEYS } from './utils';
|
|
|
26
28
|
const props = withDefaults(defineProps<MenuSubTriggerProps>(), {
|
|
27
29
|
graceDuration: 300,
|
|
28
30
|
});
|
|
31
|
+
// `graceDuration` is not a `MenuItemImpl` prop, so it would land on the DOM element.
|
|
32
|
+
const itemProps = reactiveOmit(props, 'graceDuration');
|
|
29
33
|
|
|
30
34
|
const menuContext = injectMenuContext();
|
|
31
35
|
const rootContext = injectMenuRootContext();
|
|
@@ -45,7 +49,7 @@ watch(menuContext.open, (open) => {
|
|
|
45
49
|
|
|
46
50
|
const openTimerRef = ref<number | null>(null);
|
|
47
51
|
|
|
48
|
-
subContext.triggerId ||= useId(undefined, '
|
|
52
|
+
subContext.triggerId ||= useId(undefined, 'reka-menu-sub-trigger');
|
|
49
53
|
|
|
50
54
|
function clearOpenTimer() {
|
|
51
55
|
if (openTimerRef.value) {
|
|
@@ -84,10 +88,14 @@ async function handlePointerLeave(event: PointerEvent) {
|
|
|
84
88
|
|
|
85
89
|
const contentRect = menuContext.content.value?.getBoundingClientRect();
|
|
86
90
|
if (contentRect?.width) {
|
|
91
|
+
// TODO (Radix UI): make sure to update this when we change positioning logic
|
|
92
|
+
// https://github.com/radix-ui/primitives/blob/main/packages/react/menu/src/Menu.tsx#L1088
|
|
87
93
|
const side = menuContext.content.value?.dataset.side as Side;
|
|
88
94
|
|
|
89
95
|
const rightSide = side === 'right';
|
|
90
|
-
const bleed = rightSide
|
|
96
|
+
const bleed = rightSide
|
|
97
|
+
? -5
|
|
98
|
+
: +5;
|
|
91
99
|
const contentNearEdge = contentRect[rightSide ? 'left' : 'right'];
|
|
92
100
|
const contentFarEdge = contentRect[rightSide ? 'right' : 'left'];
|
|
93
101
|
|
|
@@ -141,7 +149,7 @@ async function handleKeyDown(event: KeyboardEvent) {
|
|
|
141
149
|
<template>
|
|
142
150
|
<MenuAnchor as-child>
|
|
143
151
|
<MenuItemImpl
|
|
144
|
-
v-bind="
|
|
152
|
+
v-bind="itemProps"
|
|
145
153
|
:id="subContext.triggerId"
|
|
146
154
|
:ref="
|
|
147
155
|
(vnode: Element | ComponentPublicInstance | null) => {
|
package/src/Menu/utils.ts
CHANGED
|
@@ -8,7 +8,10 @@ export const ITEM_SELECT = 'menu.itemSelect';
|
|
|
8
8
|
export const SELECTION_KEYS = ['Enter', ' '];
|
|
9
9
|
export const FIRST_KEYS = ['ArrowDown', 'PageUp', 'Home'];
|
|
10
10
|
export const LAST_KEYS = ['ArrowUp', 'PageDown', 'End'];
|
|
11
|
-
export const FIRST_LAST_KEYS = [
|
|
11
|
+
export const FIRST_LAST_KEYS = [
|
|
12
|
+
...FIRST_KEYS,
|
|
13
|
+
...LAST_KEYS,
|
|
14
|
+
];
|
|
12
15
|
export const SUB_OPEN_KEYS: Record<Direction, Array<string>> = {
|
|
13
16
|
ltr: [...SELECTION_KEYS, 'ArrowRight'],
|
|
14
17
|
rtl: [...SELECTION_KEYS, 'ArrowLeft'],
|
|
@@ -71,8 +74,10 @@ export interface GraceIntent {
|
|
|
71
74
|
side: Side;
|
|
72
75
|
}
|
|
73
76
|
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Determine if a point is inside of a polygon.
|
|
79
|
+
* Based on https://github.com/substack/point-in-polygon
|
|
80
|
+
*/
|
|
76
81
|
export function isPointInPolygon(point: Point, polygon: Polygon) {
|
|
77
82
|
const { x, y } = point;
|
|
78
83
|
let inside = false;
|
|
@@ -42,7 +42,9 @@ function handleArrowNavigation(event: KeyboardEvent) {
|
|
|
42
42
|
'data-akar-menubar-subtrigger',
|
|
43
43
|
);
|
|
44
44
|
|
|
45
|
-
const prevMenuKey = rootContext.dir.value === 'rtl'
|
|
45
|
+
const prevMenuKey = rootContext.dir.value === 'rtl'
|
|
46
|
+
? 'ArrowRight'
|
|
47
|
+
: 'ArrowLeft';
|
|
46
48
|
const isPrevKey = prevMenuKey === event.key;
|
|
47
49
|
const isNextKey = !isPrevKey;
|
|
48
50
|
|
|
@@ -97,7 +97,9 @@ function handleArrowKey(e: KeyboardEvent) {
|
|
|
97
97
|
e.preventDefault();
|
|
98
98
|
e.stopPropagation();
|
|
99
99
|
const parentElement = rootContext.parentElement.value!;
|
|
100
|
-
const sign = rootContext.dir.value === 'rtl'
|
|
100
|
+
const sign = rootContext.dir.value === 'rtl'
|
|
101
|
+
? -1
|
|
102
|
+
: 1;
|
|
101
103
|
|
|
102
104
|
switch (e.code) {
|
|
103
105
|
case KEY_CODES.ARROW_RIGHT:
|
|
@@ -226,7 +226,9 @@ function onMonthChange(value: DateValue) {
|
|
|
226
226
|
modelValue.value = resolveMonthValue(value, modelValue.value as DateValue);
|
|
227
227
|
}
|
|
228
228
|
} else if (!modelValue.value) {
|
|
229
|
-
modelValue.value = [
|
|
229
|
+
modelValue.value = [
|
|
230
|
+
resolveMonthValue(value, placeholder.value),
|
|
231
|
+
];
|
|
230
232
|
} else {
|
|
231
233
|
const modelValueArray = Array.isArray(modelValue.value)
|
|
232
234
|
? modelValue.value
|
|
@@ -234,7 +236,10 @@ function onMonthChange(value: DateValue) {
|
|
|
234
236
|
|
|
235
237
|
const index = modelValueArray.findIndex((date) => isSameYearMonth(date, value));
|
|
236
238
|
if (index === -1) {
|
|
237
|
-
modelValue.value = [
|
|
239
|
+
modelValue.value = [
|
|
240
|
+
...modelValueArray,
|
|
241
|
+
resolveMonthValue(value, placeholder.value),
|
|
242
|
+
];
|
|
238
243
|
} else if (!preventDeselect.value) {
|
|
239
244
|
const next = modelValueArray.filter((date) => !isSameYearMonth(date, value));
|
|
240
245
|
if (!next.length) {
|
|
@@ -72,7 +72,9 @@ export function useMonthPicker(props: UseMonthPickerProps) {
|
|
|
72
72
|
const formatter = useDateFormatter(props.locale.value);
|
|
73
73
|
|
|
74
74
|
const resolveMatcher = (matcher?: Matcher | Ref<Matcher | undefined>) =>
|
|
75
|
-
isFunction(matcher)
|
|
75
|
+
isFunction(matcher)
|
|
76
|
+
? matcher
|
|
77
|
+
: matcher?.value;
|
|
76
78
|
|
|
77
79
|
const headingFormatOptions = computed(() => {
|
|
78
80
|
const options: DateFormatterOptions = {
|
|
@@ -172,7 +172,9 @@ function handleArrowKey(e: KeyboardEvent) {
|
|
|
172
172
|
e.preventDefault();
|
|
173
173
|
e.stopPropagation();
|
|
174
174
|
const parentElement = rootContext.parentElement.value!;
|
|
175
|
-
const sign = rootContext.dir.value === 'rtl'
|
|
175
|
+
const sign = rootContext.dir.value === 'rtl'
|
|
176
|
+
? -1
|
|
177
|
+
: 1;
|
|
176
178
|
|
|
177
179
|
switch (e.code) {
|
|
178
180
|
case KEY_CODES.ARROW_RIGHT:
|
|
@@ -265,7 +267,9 @@ function handleArrowKey(e: KeyboardEvent) {
|
|
|
265
267
|
return;
|
|
266
268
|
}
|
|
267
269
|
|
|
268
|
-
shiftFocus(candidateMonthValue, years > 0
|
|
270
|
+
shiftFocus(candidateMonthValue, years > 0
|
|
271
|
+
? 1
|
|
272
|
+
: -1, 1);
|
|
269
273
|
});
|
|
270
274
|
}
|
|
271
275
|
}
|
|
@@ -293,16 +293,31 @@ watch([startValue, endValue], ([_startValue, _endValue]) => {
|
|
|
293
293
|
isEditing.value = true;
|
|
294
294
|
if (_endValue && _startValue) {
|
|
295
295
|
const nextValue = compareYearMonth(_endValue, _startValue) < 0
|
|
296
|
-
? {
|
|
297
|
-
|
|
296
|
+
? {
|
|
297
|
+
start: _endValue.copy(),
|
|
298
|
+
end: _startValue.copy(),
|
|
299
|
+
}
|
|
300
|
+
: {
|
|
301
|
+
start: _startValue.copy(),
|
|
302
|
+
end: _endValue.copy(),
|
|
303
|
+
};
|
|
298
304
|
|
|
299
305
|
modelValue.value = { start: nextValue.start, end: nextValue.end };
|
|
300
306
|
isEditing.value = false;
|
|
301
|
-
validModelValue.value = {
|
|
307
|
+
validModelValue.value = {
|
|
308
|
+
start: nextValue.start.copy(),
|
|
309
|
+
end: nextValue.end.copy(),
|
|
310
|
+
};
|
|
302
311
|
} else {
|
|
303
312
|
modelValue.value = _startValue
|
|
304
|
-
? {
|
|
305
|
-
|
|
313
|
+
? {
|
|
314
|
+
start: _startValue.copy(),
|
|
315
|
+
end: undefined,
|
|
316
|
+
}
|
|
317
|
+
: {
|
|
318
|
+
start: _endValue?.copy(),
|
|
319
|
+
end: undefined,
|
|
320
|
+
};
|
|
306
321
|
}
|
|
307
322
|
});
|
|
308
323
|
|
|
@@ -91,7 +91,9 @@ export function useRangeMonthPickerState(props: UseRangeMonthPickerProps) {
|
|
|
91
91
|
return compareYearMonth(date, startLimit) < 0 || compareYearMonth(date, endLimit) > 0;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
const fixedValue = props.fixedDate.value === 'start'
|
|
94
|
+
const fixedValue = props.fixedDate.value === 'start'
|
|
95
|
+
? props.start.value
|
|
96
|
+
: props.end.value;
|
|
95
97
|
const maxDate = fixedValue.add({ months: maximumMonths - 1 });
|
|
96
98
|
const minDate = fixedValue.subtract({ months: maximumMonths - 1 });
|
|
97
99
|
return compareYearMonth(date, minDate) < 0 || compareYearMonth(date, maxDate) > 0;
|
|
@@ -131,11 +133,15 @@ export function useRangeMonthPickerState(props: UseRangeMonthPickerProps) {
|
|
|
131
133
|
|
|
132
134
|
if (compareYearMonth(focused, anchor) >= 0) {
|
|
133
135
|
const maxEnd = anchor.add({ months: maximumMonths - 1 });
|
|
134
|
-
const cappedEnd = compareYearMonth(focused, maxEnd) > 0
|
|
136
|
+
const cappedEnd = compareYearMonth(focused, maxEnd) > 0
|
|
137
|
+
? maxEnd
|
|
138
|
+
: focused;
|
|
135
139
|
return { start: anchor, end: cappedEnd };
|
|
136
140
|
} else {
|
|
137
141
|
const minStart = anchor.subtract({ months: maximumMonths - 1 });
|
|
138
|
-
const cappedStart = compareYearMonth(focused, minStart) < 0
|
|
142
|
+
const cappedStart = compareYearMonth(focused, minStart) < 0
|
|
143
|
+
? minStart
|
|
144
|
+
: focused;
|
|
139
145
|
return { start: cappedStart, end: anchor };
|
|
140
146
|
}
|
|
141
147
|
}
|
|
@@ -143,7 +149,9 @@ export function useRangeMonthPickerState(props: UseRangeMonthPickerProps) {
|
|
|
143
149
|
const isValid = areAllMonthsBetweenValid(
|
|
144
150
|
start,
|
|
145
151
|
end,
|
|
146
|
-
props.allowNonContiguousRanges.value
|
|
152
|
+
props.allowNonContiguousRanges.value
|
|
153
|
+
? () => false
|
|
154
|
+
: props.isMonthUnavailable,
|
|
147
155
|
rangeIsMonthDisabled,
|
|
148
156
|
);
|
|
149
157
|
if (isValid) {
|
|
@@ -63,11 +63,15 @@ const motionAttribute = computed(() => {
|
|
|
63
63
|
if (index !== prevIndex) {
|
|
64
64
|
// If we're moving to this item from another
|
|
65
65
|
if (isSelected && prevIndex !== -1) {
|
|
66
|
-
return index > prevIndex
|
|
66
|
+
return index > prevIndex
|
|
67
|
+
? 'from-end'
|
|
68
|
+
: 'from-start';
|
|
67
69
|
}
|
|
68
70
|
// If we're leaving this item for another
|
|
69
71
|
if (wasSelected && index !== -1) {
|
|
70
|
-
return index > prevIndex
|
|
72
|
+
return index > prevIndex
|
|
73
|
+
? 'to-start'
|
|
74
|
+
: 'to-end';
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
77
|
// Otherwise we're entering from closed or leaving the list
|
|
@@ -64,7 +64,9 @@ async function handleContentEntry(side = 'start') {
|
|
|
64
64
|
restoreContentTabOrderRef();
|
|
65
65
|
const candidates = getTabbableCandidates(el);
|
|
66
66
|
if (candidates.length) {
|
|
67
|
-
focusFirst(side === 'start'
|
|
67
|
+
focusFirst(side === 'start'
|
|
68
|
+
? candidates
|
|
69
|
+
: candidates.reverse());
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
}
|
|
@@ -79,7 +81,7 @@ function handleContentExit() {
|
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
|
|
82
|
-
provideNavigationMenuItemContext({
|
|
84
|
+
const itemContext = provideNavigationMenuItemContext({
|
|
83
85
|
value,
|
|
84
86
|
contentId,
|
|
85
87
|
triggerRef,
|
|
@@ -93,12 +95,21 @@ provideNavigationMenuItemContext({
|
|
|
93
95
|
|
|
94
96
|
function handleClose() {
|
|
95
97
|
context.onItemDismiss();
|
|
96
|
-
triggerRef.value?.focus();
|
|
98
|
+
itemContext.triggerRef.value?.focus();
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
function handleKeydown(ev: KeyboardEvent) {
|
|
100
102
|
const currentFocus = getActiveElement() as HTMLElement;
|
|
101
|
-
if (ev.keyCode === 32
|
|
103
|
+
if (ev.keyCode === 32) {
|
|
104
|
+
// Only the trigger of this item toggles; links and nested items keep their own behavior.
|
|
105
|
+
// `NavigationMenuTrigger` replaces `itemContext.triggerRef` with its element ref on mount.
|
|
106
|
+
if (ev.target !== itemContext.triggerRef.value) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (ev.repeat) {
|
|
110
|
+
ev.preventDefault();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
102
113
|
if (context.modelValue.value === value) {
|
|
103
114
|
handleClose();
|
|
104
115
|
ev.preventDefault();
|
|
@@ -120,7 +120,9 @@ function handleKeydown(ev: KeyboardEvent) {
|
|
|
120
120
|
if (ev.defaultPrevented) {
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
|
-
const verticalEntryKey = menuContext.dir.value === 'rtl'
|
|
123
|
+
const verticalEntryKey = menuContext.dir.value === 'rtl'
|
|
124
|
+
? 'ArrowLeft'
|
|
125
|
+
: 'ArrowRight';
|
|
124
126
|
const entryKey = { horizontal: 'ArrowDown', vertical: verticalEntryKey }[
|
|
125
127
|
menuContext.orientation
|
|
126
128
|
];
|
|
@@ -185,7 +187,7 @@ function handleVisuallyHiddenFocus(ev: FocusEvent) {
|
|
|
185
187
|
@focus="handleVisuallyHiddenFocus"
|
|
186
188
|
/>
|
|
187
189
|
<span
|
|
188
|
-
v-if="menuContext.viewport"
|
|
190
|
+
v-if="menuContext.viewport.value"
|
|
189
191
|
:aria-owns="contentId"
|
|
190
192
|
/>
|
|
191
193
|
</template>
|
|
@@ -78,5 +78,7 @@ export function removeFromTabOrder(candidates: Array<HTMLElement>) {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
export function whenMouse<E extends PointerEvent>(handler: (event?: E) => void) {
|
|
81
|
-
return (event: E) => (event.pointerType === 'mouse'
|
|
81
|
+
return (event: E) => (event.pointerType === 'mouse'
|
|
82
|
+
? handler(event)
|
|
83
|
+
: undefined);
|
|
82
84
|
}
|
|
@@ -79,9 +79,13 @@ function handleWheelEvent(event: WheelEvent) {
|
|
|
79
79
|
|
|
80
80
|
event.preventDefault();
|
|
81
81
|
if (event.deltaY > 0) {
|
|
82
|
-
rootContext.invertWheelChange.value
|
|
82
|
+
rootContext.invertWheelChange.value
|
|
83
|
+
? rootContext.handleDecrease()
|
|
84
|
+
: rootContext.handleIncrease();
|
|
83
85
|
} else if (event.deltaY < 0) {
|
|
84
|
-
rootContext.invertWheelChange.value
|
|
86
|
+
rootContext.invertWheelChange.value
|
|
87
|
+
? rootContext.handleIncrease()
|
|
88
|
+
: rootContext.handleDecrease();
|
|
85
89
|
}
|
|
86
90
|
}
|
|
87
91
|
|
|
@@ -123,7 +123,9 @@ const isIncreaseDisabled = computed(() => {
|
|
|
123
123
|
// step and rounding to nearest — which overshoots (e.g. 18.98 + step 1 -> 19.98 -> 20 not 19).
|
|
124
124
|
function getNextValue(type: 'increase' | 'decrease', from: number, multiplier = 1): number {
|
|
125
125
|
const stepValue = step.value ?? 1;
|
|
126
|
-
const operator = type === 'increase'
|
|
126
|
+
const operator = type === 'increase'
|
|
127
|
+
? '+'
|
|
128
|
+
: '-';
|
|
127
129
|
let nextValue: number;
|
|
128
130
|
|
|
129
131
|
if (stepSnapping.value && !isNaN(stepValue)) {
|
|
@@ -134,8 +136,12 @@ function getNextValue(type: 'increase' | 'decrease', from: number, multiplier =
|
|
|
134
136
|
// Align to the grid line in the requested direction first…
|
|
135
137
|
// eslint-disable-next-line no-nested-ternary
|
|
136
138
|
const aligned = type === 'increase'
|
|
137
|
-
? (snapped > from
|
|
138
|
-
|
|
139
|
+
? (snapped > from
|
|
140
|
+
? snapped
|
|
141
|
+
: handleDecimalOperation('+', snapped, stepValue))
|
|
142
|
+
: (snapped < from
|
|
143
|
+
? snapped
|
|
144
|
+
: handleDecimalOperation('-', snapped, stepValue));
|
|
139
145
|
// …then apply any remaining steps for multi-step keys (PageUp/PageDown).
|
|
140
146
|
nextValue = multiplier > 1
|
|
141
147
|
? handleDecimalOperation(operator, aligned, stepValue * (multiplier - 1))
|
|
@@ -173,7 +179,9 @@ function handleChangingValue(type: 'increase' | 'decrease', multiplier = 1) {
|
|
|
173
179
|
const nextValue = getNextValue(type, currentInputValue, multiplier);
|
|
174
180
|
// An out-of-range value (e.g. typed with `allowInvalid`) would be clamped against the requested
|
|
175
181
|
// direction — ArrowUp above `max` would lower it. Do nothing instead, like HTML stepUp/stepDown.
|
|
176
|
-
if (type === 'increase'
|
|
182
|
+
if (type === 'increase'
|
|
183
|
+
? nextValue < currentInputValue
|
|
184
|
+
: nextValue > currentInputValue) {
|
|
177
185
|
return;
|
|
178
186
|
}
|
|
179
187
|
modelValue.value = nextValue;
|
|
@@ -210,7 +218,9 @@ const inputMode = computed<HTMLAttributes['inputmode']>(() => {
|
|
|
210
218
|
// Replace negative textValue formatted using currencySign: 'accounting'
|
|
211
219
|
// with a textValue that can be announced using a minus sign.
|
|
212
220
|
const textValueFormatter = useNumberFormatter(locale, formatOptions);
|
|
213
|
-
const textValue = computed(() => isNullish(modelValue.value) || isNaN(modelValue.value)
|
|
221
|
+
const textValue = computed(() => isNullish(modelValue.value) || isNaN(modelValue.value)
|
|
222
|
+
? ''
|
|
223
|
+
: textValueFormatter.format(modelValue.value));
|
|
214
224
|
|
|
215
225
|
function validate(val: string) {
|
|
216
226
|
// `allowInvalid` lets out-of-range values be typed, so the bounds are skipped here — they
|
package/src/NumberField/utils.ts
CHANGED
|
@@ -141,7 +141,9 @@ export function useNumberParser(locale: Ref<string>, options: Ref<Intl.NumberFor
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
export function handleDecimalOperation(operator: '-' | '+', value1: number, value2: number): number {
|
|
144
|
-
let result = operator === '+'
|
|
144
|
+
let result = operator === '+'
|
|
145
|
+
? value1 + value2
|
|
146
|
+
: value1 - value2;
|
|
145
147
|
|
|
146
148
|
// Check if we have decimals
|
|
147
149
|
if (value1 % 1 !== 0 || value2 % 1 !== 0) {
|
|
@@ -156,7 +158,9 @@ export function handleDecimalOperation(operator: '-' | '+', value1: number, valu
|
|
|
156
158
|
value2 = Math.round(value2 * multiplier);
|
|
157
159
|
|
|
158
160
|
// Perform the operation on integers values to make sure we don't get a fancy decimal value
|
|
159
|
-
result = operator === '+'
|
|
161
|
+
result = operator === '+'
|
|
162
|
+
? value1 + value2
|
|
163
|
+
: value1 - value2;
|
|
160
164
|
|
|
161
165
|
// Transform the integer result back to decimal
|
|
162
166
|
result /= multiplier;
|
package/src/Pagination/utils.ts
CHANGED
|
@@ -72,7 +72,13 @@ export function getRange(currentPage: number, pageCount: number, siblingCount: n
|
|
|
72
72
|
if (showLeftEllipsis && showRightEllipsis) {
|
|
73
73
|
const middleRange = range(leftSiblingIndex, rightSiblingIndex);
|
|
74
74
|
|
|
75
|
-
return [
|
|
75
|
+
return [
|
|
76
|
+
firstPageIndex,
|
|
77
|
+
ELLIPSIS,
|
|
78
|
+
...middleRange,
|
|
79
|
+
ELLIPSIS,
|
|
80
|
+
lastPageIndex,
|
|
81
|
+
];
|
|
76
82
|
}
|
|
77
83
|
|
|
78
84
|
const fullRange = range(firstPageIndex, lastPageIndex);
|
|
@@ -223,7 +223,9 @@ function handlePaste(event: ClipboardEvent) {
|
|
|
223
223
|
|
|
224
224
|
function handleMultipleCharacter(values: string) {
|
|
225
225
|
const tempModelValue = [...context.currentModelValue.value] as typeof context.currentModelValue.value;
|
|
226
|
-
const initialIndex = values.length >= inputElements.value.length
|
|
226
|
+
const initialIndex = values.length >= inputElements.value.length
|
|
227
|
+
? 0
|
|
228
|
+
: props.index;
|
|
227
229
|
const lastIndex = Math.min(initialIndex + values.length, inputElements.value.length);
|
|
228
230
|
for (let i = initialIndex; i < lastIndex; i++) {
|
|
229
231
|
const input = inputElements.value[i];
|
|
@@ -96,7 +96,9 @@ const modelValue = useVModel(props, 'modelValue', emits, {
|
|
|
96
96
|
deep: true,
|
|
97
97
|
}) as Ref<PinInputValue<Type>>;
|
|
98
98
|
|
|
99
|
-
const currentModelValue = computed(() => Array.isArray(modelValue.value)
|
|
99
|
+
const currentModelValue = computed(() => Array.isArray(modelValue.value)
|
|
100
|
+
? [...modelValue.value]
|
|
101
|
+
: []);
|
|
100
102
|
|
|
101
103
|
const inputElements = ref<Set<HTMLInputElement>>(new Set());
|
|
102
104
|
function onInputElementChange(el: HTMLInputElement) {
|
|
@@ -243,13 +243,21 @@ const { width: arrowWidth, height: arrowHeight } = useSize(arrow);
|
|
|
243
243
|
const desiredPlacement = computed(
|
|
244
244
|
() =>
|
|
245
245
|
(props.side
|
|
246
|
-
+ (props.align !== 'center'
|
|
246
|
+
+ (props.align !== 'center'
|
|
247
|
+
? `-${props.align}`
|
|
248
|
+
: '')) as Placement,
|
|
247
249
|
);
|
|
248
250
|
|
|
249
251
|
const collisionPadding = computed(() => {
|
|
250
252
|
return isNumber(props.collisionPadding)
|
|
251
253
|
? props.collisionPadding
|
|
252
|
-
: {
|
|
254
|
+
: {
|
|
255
|
+
top: 0,
|
|
256
|
+
right: 0,
|
|
257
|
+
bottom: 0,
|
|
258
|
+
left: 0,
|
|
259
|
+
...props.collisionPadding,
|
|
260
|
+
};
|
|
253
261
|
});
|
|
254
262
|
|
|
255
263
|
const boundary = computed(() => {
|
|
@@ -290,7 +298,9 @@ const computedMiddleware = computed(() => {
|
|
|
290
298
|
&& shift({
|
|
291
299
|
mainAxis: true,
|
|
292
300
|
crossAxis: !!props.prioritizePosition,
|
|
293
|
-
limiter: props.sticky === 'partial'
|
|
301
|
+
limiter: props.sticky === 'partial'
|
|
302
|
+
? limitShift()
|
|
303
|
+
: undefined,
|
|
294
304
|
...detectOverflowOptions.value,
|
|
295
305
|
}),
|
|
296
306
|
!props.prioritizePosition
|
package/src/Popper/utils.ts
CHANGED
|
@@ -29,9 +29,13 @@ export function transformOrigin(options: {
|
|
|
29
29
|
|
|
30
30
|
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
31
31
|
const noArrowAlignX = {
|
|
32
|
-
start: options.dir === 'rtl'
|
|
32
|
+
start: options.dir === 'rtl'
|
|
33
|
+
? '100%'
|
|
34
|
+
: '0%',
|
|
33
35
|
center: '50%',
|
|
34
|
-
end: options.dir === 'rtl'
|
|
36
|
+
end: options.dir === 'rtl'
|
|
37
|
+
? '0%'
|
|
38
|
+
: '100%',
|
|
35
39
|
}[placedAlign];
|
|
36
40
|
|
|
37
41
|
const noArrowAlignY = {
|
|
@@ -47,19 +51,29 @@ export function transformOrigin(options: {
|
|
|
47
51
|
let y = '';
|
|
48
52
|
|
|
49
53
|
if (placedSide === 'bottom') {
|
|
50
|
-
x = isArrowHidden
|
|
54
|
+
x = isArrowHidden
|
|
55
|
+
? noArrowAlignX
|
|
56
|
+
: `${arrowXCenter}px`;
|
|
51
57
|
y = `${-arrowHeight}px`;
|
|
52
58
|
} else if (placedSide === 'top') {
|
|
53
|
-
x = isArrowHidden
|
|
59
|
+
x = isArrowHidden
|
|
60
|
+
? noArrowAlignX
|
|
61
|
+
: `${arrowXCenter}px`;
|
|
54
62
|
y = `${rects.floating.height + arrowHeight}px`;
|
|
55
63
|
} else if (placedSide === 'right') {
|
|
56
64
|
x = `${-arrowHeight}px`;
|
|
57
|
-
y = isArrowHidden
|
|
65
|
+
y = isArrowHidden
|
|
66
|
+
? noArrowAlignY
|
|
67
|
+
: `${arrowYCenter}px`;
|
|
58
68
|
} else if (placedSide === 'left') {
|
|
59
69
|
x = `${rects.floating.width + arrowHeight}px`;
|
|
60
|
-
y = isArrowHidden
|
|
70
|
+
y = isArrowHidden
|
|
71
|
+
? noArrowAlignY
|
|
72
|
+
: `${arrowYCenter}px`;
|
|
61
73
|
}
|
|
62
|
-
return {
|
|
74
|
+
return {
|
|
75
|
+
data: { x, y },
|
|
76
|
+
};
|
|
63
77
|
},
|
|
64
78
|
};
|
|
65
79
|
}
|
|
@@ -96,7 +96,9 @@ export function usePresence(
|
|
|
96
96
|
const isCurrentAnimation = currentAnimationName.includes(
|
|
97
97
|
CSS.escape(event.animationName),
|
|
98
98
|
);
|
|
99
|
-
const directionName = state.value === 'mounted'
|
|
99
|
+
const directionName = state.value === 'mounted'
|
|
100
|
+
? 'enter'
|
|
101
|
+
: 'leave';
|
|
100
102
|
if (isCurrentAnimation) {
|
|
101
103
|
dispatchCustomEvent(`after-${directionName}`);
|
|
102
104
|
dispatch('ANIMATION_END');
|
|
@@ -154,7 +156,9 @@ export function usePresence(
|
|
|
154
156
|
const stateWatcher = watch(state, () => {
|
|
155
157
|
const currentAnimationName = getAnimationName(node.value);
|
|
156
158
|
prevAnimationNameRef.value
|
|
157
|
-
= state.value === 'mounted'
|
|
159
|
+
= state.value === 'mounted'
|
|
160
|
+
? currentAnimationName
|
|
161
|
+
: 'none';
|
|
158
162
|
});
|
|
159
163
|
|
|
160
164
|
onUnmounted(() => {
|
|
@@ -180,5 +184,7 @@ export function usePresence(
|
|
|
180
184
|
}
|
|
181
185
|
|
|
182
186
|
function getAnimationName(node?: HTMLElement) {
|
|
183
|
-
return node
|
|
187
|
+
return node
|
|
188
|
+
? getComputedStyle(node).animationName || 'none'
|
|
189
|
+
: 'none';
|
|
184
190
|
}
|
|
@@ -27,7 +27,7 @@ export interface PrimitiveProps {
|
|
|
27
27
|
/**
|
|
28
28
|
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
29
29
|
*
|
|
30
|
-
* Read our [Composition](https://
|
|
30
|
+
* Read our [Composition](https://vinicunca.dev/akar/guides/composition) guide for more details.
|
|
31
31
|
*/
|
|
32
32
|
asChild?: boolean;
|
|
33
33
|
/**
|