react-arborist 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/module.js +5 -5
- package/dist/module.js.map +1 -1
- package/jest.config.js +5 -0
- package/package.json +15 -11
- package/src/interfaces/tree-api.test.ts +15 -0
- package/src/interfaces/tree-api.ts +7 -7
package/dist/index.js
CHANGED
|
@@ -1811,21 +1811,21 @@ class $5c74fef433be2b0a$export$e2da3477247342d1 {
|
|
|
1811
1811
|
if (this.isFiltered) return false;
|
|
1812
1812
|
const parentNode = this.get(this.state.dnd.parentId) ?? this.root;
|
|
1813
1813
|
const dragNodes = this.dragNodes;
|
|
1814
|
-
const
|
|
1814
|
+
const isDisabled = this.props.disableDrop;
|
|
1815
1815
|
for (const drag of dragNodes){
|
|
1816
1816
|
if (!drag) return false;
|
|
1817
1817
|
if (!parentNode) return false;
|
|
1818
1818
|
if (drag.isInternal && $eb5355379510ac9b$exports.isDecendent(parentNode, drag)) return false;
|
|
1819
1819
|
}
|
|
1820
1820
|
// Allow the user to insert their own logic
|
|
1821
|
-
if (typeof
|
|
1821
|
+
if (typeof isDisabled == "function") return !isDisabled({
|
|
1822
1822
|
parentNode: parentNode,
|
|
1823
1823
|
dragNodes: this.dragNodes,
|
|
1824
1824
|
index: this.state.dnd.index
|
|
1825
1825
|
});
|
|
1826
|
-
else if (typeof
|
|
1827
|
-
return
|
|
1828
|
-
else if (typeof
|
|
1826
|
+
else if (typeof isDisabled == "string") // @ts-ignore
|
|
1827
|
+
return !parentNode.data[isDisabled];
|
|
1828
|
+
else if (typeof isDisabled === "boolean") return !isDisabled;
|
|
1829
1829
|
else return true;
|
|
1830
1830
|
}
|
|
1831
1831
|
hideCursor() {
|