@react-stately/table 3.15.3 → 3.16.0

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.
Files changed (76) hide show
  1. package/dist/import.mjs +6 -18
  2. package/dist/main.js +18 -30
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +6 -18
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +9 -0
  7. package/package.json +17 -20
  8. package/src/index.ts +9 -16
  9. package/dist/Cell.main.js +0 -38
  10. package/dist/Cell.main.js.map +0 -1
  11. package/dist/Cell.mjs +0 -33
  12. package/dist/Cell.module.js +0 -33
  13. package/dist/Cell.module.js.map +0 -1
  14. package/dist/Column.main.js +0 -75
  15. package/dist/Column.main.js.map +0 -1
  16. package/dist/Column.mjs +0 -66
  17. package/dist/Column.module.js +0 -66
  18. package/dist/Column.module.js.map +0 -1
  19. package/dist/Row.main.js +0 -102
  20. package/dist/Row.main.js.map +0 -1
  21. package/dist/Row.mjs +0 -93
  22. package/dist/Row.module.js +0 -93
  23. package/dist/Row.module.js.map +0 -1
  24. package/dist/TableBody.main.js +0 -61
  25. package/dist/TableBody.main.js.map +0 -1
  26. package/dist/TableBody.mjs +0 -52
  27. package/dist/TableBody.module.js +0 -52
  28. package/dist/TableBody.module.js.map +0 -1
  29. package/dist/TableCollection.main.js +0 -308
  30. package/dist/TableCollection.main.js.map +0 -1
  31. package/dist/TableCollection.mjs +0 -302
  32. package/dist/TableCollection.module.js +0 -302
  33. package/dist/TableCollection.module.js.map +0 -1
  34. package/dist/TableColumnLayout.main.js +0 -113
  35. package/dist/TableColumnLayout.main.js.map +0 -1
  36. package/dist/TableColumnLayout.mjs +0 -108
  37. package/dist/TableColumnLayout.module.js +0 -108
  38. package/dist/TableColumnLayout.module.js.map +0 -1
  39. package/dist/TableHeader.main.js +0 -56
  40. package/dist/TableHeader.main.js.map +0 -1
  41. package/dist/TableHeader.mjs +0 -47
  42. package/dist/TableHeader.module.js +0 -47
  43. package/dist/TableHeader.module.js.map +0 -1
  44. package/dist/TableUtils.main.js +0 -182
  45. package/dist/TableUtils.main.js.map +0 -1
  46. package/dist/TableUtils.mjs +0 -175
  47. package/dist/TableUtils.module.js +0 -175
  48. package/dist/TableUtils.module.js.map +0 -1
  49. package/dist/types.d.ts +0 -194
  50. package/dist/types.d.ts.map +0 -1
  51. package/dist/useTableColumnResizeState.main.js +0 -109
  52. package/dist/useTableColumnResizeState.main.js.map +0 -1
  53. package/dist/useTableColumnResizeState.mjs +0 -104
  54. package/dist/useTableColumnResizeState.module.js +0 -104
  55. package/dist/useTableColumnResizeState.module.js.map +0 -1
  56. package/dist/useTableState.main.js +0 -86
  57. package/dist/useTableState.main.js.map +0 -1
  58. package/dist/useTableState.mjs +0 -80
  59. package/dist/useTableState.module.js +0 -80
  60. package/dist/useTableState.module.js.map +0 -1
  61. package/dist/useTreeGridState.main.js +0 -207
  62. package/dist/useTreeGridState.main.js.map +0 -1
  63. package/dist/useTreeGridState.mjs +0 -202
  64. package/dist/useTreeGridState.module.js +0 -202
  65. package/dist/useTreeGridState.module.js.map +0 -1
  66. package/src/Cell.ts +0 -40
  67. package/src/Column.ts +0 -83
  68. package/src/Row.ts +0 -121
  69. package/src/TableBody.ts +0 -61
  70. package/src/TableCollection.ts +0 -367
  71. package/src/TableColumnLayout.ts +0 -127
  72. package/src/TableHeader.ts +0 -59
  73. package/src/TableUtils.ts +0 -266
  74. package/src/useTableColumnResizeState.ts +0 -147
  75. package/src/useTableState.ts +0 -124
  76. package/src/useTreeGridState.ts +0 -278
