@react-stately/collections 3.10.6 → 3.10.8
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/CollectionBuilder.main.js +7 -7
- package/dist/CollectionBuilder.mjs +8 -8
- package/dist/CollectionBuilder.module.js +7 -7
- package/dist/Item.main.js +6 -6
- package/dist/Item.mjs +7 -7
- package/dist/Item.module.js +6 -6
- package/dist/Section.main.js +6 -6
- package/dist/Section.mjs +7 -7
- package/dist/Section.module.js +6 -6
- package/dist/getChildNodes.main.js +1 -1
- package/dist/getChildNodes.mjs +2 -2
- package/dist/getChildNodes.module.js +1 -1
- package/dist/getItemCount.main.js +1 -1
- package/dist/getItemCount.mjs +2 -2
- package/dist/getItemCount.module.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/useCollection.main.js.map +1 -1
- package/dist/useCollection.mjs +1 -1
- package/dist/useCollection.module.js.map +1 -1
- package/package.json +4 -4
- package/src/useCollection.ts +1 -1
|
@@ -28,8 +28,8 @@ class $51588fd411aace25$export$bf788dd355e3a401 {
|
|
|
28
28
|
}
|
|
29
29
|
*iterateCollection(props) {
|
|
30
30
|
let { children: children, items: items } = props;
|
|
31
|
-
if (typeof children ===
|
|
32
|
-
if (!items) throw new Error(
|
|
31
|
+
if (typeof children === 'function') {
|
|
32
|
+
if (!items) throw new Error('props.children was a function but props.items is missing');
|
|
33
33
|
for (let item of props.items)yield* this.getFullNode({
|
|
34
34
|
value: item
|
|
35
35
|
}, {
|
|
@@ -55,12 +55,12 @@ class $51588fd411aace25$export$bf788dd355e3a401 {
|
|
|
55
55
|
}
|
|
56
56
|
getKey(item, partialNode, state, parentKey) {
|
|
57
57
|
if (item.key != null) return item.key;
|
|
58
|
-
if (partialNode.type ===
|
|
58
|
+
if (partialNode.type === 'cell' && partialNode.key != null) return `${parentKey}${partialNode.key}`;
|
|
59
59
|
let v = partialNode.value;
|
|
60
60
|
if (v != null) {
|
|
61
61
|
var _v_key;
|
|
62
62
|
let key = (_v_key = v.key) !== null && _v_key !== void 0 ? _v_key : v.id;
|
|
63
|
-
if (key == null) throw new Error(
|
|
63
|
+
if (key == null) throw new Error('No key found for item');
|
|
64
64
|
return key;
|
|
65
65
|
}
|
|
66
66
|
return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
|
|
@@ -88,8 +88,8 @@ class $51588fd411aace25$export$bf788dd355e3a401 {
|
|
|
88
88
|
// Call this function to get a partial node, and recursively build a full node from there.
|
|
89
89
|
if ((0, ($parcel$interopDefault($ioO2y$react))).isValidElement(element)) {
|
|
90
90
|
let type = element.type;
|
|
91
|
-
if (typeof type !==
|
|
92
|
-
let name = typeof element.type ===
|
|
91
|
+
if (typeof type !== 'function' && typeof type.getCollectionNode !== 'function') {
|
|
92
|
+
let name = typeof element.type === 'function' ? element.type.name : element.type;
|
|
93
93
|
throw new Error(`Unknown element <${name}> in collection.`);
|
|
94
94
|
}
|
|
95
95
|
let childNodes = type.getCollectionNode(element.props, this.context);
|
|
@@ -137,7 +137,7 @@ class $51588fd411aace25$export$bf788dd355e3a401 {
|
|
|
137
137
|
index: partialNode.index,
|
|
138
138
|
rendered: partialNode.rendered,
|
|
139
139
|
textValue: partialNode.textValue,
|
|
140
|
-
|
|
140
|
+
'aria-label': partialNode['aria-label'],
|
|
141
141
|
wrapper: partialNode.wrapper,
|
|
142
142
|
shouldInvalidate: partialNode.shouldInvalidate,
|
|
143
143
|
hasChildNodes: partialNode.hasChildNodes,
|
|
@@ -18,8 +18,8 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
18
18
|
}
|
|
19
19
|
*iterateCollection(props) {
|
|
20
20
|
let { children: children, items: items } = props;
|
|
21
|
-
if (typeof children ===
|
|
22
|
-
if (!items) throw new Error(
|
|
21
|
+
if (typeof children === 'function') {
|
|
22
|
+
if (!items) throw new Error('props.children was a function but props.items is missing');
|
|
23
23
|
for (let item of props.items)yield* this.getFullNode({
|
|
24
24
|
value: item
|
|
25
25
|
}, {
|
|
@@ -45,12 +45,12 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
45
45
|
}
|
|
46
46
|
getKey(item, partialNode, state, parentKey) {
|
|
47
47
|
if (item.key != null) return item.key;
|
|
48
|
-
if (partialNode.type ===
|
|
48
|
+
if (partialNode.type === 'cell' && partialNode.key != null) return `${parentKey}${partialNode.key}`;
|
|
49
49
|
let v = partialNode.value;
|
|
50
50
|
if (v != null) {
|
|
51
51
|
var _v_key;
|
|
52
52
|
let key = (_v_key = v.key) !== null && _v_key !== void 0 ? _v_key : v.id;
|
|
53
|
-
if (key == null) throw new Error(
|
|
53
|
+
if (key == null) throw new Error('No key found for item');
|
|
54
54
|
return key;
|
|
55
55
|
}
|
|
56
56
|
return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
|
|
@@ -78,8 +78,8 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
78
78
|
// Call this function to get a partial node, and recursively build a full node from there.
|
|
79
79
|
if ((0, $fzaAv$react).isValidElement(element)) {
|
|
80
80
|
let type = element.type;
|
|
81
|
-
if (typeof type !==
|
|
82
|
-
let name = typeof element.type ===
|
|
81
|
+
if (typeof type !== 'function' && typeof type.getCollectionNode !== 'function') {
|
|
82
|
+
let name = typeof element.type === 'function' ? element.type.name : element.type;
|
|
83
83
|
throw new Error(`Unknown element <${name}> in collection.`);
|
|
84
84
|
}
|
|
85
85
|
let childNodes = type.getCollectionNode(element.props, this.context);
|
|
@@ -127,7 +127,7 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
127
127
|
index: partialNode.index,
|
|
128
128
|
rendered: partialNode.rendered,
|
|
129
129
|
textValue: partialNode.textValue,
|
|
130
|
-
|
|
130
|
+
'aria-label': partialNode['aria-label'],
|
|
131
131
|
wrapper: partialNode.wrapper,
|
|
132
132
|
shouldInvalidate: partialNode.shouldInvalidate,
|
|
133
133
|
hasChildNodes: partialNode.hasChildNodes,
|
|
@@ -182,4 +182,4 @@ function $eb2240fc39a57fa5$var$capitalize(str) {
|
|
|
182
182
|
|
|
183
183
|
|
|
184
184
|
export {$eb2240fc39a57fa5$export$bf788dd355e3a401 as CollectionBuilder};
|
|
185
|
-
//# sourceMappingURL=CollectionBuilder.
|
|
185
|
+
//# sourceMappingURL=CollectionBuilder.module.js.map
|
|
@@ -18,8 +18,8 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
18
18
|
}
|
|
19
19
|
*iterateCollection(props) {
|
|
20
20
|
let { children: children, items: items } = props;
|
|
21
|
-
if (typeof children ===
|
|
22
|
-
if (!items) throw new Error(
|
|
21
|
+
if (typeof children === 'function') {
|
|
22
|
+
if (!items) throw new Error('props.children was a function but props.items is missing');
|
|
23
23
|
for (let item of props.items)yield* this.getFullNode({
|
|
24
24
|
value: item
|
|
25
25
|
}, {
|
|
@@ -45,12 +45,12 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
45
45
|
}
|
|
46
46
|
getKey(item, partialNode, state, parentKey) {
|
|
47
47
|
if (item.key != null) return item.key;
|
|
48
|
-
if (partialNode.type ===
|
|
48
|
+
if (partialNode.type === 'cell' && partialNode.key != null) return `${parentKey}${partialNode.key}`;
|
|
49
49
|
let v = partialNode.value;
|
|
50
50
|
if (v != null) {
|
|
51
51
|
var _v_key;
|
|
52
52
|
let key = (_v_key = v.key) !== null && _v_key !== void 0 ? _v_key : v.id;
|
|
53
|
-
if (key == null) throw new Error(
|
|
53
|
+
if (key == null) throw new Error('No key found for item');
|
|
54
54
|
return key;
|
|
55
55
|
}
|
|
56
56
|
return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
|
|
@@ -78,8 +78,8 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
78
78
|
// Call this function to get a partial node, and recursively build a full node from there.
|
|
79
79
|
if ((0, $fzaAv$react).isValidElement(element)) {
|
|
80
80
|
let type = element.type;
|
|
81
|
-
if (typeof type !==
|
|
82
|
-
let name = typeof element.type ===
|
|
81
|
+
if (typeof type !== 'function' && typeof type.getCollectionNode !== 'function') {
|
|
82
|
+
let name = typeof element.type === 'function' ? element.type.name : element.type;
|
|
83
83
|
throw new Error(`Unknown element <${name}> in collection.`);
|
|
84
84
|
}
|
|
85
85
|
let childNodes = type.getCollectionNode(element.props, this.context);
|
|
@@ -127,7 +127,7 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
127
127
|
index: partialNode.index,
|
|
128
128
|
rendered: partialNode.rendered,
|
|
129
129
|
textValue: partialNode.textValue,
|
|
130
|
-
|
|
130
|
+
'aria-label': partialNode['aria-label'],
|
|
131
131
|
wrapper: partialNode.wrapper,
|
|
132
132
|
shouldInvalidate: partialNode.shouldInvalidate,
|
|
133
133
|
hasChildNodes: partialNode.hasChildNodes,
|
package/dist/Item.main.js
CHANGED
|
@@ -27,26 +27,26 @@ function $c870f3b549c61b6b$var$Item(props) {
|
|
|
27
27
|
$c870f3b549c61b6b$var$Item.getCollectionNode = function* getCollectionNode(props, context) {
|
|
28
28
|
let { childItems: childItems, title: title, children: children } = props;
|
|
29
29
|
let rendered = props.title || props.children;
|
|
30
|
-
let textValue = props.textValue || (typeof rendered ===
|
|
30
|
+
let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || '';
|
|
31
31
|
// suppressTextValueWarning is used in components like Tabs, which don't have type to select support.
|
|
32
|
-
if (!textValue && !(context === null || context === void 0 ? void 0 : context.suppressTextValueWarning)) console.warn(
|
|
32
|
+
if (!textValue && !(context === null || context === void 0 ? void 0 : context.suppressTextValueWarning)) console.warn('<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.');
|
|
33
33
|
yield {
|
|
34
|
-
type:
|
|
34
|
+
type: 'item',
|
|
35
35
|
props: props,
|
|
36
36
|
rendered: rendered,
|
|
37
37
|
textValue: textValue,
|
|
38
|
-
|
|
38
|
+
'aria-label': props['aria-label'],
|
|
39
39
|
hasChildNodes: $c870f3b549c61b6b$var$hasChildItems(props),
|
|
40
40
|
*childNodes () {
|
|
41
41
|
if (childItems) for (let child of childItems)yield {
|
|
42
|
-
type:
|
|
42
|
+
type: 'item',
|
|
43
43
|
value: child
|
|
44
44
|
};
|
|
45
45
|
else if (title) {
|
|
46
46
|
let items = [];
|
|
47
47
|
(0, ($parcel$interopDefault($5Zch8$react))).Children.forEach(children, (child)=>{
|
|
48
48
|
items.push({
|
|
49
|
-
type:
|
|
49
|
+
type: 'item',
|
|
50
50
|
element: child
|
|
51
51
|
});
|
|
52
52
|
});
|
package/dist/Item.mjs
CHANGED
|
@@ -17,26 +17,26 @@ function $c1d7fb2ec91bae71$var$Item(props) {
|
|
|
17
17
|
$c1d7fb2ec91bae71$var$Item.getCollectionNode = function* getCollectionNode(props, context) {
|
|
18
18
|
let { childItems: childItems, title: title, children: children } = props;
|
|
19
19
|
let rendered = props.title || props.children;
|
|
20
|
-
let textValue = props.textValue || (typeof rendered ===
|
|
20
|
+
let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || '';
|
|
21
21
|
// suppressTextValueWarning is used in components like Tabs, which don't have type to select support.
|
|
22
|
-
if (!textValue && !(context === null || context === void 0 ? void 0 : context.suppressTextValueWarning)) console.warn(
|
|
22
|
+
if (!textValue && !(context === null || context === void 0 ? void 0 : context.suppressTextValueWarning)) console.warn('<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.');
|
|
23
23
|
yield {
|
|
24
|
-
type:
|
|
24
|
+
type: 'item',
|
|
25
25
|
props: props,
|
|
26
26
|
rendered: rendered,
|
|
27
27
|
textValue: textValue,
|
|
28
|
-
|
|
28
|
+
'aria-label': props['aria-label'],
|
|
29
29
|
hasChildNodes: $c1d7fb2ec91bae71$var$hasChildItems(props),
|
|
30
30
|
*childNodes () {
|
|
31
31
|
if (childItems) for (let child of childItems)yield {
|
|
32
|
-
type:
|
|
32
|
+
type: 'item',
|
|
33
33
|
value: child
|
|
34
34
|
};
|
|
35
35
|
else if (title) {
|
|
36
36
|
let items = [];
|
|
37
37
|
(0, $6Fm0V$react).Children.forEach(children, (child)=>{
|
|
38
38
|
items.push({
|
|
39
|
-
type:
|
|
39
|
+
type: 'item',
|
|
40
40
|
element: child
|
|
41
41
|
});
|
|
42
42
|
});
|
|
@@ -56,4 +56,4 @@ let $c1d7fb2ec91bae71$export$6d08773d2e66f8f2 = $c1d7fb2ec91bae71$var$Item;
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
export {$c1d7fb2ec91bae71$export$6d08773d2e66f8f2 as Item};
|
|
59
|
-
//# sourceMappingURL=Item.
|
|
59
|
+
//# sourceMappingURL=Item.module.js.map
|
package/dist/Item.module.js
CHANGED
|
@@ -17,26 +17,26 @@ function $c1d7fb2ec91bae71$var$Item(props) {
|
|
|
17
17
|
$c1d7fb2ec91bae71$var$Item.getCollectionNode = function* getCollectionNode(props, context) {
|
|
18
18
|
let { childItems: childItems, title: title, children: children } = props;
|
|
19
19
|
let rendered = props.title || props.children;
|
|
20
|
-
let textValue = props.textValue || (typeof rendered ===
|
|
20
|
+
let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || '';
|
|
21
21
|
// suppressTextValueWarning is used in components like Tabs, which don't have type to select support.
|
|
22
|
-
if (!textValue && !(context === null || context === void 0 ? void 0 : context.suppressTextValueWarning)) console.warn(
|
|
22
|
+
if (!textValue && !(context === null || context === void 0 ? void 0 : context.suppressTextValueWarning)) console.warn('<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.');
|
|
23
23
|
yield {
|
|
24
|
-
type:
|
|
24
|
+
type: 'item',
|
|
25
25
|
props: props,
|
|
26
26
|
rendered: rendered,
|
|
27
27
|
textValue: textValue,
|
|
28
|
-
|
|
28
|
+
'aria-label': props['aria-label'],
|
|
29
29
|
hasChildNodes: $c1d7fb2ec91bae71$var$hasChildItems(props),
|
|
30
30
|
*childNodes () {
|
|
31
31
|
if (childItems) for (let child of childItems)yield {
|
|
32
|
-
type:
|
|
32
|
+
type: 'item',
|
|
33
33
|
value: child
|
|
34
34
|
};
|
|
35
35
|
else if (title) {
|
|
36
36
|
let items = [];
|
|
37
37
|
(0, $6Fm0V$react).Children.forEach(children, (child)=>{
|
|
38
38
|
items.push({
|
|
39
|
-
type:
|
|
39
|
+
type: 'item',
|
|
40
40
|
element: child
|
|
41
41
|
});
|
|
42
42
|
});
|
package/dist/Section.main.js
CHANGED
|
@@ -27,16 +27,16 @@ function $350f13aa4d8b327c$var$Section(props) {
|
|
|
27
27
|
$350f13aa4d8b327c$var$Section.getCollectionNode = function* getCollectionNode(props) {
|
|
28
28
|
let { children: children, title: title, items: items } = props;
|
|
29
29
|
yield {
|
|
30
|
-
type:
|
|
30
|
+
type: 'section',
|
|
31
31
|
props: props,
|
|
32
32
|
hasChildNodes: true,
|
|
33
33
|
rendered: title,
|
|
34
|
-
|
|
34
|
+
'aria-label': props['aria-label'],
|
|
35
35
|
*childNodes () {
|
|
36
|
-
if (typeof children ===
|
|
37
|
-
if (!items) throw new Error(
|
|
36
|
+
if (typeof children === 'function') {
|
|
37
|
+
if (!items) throw new Error('props.children was a function but props.items is missing');
|
|
38
38
|
for (let item of items)yield {
|
|
39
|
-
type:
|
|
39
|
+
type: 'item',
|
|
40
40
|
value: item,
|
|
41
41
|
renderer: children
|
|
42
42
|
};
|
|
@@ -44,7 +44,7 @@ $350f13aa4d8b327c$var$Section.getCollectionNode = function* getCollectionNode(pr
|
|
|
44
44
|
let items = [];
|
|
45
45
|
(0, ($parcel$interopDefault($98hxh$react))).Children.forEach(children, (child)=>{
|
|
46
46
|
items.push({
|
|
47
|
-
type:
|
|
47
|
+
type: 'item',
|
|
48
48
|
element: child
|
|
49
49
|
});
|
|
50
50
|
});
|
package/dist/Section.mjs
CHANGED
|
@@ -17,16 +17,16 @@ function $9fc4852771d079eb$var$Section(props) {
|
|
|
17
17
|
$9fc4852771d079eb$var$Section.getCollectionNode = function* getCollectionNode(props) {
|
|
18
18
|
let { children: children, title: title, items: items } = props;
|
|
19
19
|
yield {
|
|
20
|
-
type:
|
|
20
|
+
type: 'section',
|
|
21
21
|
props: props,
|
|
22
22
|
hasChildNodes: true,
|
|
23
23
|
rendered: title,
|
|
24
|
-
|
|
24
|
+
'aria-label': props['aria-label'],
|
|
25
25
|
*childNodes () {
|
|
26
|
-
if (typeof children ===
|
|
27
|
-
if (!items) throw new Error(
|
|
26
|
+
if (typeof children === 'function') {
|
|
27
|
+
if (!items) throw new Error('props.children was a function but props.items is missing');
|
|
28
28
|
for (let item of items)yield {
|
|
29
|
-
type:
|
|
29
|
+
type: 'item',
|
|
30
30
|
value: item,
|
|
31
31
|
renderer: children
|
|
32
32
|
};
|
|
@@ -34,7 +34,7 @@ $9fc4852771d079eb$var$Section.getCollectionNode = function* getCollectionNode(pr
|
|
|
34
34
|
let items = [];
|
|
35
35
|
(0, $gtysd$react).Children.forEach(children, (child)=>{
|
|
36
36
|
items.push({
|
|
37
|
-
type:
|
|
37
|
+
type: 'item',
|
|
38
38
|
element: child
|
|
39
39
|
});
|
|
40
40
|
});
|
|
@@ -48,4 +48,4 @@ let $9fc4852771d079eb$export$6e2c8f0811a474ce = $9fc4852771d079eb$var$Section;
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
export {$9fc4852771d079eb$export$6e2c8f0811a474ce as Section};
|
|
51
|
-
//# sourceMappingURL=Section.
|
|
51
|
+
//# sourceMappingURL=Section.module.js.map
|
package/dist/Section.module.js
CHANGED
|
@@ -17,16 +17,16 @@ function $9fc4852771d079eb$var$Section(props) {
|
|
|
17
17
|
$9fc4852771d079eb$var$Section.getCollectionNode = function* getCollectionNode(props) {
|
|
18
18
|
let { children: children, title: title, items: items } = props;
|
|
19
19
|
yield {
|
|
20
|
-
type:
|
|
20
|
+
type: 'section',
|
|
21
21
|
props: props,
|
|
22
22
|
hasChildNodes: true,
|
|
23
23
|
rendered: title,
|
|
24
|
-
|
|
24
|
+
'aria-label': props['aria-label'],
|
|
25
25
|
*childNodes () {
|
|
26
|
-
if (typeof children ===
|
|
27
|
-
if (!items) throw new Error(
|
|
26
|
+
if (typeof children === 'function') {
|
|
27
|
+
if (!items) throw new Error('props.children was a function but props.items is missing');
|
|
28
28
|
for (let item of items)yield {
|
|
29
|
-
type:
|
|
29
|
+
type: 'item',
|
|
30
30
|
value: item,
|
|
31
31
|
renderer: children
|
|
32
32
|
};
|
|
@@ -34,7 +34,7 @@ $9fc4852771d079eb$var$Section.getCollectionNode = function* getCollectionNode(pr
|
|
|
34
34
|
let items = [];
|
|
35
35
|
(0, $gtysd$react).Children.forEach(children, (child)=>{
|
|
36
36
|
items.push({
|
|
37
|
-
type:
|
|
37
|
+
type: 'item',
|
|
38
38
|
element: child
|
|
39
39
|
});
|
|
40
40
|
});
|
|
@@ -20,7 +20,7 @@ $parcel$export(module.exports, "compareNodeOrder", () => $7a155683b0d79a6a$expor
|
|
|
20
20
|
* governing permissions and limitations under the License.
|
|
21
21
|
*/ function $7a155683b0d79a6a$export$1005530eda016c13(node, collection) {
|
|
22
22
|
// New API: call collection.getChildren with the node key.
|
|
23
|
-
if (typeof collection.getChildren ===
|
|
23
|
+
if (typeof collection.getChildren === 'function') return collection.getChildren(node.key);
|
|
24
24
|
// Old API: access childNodes directly.
|
|
25
25
|
return node.childNodes;
|
|
26
26
|
}
|
package/dist/getChildNodes.mjs
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/ function $c5a24bc478652b5f$export$1005530eda016c13(node, collection) {
|
|
12
12
|
// New API: call collection.getChildren with the node key.
|
|
13
|
-
if (typeof collection.getChildren ===
|
|
13
|
+
if (typeof collection.getChildren === 'function') return collection.getChildren(node.key);
|
|
14
14
|
// Old API: access childNodes directly.
|
|
15
15
|
return node.childNodes;
|
|
16
16
|
}
|
|
@@ -68,4 +68,4 @@ function $c5a24bc478652b5f$var$getAncestors(collection, node) {
|
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
export {$c5a24bc478652b5f$export$1005530eda016c13 as getChildNodes, $c5a24bc478652b5f$export$fbdeaa6a76694f71 as getFirstItem, $c5a24bc478652b5f$export$5f3398f8733f90e2 as getNthItem, $c5a24bc478652b5f$export$7475b2c64539e4cf as getLastItem, $c5a24bc478652b5f$export$8c434b3a7a4dad6 as compareNodeOrder};
|
|
71
|
-
//# sourceMappingURL=getChildNodes.
|
|
71
|
+
//# sourceMappingURL=getChildNodes.module.js.map
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/ function $c5a24bc478652b5f$export$1005530eda016c13(node, collection) {
|
|
12
12
|
// New API: call collection.getChildren with the node key.
|
|
13
|
-
if (typeof collection.getChildren ===
|
|
13
|
+
if (typeof collection.getChildren === 'function') return collection.getChildren(node.key);
|
|
14
14
|
// Old API: access childNodes directly.
|
|
15
15
|
return node.childNodes;
|
|
16
16
|
}
|
|
@@ -23,7 +23,7 @@ function $e749fe52977fe2c2$export$77d5aafae4e095b2(collection) {
|
|
|
23
23
|
if (count != null) return count;
|
|
24
24
|
count = 0;
|
|
25
25
|
let countItems = (items)=>{
|
|
26
|
-
for (let item of items)if (item.type ===
|
|
26
|
+
for (let item of items)if (item.type === 'section') countItems((0, $7a155683b0d79a6a$exports.getChildNodes)(item, collection));
|
|
27
27
|
else count++;
|
|
28
28
|
};
|
|
29
29
|
countItems(collection);
|
package/dist/getItemCount.mjs
CHANGED
|
@@ -17,7 +17,7 @@ function $453cc9f0df89c0a5$export$77d5aafae4e095b2(collection) {
|
|
|
17
17
|
if (count != null) return count;
|
|
18
18
|
count = 0;
|
|
19
19
|
let countItems = (items)=>{
|
|
20
|
-
for (let item of items)if (item.type ===
|
|
20
|
+
for (let item of items)if (item.type === 'section') countItems((0, $c5a24bc478652b5f$export$1005530eda016c13)(item, collection));
|
|
21
21
|
else count++;
|
|
22
22
|
};
|
|
23
23
|
countItems(collection);
|
|
@@ -27,4 +27,4 @@ function $453cc9f0df89c0a5$export$77d5aafae4e095b2(collection) {
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
export {$453cc9f0df89c0a5$export$77d5aafae4e095b2 as getItemCount};
|
|
30
|
-
//# sourceMappingURL=getItemCount.
|
|
30
|
+
//# sourceMappingURL=getItemCount.module.js.map
|
|
@@ -17,7 +17,7 @@ function $453cc9f0df89c0a5$export$77d5aafae4e095b2(collection) {
|
|
|
17
17
|
if (count != null) return count;
|
|
18
18
|
count = 0;
|
|
19
19
|
let countItems = (items)=>{
|
|
20
|
-
for (let item of items)if (item.type ===
|
|
20
|
+
for (let item of items)if (item.type === 'section') countItems((0, $c5a24bc478652b5f$export$1005530eda016c13)(item, collection));
|
|
21
21
|
else count++;
|
|
22
22
|
};
|
|
23
23
|
countItems(collection);
|
package/dist/types.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export class CollectionBuilder<T extends object> {
|
|
|
22
22
|
build(props: CollectionBase<T>, context?: unknown): Iterable<Node<T>>;
|
|
23
23
|
}
|
|
24
24
|
interface CollectionOptions<T, C extends Collection<Node<T>>> extends Omit<CollectionStateBase<T, C>, 'children'> {
|
|
25
|
-
children?: ReactElement | ReactElement[] | ((item: T) => ReactElement);
|
|
25
|
+
children?: ReactElement<any> | ReactElement<any>[] | ((item: T) => ReactElement<any>);
|
|
26
26
|
}
|
|
27
27
|
type CollectionFactory<T, C extends Collection<Node<T>>> = (node: Iterable<Node<T>>) => C;
|
|
28
28
|
export function useCollection<T extends object, C extends Collection<Node<T>> = Collection<Node<T>>>(props: CollectionOptions<T, C>, factory: CollectionFactory<T, C>, context?: unknown): C;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;AAeA,6BAA6B,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,YAAY,CAAC;IAClD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,YAAY,CAAC;IACrC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACpD,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAA;CACjD;ACgDD,OAAA,IAAI,
|
|
1
|
+
{"mappings":"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","sources":["packages/@react-stately/collections/src/packages/@react-stately/collections/src/types.ts","packages/@react-stately/collections/src/packages/@react-stately/collections/src/Item.ts","packages/@react-stately/collections/src/packages/@react-stately/collections/src/Section.ts","packages/@react-stately/collections/src/packages/@react-stately/collections/src/CollectionBuilder.ts","packages/@react-stately/collections/src/packages/@react-stately/collections/src/useCollection.ts","packages/@react-stately/collections/src/packages/@react-stately/collections/src/getChildNodes.ts","packages/@react-stately/collections/src/packages/@react-stately/collections/src/getItemCount.ts","packages/@react-stately/collections/src/packages/@react-stately/collections/src/index.ts","packages/@react-stately/collections/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {PartialNode} from './types';\nexport {Item} from './Item';\nexport {Section} from './Section';\nexport {useCollection} from './useCollection';\nexport {getItemCount} from './getItemCount';\nexport {getChildNodes, getFirstItem, getLastItem, getNthItem, compareNodeOrder} from './getChildNodes';\nexport {CollectionBuilder} from './CollectionBuilder';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAYM,SAAS,0CAAqF,KAA8B,EAAE,OAAgC,EAAE,OAAiB;IACtL,IAAI,UAAU,CAAA,GAAA,oBAAM,EAAE,IAAM,IAAI,CAAA,GAAA,2CAAgB,KAAQ,EAAE;IAC1D,IAAI,YAAC,QAAQ,SAAE,KAAK,cAAE,UAAU,EAAC,GAAG;IACpC,IAAI,SAAS,CAAA,GAAA,oBAAM,EAAE;QACnB,IAAI,YACF,OAAO;QAET,IAAI,QAAQ,QAAQ,KAAK,CAAC;sBAAC;mBAAU;QAAK,GAAG;QAC7C,OAAO,QAAQ;IACjB,GAAG;QAAC;QAAS;QAAU;QAAO;QAAY;QAAS;KAAQ;IAC3D,OAAO;AACT","sources":["packages/@react-stately/collections/src/useCollection.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, CollectionStateBase, Node} from '@react-types/shared';\nimport {CollectionBuilder} from './CollectionBuilder';\nimport {ReactElement, useMemo} from 'react';\n\ninterface CollectionOptions<T, C extends Collection<Node<T>>> extends Omit<CollectionStateBase<T, C>, 'children'> {\n children?: ReactElement | ReactElement[] | ((item: T) => ReactElement)\n}\n\ntype CollectionFactory<T, C extends Collection<Node<T>>> = (node: Iterable<Node<T>>) => C;\n\nexport function useCollection<T extends object, C extends Collection<Node<T>> = Collection<Node<T>>>(props: CollectionOptions<T, C>, factory: CollectionFactory<T, C>, context?: unknown): C {\n let builder = useMemo(() => new CollectionBuilder<T>(), []);\n let {children, items, collection} = props;\n let result = useMemo(() => {\n if (collection) {\n return collection;\n }\n let nodes = builder.build({children, items}, context);\n return factory(nodes);\n }, [builder, children, items, collection, context, factory]);\n return result;\n}\n"],"names":[],"version":3,"file":"useCollection.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAYM,SAAS,0CAAqF,KAA8B,EAAE,OAAgC,EAAE,OAAiB;IACtL,IAAI,UAAU,CAAA,GAAA,oBAAM,EAAE,IAAM,IAAI,CAAA,GAAA,2CAAgB,KAAQ,EAAE;IAC1D,IAAI,YAAC,QAAQ,SAAE,KAAK,cAAE,UAAU,EAAC,GAAG;IACpC,IAAI,SAAS,CAAA,GAAA,oBAAM,EAAE;QACnB,IAAI,YACF,OAAO;QAET,IAAI,QAAQ,QAAQ,KAAK,CAAC;sBAAC;mBAAU;QAAK,GAAG;QAC7C,OAAO,QAAQ;IACjB,GAAG;QAAC;QAAS;QAAU;QAAO;QAAY;QAAS;KAAQ;IAC3D,OAAO;AACT","sources":["packages/@react-stately/collections/src/useCollection.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, CollectionStateBase, Node} from '@react-types/shared';\nimport {CollectionBuilder} from './CollectionBuilder';\nimport {ReactElement, useMemo} from 'react';\n\ninterface CollectionOptions<T, C extends Collection<Node<T>>> extends Omit<CollectionStateBase<T, C>, 'children'> {\n children?: ReactElement<any> | ReactElement<any>[] | ((item: T) => ReactElement<any>)\n}\n\ntype CollectionFactory<T, C extends Collection<Node<T>>> = (node: Iterable<Node<T>>) => C;\n\nexport function useCollection<T extends object, C extends Collection<Node<T>> = Collection<Node<T>>>(props: CollectionOptions<T, C>, factory: CollectionFactory<T, C>, context?: unknown): C {\n let builder = useMemo(() => new CollectionBuilder<T>(), []);\n let {children, items, collection} = props;\n let result = useMemo(() => {\n if (collection) {\n return collection;\n }\n let nodes = builder.build({children, items}, context);\n return factory(nodes);\n }, [builder, children, items, collection, context, factory]);\n return result;\n}\n"],"names":[],"version":3,"file":"useCollection.main.js.map"}
|
package/dist/useCollection.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAYM,SAAS,0CAAqF,KAA8B,EAAE,OAAgC,EAAE,OAAiB;IACtL,IAAI,UAAU,CAAA,GAAA,cAAM,EAAE,IAAM,IAAI,CAAA,GAAA,yCAAgB,KAAQ,EAAE;IAC1D,IAAI,YAAC,QAAQ,SAAE,KAAK,cAAE,UAAU,EAAC,GAAG;IACpC,IAAI,SAAS,CAAA,GAAA,cAAM,EAAE;QACnB,IAAI,YACF,OAAO;QAET,IAAI,QAAQ,QAAQ,KAAK,CAAC;sBAAC;mBAAU;QAAK,GAAG;QAC7C,OAAO,QAAQ;IACjB,GAAG;QAAC;QAAS;QAAU;QAAO;QAAY;QAAS;KAAQ;IAC3D,OAAO;AACT","sources":["packages/@react-stately/collections/src/useCollection.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, CollectionStateBase, Node} from '@react-types/shared';\nimport {CollectionBuilder} from './CollectionBuilder';\nimport {ReactElement, useMemo} from 'react';\n\ninterface CollectionOptions<T, C extends Collection<Node<T>>> extends Omit<CollectionStateBase<T, C>, 'children'> {\n children?: ReactElement | ReactElement[] | ((item: T) => ReactElement)\n}\n\ntype CollectionFactory<T, C extends Collection<Node<T>>> = (node: Iterable<Node<T>>) => C;\n\nexport function useCollection<T extends object, C extends Collection<Node<T>> = Collection<Node<T>>>(props: CollectionOptions<T, C>, factory: CollectionFactory<T, C>, context?: unknown): C {\n let builder = useMemo(() => new CollectionBuilder<T>(), []);\n let {children, items, collection} = props;\n let result = useMemo(() => {\n if (collection) {\n return collection;\n }\n let nodes = builder.build({children, items}, context);\n return factory(nodes);\n }, [builder, children, items, collection, context, factory]);\n return result;\n}\n"],"names":[],"version":3,"file":"useCollection.module.js.map"}
|
|
1
|
+
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAYM,SAAS,0CAAqF,KAA8B,EAAE,OAAgC,EAAE,OAAiB;IACtL,IAAI,UAAU,CAAA,GAAA,cAAM,EAAE,IAAM,IAAI,CAAA,GAAA,yCAAgB,KAAQ,EAAE;IAC1D,IAAI,YAAC,QAAQ,SAAE,KAAK,cAAE,UAAU,EAAC,GAAG;IACpC,IAAI,SAAS,CAAA,GAAA,cAAM,EAAE;QACnB,IAAI,YACF,OAAO;QAET,IAAI,QAAQ,QAAQ,KAAK,CAAC;sBAAC;mBAAU;QAAK,GAAG;QAC7C,OAAO,QAAQ;IACjB,GAAG;QAAC;QAAS;QAAU;QAAO;QAAY;QAAS;KAAQ;IAC3D,OAAO;AACT","sources":["packages/@react-stately/collections/src/useCollection.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, CollectionStateBase, Node} from '@react-types/shared';\nimport {CollectionBuilder} from './CollectionBuilder';\nimport {ReactElement, useMemo} from 'react';\n\ninterface CollectionOptions<T, C extends Collection<Node<T>>> extends Omit<CollectionStateBase<T, C>, 'children'> {\n children?: ReactElement<any> | ReactElement<any>[] | ((item: T) => ReactElement<any>)\n}\n\ntype CollectionFactory<T, C extends Collection<Node<T>>> = (node: Iterable<Node<T>>) => C;\n\nexport function useCollection<T extends object, C extends Collection<Node<T>> = Collection<Node<T>>>(props: CollectionOptions<T, C>, factory: CollectionFactory<T, C>, context?: unknown): C {\n let builder = useMemo(() => new CollectionBuilder<T>(), []);\n let {children, items, collection} = props;\n let result = useMemo(() => {\n if (collection) {\n return collection;\n }\n let nodes = builder.build({children, items}, context);\n return factory(nodes);\n }, [builder, children, items, collection, context, factory]);\n return result;\n}\n"],"names":[],"version":3,"file":"useCollection.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-stately/collections",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.8",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-types/shared": "^3.
|
|
25
|
+
"@react-types/shared": "^3.24.0",
|
|
26
26
|
"@swc/helpers": "^0.5.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
|
|
29
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "86d80e3216bc32e75108831cf3a5a720bc849206"
|
|
35
35
|
}
|
package/src/useCollection.ts
CHANGED
|
@@ -15,7 +15,7 @@ import {CollectionBuilder} from './CollectionBuilder';
|
|
|
15
15
|
import {ReactElement, useMemo} from 'react';
|
|
16
16
|
|
|
17
17
|
interface CollectionOptions<T, C extends Collection<Node<T>>> extends Omit<CollectionStateBase<T, C>, 'children'> {
|
|
18
|
-
children?: ReactElement | ReactElement[] | ((item: T) => ReactElement)
|
|
18
|
+
children?: ReactElement<any> | ReactElement<any>[] | ((item: T) => ReactElement<any>)
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
type CollectionFactory<T, C extends Collection<Node<T>>> = (node: Iterable<Node<T>>) => C;
|