@react-aria/selection 3.8.2 → 3.10.0
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/main.js +61 -61
- package/dist/main.js.map +1 -1
- package/dist/module.js +56 -44
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +41 -21
- package/dist/types.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/index.ts +10 -5
- package/src/useSelectableCollection.ts +10 -10
- package/src/useSelectableItem.ts +105 -36
- package/src/useSelectableList.ts +7 -7
- package/src/useTypeSelect.ts +6 -6
package/dist/module.js
CHANGED
|
@@ -4,12 +4,6 @@ import {focusWithoutScrolling as $eCAIO$focusWithoutScrolling, useEvent as $eCAI
|
|
|
4
4
|
import {useLocale as $eCAIO$useLocale, useCollator as $eCAIO$useCollator} from "@react-aria/i18n";
|
|
5
5
|
import {usePress as $eCAIO$usePress, useLongPress as $eCAIO$useLongPress} from "@react-aria/interactions";
|
|
6
6
|
|
|
7
|
-
function $parcel$export(e, n, v, s) {
|
|
8
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
9
|
-
}
|
|
10
|
-
var $ae20dd8cbca75726$exports = {};
|
|
11
|
-
|
|
12
|
-
$parcel$export($ae20dd8cbca75726$exports, "useSelectableCollection", () => $ae20dd8cbca75726$export$d6daf82dcd84e87c);
|
|
13
7
|
|
|
14
8
|
|
|
15
9
|
|
|
@@ -27,9 +21,6 @@ function $feb5ffebff200149$export$16792effe837dba3(e) {
|
|
|
27
21
|
|
|
28
22
|
|
|
29
23
|
|
|
30
|
-
var $fb3050f43d946246$exports = {};
|
|
31
|
-
|
|
32
|
-
$parcel$export($fb3050f43d946246$exports, "useTypeSelect", () => $fb3050f43d946246$export$e32c88dfddc6e1d8);
|
|
33
24
|
|
|
34
25
|
function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
|
|
35
26
|
let { keyboardDelegate: keyboardDelegate , selectionManager: selectionManager , onTypeSelect: onTypeSelect } = options;
|
|
@@ -309,9 +300,6 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
309
300
|
}
|
|
310
301
|
|
|
311
302
|
|
|
312
|
-
var $880e95eb8b93ba9a$exports = {};
|
|
313
|
-
|
|
314
|
-
$parcel$export($880e95eb8b93ba9a$exports, "useSelectableItem", () => $880e95eb8b93ba9a$export$ecf600387e221c37);
|
|
315
303
|
|
|
316
304
|
|
|
317
305
|
|
|
@@ -333,15 +321,15 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
333
321
|
}
|
|
334
322
|
};
|
|
335
323
|
// Focus the associated DOM node when this item becomes the focusedKey
|
|
336
|
-
let isFocused = key === manager.focusedKey;
|
|
337
324
|
$eCAIO$useEffect(()=>{
|
|
325
|
+
let isFocused = key === manager.focusedKey;
|
|
338
326
|
if (isFocused && manager.isFocused && !shouldUseVirtualFocus && document.activeElement !== ref.current) {
|
|
339
327
|
if (focus) focus();
|
|
340
328
|
else $eCAIO$focusSafely(ref.current);
|
|
341
329
|
}
|
|
342
330
|
}, [
|
|
343
331
|
ref,
|
|
344
|
-
|
|
332
|
+
key,
|
|
345
333
|
manager.focusedKey,
|
|
346
334
|
manager.childFocusStrategy,
|
|
347
335
|
manager.isFocused,
|
|
@@ -353,15 +341,25 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
353
341
|
let itemProps = {
|
|
354
342
|
};
|
|
355
343
|
if (!shouldUseVirtualFocus) itemProps = {
|
|
356
|
-
tabIndex:
|
|
344
|
+
tabIndex: key === manager.focusedKey ? 0 : -1,
|
|
357
345
|
onFocus (e) {
|
|
358
346
|
if (e.target === ref.current) manager.setFocusedKey(key);
|
|
359
347
|
}
|
|
360
348
|
};
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
349
|
+
// With checkbox selection, onAction (i.e. navigation) becomes primary, and occurs on a single click of the row.
|
|
350
|
+
// Clicking the checkbox enters selection mode, after which clicking anywhere on any row toggles selection for that row.
|
|
351
|
+
// With highlight selection, onAction is secondary, and occurs on double click. Single click selects the row.
|
|
352
|
+
// With touch, onAction occurs on single tap, and long press enters selection mode.
|
|
353
|
+
isDisabled = isDisabled || manager.isDisabled(key);
|
|
364
354
|
let allowsSelection = !isDisabled && manager.canSelectItem(key);
|
|
355
|
+
let allowsActions = onAction && !isDisabled;
|
|
356
|
+
let hasPrimaryAction = allowsActions && (manager.selectionBehavior === 'replace' ? !allowsSelection : manager.isEmpty);
|
|
357
|
+
let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === 'replace';
|
|
358
|
+
let hasAction = hasPrimaryAction || hasSecondaryAction;
|
|
359
|
+
let modality = $eCAIO$useRef(null);
|
|
360
|
+
let longPressEnabled = hasAction && allowsSelection;
|
|
361
|
+
let longPressEnabledOnPressStart = $eCAIO$useRef(false);
|
|
362
|
+
let hadPrimaryActionOnPressStart = $eCAIO$useRef(false);
|
|
365
363
|
// By default, selection occurs on pointer down. This can be strange if selecting an
|
|
366
364
|
// item causes the UI to disappear immediately (e.g. menus).
|
|
367
365
|
// If shouldSelectOnPressUp is true, we use onPressUp instead of onPressStart.
|
|
@@ -374,13 +372,16 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
374
372
|
if (shouldSelectOnPressUp) {
|
|
375
373
|
itemPressProps.onPressStart = (e)=>{
|
|
376
374
|
modality.current = e.pointerType;
|
|
377
|
-
|
|
375
|
+
longPressEnabledOnPressStart.current = longPressEnabled;
|
|
376
|
+
if (e.pointerType === 'keyboard' && (!hasAction || $880e95eb8b93ba9a$var$isSelectionKey())) onSelect(e);
|
|
378
377
|
};
|
|
379
378
|
// If allowsDifferentPressOrigin, make selection happen on pressUp (e.g. open menu on press down, selection on menu item happens on press up.)
|
|
380
379
|
// Otherwise, have selection happen onPress (prevents listview row selection when clicking on interactable elements in the row)
|
|
381
380
|
if (!allowsDifferentPressOrigin) itemPressProps.onPress = (e)=>{
|
|
382
|
-
if (e.pointerType !== '
|
|
383
|
-
|
|
381
|
+
if (hasPrimaryAction || hasSecondaryAction && e.pointerType !== 'mouse') {
|
|
382
|
+
if (e.pointerType === 'keyboard' && !$880e95eb8b93ba9a$var$isActionKey()) return;
|
|
383
|
+
onAction();
|
|
384
|
+
} else if (e.pointerType !== 'keyboard') onSelect(e);
|
|
384
385
|
};
|
|
385
386
|
else {
|
|
386
387
|
itemPressProps.onPressUp = (e)=>{
|
|
@@ -390,16 +391,21 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
390
391
|
: null;
|
|
391
392
|
}
|
|
392
393
|
} else {
|
|
393
|
-
// On touch, it feels strange to select on touch down, so we special case this.
|
|
394
394
|
itemPressProps.onPressStart = (e)=>{
|
|
395
395
|
modality.current = e.pointerType;
|
|
396
|
-
|
|
396
|
+
longPressEnabledOnPressStart.current = longPressEnabled;
|
|
397
|
+
hadPrimaryActionOnPressStart.current = hasPrimaryAction;
|
|
398
|
+
// Select on mouse down unless there is a primary action which will occur on mouse up.
|
|
399
|
+
// For keyboard, select on key down. If there is an action, the Space key selects on key down,
|
|
400
|
+
// and the Enter key performs onAction on key up.
|
|
401
|
+
if (e.pointerType === 'mouse' && !hasPrimaryAction || e.pointerType === 'keyboard' && (!onAction || $880e95eb8b93ba9a$var$isSelectionKey())) onSelect(e);
|
|
397
402
|
};
|
|
398
403
|
itemPressProps.onPress = (e)=>{
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
404
|
+
// Selection occurs on touch up. Primary actions always occur on pointer up.
|
|
405
|
+
// Both primary and secondary actions occur on Enter key up. The only exception
|
|
406
|
+
// is secondary actions, which occur on double click with a mouse.
|
|
407
|
+
if (e.pointerType === 'touch' || e.pointerType === 'pen' || e.pointerType === 'virtual' || e.pointerType === 'keyboard' && hasAction && $880e95eb8b93ba9a$var$isActionKey() || e.pointerType === 'mouse' && hadPrimaryActionOnPressStart.current) {
|
|
408
|
+
if (hasAction) onAction();
|
|
403
409
|
else onSelect(e);
|
|
404
410
|
}
|
|
405
411
|
};
|
|
@@ -418,9 +424,8 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
418
424
|
// Long pressing an item with touch when selectionBehavior = 'replace' switches the selection behavior
|
|
419
425
|
// to 'toggle'. This changes the single tap behavior from performing an action (i.e. navigating) to
|
|
420
426
|
// selecting, and may toggle the appearance of a UI affordance like checkboxes on each item.
|
|
421
|
-
// TODO: what about when drag and drop is also enabled??
|
|
422
427
|
let { longPressProps: longPressProps } = $eCAIO$useLongPress({
|
|
423
|
-
isDisabled: !
|
|
428
|
+
isDisabled: !longPressEnabled,
|
|
424
429
|
onLongPress (e) {
|
|
425
430
|
if (e.pointerType === 'touch') {
|
|
426
431
|
onSelect(e);
|
|
@@ -428,29 +433,36 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
428
433
|
}
|
|
429
434
|
}
|
|
430
435
|
});
|
|
431
|
-
//
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
436
|
+
// Prevent native drag and drop on long press if we also select on long press.
|
|
437
|
+
// Once the user is in selection mode, they can long press again to drag.
|
|
438
|
+
let onDragStart = (e)=>{
|
|
439
|
+
if (modality.current === 'touch' && longPressEnabledOnPressStart.current) e.preventDefault();
|
|
440
|
+
};
|
|
435
441
|
return {
|
|
436
442
|
itemProps: $eCAIO$mergeProps(itemProps, allowsSelection || hasPrimaryAction ? pressProps : {
|
|
437
|
-
},
|
|
443
|
+
}, longPressEnabled ? longPressProps : {
|
|
438
444
|
}, {
|
|
439
|
-
|
|
440
|
-
|
|
445
|
+
onDoubleClick: onDoubleClick,
|
|
446
|
+
onDragStart: onDragStart
|
|
441
447
|
}),
|
|
442
|
-
isPressed: isPressed
|
|
448
|
+
isPressed: isPressed,
|
|
449
|
+
isSelected: manager.isSelected(key),
|
|
450
|
+
isDisabled: isDisabled,
|
|
451
|
+
allowsSelection: allowsSelection,
|
|
452
|
+
hasAction: hasAction
|
|
443
453
|
};
|
|
444
454
|
}
|
|
455
|
+
function $880e95eb8b93ba9a$var$isActionKey() {
|
|
456
|
+
let event = window.event;
|
|
457
|
+
return (event === null || event === void 0 ? void 0 : event.key) === 'Enter';
|
|
458
|
+
}
|
|
459
|
+
function $880e95eb8b93ba9a$var$isSelectionKey() {
|
|
460
|
+
let event = window.event;
|
|
461
|
+
return (event === null || event === void 0 ? void 0 : event.key) === ' ' || (event === null || event === void 0 ? void 0 : event.code) === 'Space';
|
|
462
|
+
}
|
|
445
463
|
|
|
446
464
|
|
|
447
|
-
var $982254629710d113$exports = {};
|
|
448
|
-
|
|
449
|
-
$parcel$export($982254629710d113$exports, "useSelectableList", () => $982254629710d113$export$b95089534ab7c1fd);
|
|
450
|
-
|
|
451
|
-
var $2a25aae57d74318e$exports = {};
|
|
452
465
|
|
|
453
|
-
$parcel$export($2a25aae57d74318e$exports, "ListKeyboardDelegate", () => $2a25aae57d74318e$export$a05409b8bb224a5a);
|
|
454
466
|
class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
455
467
|
getKeyBelow(key) {
|
|
456
468
|
key = this.collection.getKeyAfter(key);
|
|
@@ -533,7 +545,7 @@ class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
|
533
545
|
|
|
534
546
|
|
|
535
547
|
function $982254629710d113$export$b95089534ab7c1fd(props) {
|
|
536
|
-
let { selectionManager: selectionManager , collection: collection , disabledKeys: disabledKeys , ref: ref , keyboardDelegate: keyboardDelegate , autoFocus: autoFocus , shouldFocusWrap: shouldFocusWrap , isVirtualized: isVirtualized , disallowEmptySelection: disallowEmptySelection , selectOnFocus: selectOnFocus =
|
|
548
|
+
let { selectionManager: selectionManager , collection: collection , disabledKeys: disabledKeys , ref: ref , keyboardDelegate: keyboardDelegate , autoFocus: autoFocus , shouldFocusWrap: shouldFocusWrap , isVirtualized: isVirtualized , disallowEmptySelection: disallowEmptySelection , selectOnFocus: selectOnFocus = selectionManager.selectionBehavior === 'replace' , disallowTypeAhead: disallowTypeAhead , shouldUseVirtualFocus: shouldUseVirtualFocus , allowsTabNavigation: allowsTabNavigation } = props;
|
|
537
549
|
// By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).
|
|
538
550
|
// When virtualized, the layout object will be passed in as a prop and override this.
|
|
539
551
|
let collator = $eCAIO$useCollator({
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;SEqBgB,yCAAgC,CAAC,CAAQ,EAAE,CAAC;IAC1D,EAAqF,AAArF,mFAAqF;IACrF,EAAgE,AAAhE,8DAAgE;IAChE,MAAM,CAAC,oBAAa,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,OAAO;AAC/C,CAAC;SAEe,yCAAgB,CAAC,CAAQ,EAAE,CAAC;IAC1C,EAAE,EAAE,YAAK,IACP,MAAM,CAAC,CAAC,CAAC,OAAO;IAGlB,MAAM,CAAC,CAAC,CAAC,OAAO;AAClB,CAAC;;;;;;;;SCQe,yCAAa,CAAC,OAA0B,EAAkB,CAAC;IACzE,GAAG,CAAC,CAAC,mBAAA,gBAAgB,qBAAE,gBAAgB,iBAAE,YAAY,EAAA,CAAC,GAAG,OAAO;IAChE,GAAG,CAAC,KAAK,GAAG,aAAM,CAAC,CAAC;QAClB,MAAM,EAAE,CAAE;QACV,OAAO,EAAE,IAAI;IACf,CAAC,EAAE,OAAO;IAEV,GAAG,CAAC,SAAS,IAAI,CAAgB,GAAK,CAAC;QACrC,GAAG,CAAC,SAAS,GAAG,qCAAe,CAAC,CAAC,CAAC,GAAG;QACrC,EAAE,GAAG,SAAS,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,EACtC,MAAM;QAGR,EAA8E,AAA9E,4EAA8E;QAC9E,EAA8E,AAA9E,4EAA8E;QAC9E,EAA+E,AAA/E,6EAA+E;QAC/E,EAA4E,AAA5E,0EAA4E;QAC5E,EAAE,EAAE,SA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AAA,eAAe,EAAA,CAAC,GAAG,yCAAuB,CAAC,CAAC;aAC/C,GAAG;0BACH,gBAAgB;QAChB,gBAAgB,EAAE,QAAQ;mBAC1B,SAAS;yBACT,eAAe;gCACf,sBAAsB;uBACtB,aAAa;2BACb,iBAAiB;+BACjB,qBAAqB;6BACrB,mBAAmB;uBACnB,aAAa;QACb,SAAS,EAAE,GAAG;IAChB,CAAC;IAED,MAAM,CAAC,CAAC;QACN,SAAS,EAAE,eAAe;IAC5B,CAAC;AACH,CAAC;","sources":["packages/@react-aria/selection/src/index.ts","packages/@react-aria/selection/src/useSelectableCollection.ts","packages/@react-aria/selection/src/utils.ts","packages/@react-aria/selection/src/useTypeSelect.ts","packages/@react-aria/selection/src/useSelectableItem.ts","packages/@react-aria/selection/src/useSelectableList.ts","packages/@react-aria/selection/src/ListKeyboardDelegate.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './useSelectableCollection';\nexport * from './useSelectableItem';\nexport * from './useSelectableList';\nexport * from './ListKeyboardDelegate';\nexport * from './useTypeSelect';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusEvent, HTMLAttributes, Key, KeyboardEvent, RefObject, useEffect, useRef} from 'react';\nimport {focusSafely, getFocusableTreeWalker} from '@react-aria/focus';\nimport {FocusStrategy, KeyboardDelegate} from '@react-types/shared';\nimport {focusWithoutScrolling, mergeProps, scrollIntoView, useEvent} from '@react-aria/utils';\nimport {isCtrlKeyPressed, isNonContiguousSelectionModifier} from './utils';\nimport {MultipleSelectionManager} from '@react-stately/selection';\nimport {useLocale} from '@react-aria/i18n';\nimport {useTypeSelect} from './useTypeSelect';\n\ninterface SelectableCollectionOptions {\n /**\n * An interface for reading and updating multiple selection state.\n */\n selectionManager: MultipleSelectionManager,\n /**\n * A delegate object that implements behavior for keyboard focus movement.\n */\n keyboardDelegate: KeyboardDelegate,\n /**\n * The ref attached to the element representing the collection.\n */\n ref: RefObject<HTMLElement>,\n /**\n * Whether the collection or one of its items should be automatically focused upon render.\n * @default false\n */\n autoFocus?: boolean | FocusStrategy,\n /**\n * Whether focus should wrap around when the end/start is reached.\n * @default false\n */\n shouldFocusWrap?: boolean,\n /**\n * Whether the collection allows empty selection.\n * @default false\n */\n disallowEmptySelection?: boolean,\n /**\n * Whether the collection allows the user to select all items via keyboard shortcut.\n * @default false\n */\n disallowSelectAll?: boolean,\n /**\n * Whether selection should occur automatically on focus.\n * @default false\n */\n selectOnFocus?: boolean,\n /**\n * Whether typeahead is disabled.\n * @default false\n */\n disallowTypeAhead?: boolean,\n /**\n * Whether the collection items should use virtual focus instead of being focused directly.\n */\n shouldUseVirtualFocus?: boolean,\n /**\n * Whether navigation through tab key is enabled.\n */\n allowsTabNavigation?: boolean,\n /**\n * Whether the collection items are contained in a virtual scroller.\n */\n isVirtualized?: boolean,\n /**\n * The ref attached to the scrollable body. Used to provide automatic scrolling on item focus for non-virtualized collections.\n * If not provided, defaults to the collection ref.\n */\n scrollRef?: RefObject<HTMLElement>\n}\n\ninterface SelectableCollectionAria {\n /** Props for the collection element. */\n collectionProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Handles interactions with selectable collections.\n */\nexport function useSelectableCollection(options: SelectableCollectionOptions): SelectableCollectionAria {\n let {\n selectionManager: manager,\n keyboardDelegate: delegate,\n ref,\n autoFocus = false,\n shouldFocusWrap = false,\n disallowEmptySelection = false,\n disallowSelectAll = false,\n selectOnFocus = manager.selectionBehavior === 'replace',\n disallowTypeAhead = false,\n shouldUseVirtualFocus,\n allowsTabNavigation = false,\n isVirtualized,\n // If no scrollRef is provided, assume the collection ref is the scrollable region\n scrollRef = ref\n } = options;\n let {direction} = useLocale();\n\n\n let onKeyDown = (e: KeyboardEvent) => {\n // Prevent option + tab from doing anything since it doesn't move focus to the cells, only buttons/checkboxes\n if (e.altKey && e.key === 'Tab') {\n e.preventDefault();\n }\n\n // Keyboard events bubble through portals. Don't handle keyboard events\n // for elements outside the collection (e.g. menus).\n if (!ref.current.contains(e.target as HTMLElement)) {\n return;\n }\n\n const navigateToKey = (key: Key | undefined, childFocus?: FocusStrategy) => {\n if (key != null) {\n manager.setFocusedKey(key, childFocus);\n\n if (e.shiftKey && manager.selectionMode === 'multiple') {\n manager.extendSelection(key);\n } else if (selectOnFocus && !isNonContiguousSelectionModifier(e)) {\n manager.replaceSelection(key);\n }\n }\n };\n\n switch (e.key) {\n case 'ArrowDown': {\n if (delegate.getKeyBelow) {\n e.preventDefault();\n let nextKey = manager.focusedKey != null\n ? delegate.getKeyBelow(manager.focusedKey)\n : delegate.getFirstKey?.();\n if (nextKey == null && shouldFocusWrap) {\n nextKey = delegate.getFirstKey?.(manager.focusedKey);\n }\n navigateToKey(nextKey);\n }\n break;\n }\n case 'ArrowUp': {\n if (delegate.getKeyAbove) {\n e.preventDefault();\n let nextKey = manager.focusedKey != null\n ? delegate.getKeyAbove(manager.focusedKey)\n : delegate.getLastKey?.();\n if (nextKey == null && shouldFocusWrap) {\n nextKey = delegate.getLastKey?.(manager.focusedKey);\n }\n navigateToKey(nextKey);\n }\n break;\n }\n case 'ArrowLeft': {\n if (delegate.getKeyLeftOf) {\n e.preventDefault();\n let nextKey = delegate.getKeyLeftOf(manager.focusedKey);\n navigateToKey(nextKey, direction === 'rtl' ? 'first' : 'last');\n }\n break;\n }\n case 'ArrowRight': {\n if (delegate.getKeyRightOf) {\n e.preventDefault();\n let nextKey = delegate.getKeyRightOf(manager.focusedKey);\n navigateToKey(nextKey, direction === 'rtl' ? 'last' : 'first');\n }\n break;\n }\n case 'Home':\n if (delegate.getFirstKey) {\n e.preventDefault();\n let firstKey = delegate.getFirstKey(manager.focusedKey, isCtrlKeyPressed(e));\n manager.setFocusedKey(firstKey);\n if (isCtrlKeyPressed(e) && e.shiftKey && manager.selectionMode === 'multiple') {\n manager.extendSelection(firstKey);\n } else if (selectOnFocus) {\n manager.replaceSelection(firstKey);\n }\n }\n break;\n case 'End':\n if (delegate.getLastKey) {\n e.preventDefault();\n let lastKey = delegate.getLastKey(manager.focusedKey, isCtrlKeyPressed(e));\n manager.setFocusedKey(lastKey);\n if (isCtrlKeyPressed(e) && e.shiftKey && manager.selectionMode === 'multiple') {\n manager.extendSelection(lastKey);\n } else if (selectOnFocus) {\n manager.replaceSelection(lastKey);\n }\n }\n break;\n case 'PageDown':\n if (delegate.getKeyPageBelow) {\n e.preventDefault();\n let nextKey = delegate.getKeyPageBelow(manager.focusedKey);\n navigateToKey(nextKey);\n }\n break;\n case 'PageUp':\n if (delegate.getKeyPageAbove) {\n e.preventDefault();\n let nextKey = delegate.getKeyPageAbove(manager.focusedKey);\n navigateToKey(nextKey);\n }\n break;\n case 'a':\n if (isCtrlKeyPressed(e) && manager.selectionMode === 'multiple' && disallowSelectAll !== true) {\n e.preventDefault();\n manager.selectAll();\n }\n break;\n case 'Escape':\n e.preventDefault();\n if (!disallowEmptySelection) {\n manager.clearSelection();\n }\n break;\n case 'Tab': {\n if (!allowsTabNavigation) {\n // There may be elements that are \"tabbable\" inside a collection (e.g. in a grid cell).\n // However, collections should be treated as a single tab stop, with arrow key navigation internally.\n // We don't control the rendering of these, so we can't override the tabIndex to prevent tabbing.\n // Instead, we handle the Tab key, and move focus manually to the first/last tabbable element\n // in the collection, so that the browser default behavior will apply starting from that element\n // rather than the currently focused one.\n if (e.shiftKey) {\n ref.current.focus();\n } else {\n let walker = getFocusableTreeWalker(ref.current, {tabbable: true});\n let next: HTMLElement;\n let last: HTMLElement;\n do {\n last = walker.lastChild() as HTMLElement;\n if (last) {\n next = last;\n }\n } while (last);\n\n if (next && !next.contains(document.activeElement)) {\n focusWithoutScrolling(next);\n }\n }\n break;\n }\n }\n }\n };\n\n // Store the scroll position so we can restore it later.\n let scrollPos = useRef({top: 0, left: 0});\n useEvent(scrollRef, 'scroll', isVirtualized ? null : () => {\n scrollPos.current = {\n top: scrollRef.current.scrollTop,\n left: scrollRef.current.scrollLeft\n };\n });\n\n let onFocus = (e: FocusEvent) => {\n if (manager.isFocused) {\n // If a focus event bubbled through a portal, reset focus state.\n if (!e.currentTarget.contains(e.target)) {\n manager.setFocused(false);\n }\n\n return;\n }\n\n // Focus events can bubble through portals. Ignore these events.\n if (!e.currentTarget.contains(e.target)) {\n return;\n }\n\n manager.setFocused(true);\n\n if (manager.focusedKey == null) {\n let navigateToFirstKey = (key: Key | undefined) => {\n if (key != null) {\n manager.setFocusedKey(key);\n if (selectOnFocus) {\n manager.replaceSelection(key);\n }\n }\n };\n // If the user hasn't yet interacted with the collection, there will be no focusedKey set.\n // Attempt to detect whether the user is tabbing forward or backward into the collection\n // and either focus the first or last item accordingly.\n let relatedTarget = e.relatedTarget as Element;\n if (relatedTarget && (e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING)) {\n navigateToFirstKey(manager.lastSelectedKey ?? delegate.getLastKey());\n } else {\n navigateToFirstKey(manager.firstSelectedKey ?? delegate.getFirstKey());\n }\n } else if (!isVirtualized) {\n // Restore the scroll position to what it was before.\n scrollRef.current.scrollTop = scrollPos.current.top;\n scrollRef.current.scrollLeft = scrollPos.current.left;\n\n // Refocus and scroll the focused item into view if it exists within the scrollable region.\n let element = scrollRef.current.querySelector(`[data-key=\"${manager.focusedKey}\"]`) as HTMLElement;\n if (element) {\n // This prevents a flash of focus on the first/last element in the collection\n focusWithoutScrolling(element);\n scrollIntoView(scrollRef.current, element);\n }\n }\n };\n\n let onBlur = (e) => {\n // Don't set blurred and then focused again if moving focus within the collection.\n if (!e.currentTarget.contains(e.relatedTarget as HTMLElement)) {\n manager.setFocused(false);\n }\n };\n\n const autoFocusRef = useRef(autoFocus);\n useEffect(() => {\n if (autoFocusRef.current) {\n let focusedKey = null;\n\n // Check focus strategy to determine which item to focus\n if (autoFocus === 'first') {\n focusedKey = delegate.getFirstKey();\n } if (autoFocus === 'last') {\n focusedKey = delegate.getLastKey();\n }\n\n // If there are any selected keys, make the first one the new focus target\n let selectedKeys = manager.selectedKeys;\n if (selectedKeys.size) {\n focusedKey = selectedKeys.values().next().value;\n }\n\n manager.setFocused(true);\n manager.setFocusedKey(focusedKey);\n\n // If no default focus key is selected, focus the collection itself.\n if (focusedKey == null && !shouldUseVirtualFocus) {\n focusSafely(ref.current);\n }\n }\n autoFocusRef.current = false;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // If not virtualized, scroll the focused element into view when the focusedKey changes.\n // When virtualized, Virtualizer handles this internally.\n useEffect(() => {\n if (!isVirtualized && manager.focusedKey && scrollRef?.current) {\n let element = scrollRef.current.querySelector(`[data-key=\"${manager.focusedKey}\"]`) as HTMLElement;\n if (element) {\n scrollIntoView(scrollRef.current, element);\n }\n }\n }, [isVirtualized, scrollRef, manager.focusedKey]);\n\n let handlers = {\n onKeyDown,\n onFocus,\n onBlur,\n onMouseDown(e) {\n // Ignore events that bubbled through portals.\n if (e.currentTarget.contains(e.target)) {\n // Prevent focus going to the collection when clicking on the scrollbar.\n e.preventDefault();\n }\n }\n };\n\n let {typeSelectProps} = useTypeSelect({\n keyboardDelegate: delegate,\n selectionManager: manager\n });\n\n if (!disallowTypeAhead) {\n handlers = mergeProps(typeSelectProps, handlers);\n }\n\n // If nothing is focused within the collection, make the collection itself tabbable.\n // This will be marshalled to either the first or last item depending on where focus came from.\n // If using virtual focus, don't set a tabIndex at all so that VoiceOver on iOS 14 doesn't try\n // to move real DOM focus to the element anyway.\n let tabIndex: number;\n if (!shouldUseVirtualFocus) {\n tabIndex = manager.focusedKey == null ? 0 : -1;\n }\n\n return {\n collectionProps: {\n ...handlers,\n tabIndex\n }\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isAppleDevice} from '@react-aria/utils';\nimport {isMac} from '@react-aria/utils';\n\ninterface Event {\n altKey: boolean,\n ctrlKey: boolean,\n metaKey: boolean\n}\n\nexport function isNonContiguousSelectionModifier(e: Event) {\n // Ctrl + Arrow Up/Arrow Down has a system wide meaning on macOS, so use Alt instead.\n // On Windows and Ubuntu, Alt + Space has a system wide meaning.\n return isAppleDevice() ? e.altKey : e.ctrlKey;\n}\n\nexport function isCtrlKeyPressed(e: Event) {\n if (isMac()) {\n return e.metaKey;\n }\n\n return e.ctrlKey;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {HTMLAttributes, Key, KeyboardEvent, useRef} from 'react';\nimport {KeyboardDelegate} from '@react-types/shared';\nimport {MultipleSelectionManager} from '@react-stately/selection';\n\ninterface TypeSelectOptions {\n /**\n * A delegate that returns collection item keys with respect to visual layout.\n */\n keyboardDelegate: KeyboardDelegate,\n /**\n * An interface for reading and updating multiple selection state.\n */\n selectionManager: MultipleSelectionManager,\n /**\n * Called when an item is focused by typing.\n */\n onTypeSelect?: (key: Key) => void\n}\n\ninterface TypeSelectAria {\n /**\n * Props to be spread on the owner of the options.\n */\n typeSelectProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Handles typeahead interactions with collections.\n */\nexport function useTypeSelect(options: TypeSelectOptions): TypeSelectAria {\n let {keyboardDelegate, selectionManager, onTypeSelect} = options;\n let state = useRef({\n search: '',\n timeout: null\n }).current;\n\n let onKeyDown = (e: KeyboardEvent) => {\n let character = getStringForKey(e.key);\n if (!character || e.ctrlKey || e.metaKey) {\n return;\n }\n\n // Do not propagate the Spacebar event if it's meant to be part of the search.\n // When we time out, the search term becomes empty, hence the check on length.\n // Trimming is to account for the case of pressing the Spacebar more than once,\n // which should cycle through the selection/deselection of the focused item.\n if (character === ' ' && state.search.trim().length > 0) {\n e.preventDefault();\n if (!('continuePropagation' in e)) {\n e.stopPropagation();\n }\n }\n\n state.search += character;\n\n // Use the delegate to find a key to focus.\n // Prioritize items after the currently focused item, falling back to searching the whole list.\n let key = keyboardDelegate.getKeyForSearch(state.search, selectionManager.focusedKey);\n\n // If no key found, search from the top.\n if (key == null) {\n key = keyboardDelegate.getKeyForSearch(state.search);\n }\n\n if (key != null) {\n selectionManager.setFocusedKey(key);\n if (onTypeSelect) {\n onTypeSelect(key);\n }\n }\n\n clearTimeout(state.timeout);\n state.timeout = setTimeout(() => {\n state.search = '';\n }, 500);\n };\n\n return {\n typeSelectProps: {\n // Using a capturing listener to catch the keydown event before\n // other hooks in order to handle the Spacebar event.\n onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown : null\n }\n };\n}\n\nfunction getStringForKey(key: string) {\n // If the key is of length 1, it is an ASCII value.\n // Otherwise, if there are no ASCII characters in the key name,\n // it is a Unicode character.\n // See https://www.w3.org/TR/uievents-key/\n if (key.length === 1 || !/^[A-Z]/i.test(key)) {\n return key;\n }\n\n return '';\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {focusSafely} from '@react-aria/focus';\nimport {HTMLAttributes, Key, RefObject, useEffect, useRef} from 'react';\nimport {isCtrlKeyPressed, isNonContiguousSelectionModifier} from './utils';\nimport {LongPressEvent, PressEvent} from '@react-types/shared';\nimport {mergeProps} from '@react-aria/utils';\nimport {MultipleSelectionManager} from '@react-stately/selection';\nimport {PressProps, useLongPress, usePress} from '@react-aria/interactions';\n\ninterface SelectableItemOptions {\n /**\n * An interface for reading and updating multiple selection state.\n */\n selectionManager: MultipleSelectionManager,\n /**\n * A unique key for the item.\n */\n key: Key,\n /**\n * Ref to the item.\n */\n ref: RefObject<HTMLElement>,\n /**\n * By default, selection occurs on pointer down. This can be strange if selecting an\n * item causes the UI to disappear immediately (e.g. menus).\n */\n shouldSelectOnPressUp?: boolean,\n /**\n * Whether selection requires the pointer/mouse down and up events to occur on the same target or triggers selection on\n * the target of the pointer/mouse up event.\n */\n allowsDifferentPressOrigin?: boolean,\n /**\n * Whether the option is contained in a virtual scroller.\n */\n isVirtualized?: boolean,\n /**\n * Function to focus the item.\n */\n focus?: () => void,\n /**\n * Whether the option should use virtual focus instead of being focused directly.\n */\n shouldUseVirtualFocus?: boolean,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /**\n * Handler that is called when a user performs an action on the cell. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void\n}\n\ninterface SelectableItemAria {\n /**\n * Props to be spread on the item root node.\n */\n itemProps: HTMLAttributes<HTMLElement>,\n /** Whether the item is currently in a pressed state. */\n isPressed: boolean\n}\n\n/**\n * Handles interactions with an item in a selectable collection.\n */\nexport function useSelectableItem(options: SelectableItemOptions): SelectableItemAria {\n let {\n selectionManager: manager,\n key,\n ref,\n shouldSelectOnPressUp,\n isVirtualized,\n shouldUseVirtualFocus,\n focus,\n isDisabled,\n onAction,\n allowsDifferentPressOrigin\n } = options;\n\n let onSelect = (e: PressEvent | LongPressEvent | PointerEvent) => {\n if (e.pointerType === 'keyboard' && isNonContiguousSelectionModifier(e)) {\n manager.toggleSelection(key);\n } else {\n if (manager.selectionMode === 'none') {\n return;\n }\n\n if (manager.selectionMode === 'single') {\n if (manager.isSelected(key) && !manager.disallowEmptySelection) {\n manager.toggleSelection(key);\n } else {\n manager.replaceSelection(key);\n }\n } else if (e && e.shiftKey) {\n manager.extendSelection(key);\n } else if (manager.selectionBehavior === 'toggle' || (e && (isCtrlKeyPressed(e) || e.pointerType === 'touch' || e.pointerType === 'virtual'))) {\n // if touch or virtual (VO) then we just want to toggle, otherwise it's impossible to multi select because they don't have modifier keys\n manager.toggleSelection(key);\n } else {\n manager.replaceSelection(key);\n }\n }\n };\n\n // Focus the associated DOM node when this item becomes the focusedKey\n let isFocused = key === manager.focusedKey;\n useEffect(() => {\n if (isFocused && manager.isFocused && !shouldUseVirtualFocus && document.activeElement !== ref.current) {\n if (focus) {\n focus();\n } else {\n focusSafely(ref.current);\n }\n }\n }, [ref, isFocused, manager.focusedKey, manager.childFocusStrategy, manager.isFocused, shouldUseVirtualFocus]);\n\n // Set tabIndex to 0 if the element is focused, or -1 otherwise so that only the last focused\n // item is tabbable. If using virtual focus, don't set a tabIndex at all so that VoiceOver\n // on iOS 14 doesn't try to move real DOM focus to the item anyway.\n let itemProps: SelectableItemAria['itemProps'] = {};\n if (!shouldUseVirtualFocus) {\n itemProps = {\n tabIndex: isFocused ? 0 : -1,\n onFocus(e) {\n if (e.target === ref.current) {\n manager.setFocusedKey(key);\n }\n }\n };\n }\n\n let modality = useRef(null);\n let hasPrimaryAction = onAction && manager.selectionMode === 'none';\n let hasSecondaryAction = onAction && manager.selectionMode !== 'none' && manager.selectionBehavior === 'replace';\n let allowsSelection = !isDisabled && manager.canSelectItem(key);\n\n // By default, selection occurs on pointer down. This can be strange if selecting an\n // item causes the UI to disappear immediately (e.g. menus).\n // If shouldSelectOnPressUp is true, we use onPressUp instead of onPressStart.\n // onPress requires a pointer down event on the same element as pointer up. For menus,\n // we want to be able to have the pointer down on the trigger that opens the menu and\n // the pointer up on the menu item rather than requiring a separate press.\n // For keyboard events, selection still occurs on key down.\n let itemPressProps: PressProps = {};\n if (shouldSelectOnPressUp) {\n itemPressProps.onPressStart = (e) => {\n modality.current = e.pointerType;\n if (e.pointerType === 'keyboard') {\n onSelect(e);\n }\n };\n\n // If allowsDifferentPressOrigin, make selection happen on pressUp (e.g. open menu on press down, selection on menu item happens on press up.)\n // Otherwise, have selection happen onPress (prevents listview row selection when clicking on interactable elements in the row)\n if (!allowsDifferentPressOrigin) {\n itemPressProps.onPress = (e) => {\n if (e.pointerType !== 'keyboard') {\n onSelect(e);\n }\n\n if (hasPrimaryAction) {\n onAction();\n }\n };\n } else {\n itemPressProps.onPressUp = (e) => {\n if (e.pointerType !== 'keyboard') {\n onSelect(e);\n }\n };\n\n itemPressProps.onPress = hasPrimaryAction ? () => onAction() : null;\n }\n } else {\n // On touch, it feels strange to select on touch down, so we special case this.\n itemPressProps.onPressStart = (e) => {\n modality.current = e.pointerType;\n if (e.pointerType !== 'touch' && e.pointerType !== 'virtual') {\n onSelect(e);\n }\n };\n\n itemPressProps.onPress = (e) => {\n if (e.pointerType === 'touch' || e.pointerType === 'virtual' || hasPrimaryAction) {\n // Single tap on touch with selectionBehavior = 'replace' performs an action, i.e. navigation.\n // Also perform action on press up when selectionMode = 'none'.\n if (hasPrimaryAction || hasSecondaryAction) {\n onAction();\n } else {\n onSelect(e);\n }\n }\n };\n }\n\n if (!isVirtualized) {\n itemProps['data-key'] = key;\n }\n\n itemPressProps.preventFocusOnPress = shouldUseVirtualFocus;\n let {pressProps, isPressed} = usePress(itemPressProps);\n\n // Double clicking with a mouse with selectionBehavior = 'replace' performs an action.\n let onDoubleClick = hasSecondaryAction ? (e) => {\n if (modality.current === 'mouse') {\n e.stopPropagation();\n e.preventDefault();\n onAction();\n }\n } : undefined;\n\n // Long pressing an item with touch when selectionBehavior = 'replace' switches the selection behavior\n // to 'toggle'. This changes the single tap behavior from performing an action (i.e. navigating) to\n // selecting, and may toggle the appearance of a UI affordance like checkboxes on each item.\n // TODO: what about when drag and drop is also enabled??\n let {longPressProps} = useLongPress({\n isDisabled: !hasSecondaryAction,\n onLongPress(e) {\n if (e.pointerType === 'touch') {\n onSelect(e);\n manager.setSelectionBehavior('toggle');\n }\n }\n });\n\n // Pressing the Enter key with selectionBehavior = 'replace' performs an action (i.e. navigation).\n let onKeyUp = hasSecondaryAction ? (e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n onAction();\n }\n } : undefined;\n\n return {\n itemProps: mergeProps(\n itemProps,\n allowsSelection || hasPrimaryAction ? pressProps : {},\n hasSecondaryAction ? longPressProps : {},\n {onKeyUp, onDoubleClick}\n ),\n isPressed\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, FocusStrategy, KeyboardDelegate, Node} from '@react-types/shared';\nimport {HTMLAttributes, Key, RefObject, useMemo} from 'react';\nimport {ListKeyboardDelegate} from './ListKeyboardDelegate';\nimport {MultipleSelectionManager} from '@react-stately/selection';\nimport {useCollator} from '@react-aria/i18n';\nimport {useSelectableCollection} from './useSelectableCollection';\n\ninterface SelectableListOptions {\n /**\n * An interface for reading and updating multiple selection state.\n */\n selectionManager: MultipleSelectionManager,\n /**\n * State of the collection.\n */\n collection: Collection<Node<unknown>>,\n /**\n * The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.\n */\n disabledKeys: Set<Key>,\n /**\n * A ref to the item.\n */\n ref?: RefObject<HTMLElement>,\n /**\n * A delegate that returns collection item keys with respect to visual layout.\n */\n keyboardDelegate?: KeyboardDelegate,\n /**\n * Whether the collection or one of its items should be automatically focused upon render.\n * @default false\n */\n autoFocus?: boolean | FocusStrategy,\n /**\n * Whether focus should wrap around when the end/start is reached.\n * @default false\n */\n shouldFocusWrap?: boolean,\n /**\n * Whether the option is contained in a virtual scroller.\n */\n isVirtualized?: boolean,\n /**\n * Whether the collection allows empty selection.\n * @default false\n */\n disallowEmptySelection?: boolean,\n /**\n * Whether selection should occur automatically on focus.\n * @default false\n */\n selectOnFocus?: boolean,\n /**\n * Whether typeahead is disabled.\n * @default false\n */\n disallowTypeAhead?: boolean,\n /**\n * Whether the collection items should use virtual focus instead of being focused directly.\n */\n shouldUseVirtualFocus?: boolean,\n /**\n * Whether navigation through tab key is enabled.\n */\n allowsTabNavigation?: boolean\n}\n\ninterface SelectableListAria {\n /**\n * Props for the option element.\n */\n listProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Handles interactions with a selectable list.\n */\nexport function useSelectableList(props: SelectableListOptions): SelectableListAria {\n let {\n selectionManager,\n collection,\n disabledKeys,\n ref,\n keyboardDelegate,\n autoFocus,\n shouldFocusWrap,\n isVirtualized,\n disallowEmptySelection,\n selectOnFocus = false,\n disallowTypeAhead,\n shouldUseVirtualFocus,\n allowsTabNavigation\n } = props;\n\n // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).\n // When virtualized, the layout object will be passed in as a prop and override this.\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let delegate = useMemo(() => keyboardDelegate || new ListKeyboardDelegate(collection, disabledKeys, ref, collator), [keyboardDelegate, collection, disabledKeys, ref, collator]);\n\n let {collectionProps} = useSelectableCollection({\n ref,\n selectionManager,\n keyboardDelegate: delegate,\n autoFocus,\n shouldFocusWrap,\n disallowEmptySelection,\n selectOnFocus,\n disallowTypeAhead,\n shouldUseVirtualFocus,\n allowsTabNavigation,\n isVirtualized,\n scrollRef: ref\n });\n\n return {\n listProps: collectionProps\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, KeyboardDelegate, Node} from '@react-types/shared';\nimport {Key, RefObject} from 'react';\n\nexport class ListKeyboardDelegate<T> implements KeyboardDelegate {\n private collection: Collection<Node<T>>;\n private disabledKeys: Set<Key>;\n private ref: RefObject<HTMLElement>;\n private collator: Intl.Collator;\n\n constructor(collection: Collection<Node<T>>, disabledKeys: Set<Key>, ref: RefObject<HTMLElement>, collator?: Intl.Collator) {\n this.collection = collection;\n this.disabledKeys = disabledKeys;\n this.ref = ref;\n this.collator = collator;\n }\n\n getKeyBelow(key: Key) {\n key = this.collection.getKeyAfter(key);\n while (key != null) {\n let item = this.collection.getItem(key);\n if (item.type === 'item' && !this.disabledKeys.has(key)) {\n return key;\n }\n\n key = this.collection.getKeyAfter(key);\n }\n }\n\n getKeyAbove(key: Key) {\n key = this.collection.getKeyBefore(key);\n while (key != null) {\n let item = this.collection.getItem(key);\n if (item.type === 'item' && !this.disabledKeys.has(key)) {\n return key;\n }\n\n key = this.collection.getKeyBefore(key);\n }\n }\n\n getFirstKey() {\n let key = this.collection.getFirstKey();\n while (key != null) {\n let item = this.collection.getItem(key);\n if (item.type === 'item' && !this.disabledKeys.has(key)) {\n return key;\n }\n\n key = this.collection.getKeyAfter(key);\n }\n }\n\n getLastKey() {\n let key = this.collection.getLastKey();\n while (key != null) {\n let item = this.collection.getItem(key);\n if (item.type === 'item' && !this.disabledKeys.has(key)) {\n return key;\n }\n\n key = this.collection.getKeyBefore(key);\n }\n }\n\n private getItem(key: Key): HTMLElement {\n return this.ref.current.querySelector(`[data-key=\"${key}\"]`);\n }\n\n getKeyPageAbove(key: Key) {\n let menu = this.ref.current;\n let item = this.getItem(key);\n if (!item) {\n return null;\n }\n\n let pageY = Math.max(0, item.offsetTop + item.offsetHeight - menu.offsetHeight);\n\n while (item && item.offsetTop > pageY) {\n key = this.getKeyAbove(key);\n item = this.getItem(key);\n }\n\n return key;\n }\n\n getKeyPageBelow(key: Key) {\n let menu = this.ref.current;\n let item = this.getItem(key);\n if (!item) {\n return null;\n }\n\n let pageY = Math.min(menu.scrollHeight, item.offsetTop - item.offsetHeight + menu.offsetHeight);\n\n while (item && item.offsetTop < pageY) {\n key = this.getKeyBelow(key);\n item = this.getItem(key);\n }\n\n return key;\n }\n\n getKeyForSearch(search: string, fromKey?: Key) {\n if (!this.collator) {\n return null;\n }\n\n let collection = this.collection;\n let key = fromKey || this.getFirstKey();\n while (key != null) {\n let item = collection.getItem(key);\n let substring = item.textValue.slice(0, search.length);\n if (item.textValue && this.collator.compare(substring, search) === 0) {\n return key;\n }\n\n key = this.getKeyBelow(key);\n }\n\n return null;\n }\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;SEqBgB,yCAAgC,CAAC,CAAQ,EAAE,CAAC;IAC1D,EAAqF,AAArF,mFAAqF;IACrF,EAAgE,AAAhE,8DAAgE;IAChE,MAAM,CAAC,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CAAC,kBAAA,eAAe,EAAA,CAAC,GAAG,yCAAuB,CAAC,CAAC;aAC/C,GAAG;0BACH,gBAAgB;QAChB,gBAAgB,EAAE,QAAQ;mBAC1B,SAAS;yBACT,eAAe;gCACf,sBAAsB;uBACtB,aAAa;2BACb,iBAAiB;+BACjB,qBAAqB;6BACrB,mBAAmB;uBACnB,aAAa;QACb,SAAS,EAAE,GAAG;IAChB,CAAC;IAED,MAAM,CAAC,CAAC;QACN,SAAS,EAAE,eAAe;IAC5B,CAAC;AACH,CAAC;","sources":["packages/@react-aria/selection/src/index.ts","packages/@react-aria/selection/src/useSelectableCollection.ts","packages/@react-aria/selection/src/utils.ts","packages/@react-aria/selection/src/useTypeSelect.ts","packages/@react-aria/selection/src/useSelectableItem.ts","packages/@react-aria/selection/src/useSelectableList.ts","packages/@react-aria/selection/src/ListKeyboardDelegate.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useSelectableCollection} from './useSelectableCollection';\nexport {useSelectableItem} from './useSelectableItem';\nexport {useSelectableList} from './useSelectableList';\nexport {ListKeyboardDelegate} from './ListKeyboardDelegate';\nexport {useTypeSelect} from './useTypeSelect';\n\nexport type {AriaSelectableCollectionOptions, SelectableCollectionAria} from './useSelectableCollection';\nexport type {AriaSelectableListOptions, SelectableListAria} from './useSelectableList';\nexport type {SelectableItemOptions, SelectableItemStates, SelectableItemAria} from './useSelectableItem';\nexport type {AriaTypeSelectOptions, TypeSelectAria} from './useTypeSelect';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, FocusableElement, FocusStrategy, KeyboardDelegate} from '@react-types/shared';\nimport {FocusEvent, Key, KeyboardEvent, RefObject, useEffect, useRef} from 'react';\nimport {focusSafely, getFocusableTreeWalker} from '@react-aria/focus';\nimport {focusWithoutScrolling, mergeProps, scrollIntoView, useEvent} from '@react-aria/utils';\nimport {isCtrlKeyPressed, isNonContiguousSelectionModifier} from './utils';\nimport {MultipleSelectionManager} from '@react-stately/selection';\nimport {useLocale} from '@react-aria/i18n';\nimport {useTypeSelect} from './useTypeSelect';\n\nexport interface AriaSelectableCollectionOptions {\n /**\n * An interface for reading and updating multiple selection state.\n */\n selectionManager: MultipleSelectionManager,\n /**\n * A delegate object that implements behavior for keyboard focus movement.\n */\n keyboardDelegate: KeyboardDelegate,\n /**\n * The ref attached to the element representing the collection.\n */\n ref: RefObject<HTMLElement>,\n /**\n * Whether the collection or one of its items should be automatically focused upon render.\n * @default false\n */\n autoFocus?: boolean | FocusStrategy,\n /**\n * Whether focus should wrap around when the end/start is reached.\n * @default false\n */\n shouldFocusWrap?: boolean,\n /**\n * Whether the collection allows empty selection.\n * @default false\n */\n disallowEmptySelection?: boolean,\n /**\n * Whether the collection allows the user to select all items via keyboard shortcut.\n * @default false\n */\n disallowSelectAll?: boolean,\n /**\n * Whether selection should occur automatically on focus.\n * @default false\n */\n selectOnFocus?: boolean,\n /**\n * Whether typeahead is disabled.\n * @default false\n */\n disallowTypeAhead?: boolean,\n /**\n * Whether the collection items should use virtual focus instead of being focused directly.\n */\n shouldUseVirtualFocus?: boolean,\n /**\n * Whether navigation through tab key is enabled.\n */\n allowsTabNavigation?: boolean,\n /**\n * Whether the collection items are contained in a virtual scroller.\n */\n isVirtualized?: boolean,\n /**\n * The ref attached to the scrollable body. Used to provide automatic scrolling on item focus for non-virtualized collections.\n * If not provided, defaults to the collection ref.\n */\n scrollRef?: RefObject<HTMLElement>\n}\n\nexport interface SelectableCollectionAria {\n /** Props for the collection element. */\n collectionProps: DOMAttributes\n}\n\n/**\n * Handles interactions with selectable collections.\n */\nexport function useSelectableCollection(options: AriaSelectableCollectionOptions): SelectableCollectionAria {\n let {\n selectionManager: manager,\n keyboardDelegate: delegate,\n ref,\n autoFocus = false,\n shouldFocusWrap = false,\n disallowEmptySelection = false,\n disallowSelectAll = false,\n selectOnFocus = manager.selectionBehavior === 'replace',\n disallowTypeAhead = false,\n shouldUseVirtualFocus,\n allowsTabNavigation = false,\n isVirtualized,\n // If no scrollRef is provided, assume the collection ref is the scrollable region\n scrollRef = ref\n } = options;\n let {direction} = useLocale();\n\n\n let onKeyDown = (e: KeyboardEvent) => {\n // Prevent option + tab from doing anything since it doesn't move focus to the cells, only buttons/checkboxes\n if (e.altKey && e.key === 'Tab') {\n e.preventDefault();\n }\n\n // Keyboard events bubble through portals. Don't handle keyboard events\n // for elements outside the collection (e.g. menus).\n if (!ref.current.contains(e.target as Element)) {\n return;\n }\n\n const navigateToKey = (key: Key | undefined, childFocus?: FocusStrategy) => {\n if (key != null) {\n manager.setFocusedKey(key, childFocus);\n\n if (e.shiftKey && manager.selectionMode === 'multiple') {\n manager.extendSelection(key);\n } else if (selectOnFocus && !isNonContiguousSelectionModifier(e)) {\n manager.replaceSelection(key);\n }\n }\n };\n\n switch (e.key) {\n case 'ArrowDown': {\n if (delegate.getKeyBelow) {\n e.preventDefault();\n let nextKey = manager.focusedKey != null\n ? delegate.getKeyBelow(manager.focusedKey)\n : delegate.getFirstKey?.();\n if (nextKey == null && shouldFocusWrap) {\n nextKey = delegate.getFirstKey?.(manager.focusedKey);\n }\n navigateToKey(nextKey);\n }\n break;\n }\n case 'ArrowUp': {\n if (delegate.getKeyAbove) {\n e.preventDefault();\n let nextKey = manager.focusedKey != null\n ? delegate.getKeyAbove(manager.focusedKey)\n : delegate.getLastKey?.();\n if (nextKey == null && shouldFocusWrap) {\n nextKey = delegate.getLastKey?.(manager.focusedKey);\n }\n navigateToKey(nextKey);\n }\n break;\n }\n case 'ArrowLeft': {\n if (delegate.getKeyLeftOf) {\n e.preventDefault();\n let nextKey = delegate.getKeyLeftOf(manager.focusedKey);\n navigateToKey(nextKey, direction === 'rtl' ? 'first' : 'last');\n }\n break;\n }\n case 'ArrowRight': {\n if (delegate.getKeyRightOf) {\n e.preventDefault();\n let nextKey = delegate.getKeyRightOf(manager.focusedKey);\n navigateToKey(nextKey, direction === 'rtl' ? 'last' : 'first');\n }\n break;\n }\n case 'Home':\n if (delegate.getFirstKey) {\n e.preventDefault();\n let firstKey = delegate.getFirstKey(manager.focusedKey, isCtrlKeyPressed(e));\n manager.setFocusedKey(firstKey);\n if (isCtrlKeyPressed(e) && e.shiftKey && manager.selectionMode === 'multiple') {\n manager.extendSelection(firstKey);\n } else if (selectOnFocus) {\n manager.replaceSelection(firstKey);\n }\n }\n break;\n case 'End':\n if (delegate.getLastKey) {\n e.preventDefault();\n let lastKey = delegate.getLastKey(manager.focusedKey, isCtrlKeyPressed(e));\n manager.setFocusedKey(lastKey);\n if (isCtrlKeyPressed(e) && e.shiftKey && manager.selectionMode === 'multiple') {\n manager.extendSelection(lastKey);\n } else if (selectOnFocus) {\n manager.replaceSelection(lastKey);\n }\n }\n break;\n case 'PageDown':\n if (delegate.getKeyPageBelow) {\n e.preventDefault();\n let nextKey = delegate.getKeyPageBelow(manager.focusedKey);\n navigateToKey(nextKey);\n }\n break;\n case 'PageUp':\n if (delegate.getKeyPageAbove) {\n e.preventDefault();\n let nextKey = delegate.getKeyPageAbove(manager.focusedKey);\n navigateToKey(nextKey);\n }\n break;\n case 'a':\n if (isCtrlKeyPressed(e) && manager.selectionMode === 'multiple' && disallowSelectAll !== true) {\n e.preventDefault();\n manager.selectAll();\n }\n break;\n case 'Escape':\n e.preventDefault();\n if (!disallowEmptySelection) {\n manager.clearSelection();\n }\n break;\n case 'Tab': {\n if (!allowsTabNavigation) {\n // There may be elements that are \"tabbable\" inside a collection (e.g. in a grid cell).\n // However, collections should be treated as a single tab stop, with arrow key navigation internally.\n // We don't control the rendering of these, so we can't override the tabIndex to prevent tabbing.\n // Instead, we handle the Tab key, and move focus manually to the first/last tabbable element\n // in the collection, so that the browser default behavior will apply starting from that element\n // rather than the currently focused one.\n if (e.shiftKey) {\n ref.current.focus();\n } else {\n let walker = getFocusableTreeWalker(ref.current, {tabbable: true});\n let next: FocusableElement;\n let last: FocusableElement;\n do {\n last = walker.lastChild() as FocusableElement;\n if (last) {\n next = last;\n }\n } while (last);\n\n if (next && !next.contains(document.activeElement)) {\n focusWithoutScrolling(next);\n }\n }\n break;\n }\n }\n }\n };\n\n // Store the scroll position so we can restore it later.\n let scrollPos = useRef({top: 0, left: 0});\n useEvent(scrollRef, 'scroll', isVirtualized ? null : () => {\n scrollPos.current = {\n top: scrollRef.current.scrollTop,\n left: scrollRef.current.scrollLeft\n };\n });\n\n let onFocus = (e: FocusEvent) => {\n if (manager.isFocused) {\n // If a focus event bubbled through a portal, reset focus state.\n if (!e.currentTarget.contains(e.target)) {\n manager.setFocused(false);\n }\n\n return;\n }\n\n // Focus events can bubble through portals. Ignore these events.\n if (!e.currentTarget.contains(e.target)) {\n return;\n }\n\n manager.setFocused(true);\n\n if (manager.focusedKey == null) {\n let navigateToFirstKey = (key: Key | undefined) => {\n if (key != null) {\n manager.setFocusedKey(key);\n if (selectOnFocus) {\n manager.replaceSelection(key);\n }\n }\n };\n // If the user hasn't yet interacted with the collection, there will be no focusedKey set.\n // Attempt to detect whether the user is tabbing forward or backward into the collection\n // and either focus the first or last item accordingly.\n let relatedTarget = e.relatedTarget as Element;\n if (relatedTarget && (e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING)) {\n navigateToFirstKey(manager.lastSelectedKey ?? delegate.getLastKey());\n } else {\n navigateToFirstKey(manager.firstSelectedKey ?? delegate.getFirstKey());\n }\n } else if (!isVirtualized) {\n // Restore the scroll position to what it was before.\n scrollRef.current.scrollTop = scrollPos.current.top;\n scrollRef.current.scrollLeft = scrollPos.current.left;\n\n // Refocus and scroll the focused item into view if it exists within the scrollable region.\n let element = scrollRef.current.querySelector(`[data-key=\"${manager.focusedKey}\"]`) as HTMLElement;\n if (element) {\n // This prevents a flash of focus on the first/last element in the collection\n focusWithoutScrolling(element);\n scrollIntoView(scrollRef.current, element);\n }\n }\n };\n\n let onBlur = (e) => {\n // Don't set blurred and then focused again if moving focus within the collection.\n if (!e.currentTarget.contains(e.relatedTarget as HTMLElement)) {\n manager.setFocused(false);\n }\n };\n\n const autoFocusRef = useRef(autoFocus);\n useEffect(() => {\n if (autoFocusRef.current) {\n let focusedKey = null;\n\n // Check focus strategy to determine which item to focus\n if (autoFocus === 'first') {\n focusedKey = delegate.getFirstKey();\n } if (autoFocus === 'last') {\n focusedKey = delegate.getLastKey();\n }\n\n // If there are any selected keys, make the first one the new focus target\n let selectedKeys = manager.selectedKeys;\n if (selectedKeys.size) {\n focusedKey = selectedKeys.values().next().value;\n }\n\n manager.setFocused(true);\n manager.setFocusedKey(focusedKey);\n\n // If no default focus key is selected, focus the collection itself.\n if (focusedKey == null && !shouldUseVirtualFocus) {\n focusSafely(ref.current);\n }\n }\n autoFocusRef.current = false;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // If not virtualized, scroll the focused element into view when the focusedKey changes.\n // When virtualized, Virtualizer handles this internally.\n useEffect(() => {\n if (!isVirtualized && manager.focusedKey && scrollRef?.current) {\n let element = scrollRef.current.querySelector(`[data-key=\"${manager.focusedKey}\"]`) as HTMLElement;\n if (element) {\n scrollIntoView(scrollRef.current, element);\n }\n }\n }, [isVirtualized, scrollRef, manager.focusedKey]);\n\n let handlers = {\n onKeyDown,\n onFocus,\n onBlur,\n onMouseDown(e) {\n // Ignore events that bubbled through portals.\n if (e.currentTarget.contains(e.target)) {\n // Prevent focus going to the collection when clicking on the scrollbar.\n e.preventDefault();\n }\n }\n };\n\n let {typeSelectProps} = useTypeSelect({\n keyboardDelegate: delegate,\n selectionManager: manager\n });\n\n if (!disallowTypeAhead) {\n handlers = mergeProps(typeSelectProps, handlers);\n }\n\n // If nothing is focused within the collection, make the collection itself tabbable.\n // This will be marshalled to either the first or last item depending on where focus came from.\n // If using virtual focus, don't set a tabIndex at all so that VoiceOver on iOS 14 doesn't try\n // to move real DOM focus to the element anyway.\n let tabIndex: number;\n if (!shouldUseVirtualFocus) {\n tabIndex = manager.focusedKey == null ? 0 : -1;\n }\n\n return {\n collectionProps: {\n ...handlers,\n tabIndex\n }\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isAppleDevice} from '@react-aria/utils';\nimport {isMac} from '@react-aria/utils';\n\ninterface Event {\n altKey: boolean,\n ctrlKey: boolean,\n metaKey: boolean\n}\n\nexport function isNonContiguousSelectionModifier(e: Event) {\n // Ctrl + Arrow Up/Arrow Down has a system wide meaning on macOS, so use Alt instead.\n // On Windows and Ubuntu, Alt + Space has a system wide meaning.\n return isAppleDevice() ? e.altKey : e.ctrlKey;\n}\n\nexport function isCtrlKeyPressed(e: Event) {\n if (isMac()) {\n return e.metaKey;\n }\n\n return e.ctrlKey;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, KeyboardDelegate} from '@react-types/shared';\nimport {Key, KeyboardEvent, useRef} from 'react';\nimport {MultipleSelectionManager} from '@react-stately/selection';\n\nexport interface AriaTypeSelectOptions {\n /**\n * A delegate that returns collection item keys with respect to visual layout.\n */\n keyboardDelegate: KeyboardDelegate,\n /**\n * An interface for reading and updating multiple selection state.\n */\n selectionManager: MultipleSelectionManager,\n /**\n * Called when an item is focused by typing.\n */\n onTypeSelect?: (key: Key) => void\n}\n\nexport interface TypeSelectAria {\n /**\n * Props to be spread on the owner of the options.\n */\n typeSelectProps: DOMAttributes\n}\n\n/**\n * Handles typeahead interactions with collections.\n */\nexport function useTypeSelect(options: AriaTypeSelectOptions): TypeSelectAria {\n let {keyboardDelegate, selectionManager, onTypeSelect} = options;\n let state = useRef({\n search: '',\n timeout: null\n }).current;\n\n let onKeyDown = (e: KeyboardEvent) => {\n let character = getStringForKey(e.key);\n if (!character || e.ctrlKey || e.metaKey) {\n return;\n }\n\n // Do not propagate the Spacebar event if it's meant to be part of the search.\n // When we time out, the search term becomes empty, hence the check on length.\n // Trimming is to account for the case of pressing the Spacebar more than once,\n // which should cycle through the selection/deselection of the focused item.\n if (character === ' ' && state.search.trim().length > 0) {\n e.preventDefault();\n if (!('continuePropagation' in e)) {\n e.stopPropagation();\n }\n }\n\n state.search += character;\n\n // Use the delegate to find a key to focus.\n // Prioritize items after the currently focused item, falling back to searching the whole list.\n let key = keyboardDelegate.getKeyForSearch(state.search, selectionManager.focusedKey);\n\n // If no key found, search from the top.\n if (key == null) {\n key = keyboardDelegate.getKeyForSearch(state.search);\n }\n\n if (key != null) {\n selectionManager.setFocusedKey(key);\n if (onTypeSelect) {\n onTypeSelect(key);\n }\n }\n\n clearTimeout(state.timeout);\n state.timeout = setTimeout(() => {\n state.search = '';\n }, 500);\n };\n\n return {\n typeSelectProps: {\n // Using a capturing listener to catch the keydown event before\n // other hooks in order to handle the Spacebar event.\n onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown : null\n }\n };\n}\n\nfunction getStringForKey(key: string) {\n // If the key is of length 1, it is an ASCII value.\n // Otherwise, if there are no ASCII characters in the key name,\n // it is a Unicode character.\n // See https://www.w3.org/TR/uievents-key/\n if (key.length === 1 || !/^[A-Z]/i.test(key)) {\n return key;\n }\n\n return '';\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, FocusableElement, LongPressEvent, PressEvent} from '@react-types/shared';\nimport {focusSafely} from '@react-aria/focus';\nimport {isCtrlKeyPressed, isNonContiguousSelectionModifier} from './utils';\nimport {Key, RefObject, useEffect, useRef} from 'react';\nimport {mergeProps} from '@react-aria/utils';\nimport {MultipleSelectionManager} from '@react-stately/selection';\nimport {PressProps, useLongPress, usePress} from '@react-aria/interactions';\n\nexport interface SelectableItemOptions {\n /**\n * An interface for reading and updating multiple selection state.\n */\n selectionManager: MultipleSelectionManager,\n /**\n * A unique key for the item.\n */\n key: Key,\n /**\n * Ref to the item.\n */\n ref: RefObject<FocusableElement>,\n /**\n * By default, selection occurs on pointer down. This can be strange if selecting an\n * item causes the UI to disappear immediately (e.g. menus).\n */\n shouldSelectOnPressUp?: boolean,\n /**\n * Whether selection requires the pointer/mouse down and up events to occur on the same target or triggers selection on\n * the target of the pointer/mouse up event.\n */\n allowsDifferentPressOrigin?: boolean,\n /**\n * Whether the option is contained in a virtual scroller.\n */\n isVirtualized?: boolean,\n /**\n * Function to focus the item.\n */\n focus?: () => void,\n /**\n * Whether the option should use virtual focus instead of being focused directly.\n */\n shouldUseVirtualFocus?: boolean,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void\n}\n\nexport interface SelectableItemStates {\n /** Whether the item is currently in a pressed state. */\n isPressed: boolean,\n /** Whether the item is currently selected. */\n isSelected: boolean,\n /**\n * Whether the item is non-interactive, i.e. both selection and actions are disabled and the item may\n * not be focused. Dependent on `disabledKeys` and `disabledBehavior`.\n */\n isDisabled: boolean,\n /**\n * Whether the item may be selected, dependent on `selectionMode`, `disabledKeys`, and `disabledBehavior`.\n */\n allowsSelection: boolean,\n /**\n * Whether the item has an action, dependent on `onAction`, `disabledKeys`,\n * and `disabledBehavior. It may also change depending on the current selection state\n * of the list (e.g. when selection is primary). This can be used to enable or disable hover\n * styles or other visual indications of interactivity.\n */\n hasAction: boolean\n}\n\nexport interface SelectableItemAria extends SelectableItemStates {\n /**\n * Props to be spread on the item root node.\n */\n itemProps: DOMAttributes\n}\n\n/**\n * Handles interactions with an item in a selectable collection.\n */\nexport function useSelectableItem(options: SelectableItemOptions): SelectableItemAria {\n let {\n selectionManager: manager,\n key,\n ref,\n shouldSelectOnPressUp,\n isVirtualized,\n shouldUseVirtualFocus,\n focus,\n isDisabled,\n onAction,\n allowsDifferentPressOrigin\n } = options;\n\n let onSelect = (e: PressEvent | LongPressEvent | PointerEvent) => {\n if (e.pointerType === 'keyboard' && isNonContiguousSelectionModifier(e)) {\n manager.toggleSelection(key);\n } else {\n if (manager.selectionMode === 'none') {\n return;\n }\n\n if (manager.selectionMode === 'single') {\n if (manager.isSelected(key) && !manager.disallowEmptySelection) {\n manager.toggleSelection(key);\n } else {\n manager.replaceSelection(key);\n }\n } else if (e && e.shiftKey) {\n manager.extendSelection(key);\n } else if (manager.selectionBehavior === 'toggle' || (e && (isCtrlKeyPressed(e) || e.pointerType === 'touch' || e.pointerType === 'virtual'))) {\n // if touch or virtual (VO) then we just want to toggle, otherwise it's impossible to multi select because they don't have modifier keys\n manager.toggleSelection(key);\n } else {\n manager.replaceSelection(key);\n }\n }\n };\n\n // Focus the associated DOM node when this item becomes the focusedKey\n useEffect(() => {\n let isFocused = key === manager.focusedKey;\n if (isFocused && manager.isFocused && !shouldUseVirtualFocus && document.activeElement !== ref.current) {\n if (focus) {\n focus();\n } else {\n focusSafely(ref.current);\n }\n }\n }, [ref, key, manager.focusedKey, manager.childFocusStrategy, manager.isFocused, shouldUseVirtualFocus]);\n\n // Set tabIndex to 0 if the element is focused, or -1 otherwise so that only the last focused\n // item is tabbable. If using virtual focus, don't set a tabIndex at all so that VoiceOver\n // on iOS 14 doesn't try to move real DOM focus to the item anyway.\n let itemProps: SelectableItemAria['itemProps'] = {};\n if (!shouldUseVirtualFocus) {\n itemProps = {\n tabIndex: key === manager.focusedKey ? 0 : -1,\n onFocus(e) {\n if (e.target === ref.current) {\n manager.setFocusedKey(key);\n }\n }\n };\n }\n\n\n // With checkbox selection, onAction (i.e. navigation) becomes primary, and occurs on a single click of the row.\n // Clicking the checkbox enters selection mode, after which clicking anywhere on any row toggles selection for that row.\n // With highlight selection, onAction is secondary, and occurs on double click. Single click selects the row.\n // With touch, onAction occurs on single tap, and long press enters selection mode.\n isDisabled = isDisabled || manager.isDisabled(key);\n let allowsSelection = !isDisabled && manager.canSelectItem(key);\n let allowsActions = onAction && !isDisabled;\n let hasPrimaryAction = allowsActions && (\n manager.selectionBehavior === 'replace'\n ? !allowsSelection\n : manager.isEmpty\n );\n let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === 'replace';\n let hasAction = hasPrimaryAction || hasSecondaryAction;\n let modality = useRef(null);\n\n let longPressEnabled = hasAction && allowsSelection;\n let longPressEnabledOnPressStart = useRef(false);\n let hadPrimaryActionOnPressStart = useRef(false);\n\n // By default, selection occurs on pointer down. This can be strange if selecting an\n // item causes the UI to disappear immediately (e.g. menus).\n // If shouldSelectOnPressUp is true, we use onPressUp instead of onPressStart.\n // onPress requires a pointer down event on the same element as pointer up. For menus,\n // we want to be able to have the pointer down on the trigger that opens the menu and\n // the pointer up on the menu item rather than requiring a separate press.\n // For keyboard events, selection still occurs on key down.\n let itemPressProps: PressProps = {};\n if (shouldSelectOnPressUp) {\n itemPressProps.onPressStart = (e) => {\n modality.current = e.pointerType;\n longPressEnabledOnPressStart.current = longPressEnabled;\n if (e.pointerType === 'keyboard' && (!hasAction || isSelectionKey())) {\n onSelect(e);\n }\n };\n\n // If allowsDifferentPressOrigin, make selection happen on pressUp (e.g. open menu on press down, selection on menu item happens on press up.)\n // Otherwise, have selection happen onPress (prevents listview row selection when clicking on interactable elements in the row)\n if (!allowsDifferentPressOrigin) {\n itemPressProps.onPress = (e) => {\n if (hasPrimaryAction || (hasSecondaryAction && e.pointerType !== 'mouse')) {\n if (e.pointerType === 'keyboard' && !isActionKey()) {\n return;\n }\n\n onAction();\n } else if (e.pointerType !== 'keyboard') {\n onSelect(e);\n }\n };\n } else {\n itemPressProps.onPressUp = (e) => {\n if (e.pointerType !== 'keyboard') {\n onSelect(e);\n }\n };\n\n itemPressProps.onPress = hasPrimaryAction ? () => onAction() : null;\n }\n } else {\n itemPressProps.onPressStart = (e) => {\n modality.current = e.pointerType;\n longPressEnabledOnPressStart.current = longPressEnabled;\n hadPrimaryActionOnPressStart.current = hasPrimaryAction;\n\n // Select on mouse down unless there is a primary action which will occur on mouse up.\n // For keyboard, select on key down. If there is an action, the Space key selects on key down,\n // and the Enter key performs onAction on key up.\n if (\n (e.pointerType === 'mouse' && !hasPrimaryAction) ||\n (e.pointerType === 'keyboard' && (!onAction || isSelectionKey()))\n ) {\n onSelect(e);\n }\n };\n\n itemPressProps.onPress = (e) => {\n // Selection occurs on touch up. Primary actions always occur on pointer up.\n // Both primary and secondary actions occur on Enter key up. The only exception\n // is secondary actions, which occur on double click with a mouse.\n if (\n e.pointerType === 'touch' ||\n e.pointerType === 'pen' ||\n e.pointerType === 'virtual' ||\n (e.pointerType === 'keyboard' && hasAction && isActionKey()) ||\n (e.pointerType === 'mouse' && hadPrimaryActionOnPressStart.current)\n ) {\n if (hasAction) {\n onAction();\n } else {\n onSelect(e);\n }\n }\n };\n }\n\n if (!isVirtualized) {\n itemProps['data-key'] = key;\n }\n\n itemPressProps.preventFocusOnPress = shouldUseVirtualFocus;\n let {pressProps, isPressed} = usePress(itemPressProps);\n\n // Double clicking with a mouse with selectionBehavior = 'replace' performs an action.\n let onDoubleClick = hasSecondaryAction ? (e) => {\n if (modality.current === 'mouse') {\n e.stopPropagation();\n e.preventDefault();\n onAction();\n }\n } : undefined;\n\n // Long pressing an item with touch when selectionBehavior = 'replace' switches the selection behavior\n // to 'toggle'. This changes the single tap behavior from performing an action (i.e. navigating) to\n // selecting, and may toggle the appearance of a UI affordance like checkboxes on each item.\n let {longPressProps} = useLongPress({\n isDisabled: !longPressEnabled,\n onLongPress(e) {\n if (e.pointerType === 'touch') {\n onSelect(e);\n manager.setSelectionBehavior('toggle');\n }\n }\n });\n\n // Prevent native drag and drop on long press if we also select on long press.\n // Once the user is in selection mode, they can long press again to drag.\n let onDragStart = e => {\n if (modality.current === 'touch' && longPressEnabledOnPressStart.current) {\n e.preventDefault();\n }\n };\n\n return {\n itemProps: mergeProps(\n itemProps,\n allowsSelection || hasPrimaryAction ? pressProps : {},\n longPressEnabled ? longPressProps : {},\n {onDoubleClick, onDragStart}\n ),\n isPressed,\n isSelected: manager.isSelected(key),\n isDisabled,\n allowsSelection,\n hasAction\n };\n}\n\nfunction isActionKey() {\n let event = window.event as KeyboardEvent;\n return event?.key === 'Enter';\n}\n\nfunction isSelectionKey() {\n let event = window.event as KeyboardEvent;\n return event?.key === ' ' || event?.code === 'Space';\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, DOMAttributes, FocusStrategy, KeyboardDelegate, Node} from '@react-types/shared';\nimport {Key, RefObject, useMemo} from 'react';\nimport {ListKeyboardDelegate} from './ListKeyboardDelegate';\nimport {MultipleSelectionManager} from '@react-stately/selection';\nimport {useCollator} from '@react-aria/i18n';\nimport {useSelectableCollection} from './useSelectableCollection';\n\nexport interface AriaSelectableListOptions {\n /**\n * An interface for reading and updating multiple selection state.\n */\n selectionManager: MultipleSelectionManager,\n /**\n * State of the collection.\n */\n collection: Collection<Node<unknown>>,\n /**\n * The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.\n */\n disabledKeys: Set<Key>,\n /**\n * A ref to the item.\n */\n ref?: RefObject<HTMLElement>,\n /**\n * A delegate that returns collection item keys with respect to visual layout.\n */\n keyboardDelegate?: KeyboardDelegate,\n /**\n * Whether the collection or one of its items should be automatically focused upon render.\n * @default false\n */\n autoFocus?: boolean | FocusStrategy,\n /**\n * Whether focus should wrap around when the end/start is reached.\n * @default false\n */\n shouldFocusWrap?: boolean,\n /**\n * Whether the option is contained in a virtual scroller.\n */\n isVirtualized?: boolean,\n /**\n * Whether the collection allows empty selection.\n * @default false\n */\n disallowEmptySelection?: boolean,\n /**\n * Whether selection should occur automatically on focus.\n * @default false\n */\n selectOnFocus?: boolean,\n /**\n * Whether typeahead is disabled.\n * @default false\n */\n disallowTypeAhead?: boolean,\n /**\n * Whether the collection items should use virtual focus instead of being focused directly.\n */\n shouldUseVirtualFocus?: boolean,\n /**\n * Whether navigation through tab key is enabled.\n */\n allowsTabNavigation?: boolean\n}\n\nexport interface SelectableListAria {\n /**\n * Props for the option element.\n */\n listProps: DOMAttributes\n}\n\n/**\n * Handles interactions with a selectable list.\n */\nexport function useSelectableList(props: AriaSelectableListOptions): SelectableListAria {\n let {\n selectionManager,\n collection,\n disabledKeys,\n ref,\n keyboardDelegate,\n autoFocus,\n shouldFocusWrap,\n isVirtualized,\n disallowEmptySelection,\n selectOnFocus = selectionManager.selectionBehavior === 'replace',\n disallowTypeAhead,\n shouldUseVirtualFocus,\n allowsTabNavigation\n } = props;\n\n // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).\n // When virtualized, the layout object will be passed in as a prop and override this.\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let delegate = useMemo(() => keyboardDelegate || new ListKeyboardDelegate(collection, disabledKeys, ref, collator), [keyboardDelegate, collection, disabledKeys, ref, collator]);\n\n let {collectionProps} = useSelectableCollection({\n ref,\n selectionManager,\n keyboardDelegate: delegate,\n autoFocus,\n shouldFocusWrap,\n disallowEmptySelection,\n selectOnFocus,\n disallowTypeAhead,\n shouldUseVirtualFocus,\n allowsTabNavigation,\n isVirtualized,\n scrollRef: ref\n });\n\n return {\n listProps: collectionProps\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, KeyboardDelegate, Node} from '@react-types/shared';\nimport {Key, RefObject} from 'react';\n\nexport class ListKeyboardDelegate<T> implements KeyboardDelegate {\n private collection: Collection<Node<T>>;\n private disabledKeys: Set<Key>;\n private ref: RefObject<HTMLElement>;\n private collator: Intl.Collator;\n\n constructor(collection: Collection<Node<T>>, disabledKeys: Set<Key>, ref: RefObject<HTMLElement>, collator?: Intl.Collator) {\n this.collection = collection;\n this.disabledKeys = disabledKeys;\n this.ref = ref;\n this.collator = collator;\n }\n\n getKeyBelow(key: Key) {\n key = this.collection.getKeyAfter(key);\n while (key != null) {\n let item = this.collection.getItem(key);\n if (item.type === 'item' && !this.disabledKeys.has(key)) {\n return key;\n }\n\n key = this.collection.getKeyAfter(key);\n }\n }\n\n getKeyAbove(key: Key) {\n key = this.collection.getKeyBefore(key);\n while (key != null) {\n let item = this.collection.getItem(key);\n if (item.type === 'item' && !this.disabledKeys.has(key)) {\n return key;\n }\n\n key = this.collection.getKeyBefore(key);\n }\n }\n\n getFirstKey() {\n let key = this.collection.getFirstKey();\n while (key != null) {\n let item = this.collection.getItem(key);\n if (item.type === 'item' && !this.disabledKeys.has(key)) {\n return key;\n }\n\n key = this.collection.getKeyAfter(key);\n }\n }\n\n getLastKey() {\n let key = this.collection.getLastKey();\n while (key != null) {\n let item = this.collection.getItem(key);\n if (item.type === 'item' && !this.disabledKeys.has(key)) {\n return key;\n }\n\n key = this.collection.getKeyBefore(key);\n }\n }\n\n private getItem(key: Key): HTMLElement {\n return this.ref.current.querySelector(`[data-key=\"${key}\"]`);\n }\n\n getKeyPageAbove(key: Key) {\n let menu = this.ref.current;\n let item = this.getItem(key);\n if (!item) {\n return null;\n }\n\n let pageY = Math.max(0, item.offsetTop + item.offsetHeight - menu.offsetHeight);\n\n while (item && item.offsetTop > pageY) {\n key = this.getKeyAbove(key);\n item = this.getItem(key);\n }\n\n return key;\n }\n\n getKeyPageBelow(key: Key) {\n let menu = this.ref.current;\n let item = this.getItem(key);\n if (!item) {\n return null;\n }\n\n let pageY = Math.min(menu.scrollHeight, item.offsetTop - item.offsetHeight + menu.offsetHeight);\n\n while (item && item.offsetTop < pageY) {\n key = this.getKeyBelow(key);\n item = this.getItem(key);\n }\n\n return key;\n }\n\n getKeyForSearch(search: string, fromKey?: Key) {\n if (!this.collator) {\n return null;\n }\n\n let collection = this.collection;\n let key = fromKey || this.getFirstKey();\n while (key != null) {\n let item = collection.getItem(key);\n let substring = item.textValue.slice(0, search.length);\n if (item.textValue && this.collator.compare(substring, search) === 0) {\n return key;\n }\n\n key = this.getKeyBelow(key);\n }\n\n return null;\n }\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { DOMAttributes, KeyboardDelegate, FocusStrategy, FocusableElement, Collection, Node } from "@react-types/shared";
|
|
2
|
+
import { Key, RefObject } from "react";
|
|
3
3
|
import { MultipleSelectionManager } from "@react-stately/selection";
|
|
4
|
-
interface
|
|
4
|
+
export interface AriaTypeSelectOptions {
|
|
5
5
|
/**
|
|
6
6
|
* A delegate that returns collection item keys with respect to visual layout.
|
|
7
7
|
*/
|
|
@@ -15,17 +15,17 @@ interface TypeSelectOptions {
|
|
|
15
15
|
*/
|
|
16
16
|
onTypeSelect?: (key: Key) => void;
|
|
17
17
|
}
|
|
18
|
-
interface TypeSelectAria {
|
|
18
|
+
export interface TypeSelectAria {
|
|
19
19
|
/**
|
|
20
20
|
* Props to be spread on the owner of the options.
|
|
21
21
|
*/
|
|
22
|
-
typeSelectProps:
|
|
22
|
+
typeSelectProps: DOMAttributes;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Handles typeahead interactions with collections.
|
|
26
26
|
*/
|
|
27
|
-
export function useTypeSelect(options:
|
|
28
|
-
interface
|
|
27
|
+
export function useTypeSelect(options: AriaTypeSelectOptions): TypeSelectAria;
|
|
28
|
+
export interface AriaSelectableCollectionOptions {
|
|
29
29
|
/**
|
|
30
30
|
* An interface for reading and updating multiple selection state.
|
|
31
31
|
*/
|
|
@@ -86,15 +86,15 @@ interface SelectableCollectionOptions {
|
|
|
86
86
|
*/
|
|
87
87
|
scrollRef?: RefObject<HTMLElement>;
|
|
88
88
|
}
|
|
89
|
-
interface SelectableCollectionAria {
|
|
89
|
+
export interface SelectableCollectionAria {
|
|
90
90
|
/** Props for the collection element. */
|
|
91
|
-
collectionProps:
|
|
91
|
+
collectionProps: DOMAttributes;
|
|
92
92
|
}
|
|
93
93
|
/**
|
|
94
94
|
* Handles interactions with selectable collections.
|
|
95
95
|
*/
|
|
96
|
-
export function useSelectableCollection(options:
|
|
97
|
-
interface SelectableItemOptions {
|
|
96
|
+
export function useSelectableCollection(options: AriaSelectableCollectionOptions): SelectableCollectionAria;
|
|
97
|
+
export interface SelectableItemOptions {
|
|
98
98
|
/**
|
|
99
99
|
* An interface for reading and updating multiple selection state.
|
|
100
100
|
*/
|
|
@@ -106,7 +106,7 @@ interface SelectableItemOptions {
|
|
|
106
106
|
/**
|
|
107
107
|
* Ref to the item.
|
|
108
108
|
*/
|
|
109
|
-
ref: RefObject<
|
|
109
|
+
ref: RefObject<FocusableElement>;
|
|
110
110
|
/**
|
|
111
111
|
* By default, selection occurs on pointer down. This can be strange if selecting an
|
|
112
112
|
* item causes the UI to disappear immediately (e.g. menus).
|
|
@@ -132,18 +132,38 @@ interface SelectableItemOptions {
|
|
|
132
132
|
/** Whether the item is disabled. */
|
|
133
133
|
isDisabled?: boolean;
|
|
134
134
|
/**
|
|
135
|
-
* Handler that is called when a user performs an action on the
|
|
135
|
+
* Handler that is called when a user performs an action on the item. The exact user event depends on
|
|
136
136
|
* the collection's `selectionBehavior` prop and the interaction modality.
|
|
137
137
|
*/
|
|
138
138
|
onAction?: () => void;
|
|
139
139
|
}
|
|
140
|
-
interface
|
|
140
|
+
export interface SelectableItemStates {
|
|
141
|
+
/** Whether the item is currently in a pressed state. */
|
|
142
|
+
isPressed: boolean;
|
|
143
|
+
/** Whether the item is currently selected. */
|
|
144
|
+
isSelected: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Whether the item is non-interactive, i.e. both selection and actions are disabled and the item may
|
|
147
|
+
* not be focused. Dependent on `disabledKeys` and `disabledBehavior`.
|
|
148
|
+
*/
|
|
149
|
+
isDisabled: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Whether the item may be selected, dependent on `selectionMode`, `disabledKeys`, and `disabledBehavior`.
|
|
152
|
+
*/
|
|
153
|
+
allowsSelection: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Whether the item has an action, dependent on `onAction`, `disabledKeys`,
|
|
156
|
+
* and `disabledBehavior. It may also change depending on the current selection state
|
|
157
|
+
* of the list (e.g. when selection is primary). This can be used to enable or disable hover
|
|
158
|
+
* styles or other visual indications of interactivity.
|
|
159
|
+
*/
|
|
160
|
+
hasAction: boolean;
|
|
161
|
+
}
|
|
162
|
+
export interface SelectableItemAria extends SelectableItemStates {
|
|
141
163
|
/**
|
|
142
164
|
* Props to be spread on the item root node.
|
|
143
165
|
*/
|
|
144
|
-
itemProps:
|
|
145
|
-
/** Whether the item is currently in a pressed state. */
|
|
146
|
-
isPressed: boolean;
|
|
166
|
+
itemProps: DOMAttributes;
|
|
147
167
|
}
|
|
148
168
|
/**
|
|
149
169
|
* Handles interactions with an item in a selectable collection.
|
|
@@ -159,7 +179,7 @@ export class ListKeyboardDelegate<T> implements KeyboardDelegate {
|
|
|
159
179
|
getKeyPageBelow(key: Key): Key;
|
|
160
180
|
getKeyForSearch(search: string, fromKey?: Key): Key;
|
|
161
181
|
}
|
|
162
|
-
interface
|
|
182
|
+
export interface AriaSelectableListOptions {
|
|
163
183
|
/**
|
|
164
184
|
* An interface for reading and updating multiple selection state.
|
|
165
185
|
*/
|
|
@@ -218,15 +238,15 @@ interface SelectableListOptions {
|
|
|
218
238
|
*/
|
|
219
239
|
allowsTabNavigation?: boolean;
|
|
220
240
|
}
|
|
221
|
-
interface SelectableListAria {
|
|
241
|
+
export interface SelectableListAria {
|
|
222
242
|
/**
|
|
223
243
|
* Props for the option element.
|
|
224
244
|
*/
|
|
225
|
-
listProps:
|
|
245
|
+
listProps: DOMAttributes;
|
|
226
246
|
}
|
|
227
247
|
/**
|
|
228
248
|
* Handles interactions with a selectable list.
|
|
229
249
|
*/
|
|
230
|
-
export function useSelectableList(props:
|
|
250
|
+
export function useSelectableList(props: AriaSelectableListOptions): SelectableListAria;
|
|
231
251
|
|
|
232
252
|
//# sourceMappingURL=types.d.ts.map
|