akar 2.0.23 → 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.map +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/DialogContent.cjs.map +1 -1
- package/dist/Dialog/DialogContent.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.map +1 -1
- package/dist/DismissableLayer/DismissableLayer.js.map +1 -1
- package/dist/DismissableLayer/context.cjs +1 -0
- package/dist/DismissableLayer/context.cjs.map +1 -1
- package/dist/DismissableLayer/context.js +1 -0
- 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.map +1 -1
- 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.map +1 -1
- 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/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/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/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/constant.d.ts.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.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index2.d.cts +2 -0
- package/dist/index2.d.cts.map +1 -1
- package/dist/index2.d.ts +2 -0
- package/dist/index2.d.ts.map +1 -1
- package/dist/index3.d.cts +721 -719
- package/dist/index3.d.cts.map +1 -1
- package/dist/index3.d.ts +711 -709
- package/dist/index3.d.ts.map +1 -1
- package/dist/internal.d.cts +2 -2
- package/dist/internal.d.cts.map +1 -1
- package/dist/internal.d.ts +2 -2
- package/dist/shared/bodyPointerEvents.cjs.map +1 -1
- package/dist/shared/bodyPointerEvents.js.map +1 -1
- 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.map +1 -1
- package/dist/shared/useBodyScrollLock.js.map +1 -1
- package/dist/shared/useCalendarKeyboardNavigation.cjs.map +1 -1
- 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/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 +10 -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 +3 -1
- 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 +9 -2
- 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 +3 -1
- 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 +3 -1
- 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/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/ToastRoot.vue +4 -1
- package/src/Toast/ToastRootImpl.vue +19 -5
- 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 +4 -1
- 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 +12 -4
- package/src/shared/useCalendarKeyboardNavigation.ts +30 -8
- 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
|
@@ -4,11 +4,11 @@ import type { PrimitiveProps } from '@/Primitive';
|
|
|
4
4
|
import type { FormFieldProps } from '@/shared/types';
|
|
5
5
|
import { createContext, useFormControl, useForwardExpose, useForwardScopeId } from '@/shared';
|
|
6
6
|
|
|
7
|
-
export interface SwitchRootProps<
|
|
7
|
+
export interface SwitchRootProps<TrueValue = boolean, FalseValue = TrueValue> extends PrimitiveProps, FormFieldProps {
|
|
8
8
|
/** The state of the switch when it is initially rendered. Use when you do not need to control its state. */
|
|
9
|
-
defaultValue?:
|
|
9
|
+
defaultValue?: NoInfer<TrueValue | FalseValue>;
|
|
10
10
|
/** The controlled state of the switch. Can be bind as `v-model`. */
|
|
11
|
-
modelValue?:
|
|
11
|
+
modelValue?: NoInfer<TrueValue | FalseValue> | null;
|
|
12
12
|
/** When `true`, prevents the user from interacting with the switch. */
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
id?: string;
|
|
@@ -17,16 +17,16 @@ export interface SwitchRootProps<T = boolean> extends PrimitiveProps, FormFieldP
|
|
|
17
17
|
/**
|
|
18
18
|
* The value used when the switch is on. Defaults to `true`.
|
|
19
19
|
*/
|
|
20
|
-
trueValue?:
|
|
20
|
+
trueValue?: TrueValue;
|
|
21
21
|
/**
|
|
22
22
|
* The value used when the switch is off. Defaults to `false`.
|
|
23
23
|
*/
|
|
24
|
-
falseValue?:
|
|
24
|
+
falseValue?: FalseValue;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export type SwitchRootEmits<
|
|
27
|
+
export type SwitchRootEmits<TrueValue = boolean, FalseValue = TrueValue> = {
|
|
28
28
|
/** Event handler called when the value of the switch changes. */
|
|
29
|
-
'update:modelValue': [payload:
|
|
29
|
+
'update:modelValue': [payload: TrueValue | FalseValue];
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
export interface SwitchRootContext {
|
|
@@ -39,7 +39,7 @@ export const [injectSwitchRootContext, provideSwitchRootContext]
|
|
|
39
39
|
= createContext<SwitchRootContext>('SwitchRoot');
|
|
40
40
|
</script>
|
|
41
41
|
|
|
42
|
-
<script setup lang="ts" generic="
|
|
42
|
+
<script setup lang="ts" generic="TrueValue = true, FalseValue = false">
|
|
43
43
|
import { useVModel } from '@vueuse/core';
|
|
44
44
|
import { computed, toRefs } from 'vue';
|
|
45
45
|
import { Primitive } from '@/Primitive';
|
|
@@ -50,7 +50,7 @@ defineOptions({
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
const props = withDefaults(
|
|
53
|
-
defineProps<SwitchRootProps<
|
|
53
|
+
defineProps<SwitchRootProps<TrueValue, FalseValue>>(),
|
|
54
54
|
{
|
|
55
55
|
as: 'button',
|
|
56
56
|
modelValue: undefined,
|
|
@@ -59,7 +59,7 @@ const props = withDefaults(
|
|
|
59
59
|
falseValue: (() => false) as unknown as undefined,
|
|
60
60
|
},
|
|
61
61
|
);
|
|
62
|
-
const emit = defineEmits<SwitchRootEmits<
|
|
62
|
+
const emit = defineEmits<SwitchRootEmits<TrueValue, FalseValue>>();
|
|
63
63
|
|
|
64
64
|
defineSlots<{
|
|
65
65
|
default?: (props: {
|
|
@@ -75,7 +75,7 @@ const { disabled } = toRefs(props);
|
|
|
75
75
|
const modelValue = useVModel(props as any, 'modelValue', emit as any, {
|
|
76
76
|
defaultValue: props.defaultValue ?? props.falseValue,
|
|
77
77
|
passive: (props.modelValue === undefined) as false,
|
|
78
|
-
}) as Ref<
|
|
78
|
+
}) as Ref<TrueValue | FalseValue>;
|
|
79
79
|
|
|
80
80
|
const checked = computed(() => modelValue.value === props.trueValue);
|
|
81
81
|
|
|
@@ -84,7 +84,7 @@ function toggleCheck() {
|
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
modelValue.value = checked.value ? props.falseValue as
|
|
87
|
+
modelValue.value = checked.value ? props.falseValue as FalseValue : props.trueValue as TrueValue;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
const { forwardRef, currentElement } = useForwardExpose();
|
|
@@ -92,7 +92,9 @@ const isFormControl = useFormControl(currentElement);
|
|
|
92
92
|
// Hidden form input is a sibling (not nested) of the control to avoid the
|
|
93
93
|
// `nested-interactive` a11y violation; forward the parent scope id for scoped styles.
|
|
94
94
|
const scopeIdAttrs = useForwardScopeId();
|
|
95
|
-
const ariaLabel = computed(() => props.id && currentElement.value
|
|
95
|
+
const ariaLabel = computed(() => props.id && currentElement.value
|
|
96
|
+
? (document.querySelector(`[for="${props.id}"]`) as HTMLLabelElement)?.innerText
|
|
97
|
+
: undefined);
|
|
96
98
|
|
|
97
99
|
provideSwitchRootContext({
|
|
98
100
|
checked,
|
package/src/Tabs/TabsTrigger.vue
CHANGED
|
@@ -27,7 +27,9 @@ const { forwardRef } = useForwardExpose();
|
|
|
27
27
|
const rootContext = injectTabsRootContext();
|
|
28
28
|
|
|
29
29
|
const triggerId = computed(() => makeTriggerId(rootContext.baseId, props.value));
|
|
30
|
-
const contentId = computed(() => rootContext.contentIds.value.has(props.value)
|
|
30
|
+
const contentId = computed(() => rootContext.contentIds.value.has(props.value)
|
|
31
|
+
? makeContentId(rootContext.baseId, props.value)
|
|
32
|
+
: undefined);
|
|
31
33
|
|
|
32
34
|
const isSelected = computed(() => props.value === rootContext.modelValue.value);
|
|
33
35
|
</script>
|
|
@@ -25,7 +25,9 @@ const disabled = computed(() => itemContext.disabled.value || props.disabled);
|
|
|
25
25
|
|
|
26
26
|
// Only the focused tag's button is tabbable, so Tab moves from a tag to its
|
|
27
27
|
// delete button and then out of the group, like React Aria.
|
|
28
|
-
const tabindex = computed(() => itemContext.isTabStop.value
|
|
28
|
+
const tabindex = computed(() => itemContext.isTabStop.value
|
|
29
|
+
? 0
|
|
30
|
+
: -1);
|
|
29
31
|
|
|
30
32
|
function handleClick(event: MouseEvent) {
|
|
31
33
|
// The tag itself toggles selection on click.
|
|
@@ -105,7 +105,9 @@ const fieldContext = injectFieldRootContext(null);
|
|
|
105
105
|
const disabled = computed(() => Boolean(props.disabled || fieldContext?.disabled.value));
|
|
106
106
|
|
|
107
107
|
const modelValue = useVModel(props, 'modelValue', emits, {
|
|
108
|
-
defaultValue: (props.defaultValue ?? (props.selectionMode === 'multiple'
|
|
108
|
+
defaultValue: (props.defaultValue ?? (props.selectionMode === 'multiple'
|
|
109
|
+
? []
|
|
110
|
+
: undefined)) as any,
|
|
109
111
|
passive: (props.modelValue === undefined) as false,
|
|
110
112
|
}) as Ref<T | Array<T> | undefined>;
|
|
111
113
|
|
|
@@ -114,7 +116,9 @@ const selectedValues = computed<Array<T>>(() => {
|
|
|
114
116
|
if (value === undefined || value === null) {
|
|
115
117
|
return [];
|
|
116
118
|
}
|
|
117
|
-
return Array.isArray(value)
|
|
119
|
+
return Array.isArray(value)
|
|
120
|
+
? value
|
|
121
|
+
: [value];
|
|
118
122
|
});
|
|
119
123
|
|
|
120
124
|
function isSelected(value: AcceptableValue) {
|
|
@@ -122,7 +126,9 @@ function isSelected(value: AcceptableValue) {
|
|
|
122
126
|
}
|
|
123
127
|
|
|
124
128
|
function setSelection(values: Array<T>) {
|
|
125
|
-
modelValue.value = selectionMode.value === 'multiple'
|
|
129
|
+
modelValue.value = selectionMode.value === 'multiple'
|
|
130
|
+
? values
|
|
131
|
+
: values[0];
|
|
126
132
|
}
|
|
127
133
|
|
|
128
134
|
function toggleSelection(value: AcceptableValue) {
|
|
@@ -137,7 +143,9 @@ function toggleSelection(value: AcceptableValue) {
|
|
|
137
143
|
}
|
|
138
144
|
setSelection(next);
|
|
139
145
|
} else {
|
|
140
|
-
setSelection(selectionMode.value === 'multiple'
|
|
146
|
+
setSelection(selectionMode.value === 'multiple'
|
|
147
|
+
? [...selectedValues.value, value as T]
|
|
148
|
+
: [value as T]);
|
|
141
149
|
}
|
|
142
150
|
}
|
|
143
151
|
|
|
@@ -167,9 +175,14 @@ function removeTags(value: AcceptableValue, withSelection: boolean) {
|
|
|
167
175
|
const items = shallowReactive(new Set<TagGroupItemRegistration>());
|
|
168
176
|
|
|
169
177
|
function getOrderedItems() {
|
|
170
|
-
return Array.from(items, (item) => ({
|
|
178
|
+
return Array.from(items, (item) => ({
|
|
179
|
+
...item,
|
|
180
|
+
el: item.element(),
|
|
181
|
+
}))
|
|
171
182
|
.filter((item): item is TagGroupItemRegistration & { el: HTMLElement } => !!item.el)
|
|
172
|
-
.sort((a, b) => a.el.compareDocumentPosition(b.el) & Node.DOCUMENT_POSITION_FOLLOWING
|
|
183
|
+
.sort((a, b) => a.el.compareDocumentPosition(b.el) & Node.DOCUMENT_POSITION_FOLLOWING
|
|
184
|
+
? -1
|
|
185
|
+
: 1);
|
|
173
186
|
}
|
|
174
187
|
|
|
175
188
|
function isDisabledValue(value: T) {
|
|
@@ -219,7 +232,12 @@ const { handleTypeaheadSearch } = useTypeahead();
|
|
|
219
232
|
function handleTypeahead(key: string) {
|
|
220
233
|
const candidates = getOrderedItems()
|
|
221
234
|
.filter((item) => !item.disabled())
|
|
222
|
-
.map((item) => ({
|
|
235
|
+
.map((item) => ({
|
|
236
|
+
ref: item.el,
|
|
237
|
+
value: {
|
|
238
|
+
textValue: item.textValue(),
|
|
239
|
+
},
|
|
240
|
+
}));
|
|
223
241
|
handleTypeaheadSearch(key, candidates);
|
|
224
242
|
}
|
|
225
243
|
|
|
@@ -108,7 +108,9 @@ const { getItems, CollectionSlot } = useCollection({ isProvider: true });
|
|
|
108
108
|
const selectedElement = ref<HTMLElement>();
|
|
109
109
|
const isInvalidInput = ref(false);
|
|
110
110
|
|
|
111
|
-
const currentModelValue = computed(() => Array.isArray(modelValue.value)
|
|
111
|
+
const currentModelValue = computed(() => Array.isArray(modelValue.value)
|
|
112
|
+
? [...modelValue.value]
|
|
113
|
+
: []);
|
|
112
114
|
|
|
113
115
|
function handleRemoveTag(index: number) {
|
|
114
116
|
if (index !== -1) {
|
|
@@ -130,7 +132,9 @@ provideTagsInputRootContext({
|
|
|
130
132
|
if ((modelValueIsObject || defaultValueIsObject) && !isFunction(props.convertValue)) {
|
|
131
133
|
throw new Error('You must provide a `convertValue` function when using objects as values.');
|
|
132
134
|
}
|
|
133
|
-
const payload = props.convertValue
|
|
135
|
+
const payload = props.convertValue
|
|
136
|
+
? props.convertValue(_payload)
|
|
137
|
+
: _payload as T;
|
|
134
138
|
|
|
135
139
|
if ((array.length >= max.value) && !!max.value) {
|
|
136
140
|
emits('invalid', payload);
|
|
@@ -177,9 +181,13 @@ provideTagsInputRootContext({
|
|
|
177
181
|
if (selectedElement.value) {
|
|
178
182
|
const index = collection.findIndex((i) => i === selectedElement.value);
|
|
179
183
|
const selectedItem = getItems().find((i) => i.ref === selectedElement.value);
|
|
180
|
-
const modelIndex = selectedItem
|
|
184
|
+
const modelIndex = selectedItem
|
|
185
|
+
? modelValue.value.findIndex((v) => isDeepEqual(v, selectedItem.value))
|
|
186
|
+
: -1;
|
|
181
187
|
handleRemoveTag(modelIndex);
|
|
182
|
-
selectedElement.value = selectedElement.value === lastTag
|
|
188
|
+
selectedElement.value = selectedElement.value === lastTag
|
|
189
|
+
? collection.at(index - 1)
|
|
190
|
+
: collection.at(index + 1);
|
|
183
191
|
event.preventDefault();
|
|
184
192
|
} else if (event.key === 'Backspace') {
|
|
185
193
|
selectedElement.value = lastTag;
|
|
@@ -136,8 +136,12 @@ const segmentElements = ref<Set<HTMLElement>>(new Set());
|
|
|
136
136
|
|
|
137
137
|
const step = computed(() => normalizeDateStep(props));
|
|
138
138
|
|
|
139
|
-
const convertedMinValue = computed(() => minValue.value
|
|
140
|
-
|
|
139
|
+
const convertedMinValue = computed(() => minValue.value
|
|
140
|
+
? convertValue(minValue.value)
|
|
141
|
+
: undefined);
|
|
142
|
+
const convertedMaxValue = computed(() => maxValue.value
|
|
143
|
+
? convertValue(maxValue.value)
|
|
144
|
+
: undefined);
|
|
141
145
|
|
|
142
146
|
onMounted(() => {
|
|
143
147
|
getTimeFieldSegmentElements(parentElement.value).forEach((item) => {
|
|
@@ -159,7 +163,9 @@ const convertedModelValue = computed({
|
|
|
159
163
|
},
|
|
160
164
|
set(newValue) {
|
|
161
165
|
if (newValue) {
|
|
162
|
-
modelValue.value = modelValue.value && 'day' in modelValue.value
|
|
166
|
+
modelValue.value = modelValue.value && 'day' in modelValue.value
|
|
167
|
+
? newValue
|
|
168
|
+
: new Time(newValue.hour, newValue.minute, newValue.second, modelValue.value?.millisecond);
|
|
163
169
|
} else {
|
|
164
170
|
modelValue.value = newValue;
|
|
165
171
|
}
|
|
@@ -183,7 +189,9 @@ const convertedPlaceholder = computed({
|
|
|
183
189
|
},
|
|
184
190
|
set(newValue) {
|
|
185
191
|
if (newValue) {
|
|
186
|
-
placeholder.value = 'day' in placeholder.value
|
|
192
|
+
placeholder.value = 'day' in placeholder.value
|
|
193
|
+
? newValue.copy()
|
|
194
|
+
: new Time(newValue.hour, newValue.minute, newValue.second, placeholder.value?.millisecond);
|
|
187
195
|
}
|
|
188
196
|
return newValue;
|
|
189
197
|
},
|
|
@@ -215,7 +223,11 @@ const isInvalid = computed(() => {
|
|
|
215
223
|
|
|
216
224
|
const initialSegments = initializeTimeSegmentValues(inferredGranularity.value);
|
|
217
225
|
|
|
218
|
-
const segmentValues = ref<SegmentValueObj>(modelValue.value
|
|
226
|
+
const segmentValues = ref<SegmentValueObj>(modelValue.value
|
|
227
|
+
? {
|
|
228
|
+
...syncTimeSegmentValues({ value: convertedModelValue.value, formatter }),
|
|
229
|
+
}
|
|
230
|
+
: { ...initialSegments });
|
|
219
231
|
|
|
220
232
|
const allSegmentContent = computed(() => createContent({
|
|
221
233
|
granularity: inferredGranularity.value,
|
|
@@ -238,8 +250,15 @@ const segmentContents = computed(() => {
|
|
|
238
250
|
const hour = segmentValues.value.hour;
|
|
239
251
|
if (hour !== null) {
|
|
240
252
|
// eslint-disable-next-line no-nested-ternary
|
|
241
|
-
const displayHour = hour === 0
|
|
242
|
-
|
|
253
|
+
const displayHour = hour === 0
|
|
254
|
+
? 12
|
|
255
|
+
: hour > 12
|
|
256
|
+
? hour - 12
|
|
257
|
+
: hour;
|
|
258
|
+
return {
|
|
259
|
+
...segment,
|
|
260
|
+
value: displayHour.toString(),
|
|
261
|
+
};
|
|
243
262
|
}
|
|
244
263
|
}
|
|
245
264
|
return segment;
|
|
@@ -273,7 +292,9 @@ watch(convertedModelValue, (_modelValue) => {
|
|
|
273
292
|
|
|
274
293
|
watch([convertedModelValue, locale], ([_modelValue]) => {
|
|
275
294
|
if (!isNullish(_modelValue)) {
|
|
276
|
-
segmentValues.value = {
|
|
295
|
+
segmentValues.value = {
|
|
296
|
+
...syncTimeSegmentValues({ value: _modelValue, formatter }),
|
|
297
|
+
};
|
|
277
298
|
} else if (Object.values(segmentValues.value).every((value) => value !== null) && isNullish(_modelValue)) {
|
|
278
299
|
// If segment has null value, means that user modified it, thus do not reset the segmentValues
|
|
279
300
|
segmentValues.value = { ...initialSegments };
|
|
@@ -42,7 +42,9 @@ const {
|
|
|
42
42
|
disabled: rootContext.disabled,
|
|
43
43
|
readonly: rootContext.readonly,
|
|
44
44
|
focusNext: rootContext.focusNext,
|
|
45
|
-
modelValue: props.type === 'start'
|
|
45
|
+
modelValue: props.type === 'start'
|
|
46
|
+
? rootContext.startValue
|
|
47
|
+
: rootContext.endValue,
|
|
46
48
|
});
|
|
47
49
|
|
|
48
50
|
const disabled = computed(() => rootContext.disabled.value);
|
|
@@ -139,8 +139,12 @@ const segmentElements = ref<Set<HTMLElement>>(new Set());
|
|
|
139
139
|
|
|
140
140
|
const step = computed(() => normalizeDateStep(props));
|
|
141
141
|
|
|
142
|
-
const convertedMinValue = computed(() => minValue.value
|
|
143
|
-
|
|
142
|
+
const convertedMinValue = computed(() => minValue.value
|
|
143
|
+
? convertValue(minValue.value)
|
|
144
|
+
: undefined);
|
|
145
|
+
const convertedMaxValue = computed(() => maxValue.value
|
|
146
|
+
? convertValue(maxValue.value)
|
|
147
|
+
: undefined);
|
|
144
148
|
|
|
145
149
|
onMounted(() => {
|
|
146
150
|
getTimeFieldSegmentElements(parentElement.value).forEach((item) => {
|
|
@@ -233,7 +237,10 @@ const startValue = ref(modelValue.value?.start?.copy()) as Ref<TimeValue | undef
|
|
|
233
237
|
const endValue = ref(modelValue.value?.end?.copy()) as Ref<TimeValue | undefined>;
|
|
234
238
|
|
|
235
239
|
watch([startValue, endValue], ([_startValue, _endValue]) => {
|
|
236
|
-
modelValue.value = {
|
|
240
|
+
modelValue.value = {
|
|
241
|
+
start: _startValue?.copy(),
|
|
242
|
+
end: _endValue?.copy(),
|
|
243
|
+
};
|
|
237
244
|
});
|
|
238
245
|
|
|
239
246
|
const convertedStartValue = computed({
|
|
@@ -245,7 +252,9 @@ const convertedStartValue = computed({
|
|
|
245
252
|
},
|
|
246
253
|
set(newValue) {
|
|
247
254
|
if (newValue) {
|
|
248
|
-
startValue.value = startValue.value && 'day' in startValue.value
|
|
255
|
+
startValue.value = startValue.value && 'day' in startValue.value
|
|
256
|
+
? newValue
|
|
257
|
+
: new Time(newValue.hour, newValue.minute, newValue.second, startValue.value?.millisecond);
|
|
249
258
|
} else {
|
|
250
259
|
startValue.value = newValue;
|
|
251
260
|
}
|
|
@@ -262,7 +271,9 @@ const convertedEndValue = computed({
|
|
|
262
271
|
},
|
|
263
272
|
set(newValue) {
|
|
264
273
|
if (newValue) {
|
|
265
|
-
endValue.value = endValue.value && 'day' in endValue.value
|
|
274
|
+
endValue.value = endValue.value && 'day' in endValue.value
|
|
275
|
+
? newValue
|
|
276
|
+
: new Time(newValue.hour, newValue.minute, newValue.second, endValue.value?.millisecond);
|
|
266
277
|
} else {
|
|
267
278
|
endValue.value = newValue;
|
|
268
279
|
}
|
|
@@ -288,7 +299,9 @@ const convertedPlaceholder = computed({
|
|
|
288
299
|
},
|
|
289
300
|
set(newValue) {
|
|
290
301
|
if (newValue) {
|
|
291
|
-
placeholder.value = 'day' in placeholder.value
|
|
302
|
+
placeholder.value = 'day' in placeholder.value
|
|
303
|
+
? newValue.copy()
|
|
304
|
+
: new Time(newValue.hour, newValue.minute, newValue.second, placeholder.value?.millisecond);
|
|
292
305
|
}
|
|
293
306
|
return newValue;
|
|
294
307
|
},
|
|
@@ -304,8 +317,16 @@ const inferredGranularity = computed(() => {
|
|
|
304
317
|
|
|
305
318
|
const initialSegments = initializeTimeSegmentValues(inferredGranularity.value);
|
|
306
319
|
|
|
307
|
-
const startSegmentValues = ref<SegmentValueObj>(convertedStartValue.value
|
|
308
|
-
|
|
320
|
+
const startSegmentValues = ref<SegmentValueObj>(convertedStartValue.value
|
|
321
|
+
? {
|
|
322
|
+
...syncTimeSegmentValues({ value: convertedStartValue.value, formatter }),
|
|
323
|
+
}
|
|
324
|
+
: { ...initialSegments });
|
|
325
|
+
const endSegmentValues = ref<SegmentValueObj>(convertedEndValue.value
|
|
326
|
+
? {
|
|
327
|
+
...syncTimeSegmentValues({ value: convertedEndValue.value, formatter }),
|
|
328
|
+
}
|
|
329
|
+
: { ...initialSegments });
|
|
309
330
|
|
|
310
331
|
const startSegmentContent = computed(() => createContent({
|
|
311
332
|
granularity: inferredGranularity.value,
|
|
@@ -334,7 +355,10 @@ const segmentContents = computed(() => ({
|
|
|
334
355
|
end: endSegmentContent.value.arr,
|
|
335
356
|
}));
|
|
336
357
|
|
|
337
|
-
const editableSegmentContents = computed(() => ({
|
|
358
|
+
const editableSegmentContents = computed(() => ({
|
|
359
|
+
start: segmentContents.value.start.filter(({ part }) => part !== 'literal'),
|
|
360
|
+
end: segmentContents.value.end.filter(({ part }) => part !== 'literal'),
|
|
361
|
+
}));
|
|
338
362
|
|
|
339
363
|
watch(modelValue, (_modelValue) => {
|
|
340
364
|
const isStartChanged = _modelValue?.start && startValue.value
|
|
@@ -354,7 +378,9 @@ watch(modelValue, (_modelValue) => {
|
|
|
354
378
|
|
|
355
379
|
watch([convertedStartValue, locale], ([_startValue]) => {
|
|
356
380
|
if (_startValue !== undefined) {
|
|
357
|
-
startSegmentValues.value = {
|
|
381
|
+
startSegmentValues.value = {
|
|
382
|
+
...syncSegmentValues({ value: _startValue, formatter }),
|
|
383
|
+
};
|
|
358
384
|
} else if (Object.values(startSegmentValues.value).every((value) => value !== null) && _startValue === undefined) {
|
|
359
385
|
// If segment has null value, means that user modified it, thus do not reset the segmentValues
|
|
360
386
|
startSegmentValues.value = { ...initialSegments };
|
|
@@ -383,7 +409,9 @@ watch(convertedModelValue, (_modelValue) => {
|
|
|
383
409
|
|
|
384
410
|
watch([convertedEndValue, locale], ([_endValue]) => {
|
|
385
411
|
if (_endValue !== undefined) {
|
|
386
|
-
endSegmentValues.value = {
|
|
412
|
+
endSegmentValues.value = {
|
|
413
|
+
...syncSegmentValues({ value: _endValue, formatter }),
|
|
414
|
+
};
|
|
387
415
|
} else if (Object.values(endSegmentValues.value).every((value) => value !== null) && _endValue === undefined) {
|
|
388
416
|
// If segment has null value, means that user modified it, thus do not reset the segmentValues
|
|
389
417
|
endSegmentValues.value = { ...initialSegments };
|
package/src/Toast/ToastRoot.vue
CHANGED
|
@@ -72,7 +72,10 @@ function close() {
|
|
|
72
72
|
// A managed toast leaves the list once it is closed and its exit animation has
|
|
73
73
|
// unmounted the content (or it closed before the content ever mounted).
|
|
74
74
|
const isContentMounted = ref(false);
|
|
75
|
-
watch([
|
|
75
|
+
watch([
|
|
76
|
+
() => props.toast,
|
|
77
|
+
isContentMounted,
|
|
78
|
+
], ([toast, mounted]) => {
|
|
76
79
|
if (toast && !toast.open && !mounted) {
|
|
77
80
|
providerContext.toastStore.remove(toast.id);
|
|
78
81
|
}
|
|
@@ -133,8 +133,13 @@ const positionerContext = injectToastPositionerContext(null);
|
|
|
133
133
|
// Read after the DOM updates, and again when a managed toast changes, so that an
|
|
134
134
|
// updated toast (e.g. a promise going from loading to success) is announced again.
|
|
135
135
|
const announceTextContent = shallowRef<Array<string> | null>(null);
|
|
136
|
-
watch([
|
|
137
|
-
|
|
136
|
+
watch([
|
|
137
|
+
currentElement,
|
|
138
|
+
() => props.toast?.updateKey,
|
|
139
|
+
], ([element]) => {
|
|
140
|
+
announceTextContent.value = element
|
|
141
|
+
? getAnnounceTextContent(element)
|
|
142
|
+
: null;
|
|
138
143
|
}, { flush: 'post', immediate: true });
|
|
139
144
|
|
|
140
145
|
const stackEntry = reactive({ seq: 0, height: 0, open: props.open });
|
|
@@ -194,8 +199,14 @@ watchEffect((cleanupFn) => {
|
|
|
194
199
|
// start timer when toast opens or duration changes.
|
|
195
200
|
// we include `open` in deps because closed !== unmounted when animating
|
|
196
201
|
// so it could reopen before being completely unmounted
|
|
197
|
-
const restartKey = computed(() => props.toast
|
|
198
|
-
|
|
202
|
+
const restartKey = computed(() => props.toast
|
|
203
|
+
? providerContext.toastStore.getRestartKey(props.toast.id)
|
|
204
|
+
: 0);
|
|
205
|
+
watch([
|
|
206
|
+
() => props.open,
|
|
207
|
+
duration,
|
|
208
|
+
restartKey,
|
|
209
|
+
], () => {
|
|
199
210
|
// Reset the timer when the toast is rerendered with the new duration
|
|
200
211
|
closeTimerRemainingTimeRef.value = duration.value;
|
|
201
212
|
|
|
@@ -223,7 +234,10 @@ onUnmounted(() => {
|
|
|
223
234
|
unregisterToast?.();
|
|
224
235
|
});
|
|
225
236
|
|
|
226
|
-
provideToastRootContext({
|
|
237
|
+
provideToastRootContext({
|
|
238
|
+
onClose: handleClose,
|
|
239
|
+
toast: toRef(props, 'toast'),
|
|
240
|
+
});
|
|
227
241
|
</script>
|
|
228
242
|
|
|
229
243
|
<template>
|
|
@@ -184,13 +184,18 @@ watchEffect((cleanupFn) => {
|
|
|
184
184
|
function getSortedTabbableCandidates({ tabbingDirection }: { tabbingDirection: 'forwards' | 'backwards' }) {
|
|
185
185
|
const toastItems = getItems().map((i) => i.ref);
|
|
186
186
|
const tabbableCandidates = toastItems.map((toastNode) => {
|
|
187
|
-
const toastTabbableCandidates = [
|
|
187
|
+
const toastTabbableCandidates = [
|
|
188
|
+
toastNode,
|
|
189
|
+
...getTabbableCandidates(toastNode),
|
|
190
|
+
];
|
|
188
191
|
return tabbingDirection === 'forwards'
|
|
189
192
|
? toastTabbableCandidates
|
|
190
193
|
: toastTabbableCandidates.reverse();
|
|
191
194
|
});
|
|
192
195
|
return (
|
|
193
|
-
tabbingDirection === 'forwards'
|
|
196
|
+
tabbingDirection === 'forwards'
|
|
197
|
+
? tabbableCandidates.reverse()
|
|
198
|
+
: tabbableCandidates
|
|
194
199
|
).flat();
|
|
195
200
|
}
|
|
196
201
|
</script>
|
|
@@ -128,8 +128,12 @@ function resolvePromiseState<Value, Data extends object>(
|
|
|
128
128
|
state: ToastPromiseState<Value, Data>,
|
|
129
129
|
value?: Value,
|
|
130
130
|
): ToastUpdateOptions<Data> {
|
|
131
|
-
const resolved = typeof state === 'function'
|
|
132
|
-
|
|
131
|
+
const resolved = typeof state === 'function'
|
|
132
|
+
? state(value as Value)
|
|
133
|
+
: state;
|
|
134
|
+
return typeof resolved === 'string'
|
|
135
|
+
? { description: resolved }
|
|
136
|
+
: resolved;
|
|
133
137
|
}
|
|
134
138
|
|
|
135
139
|
export function runToastPromise<Value, Data extends object>(
|
|
@@ -138,16 +142,24 @@ export function runToastPromise<Value, Data extends object>(
|
|
|
138
142
|
add: ToastManager<Data>['add'],
|
|
139
143
|
update: ToastManager<Data>['update'],
|
|
140
144
|
): Promise<Value> {
|
|
141
|
-
const loading = typeof options.loading === 'string'
|
|
145
|
+
const loading = typeof options.loading === 'string'
|
|
146
|
+
? { description: options.loading }
|
|
147
|
+
: options.loading;
|
|
142
148
|
const id = add({ ...loading, status: 'loading' });
|
|
143
149
|
|
|
144
150
|
return promise.then(
|
|
145
151
|
(value) => {
|
|
146
|
-
update(id, {
|
|
152
|
+
update(id, {
|
|
153
|
+
...resolvePromiseState(options.success, value),
|
|
154
|
+
status: 'success',
|
|
155
|
+
});
|
|
147
156
|
return value;
|
|
148
157
|
},
|
|
149
158
|
(error) => {
|
|
150
|
-
update(id, {
|
|
159
|
+
update(id, {
|
|
160
|
+
...resolvePromiseState(options.error, error),
|
|
161
|
+
status: 'error',
|
|
162
|
+
});
|
|
151
163
|
throw error;
|
|
152
164
|
},
|
|
153
165
|
);
|
|
@@ -178,7 +190,10 @@ export function createToastManager<Data extends object = any>(): GlobalToastMana
|
|
|
178
190
|
const manager: ToastManager<Data> = {
|
|
179
191
|
add(options) {
|
|
180
192
|
const id = options.id ?? generateToastId();
|
|
181
|
-
emit({
|
|
193
|
+
emit({
|
|
194
|
+
action: 'add',
|
|
195
|
+
options: { ...options, id },
|
|
196
|
+
});
|
|
182
197
|
return id;
|
|
183
198
|
},
|
|
184
199
|
close(id) {
|
|
@@ -21,7 +21,9 @@ export function useToastStore(): ToastStore {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function replace(id: string, next: ToastObject) {
|
|
24
|
-
toasts.value = toasts.value.map((toast) => toast.id === id
|
|
24
|
+
toasts.value = toasts.value.map((toast) => toast.id === id
|
|
25
|
+
? next
|
|
26
|
+
: toast);
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
function remove(id: string) {
|
|
@@ -41,14 +43,28 @@ export function useToastStore(): ToastStore {
|
|
|
41
43
|
|
|
42
44
|
if (existing?.open) {
|
|
43
45
|
const { id: _id, ...updates } = options;
|
|
44
|
-
replace(id, {
|
|
46
|
+
replace(id, {
|
|
47
|
+
...existing,
|
|
48
|
+
...updates,
|
|
49
|
+
updateKey: existing.updateKey + 1,
|
|
50
|
+
});
|
|
45
51
|
restartKeys.set(id, (restartKeys.get(id) ?? 0) + 1);
|
|
46
52
|
return id;
|
|
47
53
|
}
|
|
48
54
|
|
|
49
55
|
// A closing toast that is added again starts a new lifecycle at the front of the list.
|
|
50
|
-
const rest = existing
|
|
51
|
-
|
|
56
|
+
const rest = existing
|
|
57
|
+
? toasts.value.filter((toast) => toast.id !== id)
|
|
58
|
+
: toasts.value;
|
|
59
|
+
toasts.value = [
|
|
60
|
+
{
|
|
61
|
+
...options,
|
|
62
|
+
id,
|
|
63
|
+
open: true,
|
|
64
|
+
updateKey: 0,
|
|
65
|
+
},
|
|
66
|
+
...rest,
|
|
67
|
+
];
|
|
52
68
|
return id;
|
|
53
69
|
}
|
|
54
70
|
|
|
@@ -58,8 +74,12 @@ export function useToastStore(): ToastStore {
|
|
|
58
74
|
return;
|
|
59
75
|
}
|
|
60
76
|
|
|
61
|
-
toasts.value = toasts.value.map((toast) => closing.includes(toast)
|
|
62
|
-
|
|
77
|
+
toasts.value = toasts.value.map((toast) => closing.includes(toast)
|
|
78
|
+
? { ...toast, open: false }
|
|
79
|
+
: toast);
|
|
80
|
+
closing.forEach((toast) => {
|
|
81
|
+
toast.onClose?.();
|
|
82
|
+
});
|
|
63
83
|
}
|
|
64
84
|
|
|
65
85
|
function update(id: string, updates: ToastUpdateOptions | ((prevToast: ToastObject) => ToastUpdateOptions)) {
|
|
@@ -69,13 +89,21 @@ export function useToastStore(): ToastStore {
|
|
|
69
89
|
return;
|
|
70
90
|
}
|
|
71
91
|
|
|
72
|
-
const patch = typeof updates === 'function'
|
|
92
|
+
const patch = typeof updates === 'function'
|
|
93
|
+
? updates(prevToast)
|
|
94
|
+
: updates;
|
|
73
95
|
const current = find(id);
|
|
74
96
|
if (!current?.open) {
|
|
75
97
|
return;
|
|
76
98
|
}
|
|
77
99
|
|
|
78
|
-
replace(id, {
|
|
100
|
+
replace(id, {
|
|
101
|
+
...current,
|
|
102
|
+
...patch,
|
|
103
|
+
id,
|
|
104
|
+
open: true,
|
|
105
|
+
updateKey: current.updateKey + 1,
|
|
106
|
+
});
|
|
79
107
|
}
|
|
80
108
|
|
|
81
109
|
return {
|
package/src/Tree/TreeItem.vue
CHANGED
|
@@ -162,7 +162,12 @@ async function handleSelectCustomEvent(ev?: PointerEvent | KeyboardEvent) {
|
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
const eventDetail = {
|
|
165
|
+
const eventDetail = {
|
|
166
|
+
originalEvent: ev,
|
|
167
|
+
value: props.value,
|
|
168
|
+
isExpanded: isExpanded.value,
|
|
169
|
+
isSelected: isSelected.value,
|
|
170
|
+
};
|
|
166
171
|
handleAndDispatchCustomEvent(TREE_SELECT, handleSelect, eventDetail);
|
|
167
172
|
}
|
|
168
173
|
|
|
@@ -171,7 +176,12 @@ async function handleToggleCustomEvent(ev?: PointerEvent | KeyboardEvent) {
|
|
|
171
176
|
return;
|
|
172
177
|
}
|
|
173
178
|
|
|
174
|
-
const eventDetail = {
|
|
179
|
+
const eventDetail = {
|
|
180
|
+
originalEvent: ev,
|
|
181
|
+
value: props.value,
|
|
182
|
+
isExpanded: isExpanded.value,
|
|
183
|
+
isSelected: isSelected.value,
|
|
184
|
+
};
|
|
175
185
|
handleAndDispatchCustomEvent(TREE_TOGGLE, handleToggle, eventDetail);
|
|
176
186
|
}
|
|
177
187
|
|