@@ -1 +0,0 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAQD,SAAS,6BAAU,KAAqB;IACtC,OAAO;AACT;AAEA,6BAAO,iBAAiB,GAAG,UAAU,kBAAqB,KAAqB,EAAE,OAAoC;IACnH,IAAI,SAAC,KAAK,YAAE,QAAQ,gBAAE,YAAY,EAAC,GAAG;IAEtC,IAAI,WAAW,SAAS;IACxB,IAAI,YAAY,MAAM,SAAS,IAAK,CAAA,OAAO,aAAa,WAAW,WAAW,EAAC,KAAM,KAAK,CAAC,aAAa;IAExG,IAAI,YAAY,MAAM;QACpB,MAAM;QACN,eAAe,CAAC,CAAC,gBAAiB,CAAC,CAAC,SAAS,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,YAAY;kBAC9E;mBACA;eACA;QACA,CAAC;YACC,IAAI,cACF,KAAK,IAAI,SAAS,aAChB,MAAM;gBACJ,MAAM;gBACN,OAAO;YACT;iBAEG,IAAI,OAAO;gBAChB,IAAI,eAAiC,EAAE;gBACvC,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAA;oBAC/B,aAAa,IAAI,CAAC;wBAChB,MAAM;wBACN,SAAS;oBACX;gBACF;gBAEA,OAAO;YACT;QACF;QACA,kBAAiB,UAAuC;YACtD,yCAAyC;YACzC,kFAAkF;YAClF,0EAA0E;YAC1E,cAAc;YACd,OAAO;QACT;IACF;IAEA,IAAI,gBAAgB,CAAC;QACnB,qEAAqE;QACrE,KAAK,IAAI,QAAQ,UACf,IAAI,CAAC,KAAK,aAAa,EACrB,QAAQ,OAAO,CAAC,IAAI,CAAC;IAG3B;IAEA,cAAc;AAChB;AAEA;;;;CAIC,GACD,oEAAoE;AACpE,IAAI,4CAAU","sources":["packages/@react-stately/table/src/Column.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 {CollectionBuilderContext} from './useTableState';\nimport {ColumnProps} from '@react-types/table';\nimport {GridNode} from '@react-types/grid';\nimport {PartialNode} from '@react-stately/collections';\nimport React, {JSX, ReactElement} from 'react';\n\nfunction Column<T>(props: ColumnProps<T>): ReactElement | null { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nColumn.getCollectionNode = function* getCollectionNode<T>(props: ColumnProps<T>, context: CollectionBuilderContext<T>): Generator<PartialNode<T>, void, GridNode<T>[]> {\n let {title, children, childColumns} = props;\n\n let rendered = title || children;\n let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'];\n\n let fullNodes = yield {\n type: 'column',\n hasChildNodes: !!childColumns || (!!title && React.Children.count(children) > 0),\n rendered,\n textValue,\n props,\n *childNodes() {\n if (childColumns) {\n for (let child of childColumns) {\n yield {\n type: 'column',\n value: child\n };\n }\n } else if (title) {\n let childColumns: PartialNode<T>[] = [];\n React.Children.forEach(children, child => {\n childColumns.push({\n type: 'column',\n element: child as ReactElement<ColumnProps<T>>\n });\n });\n\n yield* childColumns;\n }\n },\n shouldInvalidate(newContext: CollectionBuilderContext<T>) {\n // This is a bit of a hack, but it works.\n // If this method is called, then there's a cached version of this node available.\n // But, we need to keep the list of columns in the new context up to date.\n updateContext(newContext);\n return false;\n }\n };\n\n let updateContext = (context: CollectionBuilderContext<T>) => {\n // register leaf columns on the context so that <Row> can access them\n for (let node of fullNodes) {\n if (!node.hasChildNodes) {\n context.columns.push(node);\n }\n }\n };\n\n updateContext(context);\n};\n\n/**\n * A Column represents a field of each item within a Table. Columns may also contain nested\n * Column elements to represent column groups. Nested columns can be statically defined as\n * children, or dynamically generated using a function based on the `childColumns` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Column = Column as <T>(props: ColumnProps<T>) => JSX.Element;\nexport {_Column as Column};\n"],"names":[],"version":3,"file":"Column.module.js.map"}
package/dist/Row.main.js DELETED
@@ -1,102 +0,0 @@
1
- var $7Z9ig$react = require("react");
2
-
3
-
4
- function $parcel$interopDefault(a) {
5
- return a && a.__esModule ? a.default : a;
6
- }
7
-
8
- function $parcel$export(e, n, v, s) {
9
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
10
- }
11
-
12
- $parcel$export(module.exports, "Row", () => $9ec6912e32cc0d81$export$b59bdbef9ce70de2);
13
- /*
14
- * Copyright 2020 Adobe. All rights reserved.
15
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
16
- * you may not use this file except in compliance with the License. You may obtain a copy
17
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
18
- *
19
- * Unless required by applicable law or agreed to in writing, software distributed under
20
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
21
- * OF ANY KIND, either express or implied. See the License for the specific language
22
- * governing permissions and limitations under the License.
23
- */
24
- function $9ec6912e32cc0d81$var$Row(props) {
25
- return null;
26
- }
27
- $9ec6912e32cc0d81$var$Row.getCollectionNode = function* getCollectionNode(props, context) {
28
- let { children: children, textValue: textValue, UNSTABLE_childItems: UNSTABLE_childItems } = props;
29
- yield {
30
- type: 'item',
31
- props: props,
32
- textValue: textValue,
33
- 'aria-label': props['aria-label'],
34
- hasChildNodes: true,
35
- *childNodes () {
36
- // Process cells first
37
- if (context.showDragButtons) yield {
38
- type: 'cell',
39
- key: 'header-drag',
40
- props: {
41
- isDragButtonCell: true
42
- }
43
- };
44
- if (context.showSelectionCheckboxes && context.selectionMode !== 'none') yield {
45
- type: 'cell',
46
- key: 'header',
47
- props: {
48
- isSelectionCell: true
49
- }
50
- };
51
- if (typeof children === 'function') {
52
- for (let column of context.columns)yield {
53
- type: 'cell',
54
- element: children(column.key),
55
- key: column.key // this is combined with the row key by CollectionBuilder
56
- };
57
- if (UNSTABLE_childItems) for (let child of UNSTABLE_childItems)// Note: in order to reuse the render function of TableBody for our child rows, we just need to yield a type and a value here. CollectionBuilder will then look up
58
- // the parent renderer and use that to build the full node of this child row, using the value provided here to generate the cells
59
- yield {
60
- type: 'item',
61
- value: child
62
- };
63
- } else {
64
- let cells = [];
65
- let childRows = [];
66
- let columnCount = 0;
67
- (0, ($parcel$interopDefault($7Z9ig$react))).Children.forEach(children, (node)=>{
68
- if (node.type === $9ec6912e32cc0d81$var$Row) {
69
- if (cells.length < context.columns.length) throw new Error('All of a Row\'s child Cells must be positioned before any child Rows.');
70
- childRows.push({
71
- type: 'item',
72
- element: node
73
- });
74
- } else {
75
- cells.push({
76
- type: 'cell',
77
- element: node
78
- });
79
- var _node_props_colSpan;
80
- columnCount += (_node_props_colSpan = node.props.colSpan) !== null && _node_props_colSpan !== void 0 ? _node_props_colSpan : 1;
81
- }
82
- });
83
- if (columnCount !== context.columns.length) throw new Error(`Cell count must match column count. Found ${columnCount} cells and ${context.columns.length} columns.`);
84
- yield* cells;
85
- yield* childRows;
86
- }
87
- },
88
- shouldInvalidate (newContext) {
89
- // Invalidate all rows if the columns changed.
90
- return newContext.columns.length !== context.columns.length || newContext.columns.some((c, i)=>c.key !== context.columns[i].key) || newContext.showSelectionCheckboxes !== context.showSelectionCheckboxes || newContext.showDragButtons !== context.showDragButtons || newContext.selectionMode !== context.selectionMode;
91
- }
92
- };
93
- };
94
- /**
95
- * A Row represents a single item in a Table and contains Cell elements for each column.
96
- * Cells can be statically defined as children, or generated dynamically using a function
97
- * based on the columns defined in the TableHeader.
98
- */ // We don't want getCollectionNode to show up in the type definition
99
- let $9ec6912e32cc0d81$export$b59bdbef9ce70de2 = $9ec6912e32cc0d81$var$Row;
100
-
101
-
102
- //# sourceMappingURL=Row.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAOD,SAAS,0BAAO,KAAkB;IAChC,OAAO;AACT;AAEA,0BAAI,iBAAiB,GAAG,UAAU,kBAAqB,KAAkB,EAAE,OAAoC;IAC7G,IAAI,YAAC,QAAQ,aAAE,SAAS,uBAAE,mBAAmB,EAAC,GAAG;IAEjD,MAAM;QACJ,MAAM;QACN,OAAO;mBACP;QACA,cAAc,KAAK,CAAC,aAAa;QACjC,eAAe;QACf,CAAC;YACC,sBAAsB;YACtB,IAAI,QAAQ,eAAe,EACzB,MAAM;gBACJ,MAAM;gBACN,KAAK;gBACL,OAAO;oBACL,kBAAkB;gBACpB;YACF;YAGF,IAAI,QAAQ,uBAAuB,IAAI,QAAQ,aAAa,KAAK,QAC/D,MAAM;gBACJ,MAAM;gBACN,KAAK;gBACL,OAAO;oBACL,iBAAiB;gBACnB;YACF;YAGF,IAAI,OAAO,aAAa,YAAY;gBAClC,KAAK,IAAI,UAAU,QAAQ,OAAO,CAChC,MAAM;oBACJ,MAAM;oBACN,SAAS,SAAS,OAAO,GAAG;oBAC5B,KAAK,OAAO,GAAG,CAAC,yDAAyD;gBAC3E;gBAGF,IAAI,qBACF,KAAK,IAAI,SAAS,oBAChB,kKAAkK;gBAClK,iIAAiI;gBACjI,MAAM;oBACJ,MAAM;oBACN,OAAO;gBACT;YAGN,OAAO;gBACL,IAAI,QAA0B,EAAE;gBAChC,IAAI,YAA8B,EAAE;gBACpC,IAAI,cAAc;gBAClB,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAA;oBAC/B,IAAI,KAAK,IAAI,KAAK,2BAAK;wBACrB,IAAI,MAAM,MAAM,GAAG,QAAQ,OAAO,CAAC,MAAM,EACvC,MAAM,IAAI,MAAM;wBAGlB,UAAU,IAAI,CAAC;4BACb,MAAM;4BACN,SAAS;wBACX;oBACF,OAAO;wBACL,MAAM,IAAI,CAAC;4BACT,MAAM;4BACN,SAAS;wBACX;4BACe;wBAAf,eAAe,CAAA,sBAAA,KAAK,KAAK,CAAC,OAAO,cAAlB,iCAAA,sBAAsB;oBACvC;gBACF;gBAEA,IAAI,gBAAgB,QAAQ,OAAO,CAAC,MAAM,EACxC,MAAM,IAAI,MAAM,CAAC,0CAA0C,EAAE,YAAY,WAAW,EAAE,QAAQ,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;gBAGzH,OAAO;gBACP,OAAO;YACT;QACF;QACA,kBAAiB,UAAuC;YACtD,8CAA8C;YAC9C,OAAO,WAAW,OAAO,CAAC,MAAM,KAAK,QAAQ,OAAO,CAAC,MAAM,IACzD,WAAW,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,IAAM,EAAE,GAAG,KAAK,QAAQ,OAAO,CAAC,EAAE,CAAC,GAAG,KAClE,WAAW,uBAAuB,KAAK,QAAQ,uBAAuB,IACtE,WAAW,eAAe,KAAK,QAAQ,eAAe,IACtD,WAAW,aAAa,KAAK,QAAQ,aAAa;QACtD;IACF;AACF;AAEA;;;;CAIC,GACD,oEAAoE;AACpE,IAAI,4CAAO","sources":["packages/@react-stately/table/src/Row.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 {CollectionBuilderContext} from './useTableState';\nimport {PartialNode} from '@react-stately/collections';\nimport React, {JSX, ReactElement} from 'react';\nimport {RowProps} from '@react-types/table';\n\nfunction Row<T>(props: RowProps<T>): ReactElement | null { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nRow.getCollectionNode = function* getCollectionNode<T>(props: RowProps<T>, context: CollectionBuilderContext<T>): Generator<PartialNode<T>> {\n let {children, textValue, UNSTABLE_childItems} = props;\n\n yield {\n type: 'item',\n props: props,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: true,\n *childNodes() {\n // Process cells first\n if (context.showDragButtons) {\n yield {\n type: 'cell',\n key: 'header-drag', // this is combined with the row key by CollectionBuilder\n props: {\n isDragButtonCell: true\n }\n };\n }\n\n if (context.showSelectionCheckboxes && context.selectionMode !== 'none') {\n yield {\n type: 'cell',\n key: 'header', // this is combined with the row key by CollectionBuilder\n props: {\n isSelectionCell: true\n }\n };\n }\n\n if (typeof children === 'function') {\n for (let column of context.columns) {\n yield {\n type: 'cell',\n element: children(column.key),\n key: column.key // this is combined with the row key by CollectionBuilder\n };\n }\n\n if (UNSTABLE_childItems) {\n for (let child of UNSTABLE_childItems) {\n // Note: in order to reuse the render function of TableBody for our child rows, we just need to yield a type and a value here. CollectionBuilder will then look up\n // the parent renderer and use that to build the full node of this child row, using the value provided here to generate the cells\n yield {\n type: 'item',\n value: child\n };\n }\n }\n } else {\n let cells: PartialNode<T>[] = [];\n let childRows: PartialNode<T>[] = [];\n let columnCount = 0;\n React.Children.forEach(children, node => {\n if (node.type === Row) {\n if (cells.length < context.columns.length) {\n throw new Error('All of a Row\\'s child Cells must be positioned before any child Rows.');\n }\n\n childRows.push({\n type: 'item',\n element: node\n });\n } else {\n cells.push({\n type: 'cell',\n element: node\n });\n columnCount += node.props.colSpan ?? 1;\n }\n });\n\n if (columnCount !== context.columns.length) {\n throw new Error(`Cell count must match column count. Found ${columnCount} cells and ${context.columns.length} columns.`);\n }\n\n yield* cells;\n yield* childRows;\n }\n },\n shouldInvalidate(newContext: CollectionBuilderContext<T>) {\n // Invalidate all rows if the columns changed.\n return newContext.columns.length !== context.columns.length ||\n newContext.columns.some((c, i) => c.key !== context.columns[i].key) ||\n newContext.showSelectionCheckboxes !== context.showSelectionCheckboxes ||\n newContext.showDragButtons !== context.showDragButtons ||\n newContext.selectionMode !== context.selectionMode;\n }\n };\n};\n\n/**\n * A Row represents a single item in a Table and contains Cell elements for each column.\n * Cells can be statically defined as children, or generated dynamically using a function\n * based on the columns defined in the TableHeader.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Row = Row as <T>(props: RowProps<T>) => JSX.Element;\nexport {_Row as Row};\n"],"names":[],"version":3,"file":"Row.main.js.map"}
package/dist/Row.mjs DELETED
@@ -1,93 +0,0 @@
1
- import $7GIZw$react from "react";
2
-
3
- /*
4
- * Copyright 2020 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */
14
- function $70d70eb16ea48428$var$Row(props) {
15
- return null;
16
- }
17
- $70d70eb16ea48428$var$Row.getCollectionNode = function* getCollectionNode(props, context) {
18
- let { children: children, textValue: textValue, UNSTABLE_childItems: UNSTABLE_childItems } = props;
19
- yield {
20
- type: 'item',
21
- props: props,
22
- textValue: textValue,
23
- 'aria-label': props['aria-label'],
24
- hasChildNodes: true,
25
- *childNodes () {
26
- // Process cells first
27
- if (context.showDragButtons) yield {
28
- type: 'cell',
29
- key: 'header-drag',
30
- props: {
31
- isDragButtonCell: true
32
- }
33
- };
34
- if (context.showSelectionCheckboxes && context.selectionMode !== 'none') yield {
35
- type: 'cell',
36
- key: 'header',
37
- props: {
38
- isSelectionCell: true
39
- }
40
- };
41
- if (typeof children === 'function') {
42
- for (let column of context.columns)yield {
43
- type: 'cell',
44
- element: children(column.key),
45
- key: column.key // this is combined with the row key by CollectionBuilder
46
- };
47
- if (UNSTABLE_childItems) for (let child of UNSTABLE_childItems)// Note: in order to reuse the render function of TableBody for our child rows, we just need to yield a type and a value here. CollectionBuilder will then look up
48
- // the parent renderer and use that to build the full node of this child row, using the value provided here to generate the cells
49
- yield {
50
- type: 'item',
51
- value: child
52
- };
53
- } else {
54
- let cells = [];
55
- let childRows = [];
56
- let columnCount = 0;
57
- (0, $7GIZw$react).Children.forEach(children, (node)=>{
58
- if (node.type === $70d70eb16ea48428$var$Row) {
59
- if (cells.length < context.columns.length) throw new Error('All of a Row\'s child Cells must be positioned before any child Rows.');
60
- childRows.push({
61
- type: 'item',
62
- element: node
63
- });
64
- } else {
65
- cells.push({
66
- type: 'cell',
67
- element: node
68
- });
69
- var _node_props_colSpan;
70
- columnCount += (_node_props_colSpan = node.props.colSpan) !== null && _node_props_colSpan !== void 0 ? _node_props_colSpan : 1;
71
- }
72
- });
73
- if (columnCount !== context.columns.length) throw new Error(`Cell count must match column count. Found ${columnCount} cells and ${context.columns.length} columns.`);
74
- yield* cells;
75
- yield* childRows;
76
- }
77
- },
78
- shouldInvalidate (newContext) {
79
- // Invalidate all rows if the columns changed.
80
- return newContext.columns.length !== context.columns.length || newContext.columns.some((c, i)=>c.key !== context.columns[i].key) || newContext.showSelectionCheckboxes !== context.showSelectionCheckboxes || newContext.showDragButtons !== context.showDragButtons || newContext.selectionMode !== context.selectionMode;
81
- }
82
- };
83
- };
84
- /**
85
- * A Row represents a single item in a Table and contains Cell elements for each column.
86
- * Cells can be statically defined as children, or generated dynamically using a function
87
- * based on the columns defined in the TableHeader.
88
- */ // We don't want getCollectionNode to show up in the type definition
89
- let $70d70eb16ea48428$export$b59bdbef9ce70de2 = $70d70eb16ea48428$var$Row;
90
-
91
-
92
- export {$70d70eb16ea48428$export$b59bdbef9ce70de2 as Row};
93
- //# sourceMappingURL=Row.module.js.map
@@ -1,93 +0,0 @@
1
- import $7GIZw$react from "react";
2
-
3
- /*
4
- * Copyright 2020 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */
14
- function $70d70eb16ea48428$var$Row(props) {
15
- return null;
16
- }
17
- $70d70eb16ea48428$var$Row.getCollectionNode = function* getCollectionNode(props, context) {
18
- let { children: children, textValue: textValue, UNSTABLE_childItems: UNSTABLE_childItems } = props;
19
- yield {
20
- type: 'item',
21
- props: props,
22
- textValue: textValue,
23
- 'aria-label': props['aria-label'],
24
- hasChildNodes: true,
25
- *childNodes () {
26
- // Process cells first
27
- if (context.showDragButtons) yield {
28
- type: 'cell',
29
- key: 'header-drag',
30
- props: {
31
- isDragButtonCell: true
32
- }
33
- };
34
- if (context.showSelectionCheckboxes && context.selectionMode !== 'none') yield {
35
- type: 'cell',
36
- key: 'header',
37
- props: {
38
- isSelectionCell: true
39
- }
40
- };
41
- if (typeof children === 'function') {
42
- for (let column of context.columns)yield {
43
- type: 'cell',
44
- element: children(column.key),
45
- key: column.key // this is combined with the row key by CollectionBuilder
46
- };
47
- if (UNSTABLE_childItems) for (let child of UNSTABLE_childItems)// Note: in order to reuse the render function of TableBody for our child rows, we just need to yield a type and a value here. CollectionBuilder will then look up
48
- // the parent renderer and use that to build the full node of this child row, using the value provided here to generate the cells
49
- yield {
50
- type: 'item',
51
- value: child
52
- };
53
- } else {
54
- let cells = [];
55
- let childRows = [];
56
- let columnCount = 0;
57
- (0, $7GIZw$react).Children.forEach(children, (node)=>{
58
- if (node.type === $70d70eb16ea48428$var$Row) {
59
- if (cells.length < context.columns.length) throw new Error('All of a Row\'s child Cells must be positioned before any child Rows.');
60
- childRows.push({
61
- type: 'item',
62
- element: node
63
- });
64
- } else {
65
- cells.push({
66
- type: 'cell',
67
- element: node
68
- });
69
- var _node_props_colSpan;
70
- columnCount += (_node_props_colSpan = node.props.colSpan) !== null && _node_props_colSpan !== void 0 ? _node_props_colSpan : 1;
71
- }
72
- });
73
- if (columnCount !== context.columns.length) throw new Error(`Cell count must match column count. Found ${columnCount} cells and ${context.columns.length} columns.`);
74
- yield* cells;
75
- yield* childRows;
76
- }
77
- },
78
- shouldInvalidate (newContext) {
79
- // Invalidate all rows if the columns changed.
80
- return newContext.columns.length !== context.columns.length || newContext.columns.some((c, i)=>c.key !== context.columns[i].key) || newContext.showSelectionCheckboxes !== context.showSelectionCheckboxes || newContext.showDragButtons !== context.showDragButtons || newContext.selectionMode !== context.selectionMode;
81
- }
82
- };
83
- };
84
- /**
85
- * A Row represents a single item in a Table and contains Cell elements for each column.
86
- * Cells can be statically defined as children, or generated dynamically using a function
87
- * based on the columns defined in the TableHeader.
88
- */ // We don't want getCollectionNode to show up in the type definition
89
- let $70d70eb16ea48428$export$b59bdbef9ce70de2 = $70d70eb16ea48428$var$Row;
90
-
91
-
92
- export {$70d70eb16ea48428$export$b59bdbef9ce70de2 as Row};
93
- //# sourceMappingURL=Row.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAOD,SAAS,0BAAO,KAAkB;IAChC,OAAO;AACT;AAEA,0BAAI,iBAAiB,GAAG,UAAU,kBAAqB,KAAkB,EAAE,OAAoC;IAC7G,IAAI,YAAC,QAAQ,aAAE,SAAS,uBAAE,mBAAmB,EAAC,GAAG;IAEjD,MAAM;QACJ,MAAM;QACN,OAAO;mBACP;QACA,cAAc,KAAK,CAAC,aAAa;QACjC,eAAe;QACf,CAAC;YACC,sBAAsB;YACtB,IAAI,QAAQ,eAAe,EACzB,MAAM;gBACJ,MAAM;gBACN,KAAK;gBACL,OAAO;oBACL,kBAAkB;gBACpB;YACF;YAGF,IAAI,QAAQ,uBAAuB,IAAI,QAAQ,aAAa,KAAK,QAC/D,MAAM;gBACJ,MAAM;gBACN,KAAK;gBACL,OAAO;oBACL,iBAAiB;gBACnB;YACF;YAGF,IAAI,OAAO,aAAa,YAAY;gBAClC,KAAK,IAAI,UAAU,QAAQ,OAAO,CAChC,MAAM;oBACJ,MAAM;oBACN,SAAS,SAAS,OAAO,GAAG;oBAC5B,KAAK,OAAO,GAAG,CAAC,yDAAyD;gBAC3E;gBAGF,IAAI,qBACF,KAAK,IAAI,SAAS,oBAChB,kKAAkK;gBAClK,iIAAiI;gBACjI,MAAM;oBACJ,MAAM;oBACN,OAAO;gBACT;YAGN,OAAO;gBACL,IAAI,QAA0B,EAAE;gBAChC,IAAI,YAA8B,EAAE;gBACpC,IAAI,cAAc;gBAClB,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAA;oBAC/B,IAAI,KAAK,IAAI,KAAK,2BAAK;wBACrB,IAAI,MAAM,MAAM,GAAG,QAAQ,OAAO,CAAC,MAAM,EACvC,MAAM,IAAI,MAAM;wBAGlB,UAAU,IAAI,CAAC;4BACb,MAAM;4BACN,SAAS;wBACX;oBACF,OAAO;wBACL,MAAM,IAAI,CAAC;4BACT,MAAM;4BACN,SAAS;wBACX;4BACe;wBAAf,eAAe,CAAA,sBAAA,KAAK,KAAK,CAAC,OAAO,cAAlB,iCAAA,sBAAsB;oBACvC;gBACF;gBAEA,IAAI,gBAAgB,QAAQ,OAAO,CAAC,MAAM,EACxC,MAAM,IAAI,MAAM,CAAC,0CAA0C,EAAE,YAAY,WAAW,EAAE,QAAQ,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;gBAGzH,OAAO;gBACP,OAAO;YACT;QACF;QACA,kBAAiB,UAAuC;YACtD,8CAA8C;YAC9C,OAAO,WAAW,OAAO,CAAC,MAAM,KAAK,QAAQ,OAAO,CAAC,MAAM,IACzD,WAAW,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,IAAM,EAAE,GAAG,KAAK,QAAQ,OAAO,CAAC,EAAE,CAAC,GAAG,KAClE,WAAW,uBAAuB,KAAK,QAAQ,uBAAuB,IACtE,WAAW,eAAe,KAAK,QAAQ,eAAe,IACtD,WAAW,aAAa,KAAK,QAAQ,aAAa;QACtD;IACF;AACF;AAEA;;;;CAIC,GACD,oEAAoE;AACpE,IAAI,4CAAO","sources":["packages/@react-stately/table/src/Row.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 {CollectionBuilderContext} from './useTableState';\nimport {PartialNode} from '@react-stately/collections';\nimport React, {JSX, ReactElement} from 'react';\nimport {RowProps} from '@react-types/table';\n\nfunction Row<T>(props: RowProps<T>): ReactElement | null { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nRow.getCollectionNode = function* getCollectionNode<T>(props: RowProps<T>, context: CollectionBuilderContext<T>): Generator<PartialNode<T>> {\n let {children, textValue, UNSTABLE_childItems} = props;\n\n yield {\n type: 'item',\n props: props,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: true,\n *childNodes() {\n // Process cells first\n if (context.showDragButtons) {\n yield {\n type: 'cell',\n key: 'header-drag', // this is combined with the row key by CollectionBuilder\n props: {\n isDragButtonCell: true\n }\n };\n }\n\n if (context.showSelectionCheckboxes && context.selectionMode !== 'none') {\n yield {\n type: 'cell',\n key: 'header', // this is combined with the row key by CollectionBuilder\n props: {\n isSelectionCell: true\n }\n };\n }\n\n if (typeof children === 'function') {\n for (let column of context.columns) {\n yield {\n type: 'cell',\n element: children(column.key),\n key: column.key // this is combined with the row key by CollectionBuilder\n };\n }\n\n if (UNSTABLE_childItems) {\n for (let child of UNSTABLE_childItems) {\n // Note: in order to reuse the render function of TableBody for our child rows, we just need to yield a type and a value here. CollectionBuilder will then look up\n // the parent renderer and use that to build the full node of this child row, using the value provided here to generate the cells\n yield {\n type: 'item',\n value: child\n };\n }\n }\n } else {\n let cells: PartialNode<T>[] = [];\n let childRows: PartialNode<T>[] = [];\n let columnCount = 0;\n React.Children.forEach(children, node => {\n if (node.type === Row) {\n if (cells.length < context.columns.length) {\n throw new Error('All of a Row\\'s child Cells must be positioned before any child Rows.');\n }\n\n childRows.push({\n type: 'item',\n element: node\n });\n } else {\n cells.push({\n type: 'cell',\n element: node\n });\n columnCount += node.props.colSpan ?? 1;\n }\n });\n\n if (columnCount !== context.columns.length) {\n throw new Error(`Cell count must match column count. Found ${columnCount} cells and ${context.columns.length} columns.`);\n }\n\n yield* cells;\n yield* childRows;\n }\n },\n shouldInvalidate(newContext: CollectionBuilderContext<T>) {\n // Invalidate all rows if the columns changed.\n return newContext.columns.length !== context.columns.length ||\n newContext.columns.some((c, i) => c.key !== context.columns[i].key) ||\n newContext.showSelectionCheckboxes !== context.showSelectionCheckboxes ||\n newContext.showDragButtons !== context.showDragButtons ||\n newContext.selectionMode !== context.selectionMode;\n }\n };\n};\n\n/**\n * A Row represents a single item in a Table and contains Cell elements for each column.\n * Cells can be statically defined as children, or generated dynamically using a function\n * based on the columns defined in the TableHeader.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Row = Row as <T>(props: RowProps<T>) => JSX.Element;\nexport {_Row as Row};\n"],"names":[],"version":3,"file":"Row.module.js.map"}
@@ -1,61 +0,0 @@
1
- var $ablJS$react = require("react");
2
-
3
-
4
- function $parcel$interopDefault(a) {
5
- return a && a.__esModule ? a.default : a;
6
- }
7
-
8
- function $parcel$export(e, n, v, s) {
9
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
10
- }
11
-
12
- $parcel$export(module.exports, "TableBody", () => $6ec527db6a3a5692$export$76ccd210b9029917);
13
- /*
14
- * Copyright 2020 Adobe. All rights reserved.
15
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
16
- * you may not use this file except in compliance with the License. You may obtain a copy
17
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
18
- *
19
- * Unless required by applicable law or agreed to in writing, software distributed under
20
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
21
- * OF ANY KIND, either express or implied. See the License for the specific language
22
- * governing permissions and limitations under the License.
23
- */
24
- function $6ec527db6a3a5692$var$TableBody(props) {
25
- return null;
26
- }
27
- $6ec527db6a3a5692$var$TableBody.getCollectionNode = function* getCollectionNode(props) {
28
- let { children: children, items: items } = props;
29
- yield {
30
- type: 'body',
31
- hasChildNodes: true,
32
- props: props,
33
- *childNodes () {
34
- if (typeof children === 'function') {
35
- if (!items) throw new Error('props.children was a function but props.items is missing');
36
- for (let item of items)yield {
37
- type: 'item',
38
- value: item,
39
- renderer: children
40
- };
41
- } else {
42
- let items = [];
43
- (0, ($parcel$interopDefault($ablJS$react))).Children.forEach(children, (item)=>{
44
- items.push({
45
- type: 'item',
46
- element: item
47
- });
48
- });
49
- yield* items;
50
- }
51
- }
52
- };
53
- };
54
- /**
55
- * A TableBody is a container for the Row elements of a Table. Rows can be statically defined
56
- * as children, or generated dynamically using a function based on the data passed to the `items` prop.
57
- */ // We don't want getCollectionNode to show up in the type definition
58
- let $6ec527db6a3a5692$export$76ccd210b9029917 = $6ec527db6a3a5692$var$TableBody;
59
-
60
-
61
- //# sourceMappingURL=TableBody.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAMD,SAAS,gCAAa,KAAwB;IAC5C,OAAO;AACT;AAEA,gCAAU,iBAAiB,GAAG,UAAU,kBAAqB,KAAwB;IACnF,IAAI,YAAC,QAAQ,SAAE,KAAK,EAAC,GAAG;IACxB,MAAM;QACJ,MAAM;QACN,eAAe;eACf;QACA,CAAC;YACC,IAAI,OAAO,aAAa,YAAY;gBAClC,IAAI,CAAC,OACH,MAAM,IAAI,MAAM;gBAGlB,KAAK,IAAI,QAAQ,MACf,MAAM;oBACJ,MAAM;oBACN,OAAO;oBACP,UAAU;gBACZ;YAEJ,OAAO;gBACL,IAAI,QAA0B,EAAE;gBAChC,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAA;oBAC/B,MAAM,IAAI,CAAC;wBACT,MAAM;wBACN,SAAS;oBACX;gBACF;gBAEA,OAAO;YACT;QACF;IACF;AACF;AAEA;;;CAGC,GACD,oEAAoE;AACpE,IAAI,4CAAa","sources":["packages/@react-stately/table/src/TableBody.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 {PartialNode} from '@react-stately/collections';\nimport React, {JSX, ReactElement} from 'react';\nimport {TableBodyProps} from '@react-types/table';\n\nfunction TableBody<T>(props: TableBodyProps<T>): ReactElement | null { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nTableBody.getCollectionNode = function* getCollectionNode<T>(props: TableBodyProps<T>): Generator<PartialNode<T>> {\n let {children, items} = props;\n yield {\n type: 'body',\n hasChildNodes: true,\n props,\n *childNodes() {\n if (typeof children === 'function') {\n if (!items) {\n throw new Error('props.children was a function but props.items is missing');\n }\n\n for (let item of items) {\n yield {\n type: 'item',\n value: item,\n renderer: children\n };\n }\n } else {\n let items: PartialNode<T>[] = [];\n React.Children.forEach(children, item => {\n items.push({\n type: 'item',\n element: item\n });\n });\n\n yield* items;\n }\n }\n };\n};\n\n/**\n * A TableBody is a container for the Row elements of a Table. Rows can be statically defined\n * as children, or generated dynamically using a function based on the data passed to the `items` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _TableBody = TableBody as <T>(props: TableBodyProps<T>) => JSX.Element;\nexport {_TableBody as TableBody};\n"],"names":[],"version":3,"file":"TableBody.main.js.map"}
@@ -1,52 +0,0 @@
1
- import $6tF2U$react from "react";
2
-
3
- /*
4
- * Copyright 2020 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */
14
- function $4ae5314bf50db1a3$var$TableBody(props) {
15
- return null;
16
- }
17
- $4ae5314bf50db1a3$var$TableBody.getCollectionNode = function* getCollectionNode(props) {
18
- let { children: children, items: items } = props;
19
- yield {
20
- type: 'body',
21
- hasChildNodes: true,
22
- props: props,
23
- *childNodes () {
24
- if (typeof children === 'function') {
25
- if (!items) throw new Error('props.children was a function but props.items is missing');
26
- for (let item of items)yield {
27
- type: 'item',
28
- value: item,
29
- renderer: children
30
- };
31
- } else {
32
- let items = [];
33
- (0, $6tF2U$react).Children.forEach(children, (item)=>{
34
- items.push({
35
- type: 'item',
36
- element: item
37
- });
38
- });
39
- yield* items;
40
- }
41
- }
42
- };
43
- };
44
- /**
45
- * A TableBody is a container for the Row elements of a Table. Rows can be statically defined
46
- * as children, or generated dynamically using a function based on the data passed to the `items` prop.
47
- */ // We don't want getCollectionNode to show up in the type definition
48
- let $4ae5314bf50db1a3$export$76ccd210b9029917 = $4ae5314bf50db1a3$var$TableBody;
49
-
50
-
51
- export {$4ae5314bf50db1a3$export$76ccd210b9029917 as TableBody};
52
- //# sourceMappingURL=TableBody.module.js.map
@@ -1,52 +0,0 @@
1
- import $6tF2U$react from "react";
2
-
3
- /*
4
- * Copyright 2020 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */
14
- function $4ae5314bf50db1a3$var$TableBody(props) {
15
- return null;
16
- }
17
- $4ae5314bf50db1a3$var$TableBody.getCollectionNode = function* getCollectionNode(props) {
18
- let { children: children, items: items } = props;
19
- yield {
20
- type: 'body',
21
- hasChildNodes: true,
22
- props: props,
23
- *childNodes () {
24
- if (typeof children === 'function') {
25
- if (!items) throw new Error('props.children was a function but props.items is missing');
26
- for (let item of items)yield {
27
- type: 'item',
28
- value: item,
29
- renderer: children
30
- };
31
- } else {
32
- let items = [];
33
- (0, $6tF2U$react).Children.forEach(children, (item)=>{
34
- items.push({
35
- type: 'item',
36
- element: item
37
- });
38
- });
39
- yield* items;
40
- }
41
- }
42
- };
43
- };
44
- /**
45
- * A TableBody is a container for the Row elements of a Table. Rows can be statically defined
46
- * as children, or generated dynamically using a function based on the data passed to the `items` prop.
47
- */ // We don't want getCollectionNode to show up in the type definition
48
- let $4ae5314bf50db1a3$export$76ccd210b9029917 = $4ae5314bf50db1a3$var$TableBody;
49
-
50
-
51
- export {$4ae5314bf50db1a3$export$76ccd210b9029917 as TableBody};
52
- //# sourceMappingURL=TableBody.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAMD,SAAS,gCAAa,KAAwB;IAC5C,OAAO;AACT;AAEA,gCAAU,iBAAiB,GAAG,UAAU,kBAAqB,KAAwB;IACnF,IAAI,YAAC,QAAQ,SAAE,KAAK,EAAC,GAAG;IACxB,MAAM;QACJ,MAAM;QACN,eAAe;eACf;QACA,CAAC;YACC,IAAI,OAAO,aAAa,YAAY;gBAClC,IAAI,CAAC,OACH,MAAM,IAAI,MAAM;gBAGlB,KAAK,IAAI,QAAQ,MACf,MAAM;oBACJ,MAAM;oBACN,OAAO;oBACP,UAAU;gBACZ;YAEJ,OAAO;gBACL,IAAI,QAA0B,EAAE;gBAChC,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAA;oBAC/B,MAAM,IAAI,CAAC;wBACT,MAAM;wBACN,SAAS;oBACX;gBACF;gBAEA,OAAO;YACT;QACF;IACF;AACF;AAEA;;;CAGC,GACD,oEAAoE;AACpE,IAAI,4CAAa","sources":["packages/@react-stately/table/src/TableBody.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 {PartialNode} from '@react-stately/collections';\nimport React, {JSX, ReactElement} from 'react';\nimport {TableBodyProps} from '@react-types/table';\n\nfunction TableBody<T>(props: TableBodyProps<T>): ReactElement | null { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nTableBody.getCollectionNode = function* getCollectionNode<T>(props: TableBodyProps<T>): Generator<PartialNode<T>> {\n let {children, items} = props;\n yield {\n type: 'body',\n hasChildNodes: true,\n props,\n *childNodes() {\n if (typeof children === 'function') {\n if (!items) {\n throw new Error('props.children was a function but props.items is missing');\n }\n\n for (let item of items) {\n yield {\n type: 'item',\n value: item,\n renderer: children\n };\n }\n } else {\n let items: PartialNode<T>[] = [];\n React.Children.forEach(children, item => {\n items.push({\n type: 'item',\n element: item\n });\n });\n\n yield* items;\n }\n }\n };\n};\n\n/**\n * A TableBody is a container for the Row elements of a Table. Rows can be statically defined\n * as children, or generated dynamically using a function based on the data passed to the `items` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _TableBody = TableBody as <T>(props: TableBodyProps<T>) => JSX.Element;\nexport {_TableBody as TableBody};\n"],"names":[],"version":3,"file":"TableBody.module.js.map"}