@react-stately/tree
Advanced tools
Comparing version 3.0.0-nightly-641446f65-240905 to 3.0.0-nightly-65e3a52a3-241120
@@ -29,7 +29,9 @@ | ||
let node = this.keyMap.get(key); | ||
return node ? node.prevKey : null; | ||
var _node_prevKey; | ||
return node ? (_node_prevKey = node.prevKey) !== null && _node_prevKey !== void 0 ? _node_prevKey : null : null; | ||
} | ||
getKeyAfter(key) { | ||
let node = this.keyMap.get(key); | ||
return node ? node.nextKey : null; | ||
var _node_nextKey; | ||
return node ? (_node_nextKey = node.nextKey) !== null && _node_nextKey !== void 0 ? _node_nextKey : null : null; | ||
} | ||
@@ -43,3 +45,4 @@ getFirstKey() { | ||
getItem(key) { | ||
return this.keyMap.get(key); | ||
var _this_keyMap_get; | ||
return (_this_keyMap_get = this.keyMap.get(key)) !== null && _this_keyMap_get !== void 0 ? _this_keyMap_get : null; | ||
} | ||
@@ -54,2 +57,4 @@ at(idx) { | ||
this.keyMap = new Map(); | ||
this.firstKey = null; | ||
this.lastKey = null; | ||
this.iterable = nodes; | ||
@@ -62,3 +67,3 @@ expandedKeys = expandedKeys || new Set(); | ||
for (let node of nodes)visit(node); | ||
let last; | ||
let last = null; | ||
let index = 0; | ||
@@ -79,3 +84,4 @@ for (let [key, node] of this.keyMap){ | ||
} | ||
this.lastKey = last === null || last === void 0 ? void 0 : last.key; | ||
var _last_key; | ||
this.lastKey = (_last_key = last === null || last === void 0 ? void 0 : last.key) !== null && _last_key !== void 0 ? _last_key : null; | ||
} | ||
@@ -82,0 +88,0 @@ } |
@@ -23,7 +23,9 @@ /* | ||
let node = this.keyMap.get(key); | ||
return node ? node.prevKey : null; | ||
var _node_prevKey; | ||
return node ? (_node_prevKey = node.prevKey) !== null && _node_prevKey !== void 0 ? _node_prevKey : null : null; | ||
} | ||
getKeyAfter(key) { | ||
let node = this.keyMap.get(key); | ||
return node ? node.nextKey : null; | ||
var _node_nextKey; | ||
return node ? (_node_nextKey = node.nextKey) !== null && _node_nextKey !== void 0 ? _node_nextKey : null : null; | ||
} | ||
@@ -37,3 +39,4 @@ getFirstKey() { | ||
getItem(key) { | ||
return this.keyMap.get(key); | ||
var _this_keyMap_get; | ||
return (_this_keyMap_get = this.keyMap.get(key)) !== null && _this_keyMap_get !== void 0 ? _this_keyMap_get : null; | ||
} | ||
@@ -48,2 +51,4 @@ at(idx) { | ||
this.keyMap = new Map(); | ||
this.firstKey = null; | ||
this.lastKey = null; | ||
this.iterable = nodes; | ||
@@ -56,3 +61,3 @@ expandedKeys = expandedKeys || new Set(); | ||
for (let node of nodes)visit(node); | ||
let last; | ||
let last = null; | ||
let index = 0; | ||
@@ -73,3 +78,4 @@ for (let [key, node] of this.keyMap){ | ||
} | ||
this.lastKey = last === null || last === void 0 ? void 0 : last.key; | ||
var _last_key; | ||
this.lastKey = (_last_key = last === null || last === void 0 ? void 0 : last.key) !== null && _last_key !== void 0 ? _last_key : null; | ||
} | ||
@@ -76,0 +82,0 @@ } |
@@ -10,8 +10,8 @@ import { Collection, Key, Node, CollectionStateBase, DisabledBehavior, Expandable, MultipleSelection } from "@react-types/shared"; | ||
getKeys(): IterableIterator<Key>; | ||
getKeyBefore(key: Key): Key; | ||
getKeyAfter(key: Key): Key; | ||
getFirstKey(): Key; | ||
getLastKey(): Key; | ||
getItem(key: Key): Node<T>; | ||
at(idx: number): Node<T>; | ||
getKeyBefore(key: Key): Key | null; | ||
getKeyAfter(key: Key): Key | null; | ||
getFirstKey(): Key | null; | ||
getLastKey(): Key | null; | ||
getItem(key: Key): Node<T> | null; | ||
at(idx: number): Node<T> | null; | ||
} | ||
@@ -18,0 +18,0 @@ export interface TreeProps<T> extends CollectionStateBase<T>, Expandable, MultipleSelection { |
{ | ||
"name": "@react-stately/tree", | ||
"version": "3.0.0-nightly-641446f65-240905", | ||
"version": "3.0.0-nightly-65e3a52a3-241120", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,10 +25,10 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-stately/collections": "^3.0.0-nightly-641446f65-240905", | ||
"@react-stately/selection": "^3.0.0-nightly-641446f65-240905", | ||
"@react-stately/utils": "^3.0.0-nightly-641446f65-240905", | ||
"@react-types/shared": "^3.0.0-nightly-641446f65-240905", | ||
"@react-stately/collections": "^3.0.0-nightly-65e3a52a3-241120", | ||
"@react-stately/selection": "^3.0.0-nightly-65e3a52a3-241120", | ||
"@react-stately/utils": "^3.0.0-nightly-65e3a52a3-241120", | ||
"@react-types/shared": "^3.0.0-nightly-65e3a52a3-241120", | ||
"@swc/helpers": "^0.5.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" | ||
}, | ||
@@ -38,3 +38,3 @@ "publishConfig": { | ||
}, | ||
"stableVersion": "3.8.4" | ||
"stableVersion": "3.8.5" | ||
} |
@@ -18,4 +18,4 @@ /* | ||
private iterable: Iterable<Node<T>>; | ||
private firstKey: Key; | ||
private lastKey: Key; | ||
private firstKey: Key | null = null; | ||
private lastKey: Key | null = null; | ||
@@ -40,3 +40,3 @@ constructor(nodes: Iterable<Node<T>>, {expandedKeys}: {expandedKeys?: Set<Key>} = {}) { | ||
let last: Node<T>; | ||
let last: Node<T> | null = null; | ||
let index = 0; | ||
@@ -63,3 +63,3 @@ for (let [key, node] of this.keyMap) { | ||
this.lastKey = last?.key; | ||
this.lastKey = last?.key ?? null; | ||
} | ||
@@ -81,3 +81,3 @@ | ||
let node = this.keyMap.get(key); | ||
return node ? node.prevKey : null; | ||
return node ? node.prevKey ?? null : null; | ||
} | ||
@@ -87,3 +87,3 @@ | ||
let node = this.keyMap.get(key); | ||
return node ? node.nextKey : null; | ||
return node ? node.nextKey ?? null : null; | ||
} | ||
@@ -100,3 +100,3 @@ | ||
getItem(key: Key) { | ||
return this.keyMap.get(key); | ||
return this.keyMap.get(key) ?? null; | ||
} | ||
@@ -103,0 +103,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
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
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
53974
677
+ Addedreact@19.0.0-rc-fb9a90fa48-20240614(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedreact@18.3.1(transitive)
Updated@react-stately/collections@^3.0.0-nightly-65e3a52a3-241120
Updated@react-stately/selection@^3.0.0-nightly-65e3a52a3-241120