@react-stately/selection
Advanced tools
Comparing version 3.0.0-nightly.2811 to 3.0.0-nightly.2816
@@ -403,9 +403,11 @@ var $83d9f$reactstatelyutils = require("@react-stately/utils"); | ||
canSelectItem(key) { | ||
var _item_props; | ||
if (this.state.selectionMode === "none" || this.state.disabledKeys.has(key)) return false; | ||
let item = this.collection.getItem(key); | ||
if (!item || item.type === "cell" && !this.allowsCellSelection) return false; | ||
if (!item || (item === null || item === void 0 ? void 0 : (_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.isDisabled) || item.type === "cell" && !this.allowsCellSelection) return false; | ||
return true; | ||
} | ||
isDisabled(key) { | ||
return this.state.disabledKeys.has(key) && this.state.disabledBehavior === "all"; | ||
var _this_collection_getItem_props, _this_collection_getItem; | ||
return this.state.disabledBehavior === "all" && (this.state.disabledKeys.has(key) || !!((_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem === void 0 ? void 0 : (_this_collection_getItem_props = _this_collection_getItem.props) === null || _this_collection_getItem_props === void 0 ? void 0 : _this_collection_getItem_props.isDisabled)); | ||
} | ||
@@ -412,0 +414,0 @@ isLink(key) { |
@@ -396,9 +396,11 @@ import {useControlledState as $Qsto2$useControlledState} from "@react-stately/utils"; | ||
canSelectItem(key) { | ||
var _item_props; | ||
if (this.state.selectionMode === "none" || this.state.disabledKeys.has(key)) return false; | ||
let item = this.collection.getItem(key); | ||
if (!item || item.type === "cell" && !this.allowsCellSelection) return false; | ||
if (!item || (item === null || item === void 0 ? void 0 : (_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.isDisabled) || item.type === "cell" && !this.allowsCellSelection) return false; | ||
return true; | ||
} | ||
isDisabled(key) { | ||
return this.state.disabledKeys.has(key) && this.state.disabledBehavior === "all"; | ||
var _this_collection_getItem_props, _this_collection_getItem; | ||
return this.state.disabledBehavior === "all" && (this.state.disabledKeys.has(key) || !!((_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem === void 0 ? void 0 : (_this_collection_getItem_props = _this_collection_getItem.props) === null || _this_collection_getItem_props === void 0 ? void 0 : _this_collection_getItem_props.isDisabled)); | ||
} | ||
@@ -405,0 +407,0 @@ isLink(key) { |
{ | ||
"name": "@react-stately/selection", | ||
"version": "3.0.0-nightly.2811+784737eff", | ||
"version": "3.0.0-nightly.2816+3ebcc660d", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,5 +25,5 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-stately/collections": "3.0.0-nightly.2811+784737eff", | ||
"@react-stately/utils": "3.0.0-nightly.2811+784737eff", | ||
"@react-types/shared": "3.0.0-nightly.2811+784737eff", | ||
"@react-stately/collections": "3.0.0-nightly.2816+3ebcc660d", | ||
"@react-stately/utils": "3.0.0-nightly.2816+3ebcc660d", | ||
"@react-types/shared": "3.0.0-nightly.2816+3ebcc660d", | ||
"@swc/helpers": "^0.5.0" | ||
@@ -37,3 +37,3 @@ }, | ||
}, | ||
"gitHead": "784737effd44b9d5e2b1316e690da44555eafd7e" | ||
"gitHead": "3ebcc660dd5abfae62ec9002a938916828ce05aa" | ||
} |
@@ -483,3 +483,3 @@ /* | ||
let item = this.collection.getItem(key); | ||
if (!item || (item.type === 'cell' && !this.allowsCellSelection)) { | ||
if (!item || item?.props?.isDisabled || (item.type === 'cell' && !this.allowsCellSelection)) { | ||
return false; | ||
@@ -492,3 +492,3 @@ } | ||
isDisabled(key: Key) { | ||
return this.state.disabledKeys.has(key) && this.state.disabledBehavior === 'all'; | ||
return this.state.disabledBehavior === 'all' && (this.state.disabledKeys.has(key) || !!this.collection.getItem(key)?.props?.isDisabled); | ||
} | ||
@@ -495,0 +495,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
169617
2136