@react-stately/selection
Advanced tools
Comparing version 3.0.0-nightly.1100 to 3.0.0-nightly.1104
@@ -208,3 +208,3 @@ var { | ||
key = this.getKey(key); | ||
return this.state.selectedKeys === 'all' || this.state.selectedKeys.has(key); | ||
return this.state.selectedKeys === 'all' ? !this.state.disabledKeys.has(key) : this.state.selectedKeys.has(key); | ||
} | ||
@@ -387,2 +387,6 @@ /** | ||
if (this.disallowEmptySelection && keys.size === 0) { | ||
return; | ||
} | ||
this.state.setSelectedKeys(keys); | ||
@@ -472,3 +476,3 @@ } | ||
clearSelection() { | ||
if (this.state.selectedKeys === 'all' || this.state.selectedKeys.size > 0) { | ||
if (!this.disallowEmptySelection && (this.state.selectedKeys === 'all' || this.state.selectedKeys.size > 0)) { | ||
this.state.setSelectedKeys(new $cc81f14158b02e1e259a5a46d24f0c$export$Selection()); | ||
@@ -475,0 +479,0 @@ } |
@@ -199,3 +199,3 @@ import { useControlledState } from "@react-stately/utils"; | ||
key = this.getKey(key); | ||
return this.state.selectedKeys === 'all' || this.state.selectedKeys.has(key); | ||
return this.state.selectedKeys === 'all' ? !this.state.disabledKeys.has(key) : this.state.selectedKeys.has(key); | ||
} | ||
@@ -378,2 +378,6 @@ /** | ||
if (this.disallowEmptySelection && keys.size === 0) { | ||
return; | ||
} | ||
this.state.setSelectedKeys(keys); | ||
@@ -463,3 +467,3 @@ } | ||
clearSelection() { | ||
if (this.state.selectedKeys === 'all' || this.state.selectedKeys.size > 0) { | ||
if (!this.disallowEmptySelection && (this.state.selectedKeys === 'all' || this.state.selectedKeys.size > 0)) { | ||
this.state.setSelectedKeys(new $c91e86e24f2dc9a2182dcc2674c58c$export$Selection()); | ||
@@ -466,0 +470,0 @@ } |
{ | ||
"name": "@react-stately/selection", | ||
"version": "3.0.0-nightly.1100+4ffc6447a", | ||
"version": "3.0.0-nightly.1104+d04e70b27", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,5 +21,5 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@react-stately/collections": "3.0.0-nightly.1100+4ffc6447a", | ||
"@react-stately/utils": "3.0.0-nightly.1100+4ffc6447a", | ||
"@react-types/shared": "3.0.0-nightly.1100+4ffc6447a" | ||
"@react-stately/collections": "3.0.0-nightly.1104+d04e70b27", | ||
"@react-stately/utils": "3.0.0-nightly.1104+d04e70b27", | ||
"@react-types/shared": "3.0.0-nightly.1104+d04e70b27" | ||
}, | ||
@@ -32,3 +32,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "4ffc6447a8f8b22e316383997e1d0b31d8602a56" | ||
"gitHead": "d04e70b27e40d0a04312d8c5e40127eceeefcd22" | ||
} |
@@ -111,3 +111,5 @@ /* | ||
key = this.getKey(key); | ||
return this.state.selectedKeys === 'all' || this.state.selectedKeys.has(key); | ||
return this.state.selectedKeys === 'all' | ||
? !this.state.disabledKeys.has(key) | ||
: this.state.selectedKeys.has(key); | ||
} | ||
@@ -274,2 +276,6 @@ | ||
if (this.disallowEmptySelection && keys.size === 0) { | ||
return; | ||
} | ||
this.state.setSelectedKeys(keys); | ||
@@ -349,3 +355,3 @@ } | ||
clearSelection() { | ||
if (this.state.selectedKeys === 'all' || this.state.selectedKeys.size > 0) { | ||
if (!this.disallowEmptySelection && (this.state.selectedKeys === 'all' || this.state.selectedKeys.size > 0)) { | ||
this.state.setSelectedKeys(new Selection()); | ||
@@ -352,0 +358,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
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
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
121307
1553