@react-stately/collections 3.0.0-nightly.2912 → 3.0.0-nightly.2917

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.
@@ -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 === "function") {
32
- if (!items) throw new Error("props.children was a function but props.items is missing");
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 === "cell" && partialNode.key != null) return `${parentKey}${partialNode.key}`;
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("No key found for item");
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 !== "function" && typeof type.getCollectionNode !== "function") {
92
- let name = typeof element.type === "function" ? element.type.name : 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
- "aria-label": partialNode["aria-label"],
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 === "function") {
22
- if (!items) throw new Error("props.children was a function but props.items is missing");
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 === "cell" && partialNode.key != null) return `${parentKey}${partialNode.key}`;
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("No key found for item");
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 !== "function" && typeof type.getCollectionNode !== "function") {
82
- let name = typeof element.type === "function" ? element.type.name : 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
- "aria-label": partialNode["aria-label"],
130
+ 'aria-label': partialNode['aria-label'],
131
131
  wrapper: partialNode.wrapper,
132
132
  shouldInvalidate: partialNode.shouldInvalidate,
133
133
  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 === "function") {
22
- if (!items) throw new Error("props.children was a function but props.items is missing");
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 === "cell" && partialNode.key != null) return `${parentKey}${partialNode.key}`;
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("No key found for item");
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 !== "function" && typeof type.getCollectionNode !== "function") {
82
- let name = typeof element.type === "function" ? element.type.name : 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
- "aria-label": partialNode["aria-label"],
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 === "string" ? rendered : "") || props["aria-label"] || "";
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("<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.");
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: "item",
34
+ type: 'item',
35
35
  props: props,
36
36
  rendered: rendered,
37
37
  textValue: textValue,
38
- "aria-label": props["aria-label"],
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: "item",
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: "item",
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 === "string" ? rendered : "") || props["aria-label"] || "";
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("<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.");
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: "item",
24
+ type: 'item',
25
25
  props: props,
26
26
  rendered: rendered,
27
27
  textValue: textValue,
28
- "aria-label": props["aria-label"],
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: "item",
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: "item",
39
+ type: 'item',
40
40
  element: child
41
41
  });
42
42
  });
@@ -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 === "string" ? rendered : "") || props["aria-label"] || "";
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("<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.");
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: "item",
24
+ type: 'item',
25
25
  props: props,
26
26
  rendered: rendered,
27
27
  textValue: textValue,
28
- "aria-label": props["aria-label"],
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: "item",
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: "item",
39
+ type: 'item',
40
40
  element: child
41
41
  });
42
42
  });
@@ -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: "section",
30
+ type: 'section',
31
31
  props: props,
32
32
  hasChildNodes: true,
33
33
  rendered: title,
34
- "aria-label": props["aria-label"],
34
+ 'aria-label': props['aria-label'],
35
35
  *childNodes () {
36
- if (typeof children === "function") {
37
- if (!items) throw new Error("props.children was a function but props.items is missing");
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: "item",
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: "item",
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: "section",
20
+ type: 'section',
21
21
  props: props,
22
22
  hasChildNodes: true,
23
23
  rendered: title,
24
- "aria-label": props["aria-label"],
24
+ 'aria-label': props['aria-label'],
25
25
  *childNodes () {
26
- if (typeof children === "function") {
27
- if (!items) throw new Error("props.children was a function but props.items is missing");
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: "item",
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: "item",
37
+ type: 'item',
38
38
  element: child
39
39
  });
40
40
  });
@@ -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: "section",
20
+ type: 'section',
21
21
  props: props,
22
22
  hasChildNodes: true,
23
23
  rendered: title,
24
- "aria-label": props["aria-label"],
24
+ 'aria-label': props['aria-label'],
25
25
  *childNodes () {
26
- if (typeof children === "function") {
27
- if (!items) throw new Error("props.children was a function but props.items is missing");
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: "item",
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: "item",
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 === "function") return collection.getChildren(node.key);
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
  }
@@ -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 === "function") return collection.getChildren(node.key);
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
  }
@@ -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 === "function") return collection.getChildren(node.key);
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 === "section") countItems((0, $7a155683b0d79a6a$exports.getChildNodes)(item, collection));
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);
@@ -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 === "section") countItems((0, $c5a24bc478652b5f$export$1005530eda016c13)(item, collection));
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);
@@ -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 === "section") countItems((0, $c5a24bc478652b5f$export$1005530eda016c13)(item, collection));
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-stately/collections",
3
- "version": "3.0.0-nightly.2912+d80999e89",
3
+ "version": "3.0.0-nightly.2917+c34886769",
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.0.0-nightly.2912+d80999e89",
25
+ "@react-types/shared": "3.0.0-nightly.2917+c34886769",
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": "d80999e897b4d4db9fcfb4e9b8fcdc9fdd700882"
34
+ "gitHead": "c34886769d3e69bb56553a02eead6a0fd877e754"
35
35
  }