@react-stately/collections 3.12.3 → 3.12.4
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.
|
@@ -24,8 +24,10 @@ function $e749fe52977fe2c2$export$77d5aafae4e095b2(collection) {
|
|
|
24
24
|
// TS isn't smart enough to know we've ensured count is a number, so use a new variable
|
|
25
25
|
let counter = 0;
|
|
26
26
|
let countItems = (items)=>{
|
|
27
|
-
for (let item of items)
|
|
28
|
-
|
|
27
|
+
for (let item of items){
|
|
28
|
+
if (item.type === 'section') countItems((0, $7a155683b0d79a6a$exports.getChildNodes)(item, collection));
|
|
29
|
+
else if (item.type === 'item') counter++;
|
|
30
|
+
}
|
|
29
31
|
};
|
|
30
32
|
countItems(collection);
|
|
31
33
|
$e749fe52977fe2c2$var$cache.set(collection, counter);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAKD,MAAM,8BAAQ,IAAI;AAEX,SAAS,0CAAgB,UAA+B;IAC7D,IAAI,QAAQ,4BAAM,GAAG,CAAC;IACtB,IAAI,SAAS,MACX,OAAO;IAGT,uFAAuF;IACvF,IAAI,UAAU;IACd,IAAI,aAAa,CAAC;QAChB,KAAK,IAAI,QAAQ,
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAKD,MAAM,8BAAQ,IAAI;AAEX,SAAS,0CAAgB,UAA+B;IAC7D,IAAI,QAAQ,4BAAM,GAAG,CAAC;IACtB,IAAI,SAAS,MACX,OAAO;IAGT,uFAAuF;IACvF,IAAI,UAAU;IACd,IAAI,aAAa,CAAC;QAChB,KAAK,IAAI,QAAQ,MAAO;YACtB,IAAI,KAAK,IAAI,KAAK,WAChB,WAAW,CAAA,GAAA,uCAAY,EAAE,MAAM;iBAC1B,IAAI,KAAK,IAAI,KAAK,QACvB;QAEJ;IACF;IAEA,WAAW;IACX,4BAAM,GAAG,CAAC,YAAY;IACtB,OAAO;AACT","sources":["packages/@react-stately/collections/src/getItemCount.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, Node} from '@react-types/shared';\nimport {getChildNodes} from './getChildNodes';\n\nconst cache = new WeakMap<Iterable<unknown>, number>();\n\nexport function getItemCount<T>(collection: Collection<Node<T>>): number {\n let count = cache.get(collection);\n if (count != null) {\n return count;\n }\n\n // TS isn't smart enough to know we've ensured count is a number, so use a new variable\n let counter = 0;\n let countItems = (items: Iterable<Node<T>>) => {\n for (let item of items) {\n if (item.type === 'section') {\n countItems(getChildNodes(item, collection));\n } else if (item.type === 'item') {\n counter++;\n }\n }\n };\n\n countItems(collection);\n cache.set(collection, counter);\n return counter;\n}\n"],"names":[],"version":3,"file":"getItemCount.main.js.map"}
|
package/dist/getItemCount.mjs
CHANGED
|
@@ -18,8 +18,10 @@ function $453cc9f0df89c0a5$export$77d5aafae4e095b2(collection) {
|
|
|
18
18
|
// TS isn't smart enough to know we've ensured count is a number, so use a new variable
|
|
19
19
|
let counter = 0;
|
|
20
20
|
let countItems = (items)=>{
|
|
21
|
-
for (let item of items)
|
|
22
|
-
|
|
21
|
+
for (let item of items){
|
|
22
|
+
if (item.type === 'section') countItems((0, $c5a24bc478652b5f$export$1005530eda016c13)(item, collection));
|
|
23
|
+
else if (item.type === 'item') counter++;
|
|
24
|
+
}
|
|
23
25
|
};
|
|
24
26
|
countItems(collection);
|
|
25
27
|
$453cc9f0df89c0a5$var$cache.set(collection, counter);
|
|
@@ -18,8 +18,10 @@ function $453cc9f0df89c0a5$export$77d5aafae4e095b2(collection) {
|
|
|
18
18
|
// TS isn't smart enough to know we've ensured count is a number, so use a new variable
|
|
19
19
|
let counter = 0;
|
|
20
20
|
let countItems = (items)=>{
|
|
21
|
-
for (let item of items)
|
|
22
|
-
|
|
21
|
+
for (let item of items){
|
|
22
|
+
if (item.type === 'section') countItems((0, $c5a24bc478652b5f$export$1005530eda016c13)(item, collection));
|
|
23
|
+
else if (item.type === 'item') counter++;
|
|
24
|
+
}
|
|
23
25
|
};
|
|
24
26
|
countItems(collection);
|
|
25
27
|
$453cc9f0df89c0a5$var$cache.set(collection, counter);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAKD,MAAM,8BAAQ,IAAI;AAEX,SAAS,0CAAgB,UAA+B;IAC7D,IAAI,QAAQ,4BAAM,GAAG,CAAC;IACtB,IAAI,SAAS,MACX,OAAO;IAGT,uFAAuF;IACvF,IAAI,UAAU;IACd,IAAI,aAAa,CAAC;QAChB,KAAK,IAAI,QAAQ,
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAKD,MAAM,8BAAQ,IAAI;AAEX,SAAS,0CAAgB,UAA+B;IAC7D,IAAI,QAAQ,4BAAM,GAAG,CAAC;IACtB,IAAI,SAAS,MACX,OAAO;IAGT,uFAAuF;IACvF,IAAI,UAAU;IACd,IAAI,aAAa,CAAC;QAChB,KAAK,IAAI,QAAQ,MAAO;YACtB,IAAI,KAAK,IAAI,KAAK,WAChB,WAAW,CAAA,GAAA,yCAAY,EAAE,MAAM;iBAC1B,IAAI,KAAK,IAAI,KAAK,QACvB;QAEJ;IACF;IAEA,WAAW;IACX,4BAAM,GAAG,CAAC,YAAY;IACtB,OAAO;AACT","sources":["packages/@react-stately/collections/src/getItemCount.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, Node} from '@react-types/shared';\nimport {getChildNodes} from './getChildNodes';\n\nconst cache = new WeakMap<Iterable<unknown>, number>();\n\nexport function getItemCount<T>(collection: Collection<Node<T>>): number {\n let count = cache.get(collection);\n if (count != null) {\n return count;\n }\n\n // TS isn't smart enough to know we've ensured count is a number, so use a new variable\n let counter = 0;\n let countItems = (items: Iterable<Node<T>>) => {\n for (let item of items) {\n if (item.type === 'section') {\n countItems(getChildNodes(item, collection));\n } else if (item.type === 'item') {\n counter++;\n }\n }\n };\n\n countItems(collection);\n cache.set(collection, counter);\n return counter;\n}\n"],"names":[],"version":3,"file":"getItemCount.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-stately/collections",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.4",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-types/shared": "^3.29.
|
|
25
|
+
"@react-types/shared": "^3.29.1",
|
|
26
26
|
"@swc/helpers": "^0.5.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "9c77d4e8267ed39469c65f65da94ece7be509874"
|
|
35
35
|
}
|
package/src/getItemCount.ts
CHANGED