@proyecto-viviana/solidaria 0.2.4 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/actiongroup/createActionGroup.d.ts +29 -0
- package/dist/actiongroup/createActionGroup.d.ts.map +1 -0
- package/dist/actiongroup/index.d.ts +2 -0
- package/dist/actiongroup/index.d.ts.map +1 -0
- package/dist/autocomplete/createAutocomplete.d.ts +6 -2
- package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
- package/dist/breadcrumbs/createBreadcrumbs.d.ts +2 -0
- package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
- package/dist/button/createToggleButtonGroup.d.ts +32 -0
- package/dist/button/createToggleButtonGroup.d.ts.map +1 -0
- package/dist/button/index.d.ts +2 -0
- package/dist/button/index.d.ts.map +1 -1
- package/dist/calendar/createCalendarCell.d.ts +2 -0
- package/dist/calendar/createCalendarCell.d.ts.map +1 -1
- package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
- package/dist/calendar/createRangeCalendarCell.d.ts +3 -1
- package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
- package/dist/checkbox/createCheckboxGroup.d.ts +5 -1
- package/dist/checkbox/createCheckboxGroup.d.ts.map +1 -1
- package/dist/collections/index.d.ts +56 -0
- package/dist/collections/index.d.ts.map +1 -0
- package/dist/color/createColorArea.d.ts.map +1 -1
- package/dist/color/createColorSlider.d.ts.map +1 -1
- package/dist/color/createColorWheel.d.ts.map +1 -1
- package/dist/combobox/createComboBox.d.ts +6 -0
- package/dist/combobox/createComboBox.d.ts.map +1 -1
- package/dist/datepicker/createDatePicker.d.ts +6 -0
- package/dist/datepicker/createDatePicker.d.ts.map +1 -1
- package/dist/datepicker/createDateRangePicker.d.ts +40 -0
- package/dist/datepicker/createDateRangePicker.d.ts.map +1 -0
- package/dist/datepicker/createDateSegment.d.ts +1 -1
- package/dist/datepicker/createDateSegment.d.ts.map +1 -1
- package/dist/datepicker/createTimeSegment.d.ts +29 -0
- package/dist/datepicker/createTimeSegment.d.ts.map +1 -0
- package/dist/datepicker/index.d.ts +2 -0
- package/dist/datepicker/index.d.ts.map +1 -1
- package/dist/disclosure/createDisclosureGroup.d.ts +2 -1
- package/dist/disclosure/createDisclosureGroup.d.ts.map +1 -1
- package/dist/dnd/createDrag.d.ts.map +1 -1
- package/dist/dnd/createDraggableCollection.d.ts +4 -0
- package/dist/dnd/createDraggableCollection.d.ts.map +1 -1
- package/dist/dnd/createDraggableItem.d.ts.map +1 -1
- package/dist/dnd/createDrop.d.ts.map +1 -1
- package/dist/dnd/createDroppableCollection.d.ts +32 -1
- package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
- package/dist/dnd/createDroppableItem.d.ts.map +1 -1
- package/dist/dnd/index.d.ts +1 -1
- package/dist/dnd/index.d.ts.map +1 -1
- package/dist/grid/createGrid.d.ts.map +1 -1
- package/dist/gridlist/createGridList.d.ts.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4659 -3452
- package/dist/index.js.map +1 -7
- package/dist/index.ssr.js +4659 -3452
- package/dist/index.ssr.js.map +1 -7
- package/dist/interactions/createFocus.d.ts.map +1 -1
- package/dist/interactions/createFocusWithin.d.ts.map +1 -1
- package/dist/link/createLink.d.ts +10 -0
- package/dist/link/createLink.d.ts.map +1 -1
- package/dist/listbox/createListBox.d.ts +1 -0
- package/dist/listbox/createListBox.d.ts.map +1 -1
- package/dist/listbox/createOption.d.ts.map +1 -1
- package/dist/menu/createMenu.d.ts +1 -0
- package/dist/menu/createMenu.d.ts.map +1 -1
- package/dist/meter/createMeter.d.ts.map +1 -1
- package/dist/numberfield/createNumberField.d.ts +18 -0
- package/dist/numberfield/createNumberField.d.ts.map +1 -1
- package/dist/overlays/createModal.d.ts +16 -0
- package/dist/overlays/createModal.d.ts.map +1 -1
- package/dist/overlays/createOverlay.d.ts.map +1 -1
- package/dist/overlays/index.d.ts +1 -1
- package/dist/overlays/index.d.ts.map +1 -1
- package/dist/popover/createOverlayPosition.d.ts.map +1 -1
- package/dist/popover/createPopover.d.ts.map +1 -1
- package/dist/progress/createProgressBar.d.ts.map +1 -1
- package/dist/radio/createRadioGroup.d.ts +2 -2
- package/dist/radio/createRadioGroup.d.ts.map +1 -1
- package/dist/searchfield/createSearchField.d.ts.map +1 -1
- package/dist/select/createHiddenSelect.d.ts.map +1 -1
- package/dist/select/createSelect.d.ts.map +1 -1
- package/dist/slider/createSlider.d.ts.map +1 -1
- package/dist/table/createTable.d.ts.map +1 -1
- package/dist/tabs/createTabs.d.ts +1 -1
- package/dist/tabs/createTabs.d.ts.map +1 -1
- package/dist/tag/createTag.d.ts.map +1 -1
- package/dist/tag/createTagGroup.d.ts.map +1 -1
- package/dist/toast/createToast.d.ts +4 -0
- package/dist/toast/createToast.d.ts.map +1 -1
- package/dist/toast/createToastRegion.d.ts.map +1 -1
- package/dist/toolbar/createToolbar.d.ts.map +1 -1
- package/dist/tooltip/createTooltipTrigger.d.ts.map +1 -1
- package/dist/tree/createTree.d.ts.map +1 -1
- package/dist/tree/createTreeItem.d.ts.map +1 -1
- package/dist/tree/types.d.ts +4 -0
- package/dist/tree/types.d.ts.map +1 -1
- package/dist/utils/env.d.ts +1 -1
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/platform.d.ts.map +1 -1
- package/dist/visually-hidden/createVisuallyHidden.d.ts.map +1 -1
- package/package.json +8 -6
- package/src/actiongroup/createActionGroup.ts +324 -0
- package/src/actiongroup/index.ts +8 -0
- package/src/autocomplete/createAutocomplete.ts +32 -9
- package/src/breadcrumbs/createBreadcrumbs.ts +10 -15
- package/src/button/createButton.ts +1 -1
- package/src/button/createToggleButtonGroup.ts +128 -0
- package/src/button/index.ts +9 -0
- package/src/calendar/createCalendarCell.ts +6 -4
- package/src/calendar/createCalendarGrid.ts +27 -18
- package/src/calendar/createRangeCalendarCell.ts +26 -9
- package/src/checkbox/createCheckboxGroup.ts +21 -4
- package/src/collections/index.ts +242 -0
- package/src/color/createColorArea.ts +380 -314
- package/src/color/createColorField.ts +137 -137
- package/src/color/createColorSlider.ts +286 -197
- package/src/color/createColorSwatch.ts +40 -40
- package/src/color/createColorWheel.ts +218 -208
- package/src/color/index.ts +24 -24
- package/src/color/types.ts +116 -116
- package/src/combobox/createComboBox.ts +670 -647
- package/src/combobox/index.ts +6 -6
- package/src/datepicker/createDatePicker.ts +54 -16
- package/src/datepicker/createDateRangePicker.ts +246 -0
- package/src/datepicker/createDateSegment.ts +185 -31
- package/src/datepicker/createTimeSegment.ts +370 -0
- package/src/datepicker/index.ts +14 -0
- package/src/dialog/createDialog.ts +120 -120
- package/src/dialog/index.ts +2 -2
- package/src/dialog/types.ts +19 -19
- package/src/disclosure/createDisclosureGroup.ts +5 -2
- package/src/dnd/createDrag.ts +224 -209
- package/src/dnd/createDraggableCollection.ts +96 -63
- package/src/dnd/createDraggableItem.ts +259 -243
- package/src/dnd/createDrop.ts +322 -321
- package/src/dnd/createDroppableCollection.ts +682 -293
- package/src/dnd/createDroppableItem.ts +215 -213
- package/src/dnd/index.ts +55 -47
- package/src/dnd/types.ts +89 -89
- package/src/dnd/utils.ts +294 -294
- package/src/focus/createAutoFocus.ts +321 -321
- package/src/focus/createFocusRestore.ts +313 -313
- package/src/focus/createVirtualFocus.ts +396 -396
- package/src/form/createFormValidation.ts +224 -224
- package/src/form/index.ts +11 -11
- package/src/grid/createGrid.ts +3 -1
- package/src/gridlist/createGridList.ts +16 -0
- package/src/gridlist/createGridListItem.ts +1 -1
- package/src/i18n/NumberFormatter.ts +266 -266
- package/src/i18n/createCollator.ts +79 -79
- package/src/i18n/createDateFormatter.ts +83 -83
- package/src/i18n/createFilter.ts +131 -131
- package/src/i18n/createNumberFormatter.ts +52 -52
- package/src/i18n/index.ts +40 -40
- package/src/i18n/locale.tsx +188 -188
- package/src/i18n/utils.ts +99 -99
- package/src/index.ts +51 -0
- package/src/interactions/createFocus.ts +6 -5
- package/src/interactions/createFocusWithin.ts +6 -5
- package/src/interactions/createLongPress.ts +174 -174
- package/src/interactions/createMove.ts +289 -289
- package/src/interactions/createPress.ts +5 -5
- package/src/landmark/createLandmark.ts +377 -377
- package/src/landmark/index.ts +8 -8
- package/src/link/createLink.ts +23 -8
- package/src/listbox/createListBox.ts +308 -269
- package/src/listbox/createOption.ts +162 -151
- package/src/listbox/index.ts +12 -12
- package/src/live-announcer/announce.ts +322 -322
- package/src/live-announcer/index.ts +9 -9
- package/src/menu/createMenu.ts +405 -396
- package/src/menu/createMenuItem.ts +149 -149
- package/src/menu/createMenuTrigger.ts +88 -88
- package/src/menu/index.ts +18 -18
- package/src/meter/createMeter.ts +1 -6
- package/src/numberfield/createNumberField.ts +311 -268
- package/src/numberfield/index.ts +5 -5
- package/src/overlays/ariaHideOutside.ts +219 -219
- package/src/overlays/createInteractOutside.ts +149 -149
- package/src/overlays/createModal.tsx +238 -202
- package/src/overlays/createOverlay.ts +165 -155
- package/src/overlays/createOverlayTrigger.ts +85 -85
- package/src/overlays/createPreventScroll.ts +266 -266
- package/src/overlays/index.ts +48 -44
- package/src/popover/calculatePosition.ts +6 -6
- package/src/popover/createOverlayPosition.ts +7 -4
- package/src/popover/createPopover.ts +21 -7
- package/src/progress/createProgressBar.ts +6 -1
- package/src/radio/createRadioGroup.ts +88 -14
- package/src/searchfield/createSearchField.ts +241 -186
- package/src/searchfield/index.ts +2 -2
- package/src/select/createHiddenSelect.tsx +263 -236
- package/src/select/createSelect.ts +373 -395
- package/src/select/index.ts +14 -14
- package/src/slider/createSlider.ts +364 -349
- package/src/slider/index.ts +2 -2
- package/src/ssr/index.tsx +370 -370
- package/src/table/createTable.ts +3 -1
- package/src/table/createTableColumnHeader.ts +1 -1
- package/src/table/createTableRow.ts +1 -1
- package/src/tabs/createTabs.ts +80 -51
- package/src/tag/createTag.ts +135 -6
- package/src/tag/createTagGroup.ts +7 -2
- package/src/toast/createToast.ts +8 -2
- package/src/toast/createToastRegion.ts +0 -1
- package/src/toolbar/createToolbar.ts +75 -1
- package/src/tooltip/createTooltip.ts +79 -79
- package/src/tooltip/createTooltipTrigger.ts +226 -222
- package/src/tooltip/index.ts +6 -6
- package/src/tree/createTree.ts +261 -246
- package/src/tree/createTreeItem.ts +282 -233
- package/src/tree/createTreeSelectionCheckbox.ts +68 -68
- package/src/tree/index.ts +16 -16
- package/src/tree/types.ts +91 -87
- package/src/utils/env.ts +55 -54
- package/src/utils/platform.ts +16 -6
- package/src/visually-hidden/createVisuallyHidden.ts +139 -124
- package/src/visually-hidden/index.ts +6 -6
|
@@ -1,396 +1,396 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Virtual focus management for solidaria
|
|
3
|
-
*
|
|
4
|
-
* Provides virtual focus for large collections where tracking DOM focus
|
|
5
|
-
* on every item is impractical. Instead, a single element receives real
|
|
6
|
-
* focus while aria-activedescendant indicates the virtually focused item.
|
|
7
|
-
*
|
|
8
|
-
* This is commonly used in:
|
|
9
|
-
* - Virtualized lists (where not all items are in the DOM)
|
|
10
|
-
* - Large trees
|
|
11
|
-
* - Autocomplete/combobox suggestions
|
|
12
|
-
* - Grid/table navigation
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import { type Accessor, createSignal, createEffect, onCleanup } from 'solid-js';
|
|
16
|
-
import { isServer } from 'solid-js/web';
|
|
17
|
-
|
|
18
|
-
// ============================================
|
|
19
|
-
// TYPES
|
|
20
|
-
// ============================================
|
|
21
|
-
|
|
22
|
-
export interface VirtualFocusOptions<T> {
|
|
23
|
-
/**
|
|
24
|
-
* The items in the collection.
|
|
25
|
-
*/
|
|
26
|
-
items: Accessor<T[]>;
|
|
27
|
-
/**
|
|
28
|
-
* Function to get a unique key for each item.
|
|
29
|
-
*/
|
|
30
|
-
getKey: (item: T) => string;
|
|
31
|
-
/**
|
|
32
|
-
* Function to check if an item is disabled.
|
|
33
|
-
*/
|
|
34
|
-
isDisabled?: (item: T) => boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Initial focused key.
|
|
37
|
-
*/
|
|
38
|
-
defaultFocusedKey?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Controlled focused key.
|
|
41
|
-
*/
|
|
42
|
-
focusedKey?: Accessor<string | null>;
|
|
43
|
-
/**
|
|
44
|
-
* Callback when focused key changes.
|
|
45
|
-
*/
|
|
46
|
-
onFocusChange?: (key: string | null) => void;
|
|
47
|
-
/**
|
|
48
|
-
* Whether to wrap focus at the edges.
|
|
49
|
-
* @default true
|
|
50
|
-
*/
|
|
51
|
-
wrap?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Whether to loop through disabled items.
|
|
54
|
-
* @default false
|
|
55
|
-
*/
|
|
56
|
-
skipDisabled?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Orientation for keyboard navigation.
|
|
59
|
-
* @default 'vertical'
|
|
60
|
-
*/
|
|
61
|
-
orientation?: 'horizontal' | 'vertical' | 'both';
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface VirtualFocusResult<T> {
|
|
65
|
-
/**
|
|
66
|
-
* The currently focused key.
|
|
67
|
-
*/
|
|
68
|
-
focusedKey: Accessor<string | null>;
|
|
69
|
-
/**
|
|
70
|
-
* The currently focused item (if any).
|
|
71
|
-
*/
|
|
72
|
-
focusedItem: Accessor<T | null>;
|
|
73
|
-
/**
|
|
74
|
-
* Set the focused key.
|
|
75
|
-
*/
|
|
76
|
-
setFocusedKey: (key: string | null) => void;
|
|
77
|
-
/**
|
|
78
|
-
* Move focus to the next item.
|
|
79
|
-
*/
|
|
80
|
-
focusNext: () => void;
|
|
81
|
-
/**
|
|
82
|
-
* Move focus to the previous item.
|
|
83
|
-
*/
|
|
84
|
-
focusPrevious: () => void;
|
|
85
|
-
/**
|
|
86
|
-
* Move focus to the first item.
|
|
87
|
-
*/
|
|
88
|
-
focusFirst: () => void;
|
|
89
|
-
/**
|
|
90
|
-
* Move focus to the last item.
|
|
91
|
-
*/
|
|
92
|
-
focusLast: () => void;
|
|
93
|
-
/**
|
|
94
|
-
* Move focus by a page (for large lists).
|
|
95
|
-
*/
|
|
96
|
-
focusPageDown: (pageSize?: number) => void;
|
|
97
|
-
/**
|
|
98
|
-
* Move focus up by a page (for large lists).
|
|
99
|
-
*/
|
|
100
|
-
focusPageUp: (pageSize?: number) => void;
|
|
101
|
-
/**
|
|
102
|
-
* Check if a key is the currently focused key.
|
|
103
|
-
*/
|
|
104
|
-
isFocused: (key: string) => boolean;
|
|
105
|
-
/**
|
|
106
|
-
* Props to spread on the container element.
|
|
107
|
-
*/
|
|
108
|
-
containerProps: {
|
|
109
|
-
'aria-activedescendant': Accessor<string | undefined>;
|
|
110
|
-
onKeyDown: (e: KeyboardEvent) => void;
|
|
111
|
-
};
|
|
112
|
-
/**
|
|
113
|
-
* Get props for an item element.
|
|
114
|
-
*/
|
|
115
|
-
getItemProps: (key: string) => {
|
|
116
|
-
id: string;
|
|
117
|
-
'aria-selected'?: boolean;
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// ============================================
|
|
122
|
-
// CONSTANTS
|
|
123
|
-
// ============================================
|
|
124
|
-
|
|
125
|
-
const DEFAULT_PAGE_SIZE = 10;
|
|
126
|
-
|
|
127
|
-
// ============================================
|
|
128
|
-
// HOOK
|
|
129
|
-
// ============================================
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Creates virtual focus management for a collection.
|
|
133
|
-
*
|
|
134
|
-
* Virtual focus uses aria-activedescendant to indicate which item is
|
|
135
|
-
* "focused" while keeping real DOM focus on a container element. This
|
|
136
|
-
* is more performant for large collections and required for virtualized
|
|
137
|
-
* lists where items may not be in the DOM.
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* ```tsx
|
|
141
|
-
* function Listbox(props) {
|
|
142
|
-
* const virtualFocus = createVirtualFocus({
|
|
143
|
-
* items: () => props.items,
|
|
144
|
-
* getKey: (item) => item.id,
|
|
145
|
-
* isDisabled: (item) => item.disabled,
|
|
146
|
-
* });
|
|
147
|
-
*
|
|
148
|
-
* return (
|
|
149
|
-
* <ul
|
|
150
|
-
* role="listbox"
|
|
151
|
-
* tabIndex={0}
|
|
152
|
-
* aria-activedescendant={virtualFocus.containerProps['aria-activedescendant']()}
|
|
153
|
-
* onKeyDown={virtualFocus.containerProps.onKeyDown}
|
|
154
|
-
* >
|
|
155
|
-
* <For each={props.items}>
|
|
156
|
-
* {(item) => (
|
|
157
|
-
* <li
|
|
158
|
-
* {...virtualFocus.getItemProps(item.id)}
|
|
159
|
-
* role="option"
|
|
160
|
-
* aria-selected={virtualFocus.isFocused(item.id)}
|
|
161
|
-
* >
|
|
162
|
-
* {item.name}
|
|
163
|
-
* </li>
|
|
164
|
-
* )}
|
|
165
|
-
* </For>
|
|
166
|
-
* </ul>
|
|
167
|
-
* );
|
|
168
|
-
* }
|
|
169
|
-
* ```
|
|
170
|
-
*
|
|
171
|
-
* @example
|
|
172
|
-
* ```tsx
|
|
173
|
-
* // With controlled focus
|
|
174
|
-
* function ControlledListbox() {
|
|
175
|
-
* const [focusedKey, setFocusedKey] = createSignal<string | null>(null);
|
|
176
|
-
*
|
|
177
|
-
* const virtualFocus = createVirtualFocus({
|
|
178
|
-
* items: () => items,
|
|
179
|
-
* getKey: (item) => item.id,
|
|
180
|
-
* focusedKey: focusedKey,
|
|
181
|
-
* onFocusChange: setFocusedKey,
|
|
182
|
-
* });
|
|
183
|
-
*
|
|
184
|
-
* return <ul>...</ul>;
|
|
185
|
-
* }
|
|
186
|
-
* ```
|
|
187
|
-
*/
|
|
188
|
-
export function createVirtualFocus<T>(
|
|
189
|
-
options: VirtualFocusOptions<T>
|
|
190
|
-
): VirtualFocusResult<T> {
|
|
191
|
-
const {
|
|
192
|
-
items,
|
|
193
|
-
getKey,
|
|
194
|
-
isDisabled = () => false,
|
|
195
|
-
defaultFocusedKey,
|
|
196
|
-
focusedKey: controlledFocusedKey,
|
|
197
|
-
onFocusChange,
|
|
198
|
-
wrap = true,
|
|
199
|
-
skipDisabled = true,
|
|
200
|
-
orientation = 'vertical',
|
|
201
|
-
} = options;
|
|
202
|
-
|
|
203
|
-
// During SSR, return minimal implementation
|
|
204
|
-
if (isServer) {
|
|
205
|
-
const emptyAccessor = () => null;
|
|
206
|
-
return {
|
|
207
|
-
focusedKey: emptyAccessor,
|
|
208
|
-
focusedItem: emptyAccessor,
|
|
209
|
-
setFocusedKey: () => {},
|
|
210
|
-
focusNext: () => {},
|
|
211
|
-
focusPrevious: () => {},
|
|
212
|
-
focusFirst: () => {},
|
|
213
|
-
focusLast: () => {},
|
|
214
|
-
focusPageDown: () => {},
|
|
215
|
-
focusPageUp: () => {},
|
|
216
|
-
isFocused: () => false,
|
|
217
|
-
containerProps: {
|
|
218
|
-
'aria-activedescendant': () => undefined,
|
|
219
|
-
onKeyDown: () => {},
|
|
220
|
-
},
|
|
221
|
-
getItemProps: (key: string) => ({ id: `item-${key}` }),
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// Internal state for uncontrolled mode
|
|
226
|
-
const [internalKey, setInternalKey] = createSignal<string | null>(
|
|
227
|
-
defaultFocusedKey ?? null
|
|
228
|
-
);
|
|
229
|
-
|
|
230
|
-
// Use controlled or uncontrolled value
|
|
231
|
-
const focusedKey = controlledFocusedKey ?? internalKey;
|
|
232
|
-
|
|
233
|
-
const setFocusedKey = (key: string | null) => {
|
|
234
|
-
if (controlledFocusedKey) {
|
|
235
|
-
onFocusChange?.(key);
|
|
236
|
-
} else {
|
|
237
|
-
setInternalKey(key);
|
|
238
|
-
onFocusChange?.(key);
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
// Get focused item
|
|
243
|
-
const focusedItem = (): T | null => {
|
|
244
|
-
const key = focusedKey();
|
|
245
|
-
if (!key) return null;
|
|
246
|
-
return items().find((item) => getKey(item) === key) ?? null;
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
// Get valid items (not disabled if skipDisabled is true)
|
|
250
|
-
const getValidItems = (): T[] => {
|
|
251
|
-
if (!skipDisabled) return items();
|
|
252
|
-
return items().filter((item) => !isDisabled(item));
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
// Get index of key in valid items
|
|
256
|
-
const getKeyIndex = (key: string | null): number => {
|
|
257
|
-
if (!key) return -1;
|
|
258
|
-
const validItems = getValidItems();
|
|
259
|
-
return validItems.findIndex((item) => getKey(item) === key);
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
// Focus by index
|
|
263
|
-
const focusByIndex = (index: number): void => {
|
|
264
|
-
const validItems = getValidItems();
|
|
265
|
-
if (validItems.length === 0) return;
|
|
266
|
-
|
|
267
|
-
let targetIndex = index;
|
|
268
|
-
|
|
269
|
-
if (wrap) {
|
|
270
|
-
targetIndex = ((index % validItems.length) + validItems.length) % validItems.length;
|
|
271
|
-
} else {
|
|
272
|
-
targetIndex = Math.max(0, Math.min(index, validItems.length - 1));
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
const item = validItems[targetIndex];
|
|
276
|
-
if (item) {
|
|
277
|
-
setFocusedKey(getKey(item));
|
|
278
|
-
}
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
const focusNext = (): void => {
|
|
282
|
-
const currentIndex = getKeyIndex(focusedKey());
|
|
283
|
-
focusByIndex(currentIndex + 1);
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
const focusPrevious = (): void => {
|
|
287
|
-
const currentIndex = getKeyIndex(focusedKey());
|
|
288
|
-
if (currentIndex === -1) {
|
|
289
|
-
focusByIndex(getValidItems().length - 1);
|
|
290
|
-
} else {
|
|
291
|
-
focusByIndex(currentIndex - 1);
|
|
292
|
-
}
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
const focusFirst = (): void => {
|
|
296
|
-
focusByIndex(0);
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
const focusLast = (): void => {
|
|
300
|
-
focusByIndex(getValidItems().length - 1);
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
const focusPageDown = (pageSize: number = DEFAULT_PAGE_SIZE): void => {
|
|
304
|
-
const currentIndex = getKeyIndex(focusedKey());
|
|
305
|
-
focusByIndex(currentIndex + pageSize);
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
const focusPageUp = (pageSize: number = DEFAULT_PAGE_SIZE): void => {
|
|
309
|
-
const currentIndex = getKeyIndex(focusedKey());
|
|
310
|
-
if (currentIndex === -1) {
|
|
311
|
-
focusByIndex(getValidItems().length - 1);
|
|
312
|
-
} else {
|
|
313
|
-
focusByIndex(currentIndex - pageSize);
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
|
|
317
|
-
const isFocused = (key: string): boolean => {
|
|
318
|
-
return focusedKey() === key;
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
-
// Keyboard handler
|
|
322
|
-
const onKeyDown = (e: KeyboardEvent): void => {
|
|
323
|
-
const isVertical = orientation === 'vertical' || orientation === 'both';
|
|
324
|
-
const isHorizontal = orientation === 'horizontal' || orientation === 'both';
|
|
325
|
-
|
|
326
|
-
switch (e.key) {
|
|
327
|
-
case 'ArrowDown':
|
|
328
|
-
if (isVertical) {
|
|
329
|
-
e.preventDefault();
|
|
330
|
-
focusNext();
|
|
331
|
-
}
|
|
332
|
-
break;
|
|
333
|
-
case 'ArrowUp':
|
|
334
|
-
if (isVertical) {
|
|
335
|
-
e.preventDefault();
|
|
336
|
-
focusPrevious();
|
|
337
|
-
}
|
|
338
|
-
break;
|
|
339
|
-
case 'ArrowRight':
|
|
340
|
-
if (isHorizontal) {
|
|
341
|
-
e.preventDefault();
|
|
342
|
-
focusNext();
|
|
343
|
-
}
|
|
344
|
-
break;
|
|
345
|
-
case 'ArrowLeft':
|
|
346
|
-
if (isHorizontal) {
|
|
347
|
-
e.preventDefault();
|
|
348
|
-
focusPrevious();
|
|
349
|
-
}
|
|
350
|
-
break;
|
|
351
|
-
case 'Home':
|
|
352
|
-
e.preventDefault();
|
|
353
|
-
focusFirst();
|
|
354
|
-
break;
|
|
355
|
-
case 'End':
|
|
356
|
-
e.preventDefault();
|
|
357
|
-
focusLast();
|
|
358
|
-
break;
|
|
359
|
-
case 'PageDown':
|
|
360
|
-
e.preventDefault();
|
|
361
|
-
focusPageDown();
|
|
362
|
-
break;
|
|
363
|
-
case 'PageUp':
|
|
364
|
-
e.preventDefault();
|
|
365
|
-
focusPageUp();
|
|
366
|
-
break;
|
|
367
|
-
}
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
const containerProps = {
|
|
371
|
-
'aria-activedescendant': () => {
|
|
372
|
-
const key = focusedKey();
|
|
373
|
-
return key ? `item-${key}` : undefined;
|
|
374
|
-
},
|
|
375
|
-
onKeyDown,
|
|
376
|
-
};
|
|
377
|
-
|
|
378
|
-
const getItemProps = (key: string) => ({
|
|
379
|
-
id: `item-${key}`,
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
return {
|
|
383
|
-
focusedKey,
|
|
384
|
-
focusedItem,
|
|
385
|
-
setFocusedKey,
|
|
386
|
-
focusNext,
|
|
387
|
-
focusPrevious,
|
|
388
|
-
focusFirst,
|
|
389
|
-
focusLast,
|
|
390
|
-
focusPageDown,
|
|
391
|
-
focusPageUp,
|
|
392
|
-
isFocused,
|
|
393
|
-
containerProps,
|
|
394
|
-
getItemProps,
|
|
395
|
-
};
|
|
396
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Virtual focus management for solidaria
|
|
3
|
+
*
|
|
4
|
+
* Provides virtual focus for large collections where tracking DOM focus
|
|
5
|
+
* on every item is impractical. Instead, a single element receives real
|
|
6
|
+
* focus while aria-activedescendant indicates the virtually focused item.
|
|
7
|
+
*
|
|
8
|
+
* This is commonly used in:
|
|
9
|
+
* - Virtualized lists (where not all items are in the DOM)
|
|
10
|
+
* - Large trees
|
|
11
|
+
* - Autocomplete/combobox suggestions
|
|
12
|
+
* - Grid/table navigation
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { type Accessor, createSignal, createEffect, onCleanup } from 'solid-js';
|
|
16
|
+
import { isServer } from 'solid-js/web';
|
|
17
|
+
|
|
18
|
+
// ============================================
|
|
19
|
+
// TYPES
|
|
20
|
+
// ============================================
|
|
21
|
+
|
|
22
|
+
export interface VirtualFocusOptions<T> {
|
|
23
|
+
/**
|
|
24
|
+
* The items in the collection.
|
|
25
|
+
*/
|
|
26
|
+
items: Accessor<T[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Function to get a unique key for each item.
|
|
29
|
+
*/
|
|
30
|
+
getKey: (item: T) => string;
|
|
31
|
+
/**
|
|
32
|
+
* Function to check if an item is disabled.
|
|
33
|
+
*/
|
|
34
|
+
isDisabled?: (item: T) => boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Initial focused key.
|
|
37
|
+
*/
|
|
38
|
+
defaultFocusedKey?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Controlled focused key.
|
|
41
|
+
*/
|
|
42
|
+
focusedKey?: Accessor<string | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Callback when focused key changes.
|
|
45
|
+
*/
|
|
46
|
+
onFocusChange?: (key: string | null) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Whether to wrap focus at the edges.
|
|
49
|
+
* @default true
|
|
50
|
+
*/
|
|
51
|
+
wrap?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Whether to loop through disabled items.
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
skipDisabled?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Orientation for keyboard navigation.
|
|
59
|
+
* @default 'vertical'
|
|
60
|
+
*/
|
|
61
|
+
orientation?: 'horizontal' | 'vertical' | 'both';
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface VirtualFocusResult<T> {
|
|
65
|
+
/**
|
|
66
|
+
* The currently focused key.
|
|
67
|
+
*/
|
|
68
|
+
focusedKey: Accessor<string | null>;
|
|
69
|
+
/**
|
|
70
|
+
* The currently focused item (if any).
|
|
71
|
+
*/
|
|
72
|
+
focusedItem: Accessor<T | null>;
|
|
73
|
+
/**
|
|
74
|
+
* Set the focused key.
|
|
75
|
+
*/
|
|
76
|
+
setFocusedKey: (key: string | null) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Move focus to the next item.
|
|
79
|
+
*/
|
|
80
|
+
focusNext: () => void;
|
|
81
|
+
/**
|
|
82
|
+
* Move focus to the previous item.
|
|
83
|
+
*/
|
|
84
|
+
focusPrevious: () => void;
|
|
85
|
+
/**
|
|
86
|
+
* Move focus to the first item.
|
|
87
|
+
*/
|
|
88
|
+
focusFirst: () => void;
|
|
89
|
+
/**
|
|
90
|
+
* Move focus to the last item.
|
|
91
|
+
*/
|
|
92
|
+
focusLast: () => void;
|
|
93
|
+
/**
|
|
94
|
+
* Move focus by a page (for large lists).
|
|
95
|
+
*/
|
|
96
|
+
focusPageDown: (pageSize?: number) => void;
|
|
97
|
+
/**
|
|
98
|
+
* Move focus up by a page (for large lists).
|
|
99
|
+
*/
|
|
100
|
+
focusPageUp: (pageSize?: number) => void;
|
|
101
|
+
/**
|
|
102
|
+
* Check if a key is the currently focused key.
|
|
103
|
+
*/
|
|
104
|
+
isFocused: (key: string) => boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Props to spread on the container element.
|
|
107
|
+
*/
|
|
108
|
+
containerProps: {
|
|
109
|
+
'aria-activedescendant': Accessor<string | undefined>;
|
|
110
|
+
onKeyDown: (e: KeyboardEvent) => void;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Get props for an item element.
|
|
114
|
+
*/
|
|
115
|
+
getItemProps: (key: string) => {
|
|
116
|
+
id: string;
|
|
117
|
+
'aria-selected'?: boolean;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// ============================================
|
|
122
|
+
// CONSTANTS
|
|
123
|
+
// ============================================
|
|
124
|
+
|
|
125
|
+
const DEFAULT_PAGE_SIZE = 10;
|
|
126
|
+
|
|
127
|
+
// ============================================
|
|
128
|
+
// HOOK
|
|
129
|
+
// ============================================
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Creates virtual focus management for a collection.
|
|
133
|
+
*
|
|
134
|
+
* Virtual focus uses aria-activedescendant to indicate which item is
|
|
135
|
+
* "focused" while keeping real DOM focus on a container element. This
|
|
136
|
+
* is more performant for large collections and required for virtualized
|
|
137
|
+
* lists where items may not be in the DOM.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```tsx
|
|
141
|
+
* function Listbox(props) {
|
|
142
|
+
* const virtualFocus = createVirtualFocus({
|
|
143
|
+
* items: () => props.items,
|
|
144
|
+
* getKey: (item) => item.id,
|
|
145
|
+
* isDisabled: (item) => item.disabled,
|
|
146
|
+
* });
|
|
147
|
+
*
|
|
148
|
+
* return (
|
|
149
|
+
* <ul
|
|
150
|
+
* role="listbox"
|
|
151
|
+
* tabIndex={0}
|
|
152
|
+
* aria-activedescendant={virtualFocus.containerProps['aria-activedescendant']()}
|
|
153
|
+
* onKeyDown={virtualFocus.containerProps.onKeyDown}
|
|
154
|
+
* >
|
|
155
|
+
* <For each={props.items}>
|
|
156
|
+
* {(item) => (
|
|
157
|
+
* <li
|
|
158
|
+
* {...virtualFocus.getItemProps(item.id)}
|
|
159
|
+
* role="option"
|
|
160
|
+
* aria-selected={virtualFocus.isFocused(item.id)}
|
|
161
|
+
* >
|
|
162
|
+
* {item.name}
|
|
163
|
+
* </li>
|
|
164
|
+
* )}
|
|
165
|
+
* </For>
|
|
166
|
+
* </ul>
|
|
167
|
+
* );
|
|
168
|
+
* }
|
|
169
|
+
* ```
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```tsx
|
|
173
|
+
* // With controlled focus
|
|
174
|
+
* function ControlledListbox() {
|
|
175
|
+
* const [focusedKey, setFocusedKey] = createSignal<string | null>(null);
|
|
176
|
+
*
|
|
177
|
+
* const virtualFocus = createVirtualFocus({
|
|
178
|
+
* items: () => items,
|
|
179
|
+
* getKey: (item) => item.id,
|
|
180
|
+
* focusedKey: focusedKey,
|
|
181
|
+
* onFocusChange: setFocusedKey,
|
|
182
|
+
* });
|
|
183
|
+
*
|
|
184
|
+
* return <ul>...</ul>;
|
|
185
|
+
* }
|
|
186
|
+
* ```
|
|
187
|
+
*/
|
|
188
|
+
export function createVirtualFocus<T>(
|
|
189
|
+
options: VirtualFocusOptions<T>
|
|
190
|
+
): VirtualFocusResult<T> {
|
|
191
|
+
const {
|
|
192
|
+
items,
|
|
193
|
+
getKey,
|
|
194
|
+
isDisabled = () => false,
|
|
195
|
+
defaultFocusedKey,
|
|
196
|
+
focusedKey: controlledFocusedKey,
|
|
197
|
+
onFocusChange,
|
|
198
|
+
wrap = true,
|
|
199
|
+
skipDisabled = true,
|
|
200
|
+
orientation = 'vertical',
|
|
201
|
+
} = options;
|
|
202
|
+
|
|
203
|
+
// During SSR, return minimal implementation
|
|
204
|
+
if (isServer) {
|
|
205
|
+
const emptyAccessor = () => null;
|
|
206
|
+
return {
|
|
207
|
+
focusedKey: emptyAccessor,
|
|
208
|
+
focusedItem: emptyAccessor,
|
|
209
|
+
setFocusedKey: () => {},
|
|
210
|
+
focusNext: () => {},
|
|
211
|
+
focusPrevious: () => {},
|
|
212
|
+
focusFirst: () => {},
|
|
213
|
+
focusLast: () => {},
|
|
214
|
+
focusPageDown: () => {},
|
|
215
|
+
focusPageUp: () => {},
|
|
216
|
+
isFocused: () => false,
|
|
217
|
+
containerProps: {
|
|
218
|
+
'aria-activedescendant': () => undefined,
|
|
219
|
+
onKeyDown: () => {},
|
|
220
|
+
},
|
|
221
|
+
getItemProps: (key: string) => ({ id: `item-${key}` }),
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Internal state for uncontrolled mode
|
|
226
|
+
const [internalKey, setInternalKey] = createSignal<string | null>(
|
|
227
|
+
defaultFocusedKey ?? null
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
// Use controlled or uncontrolled value
|
|
231
|
+
const focusedKey = controlledFocusedKey ?? internalKey;
|
|
232
|
+
|
|
233
|
+
const setFocusedKey = (key: string | null) => {
|
|
234
|
+
if (controlledFocusedKey) {
|
|
235
|
+
onFocusChange?.(key);
|
|
236
|
+
} else {
|
|
237
|
+
setInternalKey(key);
|
|
238
|
+
onFocusChange?.(key);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// Get focused item
|
|
243
|
+
const focusedItem = (): T | null => {
|
|
244
|
+
const key = focusedKey();
|
|
245
|
+
if (!key) return null;
|
|
246
|
+
return items().find((item) => getKey(item) === key) ?? null;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
// Get valid items (not disabled if skipDisabled is true)
|
|
250
|
+
const getValidItems = (): T[] => {
|
|
251
|
+
if (!skipDisabled) return items();
|
|
252
|
+
return items().filter((item) => !isDisabled(item));
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
// Get index of key in valid items
|
|
256
|
+
const getKeyIndex = (key: string | null): number => {
|
|
257
|
+
if (!key) return -1;
|
|
258
|
+
const validItems = getValidItems();
|
|
259
|
+
return validItems.findIndex((item) => getKey(item) === key);
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
// Focus by index
|
|
263
|
+
const focusByIndex = (index: number): void => {
|
|
264
|
+
const validItems = getValidItems();
|
|
265
|
+
if (validItems.length === 0) return;
|
|
266
|
+
|
|
267
|
+
let targetIndex = index;
|
|
268
|
+
|
|
269
|
+
if (wrap) {
|
|
270
|
+
targetIndex = ((index % validItems.length) + validItems.length) % validItems.length;
|
|
271
|
+
} else {
|
|
272
|
+
targetIndex = Math.max(0, Math.min(index, validItems.length - 1));
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
const item = validItems[targetIndex];
|
|
276
|
+
if (item) {
|
|
277
|
+
setFocusedKey(getKey(item));
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
const focusNext = (): void => {
|
|
282
|
+
const currentIndex = getKeyIndex(focusedKey());
|
|
283
|
+
focusByIndex(currentIndex + 1);
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
const focusPrevious = (): void => {
|
|
287
|
+
const currentIndex = getKeyIndex(focusedKey());
|
|
288
|
+
if (currentIndex === -1) {
|
|
289
|
+
focusByIndex(getValidItems().length - 1);
|
|
290
|
+
} else {
|
|
291
|
+
focusByIndex(currentIndex - 1);
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
const focusFirst = (): void => {
|
|
296
|
+
focusByIndex(0);
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
const focusLast = (): void => {
|
|
300
|
+
focusByIndex(getValidItems().length - 1);
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
const focusPageDown = (pageSize: number = DEFAULT_PAGE_SIZE): void => {
|
|
304
|
+
const currentIndex = getKeyIndex(focusedKey());
|
|
305
|
+
focusByIndex(currentIndex + pageSize);
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
const focusPageUp = (pageSize: number = DEFAULT_PAGE_SIZE): void => {
|
|
309
|
+
const currentIndex = getKeyIndex(focusedKey());
|
|
310
|
+
if (currentIndex === -1) {
|
|
311
|
+
focusByIndex(getValidItems().length - 1);
|
|
312
|
+
} else {
|
|
313
|
+
focusByIndex(currentIndex - pageSize);
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
const isFocused = (key: string): boolean => {
|
|
318
|
+
return focusedKey() === key;
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
// Keyboard handler
|
|
322
|
+
const onKeyDown = (e: KeyboardEvent): void => {
|
|
323
|
+
const isVertical = orientation === 'vertical' || orientation === 'both';
|
|
324
|
+
const isHorizontal = orientation === 'horizontal' || orientation === 'both';
|
|
325
|
+
|
|
326
|
+
switch (e.key) {
|
|
327
|
+
case 'ArrowDown':
|
|
328
|
+
if (isVertical) {
|
|
329
|
+
e.preventDefault();
|
|
330
|
+
focusNext();
|
|
331
|
+
}
|
|
332
|
+
break;
|
|
333
|
+
case 'ArrowUp':
|
|
334
|
+
if (isVertical) {
|
|
335
|
+
e.preventDefault();
|
|
336
|
+
focusPrevious();
|
|
337
|
+
}
|
|
338
|
+
break;
|
|
339
|
+
case 'ArrowRight':
|
|
340
|
+
if (isHorizontal) {
|
|
341
|
+
e.preventDefault();
|
|
342
|
+
focusNext();
|
|
343
|
+
}
|
|
344
|
+
break;
|
|
345
|
+
case 'ArrowLeft':
|
|
346
|
+
if (isHorizontal) {
|
|
347
|
+
e.preventDefault();
|
|
348
|
+
focusPrevious();
|
|
349
|
+
}
|
|
350
|
+
break;
|
|
351
|
+
case 'Home':
|
|
352
|
+
e.preventDefault();
|
|
353
|
+
focusFirst();
|
|
354
|
+
break;
|
|
355
|
+
case 'End':
|
|
356
|
+
e.preventDefault();
|
|
357
|
+
focusLast();
|
|
358
|
+
break;
|
|
359
|
+
case 'PageDown':
|
|
360
|
+
e.preventDefault();
|
|
361
|
+
focusPageDown();
|
|
362
|
+
break;
|
|
363
|
+
case 'PageUp':
|
|
364
|
+
e.preventDefault();
|
|
365
|
+
focusPageUp();
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
const containerProps = {
|
|
371
|
+
'aria-activedescendant': () => {
|
|
372
|
+
const key = focusedKey();
|
|
373
|
+
return key ? `item-${key}` : undefined;
|
|
374
|
+
},
|
|
375
|
+
onKeyDown,
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
const getItemProps = (key: string) => ({
|
|
379
|
+
id: `item-${key}`,
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
return {
|
|
383
|
+
focusedKey,
|
|
384
|
+
focusedItem,
|
|
385
|
+
setFocusedKey,
|
|
386
|
+
focusNext,
|
|
387
|
+
focusPrevious,
|
|
388
|
+
focusFirst,
|
|
389
|
+
focusLast,
|
|
390
|
+
focusPageDown,
|
|
391
|
+
focusPageUp,
|
|
392
|
+
isFocused,
|
|
393
|
+
containerProps,
|
|
394
|
+
getItemProps,
|
|
395
|
+
};
|
|
396
|
+
}
|