@react-stately/tree 3.2.2 → 3.3.0

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/main.js CHANGED
@@ -1,7 +1,7 @@
1
- var $8jMun$react = require("react");
2
- var $8jMun$reactstatelyselection = require("@react-stately/selection");
3
- var $8jMun$reactstatelycollections = require("@react-stately/collections");
4
- var $8jMun$reactstatelyutils = require("@react-stately/utils");
1
+ var $cfIzB$react = require("react");
2
+ var $cfIzB$reactstatelyselection = require("@react-stately/selection");
3
+ var $cfIzB$reactstatelycollections = require("@react-stately/collections");
4
+ var $cfIzB$reactstatelyutils = require("@react-stately/utils");
5
5
 
6
6
  function $parcel$exportWildcard(dest, source) {
7
7
  Object.keys(source).forEach(function(key) {
@@ -22,13 +22,13 @@ function $parcel$exportWildcard(dest, source) {
22
22
  function $parcel$export(e, n, v, s) {
23
23
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
24
24
  }
25
- var $9fca792b9f1dbe9f$exports = {};
25
+ var $38effb299000faaf$exports = {};
26
26
 
27
- $parcel$export($9fca792b9f1dbe9f$exports, "useTreeState", () => $9fca792b9f1dbe9f$export$728d6ba534403756);
27
+ $parcel$export($38effb299000faaf$exports, "useTreeState", () => $38effb299000faaf$export$728d6ba534403756);
28
28
 
29
29
 
30
30
  var tmp = Symbol.iterator;
31
- class $dd657f4eb6746c96$export$863faf230ee2118a {
31
+ class $fae56b53b03726ff$export$863faf230ee2118a {
32
32
  *[tmp]() {
33
33
  yield* this.iterable;
34
34
  }
@@ -94,38 +94,38 @@ class $dd657f4eb6746c96$export$863faf230ee2118a {
94
94
 
95
95
 
96
96
 
97
- function $9fca792b9f1dbe9f$export$728d6ba534403756(props) {
98
- let [expandedKeys, setExpandedKeys] = $8jMun$reactstatelyutils.useControlledState(props.expandedKeys ? new Set(props.expandedKeys) : undefined, props.defaultExpandedKeys ? new Set(props.defaultExpandedKeys) : new Set(), props.onExpandedChange);
99
- let selectionState = $8jMun$reactstatelyselection.useMultipleSelectionState(props);
100
- let disabledKeys = $8jMun$react.useMemo(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set()
97
+ function $38effb299000faaf$export$728d6ba534403756(props) {
98
+ let [expandedKeys, setExpandedKeys] = $cfIzB$reactstatelyutils.useControlledState(props.expandedKeys ? new Set(props.expandedKeys) : undefined, props.defaultExpandedKeys ? new Set(props.defaultExpandedKeys) : new Set(), props.onExpandedChange);
99
+ let selectionState = $cfIzB$reactstatelyselection.useMultipleSelectionState(props);
100
+ let disabledKeys = $cfIzB$react.useMemo(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set()
101
101
  , [
102
102
  props.disabledKeys
103
103
  ]);
104
- let tree = $8jMun$reactstatelycollections.useCollection(props, (nodes)=>new $dd657f4eb6746c96$export$863faf230ee2118a(nodes, {
104
+ let tree = $cfIzB$reactstatelycollections.useCollection(props, (nodes)=>new $fae56b53b03726ff$export$863faf230ee2118a(nodes, {
105
105
  expandedKeys: expandedKeys
106
106
  })
107
107
  , null, [
108
108
  expandedKeys
109
109
  ]);
110
110
  // Reset focused key if that item is deleted from the collection.
111
- $8jMun$react.useEffect(()=>{
111
+ $cfIzB$react.useEffect(()=>{
112
112
  if (selectionState.focusedKey != null && !tree.getItem(selectionState.focusedKey)) selectionState.setFocusedKey(null);
113
113
  }, [
114
114
  tree,
115
115
  selectionState.focusedKey
116
116
  ]);
117
117
  let onToggle = (key)=>{
118
- setExpandedKeys($9fca792b9f1dbe9f$var$toggleKey(expandedKeys, key));
118
+ setExpandedKeys($38effb299000faaf$var$toggleKey(expandedKeys, key));
119
119
  };
120
120
  return {
121
121
  collection: tree,
122
122
  expandedKeys: expandedKeys,
123
123
  disabledKeys: disabledKeys,
124
124
  toggleKey: onToggle,
125
- selectionManager: new $8jMun$reactstatelyselection.SelectionManager(tree, selectionState)
125
+ selectionManager: new $cfIzB$reactstatelyselection.SelectionManager(tree, selectionState)
126
126
  };
127
127
  }
128
- function $9fca792b9f1dbe9f$var$toggleKey(set, key) {
128
+ function $38effb299000faaf$var$toggleKey(set, key) {
129
129
  let res = new Set(set);
130
130
  if (res.has(key)) res.delete(key);
131
131
  else res.add(key);
@@ -133,7 +133,7 @@ function $9fca792b9f1dbe9f$var$toggleKey(set, key) {
133
133
  }
134
134
 
135
135
 
136
- $parcel$exportWildcard(module.exports, $9fca792b9f1dbe9f$exports);
136
+ $parcel$exportWildcard(module.exports, $38effb299000faaf$exports);
137
137
 
138
138
 
139
139
  //# sourceMappingURL=main.js.map
package/dist/module.js CHANGED
@@ -1,18 +1,18 @@
1
- import {useMemo as $9TXm6$useMemo, useEffect as $9TXm6$useEffect} from "react";
2
- import {useMultipleSelectionState as $9TXm6$useMultipleSelectionState, SelectionManager as $9TXm6$SelectionManager} from "@react-stately/selection";
3
- import {useCollection as $9TXm6$useCollection} from "@react-stately/collections";
4
- import {useControlledState as $9TXm6$useControlledState} from "@react-stately/utils";
1
+ import {useMemo as $1OoTj$useMemo, useEffect as $1OoTj$useEffect} from "react";
2
+ import {useMultipleSelectionState as $1OoTj$useMultipleSelectionState, SelectionManager as $1OoTj$SelectionManager} from "@react-stately/selection";
3
+ import {useCollection as $1OoTj$useCollection} from "@react-stately/collections";
4
+ import {useControlledState as $1OoTj$useControlledState} from "@react-stately/utils";
5
5
 
6
6
  function $parcel$export(e, n, v, s) {
7
7
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
8
8
  }
9
- var $36d99f0640511db5$exports = {};
9
+ var $875d6693e12af071$exports = {};
10
10
 
11
- $parcel$export($36d99f0640511db5$exports, "useTreeState", () => $36d99f0640511db5$export$728d6ba534403756);
11
+ $parcel$export($875d6693e12af071$exports, "useTreeState", () => $875d6693e12af071$export$728d6ba534403756);
12
12
 
13
13
 
14
14
  var tmp = Symbol.iterator;
15
- class $c8161626733397a0$export$863faf230ee2118a {
15
+ class $05ca4cd7c4a5a999$export$863faf230ee2118a {
16
16
  *[tmp]() {
17
17
  yield* this.iterable;
18
18
  }
@@ -78,38 +78,38 @@ class $c8161626733397a0$export$863faf230ee2118a {
78
78
 
79
79
 
80
80
 
81
- function $36d99f0640511db5$export$728d6ba534403756(props) {
82
- let [expandedKeys, setExpandedKeys] = $9TXm6$useControlledState(props.expandedKeys ? new Set(props.expandedKeys) : undefined, props.defaultExpandedKeys ? new Set(props.defaultExpandedKeys) : new Set(), props.onExpandedChange);
83
- let selectionState = $9TXm6$useMultipleSelectionState(props);
84
- let disabledKeys = $9TXm6$useMemo(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set()
81
+ function $875d6693e12af071$export$728d6ba534403756(props) {
82
+ let [expandedKeys, setExpandedKeys] = $1OoTj$useControlledState(props.expandedKeys ? new Set(props.expandedKeys) : undefined, props.defaultExpandedKeys ? new Set(props.defaultExpandedKeys) : new Set(), props.onExpandedChange);
83
+ let selectionState = $1OoTj$useMultipleSelectionState(props);
84
+ let disabledKeys = $1OoTj$useMemo(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set()
85
85
  , [
86
86
  props.disabledKeys
87
87
  ]);
88
- let tree = $9TXm6$useCollection(props, (nodes)=>new $c8161626733397a0$export$863faf230ee2118a(nodes, {
88
+ let tree = $1OoTj$useCollection(props, (nodes)=>new $05ca4cd7c4a5a999$export$863faf230ee2118a(nodes, {
89
89
  expandedKeys: expandedKeys
90
90
  })
91
91
  , null, [
92
92
  expandedKeys
93
93
  ]);
94
94
  // Reset focused key if that item is deleted from the collection.
95
- $9TXm6$useEffect(()=>{
95
+ $1OoTj$useEffect(()=>{
96
96
  if (selectionState.focusedKey != null && !tree.getItem(selectionState.focusedKey)) selectionState.setFocusedKey(null);
97
97
  }, [
98
98
  tree,
99
99
  selectionState.focusedKey
100
100
  ]);
101
101
  let onToggle = (key)=>{
102
- setExpandedKeys($36d99f0640511db5$var$toggleKey(expandedKeys, key));
102
+ setExpandedKeys($875d6693e12af071$var$toggleKey(expandedKeys, key));
103
103
  };
104
104
  return {
105
105
  collection: tree,
106
106
  expandedKeys: expandedKeys,
107
107
  disabledKeys: disabledKeys,
108
108
  toggleKey: onToggle,
109
- selectionManager: new $9TXm6$SelectionManager(tree, selectionState)
109
+ selectionManager: new $1OoTj$SelectionManager(tree, selectionState)
110
110
  };
111
111
  }
112
- function $36d99f0640511db5$var$toggleKey(set, key) {
112
+ function $875d6693e12af071$var$toggleKey(set, key) {
113
113
  let res = new Set(set);
114
114
  if (res.has(key)) res.delete(key);
115
115
  else res.add(key);
@@ -119,5 +119,5 @@ function $36d99f0640511db5$var$toggleKey(set, key) {
119
119
 
120
120
 
121
121
 
122
- export {$36d99f0640511db5$export$728d6ba534403756 as useTreeState};
122
+ export {$875d6693e12af071$export$728d6ba534403756 as useTreeState};
123
123
  //# sourceMappingURL=module.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-stately/tree",
3
- "version": "3.2.2",
3
+ "version": "3.3.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -18,16 +18,16 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@babel/runtime": "^7.6.2",
21
- "@react-stately/collections": "^3.3.6",
22
- "@react-stately/selection": "^3.9.2",
23
- "@react-stately/utils": "^3.4.1",
24
- "@react-types/shared": "^3.11.1"
21
+ "@react-stately/collections": "^3.4.0",
22
+ "@react-stately/selection": "^3.10.0",
23
+ "@react-stately/utils": "^3.5.0",
24
+ "@react-types/shared": "^3.13.0"
25
25
  },
26
26
  "peerDependencies": {
27
- "react": "^16.8.0 || ^17.0.0-rc.1"
27
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
28
28
  },
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
- "gitHead": "404d41859b7d6f56201d7fc01bd9f22ae3512937"
32
+ "gitHead": "8f921ec5094e7c2b3c301bcb6133372e35a2052b"
33
33
  }