@react-stately/collections 3.0.0-nightly.1394 → 3.0.0-nightly.1395
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 +45 -45
- package/dist/module.js +41 -41
- package/package.json +3 -3
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var $
|
|
1
|
+
var $3QYD8$react = require("react");
|
|
2
2
|
|
|
3
3
|
function $parcel$exportWildcard(dest, source) {
|
|
4
4
|
Object.keys(source).forEach(function(key) {
|
|
@@ -22,14 +22,14 @@ function $parcel$interopDefault(a) {
|
|
|
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 $67609abe41544c2f$exports = {};
|
|
26
26
|
|
|
27
|
-
$parcel$export($
|
|
27
|
+
$parcel$export($67609abe41544c2f$exports, "Item", () => $67609abe41544c2f$export$6d08773d2e66f8f2);
|
|
28
28
|
|
|
29
|
-
function $
|
|
29
|
+
function $67609abe41544c2f$var$Item(props) {
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
|
-
$
|
|
32
|
+
$67609abe41544c2f$var$Item.getCollectionNode = function* getCollectionNode(props, context) {
|
|
33
33
|
let { childItems: childItems , title: title , children: children } = props;
|
|
34
34
|
let rendered = props.title || props.children;
|
|
35
35
|
let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || '';
|
|
@@ -41,7 +41,7 @@ $37e0ebfb06ba9a87$var$Item.getCollectionNode = function* getCollectionNode(props
|
|
|
41
41
|
rendered: rendered,
|
|
42
42
|
textValue: textValue,
|
|
43
43
|
'aria-label': props['aria-label'],
|
|
44
|
-
hasChildNodes: $
|
|
44
|
+
hasChildNodes: $67609abe41544c2f$var$hasChildItems(props),
|
|
45
45
|
*childNodes () {
|
|
46
46
|
if (childItems) for (let child1 of childItems)yield {
|
|
47
47
|
type: 'item',
|
|
@@ -49,7 +49,7 @@ $37e0ebfb06ba9a87$var$Item.getCollectionNode = function* getCollectionNode(props
|
|
|
49
49
|
};
|
|
50
50
|
else if (title) {
|
|
51
51
|
let items = [];
|
|
52
|
-
($parcel$interopDefault($
|
|
52
|
+
($parcel$interopDefault($3QYD8$react)).Children.forEach(children, (child)=>{
|
|
53
53
|
items.push({
|
|
54
54
|
type: 'item',
|
|
55
55
|
element: child
|
|
@@ -60,24 +60,24 @@ $37e0ebfb06ba9a87$var$Item.getCollectionNode = function* getCollectionNode(props
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
|
-
function $
|
|
63
|
+
function $67609abe41544c2f$var$hasChildItems(props) {
|
|
64
64
|
if (props.hasChildItems != null) return props.hasChildItems;
|
|
65
65
|
if (props.childItems) return true;
|
|
66
|
-
if (props.title && ($parcel$interopDefault($
|
|
66
|
+
if (props.title && ($parcel$interopDefault($3QYD8$react)).Children.count(props.children) > 0) return true;
|
|
67
67
|
return false;
|
|
68
68
|
}
|
|
69
69
|
// We don't want getCollectionNode to show up in the type definition
|
|
70
|
-
let $
|
|
70
|
+
let $67609abe41544c2f$export$6d08773d2e66f8f2 = $67609abe41544c2f$var$Item;
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
var $
|
|
73
|
+
var $7613fe6c851d27af$exports = {};
|
|
74
74
|
|
|
75
|
-
$parcel$export($
|
|
75
|
+
$parcel$export($7613fe6c851d27af$exports, "Section", () => $7613fe6c851d27af$export$6e2c8f0811a474ce);
|
|
76
76
|
|
|
77
|
-
function $
|
|
77
|
+
function $7613fe6c851d27af$var$Section(props) {
|
|
78
78
|
return null;
|
|
79
79
|
}
|
|
80
|
-
$
|
|
80
|
+
$7613fe6c851d27af$var$Section.getCollectionNode = function* getCollectionNode(props) {
|
|
81
81
|
let { children: children , title: title , items: items1 } = props;
|
|
82
82
|
yield {
|
|
83
83
|
type: 'section',
|
|
@@ -94,7 +94,7 @@ $6f449c58ea5788c8$var$Section.getCollectionNode = function* getCollectionNode(pr
|
|
|
94
94
|
};
|
|
95
95
|
} else {
|
|
96
96
|
let items = [];
|
|
97
|
-
($parcel$interopDefault($
|
|
97
|
+
($parcel$interopDefault($3QYD8$react)).Children.forEach(children, (child)=>{
|
|
98
98
|
items.push({
|
|
99
99
|
type: 'item',
|
|
100
100
|
element: child
|
|
@@ -106,20 +106,20 @@ $6f449c58ea5788c8$var$Section.getCollectionNode = function* getCollectionNode(pr
|
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
108
|
// We don't want getCollectionNode to show up in the type definition
|
|
109
|
-
let $
|
|
109
|
+
let $7613fe6c851d27af$export$6e2c8f0811a474ce = $7613fe6c851d27af$var$Section;
|
|
110
110
|
|
|
111
111
|
|
|
112
|
-
var $
|
|
112
|
+
var $f0c95e4ecd513714$exports = {};
|
|
113
113
|
|
|
114
114
|
|
|
115
|
-
var $
|
|
115
|
+
var $df8a726ef7511d2e$exports = {};
|
|
116
116
|
|
|
117
|
-
$parcel$export($
|
|
117
|
+
$parcel$export($df8a726ef7511d2e$exports, "useCollection", () => $df8a726ef7511d2e$export$6cd28814d92fa9c9);
|
|
118
118
|
|
|
119
|
-
class $
|
|
119
|
+
class $99f43427f9c89ffa$export$bf788dd355e3a401 {
|
|
120
120
|
build(props, context) {
|
|
121
121
|
this.context = context;
|
|
122
|
-
return $
|
|
122
|
+
return $99f43427f9c89ffa$var$iterable(()=>this.iterateCollection(props)
|
|
123
123
|
);
|
|
124
124
|
}
|
|
125
125
|
*iterateCollection(props) {
|
|
@@ -133,7 +133,7 @@ class $adf5083e1044b4ca$export$bf788dd355e3a401 {
|
|
|
133
133
|
});
|
|
134
134
|
} else {
|
|
135
135
|
let items = [];
|
|
136
|
-
($parcel$interopDefault($
|
|
136
|
+
($parcel$interopDefault($3QYD8$react)).Children.forEach(children, (child)=>{
|
|
137
137
|
items.push(child);
|
|
138
138
|
});
|
|
139
139
|
let index = 0;
|
|
@@ -182,7 +182,7 @@ class $adf5083e1044b4ca$export$bf788dd355e3a401 {
|
|
|
182
182
|
}
|
|
183
183
|
// If there's an element with a getCollectionNode function on its type, then it's a supported component.
|
|
184
184
|
// Call this function to get a partial node, and recursively build a full node from there.
|
|
185
|
-
if (($parcel$interopDefault($
|
|
185
|
+
if (($parcel$interopDefault($3QYD8$react)).isValidElement(element)) {
|
|
186
186
|
let type = element.type;
|
|
187
187
|
if (typeof type !== 'function' && typeof type.getCollectionNode !== 'function') {
|
|
188
188
|
let name = typeof element.type === 'function' ? element.type.name : element.type;
|
|
@@ -200,7 +200,7 @@ class $adf5083e1044b4ca$export$bf788dd355e3a401 {
|
|
|
200
200
|
...childNode,
|
|
201
201
|
key: nodeKey,
|
|
202
202
|
index: index,
|
|
203
|
-
wrapper: $
|
|
203
|
+
wrapper: $99f43427f9c89ffa$var$compose(partialNode.wrapper, childNode.wrapper)
|
|
204
204
|
}, this.getChildState(state, childNode), parentKey ? `${parentKey}${element.key}` : element.key, parentNode);
|
|
205
205
|
let children = [
|
|
206
206
|
...nodes
|
|
@@ -211,7 +211,7 @@ class $adf5083e1044b4ca$export$bf788dd355e3a401 {
|
|
|
211
211
|
if (node.value) this.cache.set(node.value, node);
|
|
212
212
|
// The partial node may have specified a type for the child in order to specify a constraint.
|
|
213
213
|
// Verify that the full node that was built recursively matches this type.
|
|
214
|
-
if (partialNode.type && node.type !== partialNode.type) throw new Error(`Unsupported type <${$
|
|
214
|
+
if (partialNode.type && node.type !== partialNode.type) throw new Error(`Unsupported type <${$99f43427f9c89ffa$var$capitalize(node.type)}> in <${$99f43427f9c89ffa$var$capitalize(parentNode.type)}>. Only <${$99f43427f9c89ffa$var$capitalize(partialNode.type)}> is supported.`);
|
|
215
215
|
index++;
|
|
216
216
|
yield node;
|
|
217
217
|
}
|
|
@@ -237,7 +237,7 @@ class $adf5083e1044b4ca$export$bf788dd355e3a401 {
|
|
|
237
237
|
wrapper: partialNode.wrapper,
|
|
238
238
|
shouldInvalidate: partialNode.shouldInvalidate,
|
|
239
239
|
hasChildNodes: partialNode.hasChildNodes,
|
|
240
|
-
childNodes: $
|
|
240
|
+
childNodes: $99f43427f9c89ffa$var$iterable(function*() {
|
|
241
241
|
if (!partialNode.hasChildNodes) return;
|
|
242
242
|
let index = 0;
|
|
243
243
|
for (let child of partialNode.childNodes()){
|
|
@@ -259,7 +259,7 @@ class $adf5083e1044b4ca$export$bf788dd355e3a401 {
|
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
// Wraps an iterator function as an iterable object, and caches the results.
|
|
262
|
-
function $
|
|
262
|
+
function $99f43427f9c89ffa$var$iterable(iterator) {
|
|
263
263
|
let cache = [];
|
|
264
264
|
let iterable = null;
|
|
265
265
|
return {
|
|
@@ -273,23 +273,23 @@ function $adf5083e1044b4ca$var$iterable(iterator) {
|
|
|
273
273
|
}
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
|
-
function $
|
|
276
|
+
function $99f43427f9c89ffa$var$compose(outer, inner) {
|
|
277
277
|
if (outer && inner) return (element)=>outer(inner(element))
|
|
278
278
|
;
|
|
279
279
|
if (outer) return outer;
|
|
280
280
|
if (inner) return inner;
|
|
281
281
|
}
|
|
282
|
-
function $
|
|
282
|
+
function $99f43427f9c89ffa$var$capitalize(str) {
|
|
283
283
|
return str[0].toUpperCase() + str.slice(1);
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
|
|
287
287
|
|
|
288
|
-
function $
|
|
289
|
-
let builder = $
|
|
288
|
+
function $df8a726ef7511d2e$export$6cd28814d92fa9c9(props, factory, context, invalidators = []) {
|
|
289
|
+
let builder = $3QYD8$react.useMemo(()=>new $99f43427f9c89ffa$export$bf788dd355e3a401()
|
|
290
290
|
, []);
|
|
291
|
-
let prev = $
|
|
292
|
-
return $
|
|
291
|
+
let prev = $3QYD8$react.useRef(null);
|
|
292
|
+
return $3QYD8$react.useMemo(()=>{
|
|
293
293
|
let nodes = builder.build(props, context);
|
|
294
294
|
prev.current = factory(nodes, prev.current);
|
|
295
295
|
return prev.current;
|
|
@@ -305,26 +305,26 @@ function $69b0cc1932e5e4e0$export$6cd28814d92fa9c9(props, factory, context, inva
|
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
|
|
308
|
-
var $
|
|
308
|
+
var $d80f40b5562dcac9$exports = {};
|
|
309
309
|
|
|
310
|
-
$parcel$export($
|
|
311
|
-
const $
|
|
312
|
-
function $
|
|
313
|
-
let count = $
|
|
310
|
+
$parcel$export($d80f40b5562dcac9$exports, "getItemCount", () => $d80f40b5562dcac9$export$77d5aafae4e095b2);
|
|
311
|
+
const $d80f40b5562dcac9$var$cache = new WeakMap();
|
|
312
|
+
function $d80f40b5562dcac9$export$77d5aafae4e095b2(collection) {
|
|
313
|
+
let count = $d80f40b5562dcac9$var$cache.get(collection);
|
|
314
314
|
if (count != null) return count;
|
|
315
315
|
count = 0;
|
|
316
|
-
for (let item of collection)if (item.type === 'section') count += $
|
|
316
|
+
for (let item of collection)if (item.type === 'section') count += $d80f40b5562dcac9$export$77d5aafae4e095b2(item.childNodes);
|
|
317
317
|
else count++;
|
|
318
|
-
$
|
|
318
|
+
$d80f40b5562dcac9$var$cache.set(collection, count);
|
|
319
319
|
return count;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
|
|
323
|
-
$parcel$exportWildcard(module.exports, $
|
|
324
|
-
$parcel$exportWildcard(module.exports, $
|
|
325
|
-
$parcel$exportWildcard(module.exports, $
|
|
326
|
-
$parcel$exportWildcard(module.exports, $
|
|
327
|
-
$parcel$exportWildcard(module.exports, $
|
|
323
|
+
$parcel$exportWildcard(module.exports, $67609abe41544c2f$exports);
|
|
324
|
+
$parcel$exportWildcard(module.exports, $7613fe6c851d27af$exports);
|
|
325
|
+
$parcel$exportWildcard(module.exports, $f0c95e4ecd513714$exports);
|
|
326
|
+
$parcel$exportWildcard(module.exports, $df8a726ef7511d2e$exports);
|
|
327
|
+
$parcel$exportWildcard(module.exports, $d80f40b5562dcac9$exports);
|
|
328
328
|
|
|
329
329
|
|
|
330
330
|
//# sourceMappingURL=main.js.map
|
package/dist/module.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import $
|
|
1
|
+
import $hGDng$react, {useMemo as $hGDng$useMemo, useRef as $hGDng$useRef} from "react";
|
|
2
2
|
|
|
3
3
|
function $parcel$export(e, n, v, s) {
|
|
4
4
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
5
5
|
}
|
|
6
|
-
var $
|
|
6
|
+
var $d80587bf41d0fb18$exports = {};
|
|
7
7
|
|
|
8
|
-
$parcel$export($
|
|
8
|
+
$parcel$export($d80587bf41d0fb18$exports, "Item", () => $d80587bf41d0fb18$export$6d08773d2e66f8f2);
|
|
9
9
|
|
|
10
|
-
function $
|
|
10
|
+
function $d80587bf41d0fb18$var$Item(props) {
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
|
-
$
|
|
13
|
+
$d80587bf41d0fb18$var$Item.getCollectionNode = function* getCollectionNode(props, context) {
|
|
14
14
|
let { childItems: childItems , title: title , children: children } = props;
|
|
15
15
|
let rendered = props.title || props.children;
|
|
16
16
|
let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || '';
|
|
@@ -22,7 +22,7 @@ $6d3916c252bf594d$var$Item.getCollectionNode = function* getCollectionNode(props
|
|
|
22
22
|
rendered: rendered,
|
|
23
23
|
textValue: textValue,
|
|
24
24
|
'aria-label': props['aria-label'],
|
|
25
|
-
hasChildNodes: $
|
|
25
|
+
hasChildNodes: $d80587bf41d0fb18$var$hasChildItems(props),
|
|
26
26
|
*childNodes () {
|
|
27
27
|
if (childItems) for (let child1 of childItems)yield {
|
|
28
28
|
type: 'item',
|
|
@@ -30,7 +30,7 @@ $6d3916c252bf594d$var$Item.getCollectionNode = function* getCollectionNode(props
|
|
|
30
30
|
};
|
|
31
31
|
else if (title) {
|
|
32
32
|
let items = [];
|
|
33
|
-
$
|
|
33
|
+
$hGDng$react.Children.forEach(children, (child)=>{
|
|
34
34
|
items.push({
|
|
35
35
|
type: 'item',
|
|
36
36
|
element: child
|
|
@@ -41,24 +41,24 @@ $6d3916c252bf594d$var$Item.getCollectionNode = function* getCollectionNode(props
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
-
function $
|
|
44
|
+
function $d80587bf41d0fb18$var$hasChildItems(props) {
|
|
45
45
|
if (props.hasChildItems != null) return props.hasChildItems;
|
|
46
46
|
if (props.childItems) return true;
|
|
47
|
-
if (props.title && $
|
|
47
|
+
if (props.title && $hGDng$react.Children.count(props.children) > 0) return true;
|
|
48
48
|
return false;
|
|
49
49
|
}
|
|
50
50
|
// We don't want getCollectionNode to show up in the type definition
|
|
51
|
-
let $
|
|
51
|
+
let $d80587bf41d0fb18$export$6d08773d2e66f8f2 = $d80587bf41d0fb18$var$Item;
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
var $
|
|
54
|
+
var $591e4228be66f7fb$exports = {};
|
|
55
55
|
|
|
56
|
-
$parcel$export($
|
|
56
|
+
$parcel$export($591e4228be66f7fb$exports, "Section", () => $591e4228be66f7fb$export$6e2c8f0811a474ce);
|
|
57
57
|
|
|
58
|
-
function $
|
|
58
|
+
function $591e4228be66f7fb$var$Section(props) {
|
|
59
59
|
return null;
|
|
60
60
|
}
|
|
61
|
-
$
|
|
61
|
+
$591e4228be66f7fb$var$Section.getCollectionNode = function* getCollectionNode(props) {
|
|
62
62
|
let { children: children , title: title , items: items1 } = props;
|
|
63
63
|
yield {
|
|
64
64
|
type: 'section',
|
|
@@ -75,7 +75,7 @@ $4f7c4e79589b00fc$var$Section.getCollectionNode = function* getCollectionNode(pr
|
|
|
75
75
|
};
|
|
76
76
|
} else {
|
|
77
77
|
let items = [];
|
|
78
|
-
$
|
|
78
|
+
$hGDng$react.Children.forEach(children, (child)=>{
|
|
79
79
|
items.push({
|
|
80
80
|
type: 'item',
|
|
81
81
|
element: child
|
|
@@ -87,20 +87,20 @@ $4f7c4e79589b00fc$var$Section.getCollectionNode = function* getCollectionNode(pr
|
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
89
|
// We don't want getCollectionNode to show up in the type definition
|
|
90
|
-
let $
|
|
90
|
+
let $591e4228be66f7fb$export$6e2c8f0811a474ce = $591e4228be66f7fb$var$Section;
|
|
91
91
|
|
|
92
92
|
|
|
93
|
-
var $
|
|
93
|
+
var $b8582cc7aa33d0e8$exports = {};
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
var $
|
|
96
|
+
var $b0e94ff142179e1f$exports = {};
|
|
97
97
|
|
|
98
|
-
$parcel$export($
|
|
98
|
+
$parcel$export($b0e94ff142179e1f$exports, "useCollection", () => $b0e94ff142179e1f$export$6cd28814d92fa9c9);
|
|
99
99
|
|
|
100
|
-
class $
|
|
100
|
+
class $0ef13e8a225e58db$export$bf788dd355e3a401 {
|
|
101
101
|
build(props, context) {
|
|
102
102
|
this.context = context;
|
|
103
|
-
return $
|
|
103
|
+
return $0ef13e8a225e58db$var$iterable(()=>this.iterateCollection(props)
|
|
104
104
|
);
|
|
105
105
|
}
|
|
106
106
|
*iterateCollection(props) {
|
|
@@ -114,7 +114,7 @@ class $8ebb3d5cda0884fa$export$bf788dd355e3a401 {
|
|
|
114
114
|
});
|
|
115
115
|
} else {
|
|
116
116
|
let items = [];
|
|
117
|
-
$
|
|
117
|
+
$hGDng$react.Children.forEach(children, (child)=>{
|
|
118
118
|
items.push(child);
|
|
119
119
|
});
|
|
120
120
|
let index = 0;
|
|
@@ -163,7 +163,7 @@ class $8ebb3d5cda0884fa$export$bf788dd355e3a401 {
|
|
|
163
163
|
}
|
|
164
164
|
// If there's an element with a getCollectionNode function on its type, then it's a supported component.
|
|
165
165
|
// Call this function to get a partial node, and recursively build a full node from there.
|
|
166
|
-
if ($
|
|
166
|
+
if ($hGDng$react.isValidElement(element)) {
|
|
167
167
|
let type = element.type;
|
|
168
168
|
if (typeof type !== 'function' && typeof type.getCollectionNode !== 'function') {
|
|
169
169
|
let name = typeof element.type === 'function' ? element.type.name : element.type;
|
|
@@ -181,7 +181,7 @@ class $8ebb3d5cda0884fa$export$bf788dd355e3a401 {
|
|
|
181
181
|
...childNode,
|
|
182
182
|
key: nodeKey,
|
|
183
183
|
index: index,
|
|
184
|
-
wrapper: $
|
|
184
|
+
wrapper: $0ef13e8a225e58db$var$compose(partialNode.wrapper, childNode.wrapper)
|
|
185
185
|
}, this.getChildState(state, childNode), parentKey ? `${parentKey}${element.key}` : element.key, parentNode);
|
|
186
186
|
let children = [
|
|
187
187
|
...nodes
|
|
@@ -192,7 +192,7 @@ class $8ebb3d5cda0884fa$export$bf788dd355e3a401 {
|
|
|
192
192
|
if (node.value) this.cache.set(node.value, node);
|
|
193
193
|
// The partial node may have specified a type for the child in order to specify a constraint.
|
|
194
194
|
// Verify that the full node that was built recursively matches this type.
|
|
195
|
-
if (partialNode.type && node.type !== partialNode.type) throw new Error(`Unsupported type <${$
|
|
195
|
+
if (partialNode.type && node.type !== partialNode.type) throw new Error(`Unsupported type <${$0ef13e8a225e58db$var$capitalize(node.type)}> in <${$0ef13e8a225e58db$var$capitalize(parentNode.type)}>. Only <${$0ef13e8a225e58db$var$capitalize(partialNode.type)}> is supported.`);
|
|
196
196
|
index++;
|
|
197
197
|
yield node;
|
|
198
198
|
}
|
|
@@ -218,7 +218,7 @@ class $8ebb3d5cda0884fa$export$bf788dd355e3a401 {
|
|
|
218
218
|
wrapper: partialNode.wrapper,
|
|
219
219
|
shouldInvalidate: partialNode.shouldInvalidate,
|
|
220
220
|
hasChildNodes: partialNode.hasChildNodes,
|
|
221
|
-
childNodes: $
|
|
221
|
+
childNodes: $0ef13e8a225e58db$var$iterable(function*() {
|
|
222
222
|
if (!partialNode.hasChildNodes) return;
|
|
223
223
|
let index = 0;
|
|
224
224
|
for (let child of partialNode.childNodes()){
|
|
@@ -240,7 +240,7 @@ class $8ebb3d5cda0884fa$export$bf788dd355e3a401 {
|
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
// Wraps an iterator function as an iterable object, and caches the results.
|
|
243
|
-
function $
|
|
243
|
+
function $0ef13e8a225e58db$var$iterable(iterator) {
|
|
244
244
|
let cache = [];
|
|
245
245
|
let iterable = null;
|
|
246
246
|
return {
|
|
@@ -254,23 +254,23 @@ function $8ebb3d5cda0884fa$var$iterable(iterator) {
|
|
|
254
254
|
}
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
|
-
function $
|
|
257
|
+
function $0ef13e8a225e58db$var$compose(outer, inner) {
|
|
258
258
|
if (outer && inner) return (element)=>outer(inner(element))
|
|
259
259
|
;
|
|
260
260
|
if (outer) return outer;
|
|
261
261
|
if (inner) return inner;
|
|
262
262
|
}
|
|
263
|
-
function $
|
|
263
|
+
function $0ef13e8a225e58db$var$capitalize(str) {
|
|
264
264
|
return str[0].toUpperCase() + str.slice(1);
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
|
|
268
268
|
|
|
269
|
-
function $
|
|
270
|
-
let builder = $
|
|
269
|
+
function $b0e94ff142179e1f$export$6cd28814d92fa9c9(props, factory, context, invalidators = []) {
|
|
270
|
+
let builder = $hGDng$useMemo(()=>new $0ef13e8a225e58db$export$bf788dd355e3a401()
|
|
271
271
|
, []);
|
|
272
|
-
let prev = $
|
|
273
|
-
return $
|
|
272
|
+
let prev = $hGDng$useRef(null);
|
|
273
|
+
return $hGDng$useMemo(()=>{
|
|
274
274
|
let nodes = builder.build(props, context);
|
|
275
275
|
prev.current = factory(nodes, prev.current);
|
|
276
276
|
return prev.current;
|
|
@@ -286,22 +286,22 @@ function $9bac41136ddb5831$export$6cd28814d92fa9c9(props, factory, context, inva
|
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
|
|
289
|
-
var $
|
|
289
|
+
var $a5bc6066b2ba167e$exports = {};
|
|
290
290
|
|
|
291
|
-
$parcel$export($
|
|
292
|
-
const $
|
|
293
|
-
function $
|
|
294
|
-
let count = $
|
|
291
|
+
$parcel$export($a5bc6066b2ba167e$exports, "getItemCount", () => $a5bc6066b2ba167e$export$77d5aafae4e095b2);
|
|
292
|
+
const $a5bc6066b2ba167e$var$cache = new WeakMap();
|
|
293
|
+
function $a5bc6066b2ba167e$export$77d5aafae4e095b2(collection) {
|
|
294
|
+
let count = $a5bc6066b2ba167e$var$cache.get(collection);
|
|
295
295
|
if (count != null) return count;
|
|
296
296
|
count = 0;
|
|
297
|
-
for (let item of collection)if (item.type === 'section') count += $
|
|
297
|
+
for (let item of collection)if (item.type === 'section') count += $a5bc6066b2ba167e$export$77d5aafae4e095b2(item.childNodes);
|
|
298
298
|
else count++;
|
|
299
|
-
$
|
|
299
|
+
$a5bc6066b2ba167e$var$cache.set(collection, count);
|
|
300
300
|
return count;
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
|
|
304
304
|
|
|
305
305
|
|
|
306
|
-
export {$
|
|
306
|
+
export {$d80587bf41d0fb18$export$6d08773d2e66f8f2 as Item, $591e4228be66f7fb$export$6e2c8f0811a474ce as Section, $b0e94ff142179e1f$export$6cd28814d92fa9c9 as useCollection, $a5bc6066b2ba167e$export$77d5aafae4e095b2 as getItemCount};
|
|
307
307
|
//# sourceMappingURL=module.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-stately/collections",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.1395+b2abc5d94",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.6.2",
|
|
21
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
21
|
+
"@react-types/shared": "3.0.0-nightly.1395+b2abc5d94"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^16.8.0 || ^17.0.0-rc.1"
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "b2abc5d94162a7bd614fffcdf11e3d3754dc7d9f"
|
|
30
30
|
}
|