@react-stately/list
Advanced tools
Comparing version 3.10.9-nightly.5042 to 3.11.0
@@ -1,2 +0,2 @@ | ||
import { Collection, Key, Node, CollectionStateBase, SingleSelection } from "@react-types/shared"; | ||
import { Collection, Key, Node, CollectionStateBase, LayoutDelegate, SingleSelection } from "@react-types/shared"; | ||
import { MultipleSelectionStateProps, SelectionManager } from "@react-stately/selection"; | ||
@@ -21,2 +21,7 @@ export class ListCollection<T> implements Collection<Node<T>> { | ||
suppressTextValueWarning?: boolean; | ||
/** | ||
* A delegate object that provides layout information for items in the collection. | ||
* This can be used to override the behavior of shift selection. | ||
*/ | ||
layoutDelegate?: LayoutDelegate; | ||
} | ||
@@ -23,0 +28,0 @@ export interface ListState<T> { |
@@ -27,3 +27,3 @@ var $c9aa5a224613c979$exports = require("./ListCollection.main.js"); | ||
function $5450691d3629f6ea$export$2f645645f7bca764(props) { | ||
let { filter: filter } = props; | ||
let { filter: filter, layoutDelegate: layoutDelegate } = props; | ||
let selectionState = (0, $5RsKl$reactstatelyselection.useMultipleSelectionState)(props); | ||
@@ -42,5 +42,8 @@ let disabledKeys = (0, $5RsKl$react.useMemo)(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set(), [ | ||
let collection = (0, $5RsKl$reactstatelycollections.useCollection)(props, factory, context); | ||
let selectionManager = (0, $5RsKl$react.useMemo)(()=>new (0, $5RsKl$reactstatelyselection.SelectionManager)(collection, selectionState), [ | ||
let selectionManager = (0, $5RsKl$react.useMemo)(()=>new (0, $5RsKl$reactstatelyselection.SelectionManager)(collection, selectionState, { | ||
layoutDelegate: layoutDelegate | ||
}), [ | ||
collection, | ||
selectionState | ||
selectionState, | ||
layoutDelegate | ||
]); | ||
@@ -47,0 +50,0 @@ // Reset focused key if that item is deleted from the collection. |
@@ -21,3 +21,3 @@ import {ListCollection as $a02d57049d202695$export$d085fb9e920b5ca7} from "./ListCollection.module.js"; | ||
function $e72dd72e1c76a225$export$2f645645f7bca764(props) { | ||
let { filter: filter } = props; | ||
let { filter: filter, layoutDelegate: layoutDelegate } = props; | ||
let selectionState = (0, $d5vlZ$useMultipleSelectionState)(props); | ||
@@ -36,5 +36,8 @@ let disabledKeys = (0, $d5vlZ$useMemo)(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set(), [ | ||
let collection = (0, $d5vlZ$useCollection)(props, factory, context); | ||
let selectionManager = (0, $d5vlZ$useMemo)(()=>new (0, $d5vlZ$SelectionManager)(collection, selectionState), [ | ||
let selectionManager = (0, $d5vlZ$useMemo)(()=>new (0, $d5vlZ$SelectionManager)(collection, selectionState, { | ||
layoutDelegate: layoutDelegate | ||
}), [ | ||
collection, | ||
selectionState | ||
selectionState, | ||
layoutDelegate | ||
]); | ||
@@ -41,0 +44,0 @@ // Reset focused key if that item is deleted from the collection. |
{ | ||
"name": "@react-stately/list", | ||
"version": "3.10.9-nightly.5042+68403fe55", | ||
"version": "3.11.0", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,6 +25,6 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-stately/collections": "3.0.0-nightly.3114+68403fe55", | ||
"@react-stately/selection": "3.0.0-nightly.3114+68403fe55", | ||
"@react-stately/utils": "3.0.0-nightly.3114+68403fe55", | ||
"@react-types/shared": "3.0.0-nightly.3114+68403fe55", | ||
"@react-stately/collections": "^3.11.0", | ||
"@react-stately/selection": "^3.17.0", | ||
"@react-stately/utils": "^3.10.4", | ||
"@react-types/shared": "^3.25.0", | ||
"@swc/helpers": "^0.5.0" | ||
@@ -37,4 +37,3 @@ }, | ||
"access": "public" | ||
}, | ||
"gitHead": "68403fe55489dce3de1b3094c957d598ad719861" | ||
} | ||
} | ||
} |
@@ -13,3 +13,3 @@ /* | ||
import {Collection, CollectionStateBase, Key, Node} from '@react-types/shared'; | ||
import {Collection, CollectionStateBase, Key, LayoutDelegate, Node} from '@react-types/shared'; | ||
import {ListCollection} from './ListCollection'; | ||
@@ -24,3 +24,8 @@ import {MultipleSelectionStateProps, SelectionManager, useMultipleSelectionState} from '@react-stately/selection'; | ||
/** @private */ | ||
suppressTextValueWarning?: boolean | ||
suppressTextValueWarning?: boolean, | ||
/** | ||
* A delegate object that provides layout information for items in the collection. | ||
* This can be used to override the behavior of shift selection. | ||
*/ | ||
layoutDelegate?: LayoutDelegate | ||
} | ||
@@ -44,3 +49,3 @@ | ||
export function useListState<T extends object>(props: ListProps<T>): ListState<T> { | ||
let {filter} = props; | ||
let {filter, layoutDelegate} = props; | ||
@@ -58,4 +63,4 @@ let selectionState = useMultipleSelectionState(props); | ||
let selectionManager = useMemo(() => | ||
new SelectionManager(collection, selectionState) | ||
, [collection, selectionState] | ||
new SelectionManager(collection, selectionState, {layoutDelegate}) | ||
, [collection, selectionState, layoutDelegate] | ||
); | ||
@@ -62,0 +67,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1077
1
0
90489
28
+ Added@react-stately/collections@3.12.0(transitive)
+ Added@react-stately/selection@3.18.0(transitive)
+ Added@react-stately/utils@3.10.5(transitive)
+ Added@react-types/shared@3.26.0(transitive)
Updated@react-stately/utils@^3.10.4
Updated@react-types/shared@^3.25.0