@react-aria/actiongroup
Advanced tools
Comparing version 3.1.2-nightly.2619 to 3.1.2-nightly.2626
@@ -50,5 +50,8 @@ var { | ||
this.disabledKeys = void 0; | ||
this.isDisabled = void 0; | ||
this.collection = collection; | ||
this.flipDirection = direction === 'rtl' && orientation === 'horizontal'; | ||
this.disabledKeys = disabledKeys; | ||
let allKeys = [...collection.getKeys()]; | ||
this.isDisabled = !allKeys.some(key => !disabledKeys.has(key)); | ||
} | ||
@@ -101,2 +104,6 @@ | ||
getNextKey(key) { | ||
if (this.isDisabled) { | ||
return undefined; | ||
} | ||
do { | ||
@@ -114,2 +121,6 @@ key = this.collection.getKeyAfter(key); | ||
getPreviousKey(key) { | ||
if (this.isDisabled) { | ||
return undefined; | ||
} | ||
do { | ||
@@ -139,2 +150,8 @@ key = this.collection.getKeyBefore(key); | ||
} = props; | ||
let allKeys = [...state.collection.getKeys()]; | ||
if (!allKeys.some(key => !state.disabledKeys.has(key))) { | ||
isDisabled = true; | ||
} | ||
let { | ||
@@ -141,0 +158,0 @@ direction |
@@ -28,5 +28,8 @@ import { useSelectableCollection, useSelectableItem } from "@react-aria/selection"; | ||
this.disabledKeys = void 0; | ||
this.isDisabled = void 0; | ||
this.collection = collection; | ||
this.flipDirection = direction === 'rtl' && orientation === 'horizontal'; | ||
this.disabledKeys = disabledKeys; | ||
let allKeys = [...collection.getKeys()]; | ||
this.isDisabled = !allKeys.some(key => !disabledKeys.has(key)); | ||
} | ||
@@ -79,2 +82,6 @@ | ||
getNextKey(key) { | ||
if (this.isDisabled) { | ||
return undefined; | ||
} | ||
do { | ||
@@ -92,2 +99,6 @@ key = this.collection.getKeyAfter(key); | ||
getPreviousKey(key) { | ||
if (this.isDisabled) { | ||
return undefined; | ||
} | ||
do { | ||
@@ -116,2 +127,8 @@ key = this.collection.getKeyBefore(key); | ||
} = props; | ||
let allKeys = [...state.collection.getKeys()]; | ||
if (!allKeys.some(key => !state.disabledKeys.has(key))) { | ||
isDisabled = true; | ||
} | ||
let { | ||
@@ -118,0 +135,0 @@ direction |
{ | ||
"name": "@react-aria/actiongroup", | ||
"version": "3.1.2-nightly.2619+30377b75", | ||
"version": "3.1.2-nightly.2626+df2f596b", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,10 +21,10 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@react-aria/i18n": "3.0.0-nightly.941+30377b75", | ||
"@react-aria/interactions": "3.0.0-nightly.941+30377b75", | ||
"@react-aria/selection": "3.0.0-nightly.941+30377b75", | ||
"@react-aria/utils": "3.0.0-nightly.941+30377b75", | ||
"@react-stately/collections": "3.0.0-nightly.941+30377b75", | ||
"@react-stately/list": "3.2.3-nightly.2619+30377b75", | ||
"@react-types/actiongroup": "3.1.2-nightly.2619+30377b75", | ||
"@react-types/shared": "3.0.0-nightly.941+30377b75" | ||
"@react-aria/i18n": "3.0.0-nightly.948+df2f596b", | ||
"@react-aria/interactions": "3.0.0-nightly.948+df2f596b", | ||
"@react-aria/selection": "3.0.0-nightly.948+df2f596b", | ||
"@react-aria/utils": "3.0.0-nightly.948+df2f596b", | ||
"@react-stately/collections": "3.0.0-nightly.948+df2f596b", | ||
"@react-stately/list": "3.2.3-nightly.2626+df2f596b", | ||
"@react-types/actiongroup": "3.1.2-nightly.2626+df2f596b", | ||
"@react-types/shared": "3.0.0-nightly.948+df2f596b" | ||
}, | ||
@@ -37,3 +37,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "30377b7558c3e621e8e52d6daf75bd69bc93dbb9" | ||
"gitHead": "df2f596bd62ba33c88e76f7093411d6a77b36a7f" | ||
} |
@@ -20,2 +20,3 @@ /* | ||
private disabledKeys: Set<Key>; | ||
private isDisabled: boolean; | ||
@@ -26,2 +27,4 @@ constructor(collection: Collection<T>, direction: Direction, orientation: Orientation, disabledKeys: Set<Key> = new Set()) { | ||
this.disabledKeys = disabledKeys; | ||
let allKeys = [...collection.getKeys()]; | ||
this.isDisabled = !allKeys.some(key => !disabledKeys.has(key)); | ||
} | ||
@@ -70,2 +73,5 @@ | ||
getNextKey(key) { | ||
if (this.isDisabled) { | ||
return undefined; | ||
} | ||
do { | ||
@@ -81,2 +87,5 @@ key = this.collection.getKeyAfter(key); | ||
getPreviousKey(key) { | ||
if (this.isDisabled) { | ||
return undefined; | ||
} | ||
do { | ||
@@ -83,0 +92,0 @@ key = this.collection.getKeyBefore(key); |
@@ -38,2 +38,6 @@ /* | ||
} = props; | ||
let allKeys = [...state.collection.getKeys()]; | ||
if (!allKeys.some(key => !state.disabledKeys.has(key))) { | ||
isDisabled = true; | ||
} | ||
@@ -40,0 +44,0 @@ let {direction} = useLocale(); |
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
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
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
59044
569