reka-ui 2.9.3 → 2.9.4
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/dist/Accordion/AccordionItem.js +1 -1
- package/dist/Accordion/AccordionRoot.js +1 -1
- package/dist/AlertDialog/AlertDialogContent.js +1 -1
- package/dist/Autocomplete/AutocompleteRoot.js +1 -1
- package/dist/Avatar/AvatarRoot.js +1 -1
- package/dist/Calendar/CalendarRoot.cjs +1 -1
- package/dist/Calendar/CalendarRoot.cjs.map +1 -1
- package/dist/Calendar/CalendarRoot.js +2 -2
- package/dist/Calendar/CalendarRoot.js.map +1 -1
- package/dist/Calendar/useCalendar.cjs +2 -2
- package/dist/Calendar/useCalendar.cjs.map +1 -1
- package/dist/Calendar/useCalendar.js +2 -2
- package/dist/Calendar/useCalendar.js.map +1 -1
- package/dist/Checkbox/CheckboxGroupRoot.js +1 -1
- package/dist/Checkbox/CheckboxRoot.js +1 -1
- package/dist/Collapsible/CollapsibleRoot.js +1 -1
- package/dist/Collection/Collection.js +2 -2
- package/dist/ColorArea/ColorAreaRoot.js +1 -1
- package/dist/ColorField/ColorFieldInput.cjs +2 -1
- package/dist/ColorField/ColorFieldInput.cjs.map +1 -1
- package/dist/ColorField/ColorFieldInput.js +2 -1
- package/dist/ColorField/ColorFieldInput.js.map +1 -1
- package/dist/ColorField/ColorFieldRoot.js +1 -1
- package/dist/ColorSlider/ColorSliderRoot.js +1 -1
- package/dist/ColorSwatchPicker/ColorSwatchPickerItem.js +1 -1
- package/dist/Combobox/ComboboxContentImpl.js +1 -1
- package/dist/Combobox/ComboboxGroup.js +1 -1
- package/dist/Combobox/ComboboxRoot.js +1 -1
- package/dist/ConfigProvider/ConfigProvider.js +1 -1
- package/dist/ContextMenu/ContextMenuRoot.js +1 -1
- package/dist/ContextMenu/ContextMenuTrigger.cjs +1 -1
- package/dist/ContextMenu/ContextMenuTrigger.cjs.map +1 -1
- package/dist/ContextMenu/ContextMenuTrigger.js +1 -1
- package/dist/ContextMenu/ContextMenuTrigger.js.map +1 -1
- package/dist/DateField/DateFieldRoot.cjs +9 -4
- package/dist/DateField/DateFieldRoot.cjs.map +1 -1
- package/dist/DateField/DateFieldRoot.js +11 -6
- package/dist/DateField/DateFieldRoot.js.map +1 -1
- package/dist/DatePicker/DatePickerRoot.js +1 -1
- package/dist/DateRangeField/DateRangeFieldRoot.js +1 -1
- package/dist/DateRangePicker/DateRangePickerRoot.js +1 -1
- package/dist/Dialog/DialogRoot.js +1 -1
- package/dist/DismissableLayer/DismissableLayer.js +1 -1
- package/dist/DropdownMenu/DropdownMenuRoot.js +1 -1
- package/dist/DropdownMenu/DropdownMenuTrigger.cjs.map +1 -1
- package/dist/DropdownMenu/DropdownMenuTrigger.js.map +1 -1
- package/dist/Editable/EditableRoot.js +1 -1
- package/dist/FocusScope/FocusScope.js +1 -1
- package/dist/HoverCard/HoverCardRoot.js +1 -1
- package/dist/Label/Label.cjs.map +1 -1
- package/dist/Label/Label.js.map +1 -1
- package/dist/Listbox/ListboxContent.cjs.map +1 -1
- package/dist/Listbox/ListboxContent.js.map +1 -1
- package/dist/Listbox/ListboxGroup.js +1 -1
- package/dist/Listbox/ListboxItem.js +1 -1
- package/dist/Listbox/ListboxRoot.js +1 -1
- package/dist/Listbox/ListboxVirtualizer.cjs +3 -3
- package/dist/Listbox/ListboxVirtualizer.cjs.map +1 -1
- package/dist/Listbox/ListboxVirtualizer.js +3 -3
- package/dist/Listbox/ListboxVirtualizer.js.map +1 -1
- package/dist/Menu/MenuContentImpl.js +1 -1
- package/dist/Menu/MenuGroup.js +1 -1
- package/dist/Menu/MenuItem.cjs +1 -1
- package/dist/Menu/MenuItem.cjs.map +1 -1
- package/dist/Menu/MenuItem.js +1 -1
- package/dist/Menu/MenuItem.js.map +1 -1
- package/dist/Menu/MenuItemImpl.cjs.map +1 -1
- package/dist/Menu/MenuItemImpl.js.map +1 -1
- package/dist/Menu/MenuItemIndicator.js +1 -1
- package/dist/Menu/MenuRadioGroup.js +1 -1
- package/dist/Menu/MenuRoot.js +2 -2
- package/dist/Menu/MenuSub.js +1 -1
- package/dist/Menu/MenuSubTrigger.cjs +2 -1
- package/dist/Menu/MenuSubTrigger.cjs.map +1 -1
- package/dist/Menu/MenuSubTrigger.js +2 -1
- package/dist/Menu/MenuSubTrigger.js.map +1 -1
- package/dist/Menubar/MenubarMenu.js +1 -1
- package/dist/Menubar/MenubarRoot.js +1 -1
- package/dist/Menubar/MenubarTrigger.cjs.map +1 -1
- package/dist/Menubar/MenubarTrigger.js.map +1 -1
- package/dist/MonthPicker/MonthPickerRoot.cjs +1 -1
- package/dist/MonthPicker/MonthPickerRoot.cjs.map +1 -1
- package/dist/MonthPicker/MonthPickerRoot.js +2 -2
- package/dist/MonthPicker/MonthPickerRoot.js.map +1 -1
- package/dist/MonthRangePicker/MonthRangePickerRoot.js +1 -1
- package/dist/NavigationMenu/NavigationMenuItem.js +1 -1
- package/dist/NavigationMenu/NavigationMenuRoot.js +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.cjs +1 -0
- package/dist/NavigationMenu/NavigationMenuTrigger.cjs.map +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.js +1 -0
- package/dist/NavigationMenu/NavigationMenuTrigger.js.map +1 -1
- package/dist/NumberField/NumberFieldRoot.js +1 -1
- package/dist/Pagination/PaginationRoot.js +1 -1
- package/dist/PinInput/PinInputRoot.js +1 -1
- package/dist/Popover/PopoverRoot.js +1 -1
- package/dist/Popper/PopperArrow.cjs +1 -1
- package/dist/Popper/PopperArrow.cjs.map +1 -1
- package/dist/Popper/PopperArrow.js +1 -1
- package/dist/Popper/PopperArrow.js.map +1 -1
- package/dist/Popper/PopperContent.js +1 -1
- package/dist/Popper/PopperRoot.js +1 -1
- package/dist/Presence/Presence.js +1 -1
- package/dist/Primitive/Primitive.js +1 -1
- package/dist/Primitive/Slot.js +1 -1
- package/dist/Progress/ProgressRoot.js +1 -1
- package/dist/RadioGroup/RadioGroupItem.js +1 -1
- package/dist/RadioGroup/RadioGroupRoot.js +1 -1
- package/dist/RangeCalendar/RangeCalendarRoot.js +1 -1
- package/dist/RovingFocus/RovingFocusGroup.js +1 -1
- package/dist/RovingFocus/RovingFocusItem.cjs.map +1 -1
- package/dist/RovingFocus/RovingFocusItem.js.map +1 -1
- package/dist/ScrollArea/ScrollAreaRoot.js +1 -1
- package/dist/ScrollArea/ScrollAreaScrollbar.js +1 -1
- package/dist/ScrollArea/ScrollAreaScrollbarGlimpse.cjs +2 -2
- package/dist/ScrollArea/ScrollAreaScrollbarGlimpse.cjs.map +1 -1
- package/dist/ScrollArea/ScrollAreaScrollbarGlimpse.js +2 -2
- package/dist/ScrollArea/ScrollAreaScrollbarGlimpse.js.map +1 -1
- package/dist/ScrollArea/ScrollAreaScrollbarScroll.cjs +1 -1
- package/dist/ScrollArea/ScrollAreaScrollbarScroll.cjs.map +1 -1
- package/dist/ScrollArea/ScrollAreaScrollbarScroll.js +1 -1
- package/dist/ScrollArea/ScrollAreaScrollbarScroll.js.map +1 -1
- package/dist/ScrollArea/ScrollAreaScrollbarVisible.js +1 -1
- package/dist/Select/SelectContentImpl.cjs +1 -0
- package/dist/Select/SelectContentImpl.cjs.map +1 -1
- package/dist/Select/SelectContentImpl.js +2 -1
- package/dist/Select/SelectContentImpl.js.map +1 -1
- package/dist/Select/SelectGroup.js +1 -1
- package/dist/Select/SelectItem.cjs.map +1 -1
- package/dist/Select/SelectItem.js +1 -1
- package/dist/Select/SelectItem.js.map +1 -1
- package/dist/Select/SelectItemAlignedPosition.cjs +1 -1
- package/dist/Select/SelectItemAlignedPosition.cjs.map +1 -1
- package/dist/Select/SelectItemAlignedPosition.js +2 -2
- package/dist/Select/SelectItemAlignedPosition.js.map +1 -1
- package/dist/Select/SelectRoot.cjs +1 -1
- package/dist/Select/SelectRoot.cjs.map +1 -1
- package/dist/Select/SelectRoot.js +2 -2
- package/dist/Select/SelectRoot.js.map +1 -1
- package/dist/Select/SelectTrigger.cjs.map +1 -1
- package/dist/Select/SelectTrigger.js.map +1 -1
- package/dist/Slider/SliderImpl.cjs.map +1 -1
- package/dist/Slider/SliderImpl.js.map +1 -1
- package/dist/Slider/SliderRoot.js +1 -1
- package/dist/Slider/utils.js +1 -1
- package/dist/Splitter/SplitterGroup.js +1 -1
- package/dist/Stepper/StepperItem.js +1 -1
- package/dist/Stepper/StepperRoot.js +1 -1
- package/dist/Switch/SwitchRoot.js +1 -1
- package/dist/Tabs/TabsRoot.js +1 -1
- package/dist/Tabs/TabsTrigger.cjs.map +1 -1
- package/dist/Tabs/TabsTrigger.js.map +1 -1
- package/dist/TagsInput/TagsInputItem.js +1 -1
- package/dist/TagsInput/TagsInputRoot.js +1 -1
- package/dist/TimeField/TimeFieldRoot.js +1 -1
- package/dist/TimeRangeField/TimeRangeFieldRoot.js +1 -1
- package/dist/Toast/ToastProvider.js +1 -1
- package/dist/Toast/ToastRootImpl.cjs +3 -3
- package/dist/Toast/ToastRootImpl.cjs.map +1 -1
- package/dist/Toast/ToastRootImpl.js +4 -4
- package/dist/Toast/ToastRootImpl.js.map +1 -1
- package/dist/Toast/ToastViewport.cjs +5 -1
- package/dist/Toast/ToastViewport.cjs.map +1 -1
- package/dist/Toast/ToastViewport.js +5 -1
- package/dist/Toast/ToastViewport.js.map +1 -1
- package/dist/ToggleGroup/ToggleGroupRoot.js +1 -1
- package/dist/Toolbar/ToolbarRoot.js +1 -1
- package/dist/Tooltip/TooltipProvider.js +1 -1
- package/dist/Tooltip/TooltipRoot.js +1 -1
- package/dist/Tree/TreeItem.cjs.map +1 -1
- package/dist/Tree/TreeItem.js.map +1 -1
- package/dist/Tree/TreeRoot.js +1 -1
- package/dist/Tree/TreeVirtualizer.cjs +1 -1
- package/dist/Tree/TreeVirtualizer.cjs.map +1 -1
- package/dist/Tree/TreeVirtualizer.js +1 -1
- package/dist/Tree/TreeVirtualizer.js.map +1 -1
- package/dist/YearPicker/YearPickerRoot.cjs +1 -1
- package/dist/YearPicker/YearPickerRoot.cjs.map +1 -1
- package/dist/YearPicker/YearPickerRoot.js +2 -2
- package/dist/YearPicker/YearPickerRoot.js.map +1 -1
- package/dist/YearPicker/useYearPicker.cjs +3 -3
- package/dist/YearPicker/useYearPicker.cjs.map +1 -1
- package/dist/YearPicker/useYearPicker.js +3 -3
- package/dist/YearPicker/useYearPicker.js.map +1 -1
- package/dist/YearRangePicker/YearRangePickerRoot.js +1 -1
- package/dist/color/parse.cjs +10 -4
- package/dist/color/parse.cjs.map +1 -1
- package/dist/color/parse.js +10 -4
- package/dist/color/parse.js.map +1 -1
- package/dist/color/utils.cjs +5 -2
- package/dist/color/utils.cjs.map +1 -1
- package/dist/color/utils.js +5 -2
- package/dist/color/utils.js.map +1 -1
- package/dist/date/calendar.cjs +1 -1
- package/dist/date/calendar.cjs.map +1 -1
- package/dist/date/calendar.js +1 -1
- package/dist/date/calendar.js.map +1 -1
- package/dist/date/useDateField.cjs +3 -0
- package/dist/date/useDateField.cjs.map +1 -1
- package/dist/date/useDateField.js +3 -0
- package/dist/date/useDateField.js.map +1 -1
- package/dist/date/utils.cjs +30 -0
- package/dist/date/utils.cjs.map +1 -1
- package/dist/date/utils.js +19 -1
- package/dist/date/utils.js.map +1 -1
- package/dist/date.d.cts +2 -1
- package/dist/date.d.ts +2 -1
- package/dist/index.cjs +6 -0
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +6 -0
- package/dist/index2.d.cts +5 -44
- package/dist/index2.d.cts.map +1 -1
- package/dist/index2.d.ts +5 -44
- package/dist/index2.d.ts.map +1 -1
- package/dist/index3.d.cts +394 -10813
- package/dist/index3.d.cts.map +1 -1
- package/dist/index3.d.ts +394 -10813
- package/dist/index3.d.ts.map +1 -1
- package/dist/index4.d.cts +10538 -0
- package/dist/index4.d.cts.map +1 -0
- package/dist/index4.d.ts +10538 -0
- package/dist/index4.d.ts.map +1 -0
- package/dist/internal.cjs +22 -0
- package/dist/internal.d.cts +8 -6
- package/dist/internal.d.cts.map +1 -1
- package/dist/internal.d.ts +8 -6
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +22 -0
- package/dist/namespaced/index.cjs +82 -0
- package/dist/namespaced/index.d.cts +77 -3
- package/dist/namespaced/index.d.mts +77 -3
- package/dist/namespaced/index.mjs +75 -3
- package/dist/shared/arrays.cjs +22 -0
- package/dist/shared/arrays.cjs.map +1 -1
- package/dist/shared/arrays.js +17 -1
- package/dist/shared/arrays.js.map +1 -1
- package/dist/shared/clamp.cjs +6 -0
- package/dist/shared/clamp.js +1 -1
- package/dist/shared/createContext.cjs +1 -1
- package/dist/shared/createContext.js +1 -1
- package/dist/shared/index.cjs +0 -0
- package/dist/shared/index.js +0 -0
- package/dist/shared/isValidVNodeElement.cjs +17 -0
- package/dist/shared/isValidVNodeElement.cjs.map +1 -0
- package/dist/shared/isValidVNodeElement.js +11 -0
- package/dist/shared/isValidVNodeElement.js.map +1 -0
- package/dist/shared/object.cjs +26 -0
- package/dist/shared/object.cjs.map +1 -0
- package/dist/shared/object.js +14 -0
- package/dist/shared/object.js.map +1 -0
- package/dist/shared/onFocusOutside.cjs +30 -0
- package/dist/shared/onFocusOutside.cjs.map +1 -0
- package/dist/shared/onFocusOutside.js +24 -0
- package/dist/shared/onFocusOutside.js.map +1 -0
- package/dist/shared/trap-focus.cjs +35 -0
- package/dist/shared/trap-focus.cjs.map +1 -0
- package/dist/shared/trap-focus.js +30 -0
- package/dist/shared/trap-focus.js.map +1 -0
- package/dist/shared/useForwardExpose.cjs +1 -1
- package/dist/shared/useForwardExpose.cjs.map +1 -1
- package/dist/shared/useForwardExpose.js +1 -1
- package/dist/shared/useForwardExpose.js.map +1 -1
- package/dist/shared/useForwardRef.cjs +23 -0
- package/dist/shared/useForwardRef.cjs.map +1 -0
- package/dist/shared/useForwardRef.js +17 -0
- package/dist/shared/useForwardRef.js.map +1 -0
- package/dist/shared/useGraceArea.cjs +2 -2
- package/dist/shared/useGraceArea.cjs.map +1 -1
- package/dist/shared/useGraceArea.js +2 -2
- package/dist/shared/useGraceArea.js.map +1 -1
- package/dist/shared/useKbd.cjs +17 -0
- package/dist/shared/useKbd.cjs.map +1 -1
- package/dist/shared/useKbd.js +12 -1
- package/dist/shared/useKbd.js.map +1 -1
- package/dist/shared/useSelectionBehavior.cjs +1 -1
- package/dist/shared/useSelectionBehavior.cjs.map +1 -1
- package/dist/shared/useSelectionBehavior.js +1 -1
- package/dist/shared/useSelectionBehavior.js.map +1 -1
- package/dist/shared.cjs +83 -0
- package/dist/shared.d.cts +2 -0
- package/dist/shared.d.ts +2 -0
- package/dist/shared.js +43 -0
- package/package.json +8 -4
- package/src/Calendar/CalendarRoot.vue +1 -1
- package/src/Calendar/useCalendar.ts +2 -2
- package/src/ColorField/ColorFieldInput.vue +3 -1
- package/src/ContextMenu/ContextMenuTrigger.vue +1 -4
- package/src/DateField/DateFieldRoot.vue +11 -4
- package/src/DropdownMenu/DropdownMenuTrigger.vue +2 -2
- package/src/Label/Label.vue +1 -1
- package/src/Listbox/ListboxContent.vue +1 -1
- package/src/Listbox/ListboxVirtualizer.vue +3 -3
- package/src/Menu/MenuItem.vue +4 -4
- package/src/Menu/MenuItemImpl.vue +2 -2
- package/src/Menu/MenuSubTrigger.vue +4 -3
- package/src/Menubar/MenubarTrigger.vue +2 -2
- package/src/MonthPicker/MonthPickerRoot.vue +1 -1
- package/src/NavigationMenu/NavigationMenuTrigger.vue +4 -2
- package/src/Popper/PopperArrow.vue +3 -2
- package/src/RovingFocus/RovingFocusItem.vue +1 -1
- package/src/ScrollArea/ScrollAreaScrollbarGlimpse.vue +2 -8
- package/src/ScrollArea/ScrollAreaScrollbarScroll.vue +1 -4
- package/src/Select/SelectContentImpl.vue +3 -2
- package/src/Select/SelectItem.vue +1 -1
- package/src/Select/SelectItemAlignedPosition.vue +1 -1
- package/src/Select/SelectRoot.vue +1 -1
- package/src/Select/SelectTrigger.vue +1 -1
- package/src/Slider/SliderImpl.vue +4 -4
- package/src/Tabs/TabsTrigger.vue +1 -1
- package/src/Toast/ToastRootImpl.vue +3 -3
- package/src/Toast/ToastViewport.vue +9 -5
- package/src/Tree/TreeItem.vue +3 -3
- package/src/Tree/TreeVirtualizer.vue +1 -1
- package/src/YearPicker/YearPickerRoot.vue +1 -1
- package/src/YearPicker/useYearPicker.ts +3 -3
- package/src/date/calendar.ts +1 -1
- package/src/shared/color/parse.ts +11 -4
- package/src/shared/color/utils.ts +6 -2
- package/src/shared/date/types.ts +2 -0
- package/src/shared/date/useDateField.ts +3 -0
- package/src/shared/date/utils.ts +29 -1
- package/src/shared/object.ts +1 -1
- package/src/shared/trap-focus.ts +1 -3
- package/src/shared/useForwardExpose.ts +1 -1
- package/src/shared/useGraceArea.ts +2 -2
- package/src/shared/useSelectionBehavior.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { ComponentPublicInstance } from 'vue'
|
|
3
3
|
import type { PrimitiveProps } from '@/Primitive'
|
|
4
4
|
import { useCollection } from '@/Collection'
|
|
5
5
|
import { useForwardExpose } from '@/shared'
|
|
@@ -119,7 +119,9 @@ function handleKeydown(ev: KeyboardEvent) {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
function setFocusProxyRef(node:
|
|
122
|
+
function setFocusProxyRef(node: Element | ComponentPublicInstance | null) {
|
|
123
|
+
if (!node)
|
|
124
|
+
return undefined
|
|
123
125
|
// @ts-expect-error unrefElement expect MaybeRef, but also support Vnode
|
|
124
126
|
itemContext.focusProxyRef.value = unrefElement(node)
|
|
125
127
|
return undefined
|
|
@@ -14,6 +14,7 @@ export interface PopperArrowProps extends ArrowProps, PrimitiveProps {}
|
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
<script setup lang="ts">
|
|
17
|
+
import type { ComponentPublicInstance } from 'vue'
|
|
17
18
|
import { computed } from 'vue'
|
|
18
19
|
import { useForwardExpose } from '@/shared'
|
|
19
20
|
import Arrow from '@/shared/component/Arrow.vue'
|
|
@@ -36,8 +37,8 @@ const baseSide = computed(() => OPPOSITE_SIDE[contentContext.placedSide.value])
|
|
|
36
37
|
|
|
37
38
|
<template>
|
|
38
39
|
<span
|
|
39
|
-
:ref="(el:
|
|
40
|
-
contentContext.onArrowChange(el)
|
|
40
|
+
:ref="(el: Element | ComponentPublicInstance | null) => {
|
|
41
|
+
contentContext.onArrowChange((el as HTMLElement) ?? undefined)
|
|
41
42
|
return undefined
|
|
42
43
|
}"
|
|
43
44
|
:style="{
|
|
@@ -97,7 +97,7 @@ function handleKeydown(event: KeyboardEvent) {
|
|
|
97
97
|
:as="as"
|
|
98
98
|
:as-child="asChild"
|
|
99
99
|
@mousedown="
|
|
100
|
-
(event) => {
|
|
100
|
+
(event: MouseEvent) => {
|
|
101
101
|
// We prevent focusing non-focusable items on `mousedown`.
|
|
102
102
|
// Even though the item has tabIndex={-1}, that only means take it out of the tab order.
|
|
103
103
|
if (!focusable) event.preventDefault();
|
|
@@ -65,10 +65,7 @@ const debounceScrollEnd = useDebounceFn(() => dispatch('SCROLL_END'), 100)
|
|
|
65
65
|
|
|
66
66
|
watchEffect((onCleanup) => {
|
|
67
67
|
if (state.value === 'glimpse') {
|
|
68
|
-
const timeId = window.setTimeout(
|
|
69
|
-
() => dispatch('HIDE'),
|
|
70
|
-
rootContext.scrollHideDelay.value,
|
|
71
|
-
)
|
|
68
|
+
const timeId = window.setTimeout(dispatch, rootContext.scrollHideDelay.value, 'HIDE')
|
|
72
69
|
|
|
73
70
|
onCleanup(() => {
|
|
74
71
|
window.clearTimeout(timeId)
|
|
@@ -78,10 +75,7 @@ watchEffect((onCleanup) => {
|
|
|
78
75
|
|
|
79
76
|
watchEffect((onCleanup) => {
|
|
80
77
|
if (state.value === 'idle') {
|
|
81
|
-
const timeId = window.setTimeout(
|
|
82
|
-
() => dispatch('HIDE'),
|
|
83
|
-
rootContext.scrollHideDelay.value,
|
|
84
|
-
)
|
|
78
|
+
const timeId = window.setTimeout(dispatch, rootContext.scrollHideDelay.value, 'HIDE')
|
|
85
79
|
|
|
86
80
|
onCleanup(() => {
|
|
87
81
|
window.clearTimeout(timeId)
|
|
@@ -44,10 +44,7 @@ const visible = computed(() => state.value !== 'hidden')
|
|
|
44
44
|
|
|
45
45
|
watchEffect((onCleanup) => {
|
|
46
46
|
if (state.value === 'idle') {
|
|
47
|
-
const timeId = window.setTimeout(
|
|
48
|
-
() => dispatch('HIDE'),
|
|
49
|
-
rootContext.scrollHideDelay.value,
|
|
50
|
-
)
|
|
47
|
+
const timeId = window.setTimeout(dispatch, rootContext.scrollHideDelay.value, 'HIDE')
|
|
51
48
|
|
|
52
49
|
onCleanup(() => {
|
|
53
50
|
window.clearTimeout(timeId)
|
|
@@ -301,8 +301,9 @@ provideSelectContentContext({
|
|
|
301
301
|
v-bind="{ ...$attrs, ...forwardedProps }"
|
|
302
302
|
:id="rootContext.contentId"
|
|
303
303
|
:ref="
|
|
304
|
-
(vnode: ComponentPublicInstance) => {
|
|
305
|
-
|
|
304
|
+
(vnode: Element | ComponentPublicInstance | null) => {
|
|
305
|
+
if (!vnode) return undefined
|
|
306
|
+
const el = unrefElement(vnode as ComponentPublicInstance) as HTMLElement | undefined
|
|
306
307
|
// special case for PopperContent
|
|
307
308
|
if (el?.hasAttribute('data-reka-popper-content-wrapper'))
|
|
308
309
|
content = el.firstElementChild as HTMLElement
|
|
@@ -169,7 +169,7 @@ provideSelectItemContext({
|
|
|
169
169
|
@focus="isFocused = true"
|
|
170
170
|
@blur="isFocused = false"
|
|
171
171
|
@pointerup="handleSelectCustomEvent"
|
|
172
|
-
@pointerdown="(event) => {
|
|
172
|
+
@pointerdown="(event: PointerEvent) => {
|
|
173
173
|
(event.currentTarget as HTMLElement).focus({ preventScroll: true })
|
|
174
174
|
}"
|
|
175
175
|
@touchend.prevent.stop
|
|
@@ -145,7 +145,7 @@ function position() {
|
|
|
145
145
|
= contentTopToItemMiddle <= topEdgeToTriggerMiddle
|
|
146
146
|
|
|
147
147
|
if (willAlignWithoutTopOverflow) {
|
|
148
|
-
const isLastItem = selectedItem.value === items
|
|
148
|
+
const isLastItem = selectedItem.value === items.at(-1)
|
|
149
149
|
contentWrapperElement.value.style.bottom = `${0}px`
|
|
150
150
|
const viewportOffsetBottom
|
|
151
151
|
= contentElement.value.clientHeight
|
|
@@ -111,7 +111,7 @@ function handlePointerOpen(event: PointerEvent) {
|
|
|
111
111
|
}
|
|
112
112
|
"
|
|
113
113
|
@keydown="
|
|
114
|
-
(event) => {
|
|
114
|
+
(event: KeyboardEvent) => {
|
|
115
115
|
const isTypingAhead = search !== '';
|
|
116
116
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
|
117
117
|
if (!isModifierKey && event.key.length === 1)
|
|
@@ -29,7 +29,7 @@ const rootContext = injectSliderRootContext()
|
|
|
29
29
|
<Primitive
|
|
30
30
|
data-slider-impl
|
|
31
31
|
v-bind="props"
|
|
32
|
-
@keydown="(event) => {
|
|
32
|
+
@keydown="(event: KeyboardEvent) => {
|
|
33
33
|
if (event.key === 'Home') {
|
|
34
34
|
emits('homeKeyDown', event)
|
|
35
35
|
// Prevent scrolling to page start
|
|
@@ -46,7 +46,7 @@ const rootContext = injectSliderRootContext()
|
|
|
46
46
|
event.preventDefault();
|
|
47
47
|
}
|
|
48
48
|
}"
|
|
49
|
-
@pointerdown="(event) => {
|
|
49
|
+
@pointerdown="(event: PointerEvent) => {
|
|
50
50
|
const target = event.target as HTMLElement;
|
|
51
51
|
target.setPointerCapture(event.pointerId);
|
|
52
52
|
// Prevent browser focus behaviour because we focus a thumb manually when values change.
|
|
@@ -60,11 +60,11 @@ const rootContext = injectSliderRootContext()
|
|
|
60
60
|
emits('slideStart', event)
|
|
61
61
|
}
|
|
62
62
|
}"
|
|
63
|
-
@pointermove="(event) => {
|
|
63
|
+
@pointermove="(event: PointerEvent) => {
|
|
64
64
|
const target = event.target as HTMLElement;
|
|
65
65
|
if (target.hasPointerCapture(event.pointerId)) emits('slideMove', event);
|
|
66
66
|
}"
|
|
67
|
-
@pointerup="(event) => {
|
|
67
|
+
@pointerup="(event: PointerEvent) => {
|
|
68
68
|
const target = event.target as HTMLElement;
|
|
69
69
|
if (target.hasPointerCapture(event.pointerId)) {
|
|
70
70
|
target.releasePointerCapture(event.pointerId);
|
package/src/Tabs/TabsTrigger.vue
CHANGED
|
@@ -51,7 +51,7 @@ const isSelected = computed(() => props.value === rootContext.modelValue.value)
|
|
|
51
51
|
:disabled="disabled"
|
|
52
52
|
:data-disabled="disabled ? '' : undefined"
|
|
53
53
|
:data-orientation="rootContext.orientation.value"
|
|
54
|
-
@mousedown.left="(event) => {
|
|
54
|
+
@mousedown.left="(event: MouseEvent) => {
|
|
55
55
|
// only call handler if it's the left button (mousedown gets triggered by all mouse buttons)
|
|
56
56
|
// but not when the control key is pressed (avoiding MacOS right click)
|
|
57
57
|
if (!disabled && event.ctrlKey === false) {
|
|
@@ -82,7 +82,7 @@ const closeTimerRef = ref(0)
|
|
|
82
82
|
const remainingTime = ref(duration.value)
|
|
83
83
|
|
|
84
84
|
const remainingRaf = useRafFn(() => {
|
|
85
|
-
const elapsedTime =
|
|
85
|
+
const elapsedTime = Date.now() - closeTimerStartTimeRef.value
|
|
86
86
|
remainingTime.value = Math.max(closeTimerRemainingTimeRef.value - elapsedTime, 0)
|
|
87
87
|
}, { fpsLimit: 60 })
|
|
88
88
|
|
|
@@ -95,7 +95,7 @@ function startTimer(duration: number) {
|
|
|
95
95
|
if (!isClient)
|
|
96
96
|
return
|
|
97
97
|
window.clearTimeout(closeTimerRef.value)
|
|
98
|
-
closeTimerStartTimeRef.value =
|
|
98
|
+
closeTimerStartTimeRef.value = Date.now()
|
|
99
99
|
closeTimerRef.value = window.setTimeout(handleClose, duration)
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -133,7 +133,7 @@ watchEffect((cleanupFn) => {
|
|
|
133
133
|
emits('resume')
|
|
134
134
|
}
|
|
135
135
|
const handlePause = () => {
|
|
136
|
-
const elapsedTime =
|
|
136
|
+
const elapsedTime = Date.now() - closeTimerStartTimeRef.value
|
|
137
137
|
closeTimerRemainingTimeRef.value = closeTimerRemainingTimeRef.value - elapsedTime
|
|
138
138
|
window.clearTimeout(closeTimerRef.value)
|
|
139
139
|
remainingRaf.pause()
|
|
@@ -48,7 +48,9 @@ const hasToasts = computed(() => providerContext.toastCount.value > 0)
|
|
|
48
48
|
const headFocusProxyRef = ref<HTMLElement>()
|
|
49
49
|
const tailFocusProxyRef = ref<HTMLElement>()
|
|
50
50
|
|
|
51
|
-
const
|
|
51
|
+
const KEY_RE = /Key/g
|
|
52
|
+
const DIGIT_RE = /Digit/g
|
|
53
|
+
const hotkeyMessage = computed(() => hotkey.value.join('+').replace(KEY_RE, '').replace(DIGIT_RE, ''))
|
|
52
54
|
|
|
53
55
|
onKeyStroke(hotkey.value, () => {
|
|
54
56
|
currentElement.value.focus()
|
|
@@ -172,8 +174,9 @@ function getSortedTabbableCandidates({ tabbingDirection }: { tabbingDirection: '
|
|
|
172
174
|
>
|
|
173
175
|
<FocusProxy
|
|
174
176
|
v-if="hasToasts"
|
|
175
|
-
:ref="(node: ComponentPublicInstance) => {
|
|
176
|
-
|
|
177
|
+
:ref="(node: Element | ComponentPublicInstance | null) => {
|
|
178
|
+
if (!node) return undefined
|
|
179
|
+
headFocusProxyRef = unrefElement(node as ComponentPublicInstance) as HTMLElement
|
|
177
180
|
return undefined
|
|
178
181
|
}"
|
|
179
182
|
@focus-from-outside-viewport="() => {
|
|
@@ -196,8 +199,9 @@ function getSortedTabbableCandidates({ tabbingDirection }: { tabbingDirection: '
|
|
|
196
199
|
</CollectionSlot>
|
|
197
200
|
<FocusProxy
|
|
198
201
|
v-if="hasToasts"
|
|
199
|
-
:ref="(node: ComponentPublicInstance) => {
|
|
200
|
-
|
|
202
|
+
:ref="(node: Element | ComponentPublicInstance | null) => {
|
|
203
|
+
if (!node) return undefined
|
|
204
|
+
tailFocusProxyRef = unrefElement(node as ComponentPublicInstance) as HTMLElement
|
|
201
205
|
return undefined
|
|
202
206
|
}"
|
|
203
207
|
@focus-from-outside-viewport="() => {
|
package/src/Tree/TreeItem.vue
CHANGED
|
@@ -178,9 +178,9 @@ defineExpose({
|
|
|
178
178
|
:data-selected="isSelected ? '' : undefined"
|
|
179
179
|
:data-expanded="isExpanded ? '' : undefined"
|
|
180
180
|
@keydown.enter.space.self.prevent="handleSelectCustomEvent"
|
|
181
|
-
@keydown.right.prevent="(ev) => rootContext.dir.value === 'ltr' ? handleKeydownRight(ev) : handleKeydownLeft(ev)"
|
|
182
|
-
@keydown.left.prevent="(ev) => rootContext.dir.value === 'ltr' ? handleKeydownLeft(ev) : handleKeydownRight(ev)"
|
|
183
|
-
@click.stop="(ev) => {
|
|
181
|
+
@keydown.right.prevent="(ev: KeyboardEvent) => rootContext.dir.value === 'ltr' ? handleKeydownRight(ev) : handleKeydownLeft(ev)"
|
|
182
|
+
@keydown.left.prevent="(ev: KeyboardEvent) => rootContext.dir.value === 'ltr' ? handleKeydownLeft(ev) : handleKeydownRight(ev)"
|
|
183
|
+
@click.stop="(ev: PointerEvent) => {
|
|
184
184
|
handleSelectCustomEvent(ev)
|
|
185
185
|
handleToggleCustomEvent(ev)
|
|
186
186
|
}"
|
|
@@ -134,7 +134,7 @@ rootContext.virtualKeydownHook.on((event) => {
|
|
|
134
134
|
virtualizer.value.scrollToIndex(index)
|
|
135
135
|
requestAnimationFrame(() => {
|
|
136
136
|
const items = getItems()
|
|
137
|
-
const item = intent === 'first' ? items[0] : items
|
|
137
|
+
const item = intent === 'first' ? items[0] : items.at(-1)!
|
|
138
138
|
item.ref.focus()
|
|
139
139
|
})
|
|
140
140
|
}
|
|
@@ -202,7 +202,7 @@ const { isInvalid, isYearSelected } = useYearPickerState({
|
|
|
202
202
|
|
|
203
203
|
watch(modelValue, (_modelValue) => {
|
|
204
204
|
if (Array.isArray(_modelValue) && _modelValue.length) {
|
|
205
|
-
const lastValue = _modelValue
|
|
205
|
+
const lastValue = _modelValue.at(-1)
|
|
206
206
|
if (lastValue && !isSameYear(placeholder.value, lastValue))
|
|
207
207
|
onPlaceholderChange(lastValue)
|
|
208
208
|
}
|
|
@@ -106,7 +106,7 @@ export function useYearPicker(props: UseYearPickerProps) {
|
|
|
106
106
|
if (props.disabled.value)
|
|
107
107
|
return true
|
|
108
108
|
|
|
109
|
-
const lastYearInView = grid.value.cells
|
|
109
|
+
const lastYearInView = grid.value.cells.at(-1)!
|
|
110
110
|
if (nextPageFunc || props.nextPage.value) {
|
|
111
111
|
const nextDate = (nextPageFunc || props.nextPage.value)!(lastYearInView)
|
|
112
112
|
return isAfter(startOfYear(nextDate), props.maxValue.value)
|
|
@@ -164,7 +164,7 @@ export function useYearPicker(props: UseYearPickerProps) {
|
|
|
164
164
|
|
|
165
165
|
watch(props.placeholder, (value) => {
|
|
166
166
|
const firstYearInGrid = grid.value.value
|
|
167
|
-
const lastYearInGrid = grid.value.cells
|
|
167
|
+
const lastYearInGrid = grid.value.cells.at(-1)!
|
|
168
168
|
if (value.year >= firstYearInGrid.year && value.year <= lastYearInGrid.year)
|
|
169
169
|
return
|
|
170
170
|
grid.value = createYearGrid({ dateObj: value, yearsPerPage: props.yearsPerPage.value })
|
|
@@ -180,7 +180,7 @@ export function useYearPicker(props: UseYearPickerProps) {
|
|
|
180
180
|
formatter.setLocale(props.locale.value)
|
|
181
181
|
|
|
182
182
|
const firstYear = grid.value.cells[0]
|
|
183
|
-
const lastYear = grid.value.cells
|
|
183
|
+
const lastYear = grid.value.cells.at(-1)!
|
|
184
184
|
|
|
185
185
|
return `${formatter.fullYear(toDate(firstYear), headingFormatOptions.value)} - ${formatter.fullYear(toDate(lastYear), headingFormatOptions.value)}`
|
|
186
186
|
})
|
package/src/date/calendar.ts
CHANGED
|
@@ -78,7 +78,7 @@ export function createMonth(props: CreateMonthProps): Grid<DateValue> {
|
|
|
78
78
|
if (fixedWeeks && totalDays < 42) {
|
|
79
79
|
const extraDays = 42 - totalDays
|
|
80
80
|
|
|
81
|
-
let startFrom = nextMonthDays
|
|
81
|
+
let startFrom = nextMonthDays.at(-1)
|
|
82
82
|
|
|
83
83
|
if (!startFrom)
|
|
84
84
|
startFrom = endOfMonth(dateObj)
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { Color, HSBColor, HSLColor, RGBColor } from './types'
|
|
2
2
|
|
|
3
|
+
const HEX3_RE = /^[0-9A-F]{3}$/i
|
|
4
|
+
const HEX6_RE = /^[0-9A-F]{6}$/i
|
|
5
|
+
const HEX8_RE = /^[0-9A-F]{8}$/i
|
|
6
|
+
const RGB_RE = /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+)\s*)?\)/
|
|
7
|
+
const HSL_RE = /hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+)\s*)?\)/
|
|
8
|
+
const HSB_RE = /hsb[av]?\(\s*([\d.]+)\s*,\s*([\d.]+)%?\s*,\s*([\d.]+)%?\s*(?:,\s*([\d.]+)\s*)?\)/
|
|
9
|
+
|
|
3
10
|
/**
|
|
4
11
|
* Parses a color string into a Color object.
|
|
5
12
|
* Supports hex (#rrggbb, #rgb), rgb(), hsl(), and hsb()/hsv() formats.
|
|
@@ -34,7 +41,7 @@ function parseHex(hex: string): RGBColor {
|
|
|
34
41
|
let normalized = hex.slice(1)
|
|
35
42
|
|
|
36
43
|
// Validate hex format (3, 6, or 8 hex digits)
|
|
37
|
-
if (
|
|
44
|
+
if (!HEX3_RE.test(normalized) && !HEX6_RE.test(normalized) && !HEX8_RE.test(normalized)) {
|
|
38
45
|
throw new Error(`Invalid hex color: ${hex}. Expected format: #RGB, #RRGGBB, or #RRGGBBAA`)
|
|
39
46
|
}
|
|
40
47
|
|
|
@@ -71,7 +78,7 @@ function parseHex(hex: string): RGBColor {
|
|
|
71
78
|
}
|
|
72
79
|
|
|
73
80
|
function parseRgb(rgb: string): RGBColor {
|
|
74
|
-
const match = rgb.match(
|
|
81
|
+
const match = rgb.match(RGB_RE)
|
|
75
82
|
if (!match) {
|
|
76
83
|
throw new Error(`Invalid RGB color: ${rgb}`)
|
|
77
84
|
}
|
|
@@ -86,7 +93,7 @@ function parseRgb(rgb: string): RGBColor {
|
|
|
86
93
|
}
|
|
87
94
|
|
|
88
95
|
function parseHsl(hsl: string): HSLColor {
|
|
89
|
-
const match = hsl.match(
|
|
96
|
+
const match = hsl.match(HSL_RE)
|
|
90
97
|
if (!match) {
|
|
91
98
|
throw new Error(`Invalid HSL color: ${hsl}`)
|
|
92
99
|
}
|
|
@@ -101,7 +108,7 @@ function parseHsl(hsl: string): HSLColor {
|
|
|
101
108
|
}
|
|
102
109
|
|
|
103
110
|
function parseHsb(hsb: string): HSBColor {
|
|
104
|
-
const match = hsb.match(
|
|
111
|
+
const match = hsb.match(HSB_RE)
|
|
105
112
|
if (!match) {
|
|
106
113
|
throw new Error(`Invalid HSB color: ${hsb}`)
|
|
107
114
|
}
|
|
@@ -3,11 +3,15 @@
|
|
|
3
3
|
* @param hex Hex color string (e.g., "#ff5733" or "#f53")
|
|
4
4
|
* @returns An object containing red, green, and blue values (0-255).
|
|
5
5
|
*/
|
|
6
|
+
const HASH_PREFIX_RE = /^#/
|
|
7
|
+
const HEX6_RE = /^[0-9A-F]{6}$/i
|
|
8
|
+
const HEX3_RE = /^[0-9A-F]{3}$/i
|
|
9
|
+
|
|
6
10
|
export function hexToRGB(hex: string): { r: number, g: number, b: number } {
|
|
7
|
-
hex = hex.replace(
|
|
11
|
+
hex = hex.replace(HASH_PREFIX_RE, '')
|
|
8
12
|
|
|
9
13
|
// Validate hex format (3 or 6 hex digits)
|
|
10
|
-
if (
|
|
14
|
+
if (!HEX6_RE.test(hex) && !HEX3_RE.test(hex)) {
|
|
11
15
|
throw new Error(`Invalid hex color: ${hex}. Expected format: #RGB or #RRGGBB`)
|
|
12
16
|
}
|
|
13
17
|
|
package/src/shared/date/types.ts
CHANGED
|
@@ -54,3 +54,5 @@ export type TimeSegmentObj = {
|
|
|
54
54
|
export type DateAndTimeSegmentObj = DateSegmentObj & TimeSegmentObj
|
|
55
55
|
export type SegmentValueObj = DateSegmentObj | DateAndTimeSegmentObj
|
|
56
56
|
export type SegmentContentObj = Record<EditableSegmentPart, string>
|
|
57
|
+
|
|
58
|
+
export type DateInputType = 'date' | 'datetime-local'
|
|
@@ -367,6 +367,7 @@ export function useDateField(props: UseDateFieldProps) {
|
|
|
367
367
|
*/
|
|
368
368
|
if (props.hasLeftFocus.value) {
|
|
369
369
|
props.hasLeftFocus.value = false
|
|
370
|
+
props.lastKeyZero.value = false
|
|
370
371
|
prev = null
|
|
371
372
|
}
|
|
372
373
|
|
|
@@ -445,6 +446,7 @@ export function useDateField(props: UseDateFieldProps) {
|
|
|
445
446
|
*/
|
|
446
447
|
if (props.hasLeftFocus.value) {
|
|
447
448
|
props.hasLeftFocus.value = false
|
|
449
|
+
props.lastKeyZero.value = false
|
|
448
450
|
prev = null
|
|
449
451
|
}
|
|
450
452
|
|
|
@@ -524,6 +526,7 @@ export function useDateField(props: UseDateFieldProps) {
|
|
|
524
526
|
// probably not implement, kind of weird
|
|
525
527
|
if (props.hasLeftFocus.value) {
|
|
526
528
|
props.hasLeftFocus.value = false
|
|
529
|
+
props.lastKeyZero.value = false
|
|
527
530
|
prev = null
|
|
528
531
|
}
|
|
529
532
|
|
package/src/shared/date/utils.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Granularity } from './comparators'
|
|
2
|
-
import type { DateStep, HourCycle } from './types'
|
|
2
|
+
import type { DateInputType, DateStep, DateValue, HourCycle } from './types'
|
|
3
3
|
import { defu } from 'defu'
|
|
4
4
|
|
|
5
5
|
export function getOptsByGranularity(granularity: Granularity, hourCycle: HourCycle, isTimeValue: boolean = false) {
|
|
@@ -82,3 +82,31 @@ export function normalizeHour12(hourCycle: HourCycle) {
|
|
|
82
82
|
return true
|
|
83
83
|
return undefined
|
|
84
84
|
}
|
|
85
|
+
|
|
86
|
+
export function getInputType(granularity: Granularity): DateInputType {
|
|
87
|
+
return granularity === 'day' ? 'date' : 'datetime-local'
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function normalizeInputValue(date: DateValue | undefined, granularity: Granularity): string {
|
|
91
|
+
if (!date)
|
|
92
|
+
return ''
|
|
93
|
+
|
|
94
|
+
const type = getInputType(granularity)
|
|
95
|
+
|
|
96
|
+
const year = String(date.year).padStart(4, '0')
|
|
97
|
+
const month = String(date.month).padStart(2, '0')
|
|
98
|
+
const day = String(date.day).padStart(2, '0')
|
|
99
|
+
|
|
100
|
+
if (type === 'date')
|
|
101
|
+
return `${year}-${month}-${day}`
|
|
102
|
+
|
|
103
|
+
const hour = String('hour' in date ? date.hour : 0).padStart(2, '0')
|
|
104
|
+
const minute = String('minute' in date ? date.minute : 0).padStart(2, '0')
|
|
105
|
+
|
|
106
|
+
if (granularity === 'second') {
|
|
107
|
+
const second = String('second' in date ? date.second : 0).padStart(2, '0')
|
|
108
|
+
return `${year}-${month}-${day}T${hour}:${minute}:${second}`
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return `${year}-${month}-${day}T${hour}:${minute}`
|
|
112
|
+
}
|
package/src/shared/object.ts
CHANGED
|
@@ -3,7 +3,7 @@ export function pick<T, K extends keyof T>(object: T, keys: K[]): Pick<T, K> {
|
|
|
3
3
|
{},
|
|
4
4
|
// eslint-disable-next-line array-callback-return
|
|
5
5
|
...keys.map((key) => {
|
|
6
|
-
if (object && Object.
|
|
6
|
+
if (object && Object.hasOwn(object, key))
|
|
7
7
|
return { [key]: object[key] }
|
|
8
8
|
}),
|
|
9
9
|
)
|
package/src/shared/trap-focus.ts
CHANGED
|
@@ -12,9 +12,7 @@ export function trapFocus(element: HTMLElement) {
|
|
|
12
12
|
el => !el.hasAttribute('disabled') && !el.getAttribute('aria-hidden'),
|
|
13
13
|
)
|
|
14
14
|
const firstFocusableEl = focusableEls[0] as HTMLElement
|
|
15
|
-
const lastFocusableEl = focusableEls
|
|
16
|
-
focusableEls.length - 1
|
|
17
|
-
] as HTMLElement
|
|
15
|
+
const lastFocusableEl = focusableEls.at(-1) as HTMLElement
|
|
18
16
|
const KEYCODE_TAB = 9
|
|
19
17
|
|
|
20
18
|
if (firstFocusableEl)
|
|
@@ -76,7 +76,7 @@ export function useForwardExpose<T extends ComponentPublicInstance>() {
|
|
|
76
76
|
|
|
77
77
|
// ref not is Element
|
|
78
78
|
// and `useForwardExpose.test.ts > useForwardRef > should forward plain DOM element ref - 2` Passing in `$el`
|
|
79
|
-
if (!(ref instanceof Element) && !Object.
|
|
79
|
+
if (!(ref instanceof Element) && !Object.hasOwn(ref, '$el')) {
|
|
80
80
|
// Retrieves the `exposed` data that has not been unwrapped by `vue` from `$.exposed`.
|
|
81
81
|
const childExposed = ref.$.exposed
|
|
82
82
|
const merged = Object.assign({}, ret)
|
|
@@ -192,7 +192,7 @@ function getHullPresorted<P extends Point>(points: Readonly<Array<P>>): Array<P>
|
|
|
192
192
|
for (let i = 0; i < points.length; i++) {
|
|
193
193
|
const p = points[i]
|
|
194
194
|
while (upperHull.length >= 2) {
|
|
195
|
-
const q = upperHull
|
|
195
|
+
const q = upperHull.at(-1)!
|
|
196
196
|
const r = upperHull[upperHull.length - 2]
|
|
197
197
|
if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x))
|
|
198
198
|
upperHull.pop()
|
|
@@ -206,7 +206,7 @@ function getHullPresorted<P extends Point>(points: Readonly<Array<P>>): Array<P>
|
|
|
206
206
|
for (let i = points.length - 1; i >= 0; i--) {
|
|
207
207
|
const p = points[i]
|
|
208
208
|
while (lowerHull.length >= 2) {
|
|
209
|
-
const q = lowerHull
|
|
209
|
+
const q = lowerHull.at(-1)!
|
|
210
210
|
const r = lowerHull[lowerHull.length - 2]
|
|
211
211
|
if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x))
|
|
212
212
|
lowerHull.pop()
|