@react-stately/list 3.4.2-nightly.3085 → 3.4.2-nightly.3100
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 +26 -26
- package/dist/module.js +24 -24
- package/package.json +6 -6
package/dist/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
4
|
-
var $
|
|
1
|
+
var $aJ74T$react = require("react");
|
|
2
|
+
var $aJ74T$reactstatelyselection = require("@react-stately/selection");
|
|
3
|
+
var $aJ74T$reactstatelycollections = require("@react-stately/collections");
|
|
4
|
+
var $aJ74T$reactstatelyutils = require("@react-stately/utils");
|
|
5
5
|
|
|
6
6
|
function $parcel$exportWildcard(dest, source) {
|
|
7
7
|
Object.keys(source).forEach(function(key) {
|
|
@@ -22,14 +22,14 @@ 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 $
|
|
25
|
+
var $72e18dacc1c2def6$exports = {};
|
|
26
26
|
|
|
27
|
-
$parcel$export($
|
|
27
|
+
$parcel$export($72e18dacc1c2def6$exports, "useListState", () => $72e18dacc1c2def6$export$2f645645f7bca764);
|
|
28
28
|
|
|
29
|
-
var $
|
|
29
|
+
var $581648861f39f723$exports = {};
|
|
30
30
|
|
|
31
|
-
$parcel$export($
|
|
32
|
-
class $
|
|
31
|
+
$parcel$export($581648861f39f723$exports, "ListCollection", () => $581648861f39f723$export$d085fb9e920b5ca7);
|
|
32
|
+
class $581648861f39f723$export$d085fb9e920b5ca7 {
|
|
33
33
|
constructor(nodes){
|
|
34
34
|
this.keyMap = new Map();
|
|
35
35
|
this.iterable = nodes;
|
|
@@ -93,26 +93,26 @@ class $99881fbe031fe9b4$export$d085fb9e920b5ca7 {
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
function $
|
|
96
|
+
function $72e18dacc1c2def6$export$2f645645f7bca764(props) {
|
|
97
97
|
let { filter: filter } = props;
|
|
98
|
-
let selectionState = $
|
|
99
|
-
let disabledKeys = $
|
|
98
|
+
let selectionState = $aJ74T$reactstatelyselection.useMultipleSelectionState(props);
|
|
99
|
+
let disabledKeys = $aJ74T$react.useMemo(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set()
|
|
100
100
|
, [
|
|
101
101
|
props.disabledKeys
|
|
102
102
|
]);
|
|
103
|
-
let factory = (nodes)=>filter ? new $
|
|
103
|
+
let factory = (nodes)=>filter ? new $581648861f39f723$export$d085fb9e920b5ca7(filter(nodes)) : new $581648861f39f723$export$d085fb9e920b5ca7(nodes)
|
|
104
104
|
;
|
|
105
|
-
let context = $
|
|
105
|
+
let context = $aJ74T$react.useMemo(()=>({
|
|
106
106
|
suppressTextValueWarning: props.suppressTextValueWarning
|
|
107
107
|
})
|
|
108
108
|
, [
|
|
109
109
|
props.suppressTextValueWarning
|
|
110
110
|
]);
|
|
111
|
-
let collection = $
|
|
111
|
+
let collection = $aJ74T$reactstatelycollections.useCollection(props, factory, context, [
|
|
112
112
|
filter
|
|
113
113
|
]);
|
|
114
114
|
// Reset focused key if that item is deleted from the collection.
|
|
115
|
-
$
|
|
115
|
+
$aJ74T$react.useEffect(()=>{
|
|
116
116
|
if (selectionState.focusedKey != null && !collection.getItem(selectionState.focusedKey)) selectionState.setFocusedKey(null);
|
|
117
117
|
}, [
|
|
118
118
|
collection,
|
|
@@ -121,26 +121,26 @@ function $0ca6fb377e78c376$export$2f645645f7bca764(props) {
|
|
|
121
121
|
return {
|
|
122
122
|
collection: collection,
|
|
123
123
|
disabledKeys: disabledKeys,
|
|
124
|
-
selectionManager: new $
|
|
124
|
+
selectionManager: new $aJ74T$reactstatelyselection.SelectionManager(collection, selectionState)
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
|
|
129
|
-
var $
|
|
129
|
+
var $bb463ca54c041eac$exports = {};
|
|
130
130
|
|
|
131
|
-
$parcel$export($
|
|
131
|
+
$parcel$export($bb463ca54c041eac$exports, "useSingleSelectListState", () => $bb463ca54c041eac$export$e7f05e985daf4b5f);
|
|
132
132
|
|
|
133
133
|
|
|
134
134
|
|
|
135
|
-
function $
|
|
136
|
-
let [selectedKey, setSelectedKey] = $
|
|
137
|
-
let selectedKeys = $
|
|
135
|
+
function $bb463ca54c041eac$export$e7f05e985daf4b5f(props) {
|
|
136
|
+
let [selectedKey, setSelectedKey] = $aJ74T$reactstatelyutils.useControlledState(props.selectedKey, props.defaultSelectedKey ?? null, props.onSelectionChange);
|
|
137
|
+
let selectedKeys = $aJ74T$react.useMemo(()=>selectedKey != null ? [
|
|
138
138
|
selectedKey
|
|
139
139
|
] : []
|
|
140
140
|
, [
|
|
141
141
|
selectedKey
|
|
142
142
|
]);
|
|
143
|
-
let { collection: collection , disabledKeys: disabledKeys , selectionManager: selectionManager } = $
|
|
143
|
+
let { collection: collection , disabledKeys: disabledKeys , selectionManager: selectionManager } = $72e18dacc1c2def6$export$2f645645f7bca764({
|
|
144
144
|
...props,
|
|
145
145
|
selectionMode: 'single',
|
|
146
146
|
disallowEmptySelection: true,
|
|
@@ -167,9 +167,9 @@ function $c2295dabe3bb5bbb$export$e7f05e985daf4b5f(props) {
|
|
|
167
167
|
|
|
168
168
|
|
|
169
169
|
|
|
170
|
-
$parcel$exportWildcard(module.exports, $
|
|
171
|
-
$parcel$exportWildcard(module.exports, $
|
|
172
|
-
$parcel$exportWildcard(module.exports, $
|
|
170
|
+
$parcel$exportWildcard(module.exports, $72e18dacc1c2def6$exports);
|
|
171
|
+
$parcel$exportWildcard(module.exports, $bb463ca54c041eac$exports);
|
|
172
|
+
$parcel$exportWildcard(module.exports, $581648861f39f723$exports);
|
|
173
173
|
|
|
174
174
|
|
|
175
175
|
//# sourceMappingURL=main.js.map
|
package/dist/module.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {useMemo as $
|
|
2
|
-
import {useMultipleSelectionState as $
|
|
3
|
-
import {useCollection as $
|
|
4
|
-
import {useControlledState as $
|
|
1
|
+
import {useMemo as $2vUeM$useMemo, useEffect as $2vUeM$useEffect} from "react";
|
|
2
|
+
import {useMultipleSelectionState as $2vUeM$useMultipleSelectionState, SelectionManager as $2vUeM$SelectionManager} from "@react-stately/selection";
|
|
3
|
+
import {useCollection as $2vUeM$useCollection} from "@react-stately/collections";
|
|
4
|
+
import {useControlledState as $2vUeM$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 $
|
|
9
|
+
var $22ee28165633d781$exports = {};
|
|
10
10
|
|
|
11
|
-
$parcel$export($
|
|
11
|
+
$parcel$export($22ee28165633d781$exports, "useListState", () => $22ee28165633d781$export$2f645645f7bca764);
|
|
12
12
|
|
|
13
|
-
var $
|
|
13
|
+
var $8b1d221864d202f1$exports = {};
|
|
14
14
|
|
|
15
|
-
$parcel$export($
|
|
16
|
-
class $
|
|
15
|
+
$parcel$export($8b1d221864d202f1$exports, "ListCollection", () => $8b1d221864d202f1$export$d085fb9e920b5ca7);
|
|
16
|
+
class $8b1d221864d202f1$export$d085fb9e920b5ca7 {
|
|
17
17
|
constructor(nodes){
|
|
18
18
|
this.keyMap = new Map();
|
|
19
19
|
this.iterable = nodes;
|
|
@@ -77,26 +77,26 @@ class $c43ff68ee1e9bc26$export$d085fb9e920b5ca7 {
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
function $
|
|
80
|
+
function $22ee28165633d781$export$2f645645f7bca764(props) {
|
|
81
81
|
let { filter: filter } = props;
|
|
82
|
-
let selectionState = $
|
|
83
|
-
let disabledKeys = $
|
|
82
|
+
let selectionState = $2vUeM$useMultipleSelectionState(props);
|
|
83
|
+
let disabledKeys = $2vUeM$useMemo(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set()
|
|
84
84
|
, [
|
|
85
85
|
props.disabledKeys
|
|
86
86
|
]);
|
|
87
|
-
let factory = (nodes)=>filter ? new $
|
|
87
|
+
let factory = (nodes)=>filter ? new $8b1d221864d202f1$export$d085fb9e920b5ca7(filter(nodes)) : new $8b1d221864d202f1$export$d085fb9e920b5ca7(nodes)
|
|
88
88
|
;
|
|
89
|
-
let context = $
|
|
89
|
+
let context = $2vUeM$useMemo(()=>({
|
|
90
90
|
suppressTextValueWarning: props.suppressTextValueWarning
|
|
91
91
|
})
|
|
92
92
|
, [
|
|
93
93
|
props.suppressTextValueWarning
|
|
94
94
|
]);
|
|
95
|
-
let collection = $
|
|
95
|
+
let collection = $2vUeM$useCollection(props, factory, context, [
|
|
96
96
|
filter
|
|
97
97
|
]);
|
|
98
98
|
// Reset focused key if that item is deleted from the collection.
|
|
99
|
-
$
|
|
99
|
+
$2vUeM$useEffect(()=>{
|
|
100
100
|
if (selectionState.focusedKey != null && !collection.getItem(selectionState.focusedKey)) selectionState.setFocusedKey(null);
|
|
101
101
|
}, [
|
|
102
102
|
collection,
|
|
@@ -105,26 +105,26 @@ function $fb0a1a056c6baecb$export$2f645645f7bca764(props) {
|
|
|
105
105
|
return {
|
|
106
106
|
collection: collection,
|
|
107
107
|
disabledKeys: disabledKeys,
|
|
108
|
-
selectionManager: new $
|
|
108
|
+
selectionManager: new $2vUeM$SelectionManager(collection, selectionState)
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
|
|
113
|
-
var $
|
|
113
|
+
var $81c60a02219e0c72$exports = {};
|
|
114
114
|
|
|
115
|
-
$parcel$export($
|
|
115
|
+
$parcel$export($81c60a02219e0c72$exports, "useSingleSelectListState", () => $81c60a02219e0c72$export$e7f05e985daf4b5f);
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
|
|
119
|
-
function $
|
|
120
|
-
let [selectedKey, setSelectedKey] = $
|
|
121
|
-
let selectedKeys = $
|
|
119
|
+
function $81c60a02219e0c72$export$e7f05e985daf4b5f(props) {
|
|
120
|
+
let [selectedKey, setSelectedKey] = $2vUeM$useControlledState(props.selectedKey, props.defaultSelectedKey ?? null, props.onSelectionChange);
|
|
121
|
+
let selectedKeys = $2vUeM$useMemo(()=>selectedKey != null ? [
|
|
122
122
|
selectedKey
|
|
123
123
|
] : []
|
|
124
124
|
, [
|
|
125
125
|
selectedKey
|
|
126
126
|
]);
|
|
127
|
-
let { collection: collection , disabledKeys: disabledKeys , selectionManager: selectionManager } = $
|
|
127
|
+
let { collection: collection , disabledKeys: disabledKeys , selectionManager: selectionManager } = $22ee28165633d781$export$2f645645f7bca764({
|
|
128
128
|
...props,
|
|
129
129
|
selectionMode: 'single',
|
|
130
130
|
disallowEmptySelection: true,
|
|
@@ -153,5 +153,5 @@ function $1c80eb4391abdea4$export$e7f05e985daf4b5f(props) {
|
|
|
153
153
|
|
|
154
154
|
|
|
155
155
|
|
|
156
|
-
export {$
|
|
156
|
+
export {$22ee28165633d781$export$2f645645f7bca764 as useListState, $81c60a02219e0c72$export$e7f05e985daf4b5f as useSingleSelectListState, $8b1d221864d202f1$export$d085fb9e920b5ca7 as ListCollection};
|
|
157
157
|
//# sourceMappingURL=module.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-stately/list",
|
|
3
|
-
"version": "3.4.2-nightly.
|
|
3
|
+
"version": "3.4.2-nightly.3100+da2aa7467",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.6.2",
|
|
21
|
-
"@react-stately/collections": "3.0.0-nightly.
|
|
22
|
-
"@react-stately/selection": "3.0.0-nightly.
|
|
23
|
-
"@react-stately/utils": "3.0.0-nightly.
|
|
24
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
21
|
+
"@react-stately/collections": "3.0.0-nightly.1409+da2aa7467",
|
|
22
|
+
"@react-stately/selection": "3.0.0-nightly.1409+da2aa7467",
|
|
23
|
+
"@react-stately/utils": "3.0.0-nightly.1409+da2aa7467",
|
|
24
|
+
"@react-types/shared": "3.0.0-nightly.1409+da2aa7467"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "^16.8.0 || ^17.0.0-rc.1"
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "da2aa74670fbd93335ff01401ca53826b3602777"
|
|
33
33
|
}
|