@react-stately/list 3.4.3 → 3.4.4-nightly.3113
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 +5 -5
package/dist/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
4
|
-
var $
|
|
1
|
+
var $jitug$react = require("react");
|
|
2
|
+
var $jitug$reactstatelyselection = require("@react-stately/selection");
|
|
3
|
+
var $jitug$reactstatelycollections = require("@react-stately/collections");
|
|
4
|
+
var $jitug$reactstatelyutils = require("@react-stately/utils");
|
|
5
5
|
|
|
6
6
|
function $parcel$exportWildcard(dest, source) {
|
|
7
7
|
Object.keys(source).forEach(function(key) {
|
|
@@ -22,15 +22,15 @@ 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 $5450691d3629f6ea$exports = {};
|
|
26
26
|
|
|
27
|
-
$parcel$export($
|
|
27
|
+
$parcel$export($5450691d3629f6ea$exports, "useListState", () => $5450691d3629f6ea$export$2f645645f7bca764);
|
|
28
28
|
|
|
29
|
-
var $
|
|
29
|
+
var $c9aa5a224613c979$exports = {};
|
|
30
30
|
|
|
31
|
-
$parcel$export($
|
|
31
|
+
$parcel$export($c9aa5a224613c979$exports, "ListCollection", () => $c9aa5a224613c979$export$d085fb9e920b5ca7);
|
|
32
32
|
var tmp = Symbol.iterator;
|
|
33
|
-
class $
|
|
33
|
+
class $c9aa5a224613c979$export$d085fb9e920b5ca7 {
|
|
34
34
|
*[tmp]() {
|
|
35
35
|
yield* this.iterable;
|
|
36
36
|
}
|
|
@@ -94,26 +94,26 @@ class $e57e1b595464cc8b$export$d085fb9e920b5ca7 {
|
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
|
|
97
|
-
function $
|
|
97
|
+
function $5450691d3629f6ea$export$2f645645f7bca764(props) {
|
|
98
98
|
let { filter: filter } = props;
|
|
99
|
-
let selectionState = $
|
|
100
|
-
let disabledKeys = $
|
|
99
|
+
let selectionState = $jitug$reactstatelyselection.useMultipleSelectionState(props);
|
|
100
|
+
let disabledKeys = $jitug$react.useMemo(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set()
|
|
101
101
|
, [
|
|
102
102
|
props.disabledKeys
|
|
103
103
|
]);
|
|
104
|
-
let factory = (nodes)=>filter ? new $
|
|
104
|
+
let factory = (nodes)=>filter ? new $c9aa5a224613c979$export$d085fb9e920b5ca7(filter(nodes)) : new $c9aa5a224613c979$export$d085fb9e920b5ca7(nodes)
|
|
105
105
|
;
|
|
106
|
-
let context = $
|
|
106
|
+
let context = $jitug$react.useMemo(()=>({
|
|
107
107
|
suppressTextValueWarning: props.suppressTextValueWarning
|
|
108
108
|
})
|
|
109
109
|
, [
|
|
110
110
|
props.suppressTextValueWarning
|
|
111
111
|
]);
|
|
112
|
-
let collection = $
|
|
112
|
+
let collection = $jitug$reactstatelycollections.useCollection(props, factory, context, [
|
|
113
113
|
filter
|
|
114
114
|
]);
|
|
115
115
|
// Reset focused key if that item is deleted from the collection.
|
|
116
|
-
$
|
|
116
|
+
$jitug$react.useEffect(()=>{
|
|
117
117
|
if (selectionState.focusedKey != null && !collection.getItem(selectionState.focusedKey)) selectionState.setFocusedKey(null);
|
|
118
118
|
}, [
|
|
119
119
|
collection,
|
|
@@ -122,27 +122,27 @@ function $bc93d2fc549b8670$export$2f645645f7bca764(props) {
|
|
|
122
122
|
return {
|
|
123
123
|
collection: collection,
|
|
124
124
|
disabledKeys: disabledKeys,
|
|
125
|
-
selectionManager: new $
|
|
125
|
+
selectionManager: new $jitug$reactstatelyselection.SelectionManager(collection, selectionState)
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
|
|
130
|
-
var $
|
|
130
|
+
var $b9e99587a092d199$exports = {};
|
|
131
131
|
|
|
132
|
-
$parcel$export($
|
|
132
|
+
$parcel$export($b9e99587a092d199$exports, "useSingleSelectListState", () => $b9e99587a092d199$export$e7f05e985daf4b5f);
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
|
|
136
|
-
function $
|
|
136
|
+
function $b9e99587a092d199$export$e7f05e985daf4b5f(props) {
|
|
137
137
|
var _defaultSelectedKey;
|
|
138
|
-
let [selectedKey, setSelectedKey] = $
|
|
139
|
-
let selectedKeys = $
|
|
138
|
+
let [selectedKey, setSelectedKey] = $jitug$reactstatelyutils.useControlledState(props.selectedKey, (_defaultSelectedKey = props.defaultSelectedKey) !== null && _defaultSelectedKey !== void 0 ? _defaultSelectedKey : null, props.onSelectionChange);
|
|
139
|
+
let selectedKeys = $jitug$react.useMemo(()=>selectedKey != null ? [
|
|
140
140
|
selectedKey
|
|
141
141
|
] : []
|
|
142
142
|
, [
|
|
143
143
|
selectedKey
|
|
144
144
|
]);
|
|
145
|
-
let { collection: collection , disabledKeys: disabledKeys , selectionManager: selectionManager } = $
|
|
145
|
+
let { collection: collection , disabledKeys: disabledKeys , selectionManager: selectionManager } = $5450691d3629f6ea$export$2f645645f7bca764({
|
|
146
146
|
...props,
|
|
147
147
|
selectionMode: 'single',
|
|
148
148
|
disallowEmptySelection: true,
|
|
@@ -169,9 +169,9 @@ function $6a9c04de034f6349$export$e7f05e985daf4b5f(props) {
|
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
|
|
172
|
-
$parcel$exportWildcard(module.exports, $
|
|
173
|
-
$parcel$exportWildcard(module.exports, $
|
|
174
|
-
$parcel$exportWildcard(module.exports, $
|
|
172
|
+
$parcel$exportWildcard(module.exports, $5450691d3629f6ea$exports);
|
|
173
|
+
$parcel$exportWildcard(module.exports, $b9e99587a092d199$exports);
|
|
174
|
+
$parcel$exportWildcard(module.exports, $c9aa5a224613c979$exports);
|
|
175
175
|
|
|
176
176
|
|
|
177
177
|
//# sourceMappingURL=main.js.map
|
package/dist/module.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {useMemo as $
|
|
2
|
-
import {useMultipleSelectionState as $
|
|
3
|
-
import {useCollection as $
|
|
4
|
-
import {useControlledState as $
|
|
1
|
+
import {useMemo as $58Phs$useMemo, useEffect as $58Phs$useEffect} from "react";
|
|
2
|
+
import {useMultipleSelectionState as $58Phs$useMultipleSelectionState, SelectionManager as $58Phs$SelectionManager} from "@react-stately/selection";
|
|
3
|
+
import {useCollection as $58Phs$useCollection} from "@react-stately/collections";
|
|
4
|
+
import {useControlledState as $58Phs$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 $e72dd72e1c76a225$exports = {};
|
|
10
10
|
|
|
11
|
-
$parcel$export($
|
|
11
|
+
$parcel$export($e72dd72e1c76a225$exports, "useListState", () => $e72dd72e1c76a225$export$2f645645f7bca764);
|
|
12
12
|
|
|
13
|
-
var $
|
|
13
|
+
var $a02d57049d202695$exports = {};
|
|
14
14
|
|
|
15
|
-
$parcel$export($
|
|
15
|
+
$parcel$export($a02d57049d202695$exports, "ListCollection", () => $a02d57049d202695$export$d085fb9e920b5ca7);
|
|
16
16
|
var tmp = Symbol.iterator;
|
|
17
|
-
class $
|
|
17
|
+
class $a02d57049d202695$export$d085fb9e920b5ca7 {
|
|
18
18
|
*[tmp]() {
|
|
19
19
|
yield* this.iterable;
|
|
20
20
|
}
|
|
@@ -78,26 +78,26 @@ class $80be09205507c5ec$export$d085fb9e920b5ca7 {
|
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
|
|
81
|
-
function $
|
|
81
|
+
function $e72dd72e1c76a225$export$2f645645f7bca764(props) {
|
|
82
82
|
let { filter: filter } = props;
|
|
83
|
-
let selectionState = $
|
|
84
|
-
let disabledKeys = $
|
|
83
|
+
let selectionState = $58Phs$useMultipleSelectionState(props);
|
|
84
|
+
let disabledKeys = $58Phs$useMemo(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set()
|
|
85
85
|
, [
|
|
86
86
|
props.disabledKeys
|
|
87
87
|
]);
|
|
88
|
-
let factory = (nodes)=>filter ? new $
|
|
88
|
+
let factory = (nodes)=>filter ? new $a02d57049d202695$export$d085fb9e920b5ca7(filter(nodes)) : new $a02d57049d202695$export$d085fb9e920b5ca7(nodes)
|
|
89
89
|
;
|
|
90
|
-
let context = $
|
|
90
|
+
let context = $58Phs$useMemo(()=>({
|
|
91
91
|
suppressTextValueWarning: props.suppressTextValueWarning
|
|
92
92
|
})
|
|
93
93
|
, [
|
|
94
94
|
props.suppressTextValueWarning
|
|
95
95
|
]);
|
|
96
|
-
let collection = $
|
|
96
|
+
let collection = $58Phs$useCollection(props, factory, context, [
|
|
97
97
|
filter
|
|
98
98
|
]);
|
|
99
99
|
// Reset focused key if that item is deleted from the collection.
|
|
100
|
-
$
|
|
100
|
+
$58Phs$useEffect(()=>{
|
|
101
101
|
if (selectionState.focusedKey != null && !collection.getItem(selectionState.focusedKey)) selectionState.setFocusedKey(null);
|
|
102
102
|
}, [
|
|
103
103
|
collection,
|
|
@@ -106,27 +106,27 @@ function $4b9a49966c91856a$export$2f645645f7bca764(props) {
|
|
|
106
106
|
return {
|
|
107
107
|
collection: collection,
|
|
108
108
|
disabledKeys: disabledKeys,
|
|
109
|
-
selectionManager: new $
|
|
109
|
+
selectionManager: new $58Phs$SelectionManager(collection, selectionState)
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
|
|
114
|
-
var $
|
|
114
|
+
var $a0d645289fe9b86b$exports = {};
|
|
115
115
|
|
|
116
|
-
$parcel$export($
|
|
116
|
+
$parcel$export($a0d645289fe9b86b$exports, "useSingleSelectListState", () => $a0d645289fe9b86b$export$e7f05e985daf4b5f);
|
|
117
117
|
|
|
118
118
|
|
|
119
119
|
|
|
120
|
-
function $
|
|
120
|
+
function $a0d645289fe9b86b$export$e7f05e985daf4b5f(props) {
|
|
121
121
|
var _defaultSelectedKey;
|
|
122
|
-
let [selectedKey, setSelectedKey] = $
|
|
123
|
-
let selectedKeys = $
|
|
122
|
+
let [selectedKey, setSelectedKey] = $58Phs$useControlledState(props.selectedKey, (_defaultSelectedKey = props.defaultSelectedKey) !== null && _defaultSelectedKey !== void 0 ? _defaultSelectedKey : null, props.onSelectionChange);
|
|
123
|
+
let selectedKeys = $58Phs$useMemo(()=>selectedKey != null ? [
|
|
124
124
|
selectedKey
|
|
125
125
|
] : []
|
|
126
126
|
, [
|
|
127
127
|
selectedKey
|
|
128
128
|
]);
|
|
129
|
-
let { collection: collection , disabledKeys: disabledKeys , selectionManager: selectionManager } = $
|
|
129
|
+
let { collection: collection , disabledKeys: disabledKeys , selectionManager: selectionManager } = $e72dd72e1c76a225$export$2f645645f7bca764({
|
|
130
130
|
...props,
|
|
131
131
|
selectionMode: 'single',
|
|
132
132
|
disallowEmptySelection: true,
|
|
@@ -155,5 +155,5 @@ function $e08e0e9da1306088$export$e7f05e985daf4b5f(props) {
|
|
|
155
155
|
|
|
156
156
|
|
|
157
157
|
|
|
158
|
-
export {$
|
|
158
|
+
export {$e72dd72e1c76a225$export$2f645645f7bca764 as useListState, $a0d645289fe9b86b$export$e7f05e985daf4b5f as useSingleSelectListState, $a02d57049d202695$export$d085fb9e920b5ca7 as ListCollection};
|
|
159
159
|
//# sourceMappingURL=module.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-stately/list",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.4-nightly.3113+404d41859",
|
|
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": "
|
|
22
|
-
"@react-stately/selection": "
|
|
23
|
-
"@react-stately/utils": "
|
|
24
|
-
"@react-types/shared": "
|
|
21
|
+
"@react-stately/collections": "3.0.0-nightly.1417+404d41859",
|
|
22
|
+
"@react-stately/selection": "3.0.0-nightly.1417+404d41859",
|
|
23
|
+
"@react-stately/utils": "3.0.0-nightly.1417+404d41859",
|
|
24
|
+
"@react-types/shared": "3.0.0-nightly.1417+404d41859"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "^16.8.0 || ^17.0.0-rc.1"
|