Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-stately/list

Package Overview
Dependencies
Maintainers
2
Versions
831
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-stately/list - npm Package Compare versions

Comparing version 3.0.0-nightly-4980928d3-240906 to 3.0.0-nightly-5a0b4fabc-240924

7

dist/types.d.ts

@@ -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> {

9

dist/useListState.main.js

@@ -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.0.0-nightly-4980928d3-240906",
"version": "3.0.0-nightly-5a0b4fabc-240924",
"description": "Spectrum UI components in React",

@@ -25,6 +25,6 @@ "license": "Apache-2.0",

"dependencies": {
"@react-stately/collections": "^3.0.0-nightly-4980928d3-240906",
"@react-stately/selection": "^3.0.0-nightly-4980928d3-240906",
"@react-stately/utils": "^3.0.0-nightly-4980928d3-240906",
"@react-types/shared": "^3.0.0-nightly-4980928d3-240906",
"@react-stately/collections": "^3.0.0-nightly-5a0b4fabc-240924",
"@react-stately/selection": "^3.0.0-nightly-5a0b4fabc-240924",
"@react-stately/utils": "^3.0.0-nightly-5a0b4fabc-240924",
"@react-types/shared": "^3.0.0-nightly-5a0b4fabc-240924",
"@swc/helpers": "^0.5.0"

@@ -31,0 +31,0 @@ },

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc