@react-stately/table 3.11.7-nightly.4552 → 3.11.7-nightly.4558

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 (62) hide show
  1. package/dist/Cell.main.js +38 -0
  2. package/dist/Cell.main.js.map +1 -0
  3. package/dist/Cell.mjs +33 -0
  4. package/dist/Cell.module.js +33 -0
  5. package/dist/Cell.module.js.map +1 -0
  6. package/dist/Column.main.js +75 -0
  7. package/dist/Column.main.js.map +1 -0
  8. package/dist/Column.mjs +66 -0
  9. package/dist/Column.module.js +66 -0
  10. package/dist/Column.module.js.map +1 -0
  11. package/dist/Row.main.js +97 -0
  12. package/dist/Row.main.js.map +1 -0
  13. package/dist/Row.mjs +88 -0
  14. package/dist/Row.module.js +88 -0
  15. package/dist/Row.module.js.map +1 -0
  16. package/dist/TableBody.main.js +61 -0
  17. package/dist/TableBody.main.js.map +1 -0
  18. package/dist/TableBody.mjs +52 -0
  19. package/dist/TableBody.module.js +52 -0
  20. package/dist/TableBody.module.js.map +1 -0
  21. package/dist/TableCollection.main.js +284 -0
  22. package/dist/TableCollection.main.js.map +1 -0
  23. package/dist/TableCollection.mjs +278 -0
  24. package/dist/TableCollection.module.js +278 -0
  25. package/dist/TableCollection.module.js.map +1 -0
  26. package/dist/TableColumnLayout.main.js +162 -0
  27. package/dist/TableColumnLayout.main.js.map +1 -0
  28. package/dist/TableColumnLayout.mjs +157 -0
  29. package/dist/TableColumnLayout.module.js +157 -0
  30. package/dist/TableColumnLayout.module.js.map +1 -0
  31. package/dist/TableHeader.main.js +56 -0
  32. package/dist/TableHeader.main.js.map +1 -0
  33. package/dist/TableHeader.mjs +47 -0
  34. package/dist/TableHeader.module.js +47 -0
  35. package/dist/TableHeader.module.js.map +1 -0
  36. package/dist/TableUtils.main.js +184 -0
  37. package/dist/TableUtils.main.js.map +1 -0
  38. package/dist/TableUtils.mjs +175 -0
  39. package/dist/TableUtils.module.js +175 -0
  40. package/dist/TableUtils.module.js.map +1 -0
  41. package/dist/import.mjs +11 -1216
  42. package/dist/main.js +21 -1230
  43. package/dist/main.js.map +1 -1
  44. package/dist/module.js +11 -1216
  45. package/dist/module.js.map +1 -1
  46. package/dist/types.d.ts +1 -1
  47. package/dist/useTableColumnResizeState.main.js +113 -0
  48. package/dist/useTableColumnResizeState.main.js.map +1 -0
  49. package/dist/useTableColumnResizeState.mjs +108 -0
  50. package/dist/useTableColumnResizeState.module.js +108 -0
  51. package/dist/useTableColumnResizeState.module.js.map +1 -0
  52. package/dist/useTableState.main.js +71 -0
  53. package/dist/useTableState.main.js.map +1 -0
  54. package/dist/useTableState.mjs +66 -0
  55. package/dist/useTableState.module.js +66 -0
  56. package/dist/useTableState.module.js.map +1 -0
  57. package/dist/useTreeGridState.main.js +207 -0
  58. package/dist/useTreeGridState.main.js.map +1 -0
  59. package/dist/useTreeGridState.mjs +202 -0
  60. package/dist/useTreeGridState.module.js +202 -0
  61. package/dist/useTreeGridState.module.js.map +1 -0
  62. package/package.json +10 -10
@@ -0,0 +1,278 @@
1
+ import {getFirstItem as $iLnZt$getFirstItem, getLastItem as $iLnZt$getLastItem} from "@react-stately/collections";
2
+ import {GridCollection as $iLnZt$GridCollection} from "@react-stately/grid";
3
+
4
+ /*
5
+ * Copyright 2020 Adobe. All rights reserved.
6
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License. You may obtain a copy
8
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software distributed under
11
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
+ * OF ANY KIND, either express or implied. See the License for the specific language
13
+ * governing permissions and limitations under the License.
14
+ */
15
+
16
+ const $788781baa30117fa$var$ROW_HEADER_COLUMN_KEY = "row-header-column-" + Math.random().toString(36).slice(2);
17
+ let $788781baa30117fa$var$ROW_HEADER_COLUMN_KEY_DRAG = "row-header-column-" + Math.random().toString(36).slice(2);
18
+ while($788781baa30117fa$var$ROW_HEADER_COLUMN_KEY === $788781baa30117fa$var$ROW_HEADER_COLUMN_KEY_DRAG)$788781baa30117fa$var$ROW_HEADER_COLUMN_KEY_DRAG = "row-header-column-" + Math.random().toString(36).slice(2);
19
+ function $788781baa30117fa$export$7c127db850d4e81e(keyMap, columnNodes) {
20
+ if (columnNodes.length === 0) return [];
21
+ let columns = [];
22
+ let seen = new Map();
23
+ for (let column of columnNodes){
24
+ let parentKey = column.parentKey;
25
+ let col = [
26
+ column
27
+ ];
28
+ while(parentKey){
29
+ let parent = keyMap.get(parentKey);
30
+ if (!parent) break;
31
+ // If we've already seen this parent, than it is shared
32
+ // with a previous column. If the current column is taller
33
+ // than the previous column, than we need to shift the parent
34
+ // in the previous column so it's level with the current column.
35
+ if (seen.has(parent)) {
36
+ parent.colspan++;
37
+ let { column: column, index: index } = seen.get(parent);
38
+ if (index > col.length) break;
39
+ for(let i = index; i < col.length; i++)column.splice(i, 0, null);
40
+ // Adjust shifted indices
41
+ for(let i = col.length; i < column.length; i++)// eslint-disable-next-line max-depth
42
+ if (column[i] && seen.has(column[i])) seen.get(column[i]).index = i;
43
+ } else {
44
+ parent.colspan = 1;
45
+ col.push(parent);
46
+ seen.set(parent, {
47
+ column: col,
48
+ index: col.length - 1
49
+ });
50
+ }
51
+ parentKey = parent.parentKey;
52
+ }
53
+ columns.push(col);
54
+ column.index = columns.length - 1;
55
+ }
56
+ let maxLength = Math.max(...columns.map((c)=>c.length));
57
+ let headerRows = Array(maxLength).fill(0).map(()=>[]);
58
+ // Convert columns into rows.
59
+ let colIndex = 0;
60
+ for (let column of columns){
61
+ let i = maxLength - 1;
62
+ for (let item of column){
63
+ if (item) {
64
+ // Fill the space up until the current column with a placeholder
65
+ let row = headerRows[i];
66
+ let rowLength = row.reduce((p, c)=>p + c.colspan, 0);
67
+ if (rowLength < colIndex) {
68
+ let placeholder = {
69
+ type: "placeholder",
70
+ key: "placeholder-" + item.key,
71
+ colspan: colIndex - rowLength,
72
+ index: rowLength,
73
+ value: null,
74
+ rendered: null,
75
+ level: i,
76
+ hasChildNodes: false,
77
+ childNodes: [],
78
+ textValue: null
79
+ };
80
+ // eslint-disable-next-line max-depth
81
+ if (row.length > 0) {
82
+ row[row.length - 1].nextKey = placeholder.key;
83
+ placeholder.prevKey = row[row.length - 1].key;
84
+ }
85
+ row.push(placeholder);
86
+ }
87
+ if (row.length > 0) {
88
+ row[row.length - 1].nextKey = item.key;
89
+ item.prevKey = row[row.length - 1].key;
90
+ }
91
+ item.level = i;
92
+ item.colIndex = colIndex;
93
+ row.push(item);
94
+ }
95
+ i--;
96
+ }
97
+ colIndex++;
98
+ }
99
+ // Add placeholders at the end of each row that is shorter than the maximum
100
+ let i = 0;
101
+ for (let row of headerRows){
102
+ let rowLength = row.reduce((p, c)=>p + c.colspan, 0);
103
+ if (rowLength < columnNodes.length) {
104
+ let placeholder = {
105
+ type: "placeholder",
106
+ key: "placeholder-" + row[row.length - 1].key,
107
+ colspan: columnNodes.length - rowLength,
108
+ index: rowLength,
109
+ value: null,
110
+ rendered: null,
111
+ level: i,
112
+ hasChildNodes: false,
113
+ childNodes: [],
114
+ textValue: null,
115
+ prevKey: row[row.length - 1].key
116
+ };
117
+ row.push(placeholder);
118
+ }
119
+ i++;
120
+ }
121
+ return headerRows.map((childNodes, index)=>{
122
+ let row = {
123
+ type: "headerrow",
124
+ key: "headerrow-" + index,
125
+ index: index,
126
+ value: null,
127
+ rendered: null,
128
+ level: 0,
129
+ hasChildNodes: true,
130
+ childNodes: childNodes,
131
+ textValue: null
132
+ };
133
+ return row;
134
+ });
135
+ }
136
+ class $788781baa30117fa$export$596e1b2e2cf93690 extends (0, $iLnZt$GridCollection) {
137
+ *[Symbol.iterator]() {
138
+ yield* this.body.childNodes;
139
+ }
140
+ get size() {
141
+ return this._size;
142
+ }
143
+ getKeys() {
144
+ return this.keyMap.keys();
145
+ }
146
+ getKeyBefore(key) {
147
+ let node = this.keyMap.get(key);
148
+ return node ? node.prevKey : null;
149
+ }
150
+ getKeyAfter(key) {
151
+ let node = this.keyMap.get(key);
152
+ return node ? node.nextKey : null;
153
+ }
154
+ getFirstKey() {
155
+ var _getFirstItem;
156
+ return (_getFirstItem = (0, $iLnZt$getFirstItem)(this.body.childNodes)) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key;
157
+ }
158
+ getLastKey() {
159
+ var _getLastItem;
160
+ return (_getLastItem = (0, $iLnZt$getLastItem)(this.body.childNodes)) === null || _getLastItem === void 0 ? void 0 : _getLastItem.key;
161
+ }
162
+ getItem(key) {
163
+ return this.keyMap.get(key);
164
+ }
165
+ at(idx) {
166
+ const keys = [
167
+ ...this.getKeys()
168
+ ];
169
+ return this.getItem(keys[idx]);
170
+ }
171
+ getTextValue(key) {
172
+ let row = this.getItem(key);
173
+ if (!row) return "";
174
+ // If the row has a textValue, use that.
175
+ if (row.textValue) return row.textValue;
176
+ // Otherwise combine the text of each of the row header columns.
177
+ let rowHeaderColumnKeys = this.rowHeaderColumnKeys;
178
+ if (rowHeaderColumnKeys) {
179
+ let text = [];
180
+ for (let cell of row.childNodes){
181
+ let column = this.columns[cell.index];
182
+ if (rowHeaderColumnKeys.has(column.key) && cell.textValue) text.push(cell.textValue);
183
+ if (text.length === rowHeaderColumnKeys.size) break;
184
+ }
185
+ return text.join(" ");
186
+ }
187
+ return "";
188
+ }
189
+ constructor(nodes, prev, opts){
190
+ let rowHeaderColumnKeys = new Set();
191
+ let body;
192
+ let columns = [];
193
+ // Add cell for selection checkboxes if needed.
194
+ if (opts === null || opts === void 0 ? void 0 : opts.showSelectionCheckboxes) {
195
+ let rowHeaderColumn = {
196
+ type: "column",
197
+ key: $788781baa30117fa$var$ROW_HEADER_COLUMN_KEY,
198
+ value: null,
199
+ textValue: "",
200
+ level: 0,
201
+ index: (opts === null || opts === void 0 ? void 0 : opts.showDragButtons) ? 1 : 0,
202
+ hasChildNodes: false,
203
+ rendered: null,
204
+ childNodes: [],
205
+ props: {
206
+ isSelectionCell: true
207
+ }
208
+ };
209
+ columns.unshift(rowHeaderColumn);
210
+ }
211
+ // Add cell for drag buttons if needed.
212
+ if (opts === null || opts === void 0 ? void 0 : opts.showDragButtons) {
213
+ let rowHeaderColumn = {
214
+ type: "column",
215
+ key: $788781baa30117fa$var$ROW_HEADER_COLUMN_KEY_DRAG,
216
+ value: null,
217
+ textValue: "",
218
+ level: 0,
219
+ index: 0,
220
+ hasChildNodes: false,
221
+ rendered: null,
222
+ childNodes: [],
223
+ props: {
224
+ isDragButtonCell: true
225
+ }
226
+ };
227
+ columns.unshift(rowHeaderColumn);
228
+ }
229
+ let rows = [];
230
+ let columnKeyMap = new Map();
231
+ let visit = (node)=>{
232
+ switch(node.type){
233
+ case "body":
234
+ body = node;
235
+ break;
236
+ case "column":
237
+ columnKeyMap.set(node.key, node);
238
+ if (!node.hasChildNodes) {
239
+ columns.push(node);
240
+ if (node.props.isRowHeader) rowHeaderColumnKeys.add(node.key);
241
+ }
242
+ break;
243
+ case "item":
244
+ rows.push(node);
245
+ return; // do not go into childNodes
246
+ }
247
+ for (let child of node.childNodes)visit(child);
248
+ };
249
+ for (let node of nodes)visit(node);
250
+ let headerRows = $788781baa30117fa$export$7c127db850d4e81e(columnKeyMap, columns);
251
+ headerRows.forEach((row, i)=>rows.splice(i, 0, row));
252
+ super({
253
+ columnCount: columns.length,
254
+ items: rows,
255
+ visitNode: (node)=>{
256
+ node.column = columns[node.index];
257
+ return node;
258
+ }
259
+ });
260
+ this._size = 0;
261
+ this.columns = columns;
262
+ this.rowHeaderColumnKeys = rowHeaderColumnKeys;
263
+ this.body = body;
264
+ this.headerRows = headerRows;
265
+ this._size = [
266
+ ...body.childNodes
267
+ ].length;
268
+ // Default row header column to the first one.
269
+ if (this.rowHeaderColumnKeys.size === 0) this.rowHeaderColumnKeys.add(this.columns.find((column)=>{
270
+ var _column_props, _column_props1;
271
+ return !((_column_props = column.props) === null || _column_props === void 0 ? void 0 : _column_props.isDragButtonCell) && !((_column_props1 = column.props) === null || _column_props1 === void 0 ? void 0 : _column_props1.isSelectionCell);
272
+ }).key);
273
+ }
274
+ }
275
+
276
+
277
+ export {$788781baa30117fa$export$7c127db850d4e81e as buildHeaderRows, $788781baa30117fa$export$596e1b2e2cf93690 as TableCollection};
278
+ //# sourceMappingURL=TableCollection.mjs.map
@@ -0,0 +1,278 @@
1
+ import {getFirstItem as $iLnZt$getFirstItem, getLastItem as $iLnZt$getLastItem} from "@react-stately/collections";
2
+ import {GridCollection as $iLnZt$GridCollection} from "@react-stately/grid";
3
+
4
+ /*
5
+ * Copyright 2020 Adobe. All rights reserved.
6
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License. You may obtain a copy
8
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software distributed under
11
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
+ * OF ANY KIND, either express or implied. See the License for the specific language
13
+ * governing permissions and limitations under the License.
14
+ */
15
+
16
+ const $788781baa30117fa$var$ROW_HEADER_COLUMN_KEY = "row-header-column-" + Math.random().toString(36).slice(2);
17
+ let $788781baa30117fa$var$ROW_HEADER_COLUMN_KEY_DRAG = "row-header-column-" + Math.random().toString(36).slice(2);
18
+ while($788781baa30117fa$var$ROW_HEADER_COLUMN_KEY === $788781baa30117fa$var$ROW_HEADER_COLUMN_KEY_DRAG)$788781baa30117fa$var$ROW_HEADER_COLUMN_KEY_DRAG = "row-header-column-" + Math.random().toString(36).slice(2);
19
+ function $788781baa30117fa$export$7c127db850d4e81e(keyMap, columnNodes) {
20
+ if (columnNodes.length === 0) return [];
21
+ let columns = [];
22
+ let seen = new Map();
23
+ for (let column of columnNodes){
24
+ let parentKey = column.parentKey;
25
+ let col = [
26
+ column
27
+ ];
28
+ while(parentKey){
29
+ let parent = keyMap.get(parentKey);
30
+ if (!parent) break;
31
+ // If we've already seen this parent, than it is shared
32
+ // with a previous column. If the current column is taller
33
+ // than the previous column, than we need to shift the parent
34
+ // in the previous column so it's level with the current column.
35
+ if (seen.has(parent)) {
36
+ parent.colspan++;
37
+ let { column: column, index: index } = seen.get(parent);
38
+ if (index > col.length) break;
39
+ for(let i = index; i < col.length; i++)column.splice(i, 0, null);
40
+ // Adjust shifted indices
41
+ for(let i = col.length; i < column.length; i++)// eslint-disable-next-line max-depth
42
+ if (column[i] && seen.has(column[i])) seen.get(column[i]).index = i;
43
+ } else {
44
+ parent.colspan = 1;
45
+ col.push(parent);
46
+ seen.set(parent, {
47
+ column: col,
48
+ index: col.length - 1
49
+ });
50
+ }
51
+ parentKey = parent.parentKey;
52
+ }
53
+ columns.push(col);
54
+ column.index = columns.length - 1;
55
+ }
56
+ let maxLength = Math.max(...columns.map((c)=>c.length));
57
+ let headerRows = Array(maxLength).fill(0).map(()=>[]);
58
+ // Convert columns into rows.
59
+ let colIndex = 0;
60
+ for (let column of columns){
61
+ let i = maxLength - 1;
62
+ for (let item of column){
63
+ if (item) {
64
+ // Fill the space up until the current column with a placeholder
65
+ let row = headerRows[i];
66
+ let rowLength = row.reduce((p, c)=>p + c.colspan, 0);
67
+ if (rowLength < colIndex) {
68
+ let placeholder = {
69
+ type: "placeholder",
70
+ key: "placeholder-" + item.key,
71
+ colspan: colIndex - rowLength,
72
+ index: rowLength,
73
+ value: null,
74
+ rendered: null,
75
+ level: i,
76
+ hasChildNodes: false,
77
+ childNodes: [],
78
+ textValue: null
79
+ };
80
+ // eslint-disable-next-line max-depth
81
+ if (row.length > 0) {
82
+ row[row.length - 1].nextKey = placeholder.key;
83
+ placeholder.prevKey = row[row.length - 1].key;
84
+ }
85
+ row.push(placeholder);
86
+ }
87
+ if (row.length > 0) {
88
+ row[row.length - 1].nextKey = item.key;
89
+ item.prevKey = row[row.length - 1].key;
90
+ }
91
+ item.level = i;
92
+ item.colIndex = colIndex;
93
+ row.push(item);
94
+ }
95
+ i--;
96
+ }
97
+ colIndex++;
98
+ }
99
+ // Add placeholders at the end of each row that is shorter than the maximum
100
+ let i = 0;
101
+ for (let row of headerRows){
102
+ let rowLength = row.reduce((p, c)=>p + c.colspan, 0);
103
+ if (rowLength < columnNodes.length) {
104
+ let placeholder = {
105
+ type: "placeholder",
106
+ key: "placeholder-" + row[row.length - 1].key,
107
+ colspan: columnNodes.length - rowLength,
108
+ index: rowLength,
109
+ value: null,
110
+ rendered: null,
111
+ level: i,
112
+ hasChildNodes: false,
113
+ childNodes: [],
114
+ textValue: null,
115
+ prevKey: row[row.length - 1].key
116
+ };
117
+ row.push(placeholder);
118
+ }
119
+ i++;
120
+ }
121
+ return headerRows.map((childNodes, index)=>{
122
+ let row = {
123
+ type: "headerrow",
124
+ key: "headerrow-" + index,
125
+ index: index,
126
+ value: null,
127
+ rendered: null,
128
+ level: 0,
129
+ hasChildNodes: true,
130
+ childNodes: childNodes,
131
+ textValue: null
132
+ };
133
+ return row;
134
+ });
135
+ }
136
+ class $788781baa30117fa$export$596e1b2e2cf93690 extends (0, $iLnZt$GridCollection) {
137
+ *[Symbol.iterator]() {
138
+ yield* this.body.childNodes;
139
+ }
140
+ get size() {
141
+ return this._size;
142
+ }
143
+ getKeys() {
144
+ return this.keyMap.keys();
145
+ }
146
+ getKeyBefore(key) {
147
+ let node = this.keyMap.get(key);
148
+ return node ? node.prevKey : null;
149
+ }
150
+ getKeyAfter(key) {
151
+ let node = this.keyMap.get(key);
152
+ return node ? node.nextKey : null;
153
+ }
154
+ getFirstKey() {
155
+ var _getFirstItem;
156
+ return (_getFirstItem = (0, $iLnZt$getFirstItem)(this.body.childNodes)) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key;
157
+ }
158
+ getLastKey() {
159
+ var _getLastItem;
160
+ return (_getLastItem = (0, $iLnZt$getLastItem)(this.body.childNodes)) === null || _getLastItem === void 0 ? void 0 : _getLastItem.key;
161
+ }
162
+ getItem(key) {
163
+ return this.keyMap.get(key);
164
+ }
165
+ at(idx) {
166
+ const keys = [
167
+ ...this.getKeys()
168
+ ];
169
+ return this.getItem(keys[idx]);
170
+ }
171
+ getTextValue(key) {
172
+ let row = this.getItem(key);
173
+ if (!row) return "";
174
+ // If the row has a textValue, use that.
175
+ if (row.textValue) return row.textValue;
176
+ // Otherwise combine the text of each of the row header columns.
177
+ let rowHeaderColumnKeys = this.rowHeaderColumnKeys;
178
+ if (rowHeaderColumnKeys) {
179
+ let text = [];
180
+ for (let cell of row.childNodes){
181
+ let column = this.columns[cell.index];
182
+ if (rowHeaderColumnKeys.has(column.key) && cell.textValue) text.push(cell.textValue);
183
+ if (text.length === rowHeaderColumnKeys.size) break;
184
+ }
185
+ return text.join(" ");
186
+ }
187
+ return "";
188
+ }
189
+ constructor(nodes, prev, opts){
190
+ let rowHeaderColumnKeys = new Set();
191
+ let body;
192
+ let columns = [];
193
+ // Add cell for selection checkboxes if needed.
194
+ if (opts === null || opts === void 0 ? void 0 : opts.showSelectionCheckboxes) {
195
+ let rowHeaderColumn = {
196
+ type: "column",
197
+ key: $788781baa30117fa$var$ROW_HEADER_COLUMN_KEY,
198
+ value: null,
199
+ textValue: "",
200
+ level: 0,
201
+ index: (opts === null || opts === void 0 ? void 0 : opts.showDragButtons) ? 1 : 0,
202
+ hasChildNodes: false,
203
+ rendered: null,
204
+ childNodes: [],
205
+ props: {
206
+ isSelectionCell: true
207
+ }
208
+ };
209
+ columns.unshift(rowHeaderColumn);
210
+ }
211
+ // Add cell for drag buttons if needed.
212
+ if (opts === null || opts === void 0 ? void 0 : opts.showDragButtons) {
213
+ let rowHeaderColumn = {
214
+ type: "column",
215
+ key: $788781baa30117fa$var$ROW_HEADER_COLUMN_KEY_DRAG,
216
+ value: null,
217
+ textValue: "",
218
+ level: 0,
219
+ index: 0,
220
+ hasChildNodes: false,
221
+ rendered: null,
222
+ childNodes: [],
223
+ props: {
224
+ isDragButtonCell: true
225
+ }
226
+ };
227
+ columns.unshift(rowHeaderColumn);
228
+ }
229
+ let rows = [];
230
+ let columnKeyMap = new Map();
231
+ let visit = (node)=>{
232
+ switch(node.type){
233
+ case "body":
234
+ body = node;
235
+ break;
236
+ case "column":
237
+ columnKeyMap.set(node.key, node);
238
+ if (!node.hasChildNodes) {
239
+ columns.push(node);
240
+ if (node.props.isRowHeader) rowHeaderColumnKeys.add(node.key);
241
+ }
242
+ break;
243
+ case "item":
244
+ rows.push(node);
245
+ return; // do not go into childNodes
246
+ }
247
+ for (let child of node.childNodes)visit(child);
248
+ };
249
+ for (let node of nodes)visit(node);
250
+ let headerRows = $788781baa30117fa$export$7c127db850d4e81e(columnKeyMap, columns);
251
+ headerRows.forEach((row, i)=>rows.splice(i, 0, row));
252
+ super({
253
+ columnCount: columns.length,
254
+ items: rows,
255
+ visitNode: (node)=>{
256
+ node.column = columns[node.index];
257
+ return node;
258
+ }
259
+ });
260
+ this._size = 0;
261
+ this.columns = columns;
262
+ this.rowHeaderColumnKeys = rowHeaderColumnKeys;
263
+ this.body = body;
264
+ this.headerRows = headerRows;
265
+ this._size = [
266
+ ...body.childNodes
267
+ ].length;
268
+ // Default row header column to the first one.
269
+ if (this.rowHeaderColumnKeys.size === 0) this.rowHeaderColumnKeys.add(this.columns.find((column)=>{
270
+ var _column_props, _column_props1;
271
+ return !((_column_props = column.props) === null || _column_props === void 0 ? void 0 : _column_props.isDragButtonCell) && !((_column_props1 = column.props) === null || _column_props1 === void 0 ? void 0 : _column_props1.isSelectionCell);
272
+ }).key);
273
+ }
274
+ }
275
+
276
+
277
+ export {$788781baa30117fa$export$7c127db850d4e81e as buildHeaderRows, $788781baa30117fa$export$596e1b2e2cf93690 as TableCollection};
278
+ //# sourceMappingURL=TableCollection.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAaD,MAAM,8CAAwB,uBAAuB,KAAK,MAAM,GAAG,QAAQ,CAAC,IAAI,KAAK,CAAC;AACtF,IAAI,mDAA6B,uBAAuB,KAAK,MAAM,GAAG,QAAQ,CAAC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I,CAAC,IAAI,GAAG;QACZ,IAAI,CAAC,UAAU,GAAG;QAClB,IAAI,CAAC,KAAK,GAAG;eAAI,KAAK,UAAU;SAAC,CAAC,MAAM;QAExC,8CAA8C;QAC9C,IAAI,IAAI,CAAC,mBAAmB,CAAC,IAAI,KAAK,GACpC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;gBAAW,eAAmC;mBAApC,GAAC,gBAAA,OAAO,KAAK,cAAZ,oCAAA,cAAc,gBAAgB,KAAI,GAAC,iBAAA,OAAO,KAAK,cAAZ,qCAAA,eAAc,eAAe;WAAE,GAAG;IAEnI;AAwEF","sources":["packages/@react-stately/table/src/TableCollection.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 {getFirstItem, getLastItem} from '@react-stately/collections';\nimport {GridCollection} from '@react-stately/grid';\nimport {GridNode} from '@react-types/grid';\nimport {TableCollection as ITableCollection} from '@react-types/table';\nimport {Key} from '@react-types/shared';\n\ninterface GridCollectionOptions {\n showSelectionCheckboxes?: boolean,\n showDragButtons?: boolean\n}\n\nconst ROW_HEADER_COLUMN_KEY = 'row-header-column-' + Math.random().toString(36).slice(2);\nlet ROW_HEADER_COLUMN_KEY_DRAG = 'row-header-column-' + Math.random().toString(36).slice(2);\nwhile (ROW_HEADER_COLUMN_KEY === ROW_HEADER_COLUMN_KEY_DRAG) {\n ROW_HEADER_COLUMN_KEY_DRAG = 'row-header-column-' + Math.random().toString(36).slice(2);\n}\n\n/** @private */\nexport function buildHeaderRows<T>(keyMap: Map<Key, GridNode<T>>, columnNodes: GridNode<T>[]): GridNode<T>[] {\n if (columnNodes.length === 0) {\n return [];\n }\n\n let columns: GridNode<T>[][] = [];\n let seen = new Map();\n for (let column of columnNodes) {\n let parentKey = column.parentKey;\n let col = [column];\n\n while (parentKey) {\n let parent: GridNode<T> = keyMap.get(parentKey);\n if (!parent) {\n break;\n }\n\n // If we've already seen this parent, than it is shared\n // with a previous column. If the current column is taller\n // than the previous column, than we need to shift the parent\n // in the previous column so it's level with the current column.\n if (seen.has(parent)) {\n parent.colspan++;\n\n let {column, index} = seen.get(parent);\n if (index > col.length) {\n break;\n }\n\n for (let i = index; i < col.length; i++) {\n column.splice(i, 0, null);\n }\n\n // Adjust shifted indices\n for (let i = col.length; i < column.length; i++) {\n // eslint-disable-next-line max-depth\n if (column[i] && seen.has(column[i])) {\n seen.get(column[i]).index = i;\n }\n }\n } else {\n parent.colspan = 1;\n col.push(parent);\n seen.set(parent, {column: col, index: col.length - 1});\n }\n\n parentKey = parent.parentKey;\n }\n\n columns.push(col);\n column.index = columns.length - 1;\n }\n\n let maxLength = Math.max(...columns.map(c => c.length));\n let headerRows = Array(maxLength).fill(0).map(() => []);\n\n // Convert columns into rows.\n let colIndex = 0;\n for (let column of columns) {\n let i = maxLength - 1;\n for (let item of column) {\n if (item) {\n // Fill the space up until the current column with a placeholder\n let row = headerRows[i];\n let rowLength = row.reduce((p, c) => p + c.colspan, 0);\n if (rowLength < colIndex) {\n let placeholder: GridNode<T> = {\n type: 'placeholder',\n key: 'placeholder-' + item.key,\n colspan: colIndex - rowLength,\n index: rowLength,\n value: null,\n rendered: null,\n level: i,\n hasChildNodes: false,\n childNodes: [],\n textValue: null\n };\n\n // eslint-disable-next-line max-depth\n if (row.length > 0) {\n row[row.length - 1].nextKey = placeholder.key;\n placeholder.prevKey = row[row.length - 1].key;\n }\n\n row.push(placeholder);\n }\n\n if (row.length > 0) {\n row[row.length - 1].nextKey = item.key;\n item.prevKey = row[row.length - 1].key;\n }\n\n item.level = i;\n item.colIndex = colIndex;\n row.push(item);\n }\n\n i--;\n }\n\n colIndex++;\n }\n\n // Add placeholders at the end of each row that is shorter than the maximum\n let i = 0;\n for (let row of headerRows) {\n let rowLength = row.reduce((p, c) => p + c.colspan, 0);\n if (rowLength < columnNodes.length) {\n let placeholder: GridNode<T> = {\n type: 'placeholder',\n key: 'placeholder-' + row[row.length - 1].key,\n colspan: columnNodes.length - rowLength,\n index: rowLength,\n value: null,\n rendered: null,\n level: i,\n hasChildNodes: false,\n childNodes: [],\n textValue: null,\n prevKey: row[row.length - 1].key\n };\n\n row.push(placeholder);\n }\n\n i++;\n }\n\n return headerRows.map((childNodes, index) => {\n let row: GridNode<T> = {\n type: 'headerrow',\n key: 'headerrow-' + index,\n index,\n value: null,\n rendered: null,\n level: 0,\n hasChildNodes: true,\n childNodes,\n textValue: null\n };\n\n return row;\n });\n}\n\nexport class TableCollection<T> extends GridCollection<T> implements ITableCollection<T> {\n headerRows: GridNode<T>[];\n columns: GridNode<T>[];\n rowHeaderColumnKeys: Set<Key>;\n body: GridNode<T>;\n _size: number = 0;\n\n constructor(nodes: Iterable<GridNode<T>>, prev?: ITableCollection<T>, opts?: GridCollectionOptions) {\n let rowHeaderColumnKeys: Set<Key> = new Set();\n let body: GridNode<T>;\n let columns: GridNode<T>[] = [];\n // Add cell for selection checkboxes if needed.\n if (opts?.showSelectionCheckboxes) {\n let rowHeaderColumn: GridNode<T> = {\n type: 'column',\n key: ROW_HEADER_COLUMN_KEY,\n value: null,\n textValue: '',\n level: 0,\n index: opts?.showDragButtons ? 1 : 0,\n hasChildNodes: false,\n rendered: null,\n childNodes: [],\n props: {\n isSelectionCell: true\n }\n };\n\n columns.unshift(rowHeaderColumn);\n }\n\n // Add cell for drag buttons if needed.\n if (opts?.showDragButtons) {\n let rowHeaderColumn: GridNode<T> = {\n type: 'column',\n key: ROW_HEADER_COLUMN_KEY_DRAG,\n value: null,\n textValue: '',\n level: 0,\n index: 0,\n hasChildNodes: false,\n rendered: null,\n childNodes: [],\n props: {\n isDragButtonCell: true\n }\n };\n\n columns.unshift(rowHeaderColumn);\n }\n\n let rows = [];\n let columnKeyMap = new Map();\n let visit = (node: GridNode<T>) => {\n switch (node.type) {\n case 'body':\n body = node;\n break;\n case 'column':\n columnKeyMap.set(node.key, node);\n if (!node.hasChildNodes) {\n columns.push(node);\n\n if (node.props.isRowHeader) {\n rowHeaderColumnKeys.add(node.key);\n }\n }\n break;\n case 'item':\n rows.push(node);\n return; // do not go into childNodes\n }\n for (let child of node.childNodes) {\n visit(child);\n }\n };\n\n for (let node of nodes) {\n visit(node);\n }\n\n let headerRows = buildHeaderRows(columnKeyMap, columns) as GridNode<T>[];\n headerRows.forEach((row, i) => rows.splice(i, 0, row));\n\n super({\n columnCount: columns.length,\n items: rows,\n visitNode: node => {\n node.column = columns[node.index];\n return node;\n }\n });\n this.columns = columns;\n this.rowHeaderColumnKeys = rowHeaderColumnKeys;\n this.body = body;\n this.headerRows = headerRows;\n this._size = [...body.childNodes].length;\n\n // Default row header column to the first one.\n if (this.rowHeaderColumnKeys.size === 0) {\n this.rowHeaderColumnKeys.add(this.columns.find(column => !column.props?.isDragButtonCell && !column.props?.isSelectionCell).key);\n }\n }\n\n *[Symbol.iterator]() {\n yield* this.body.childNodes;\n }\n\n get size() {\n return this._size;\n }\n\n getKeys() {\n return this.keyMap.keys();\n }\n\n getKeyBefore(key: Key) {\n let node = this.keyMap.get(key);\n return node ? node.prevKey : null;\n }\n\n getKeyAfter(key: Key) {\n let node = this.keyMap.get(key);\n return node ? node.nextKey : null;\n }\n\n getFirstKey() {\n return getFirstItem(this.body.childNodes)?.key;\n }\n\n getLastKey() {\n return getLastItem(this.body.childNodes)?.key;\n }\n\n getItem(key: Key) {\n return this.keyMap.get(key);\n }\n\n at(idx: number) {\n const keys = [...this.getKeys()];\n return this.getItem(keys[idx]);\n }\n\n getTextValue(key: Key): string {\n let row = this.getItem(key);\n if (!row) {\n return '';\n }\n\n // If the row has a textValue, use that.\n if (row.textValue) {\n return row.textValue;\n }\n\n // Otherwise combine the text of each of the row header columns.\n let rowHeaderColumnKeys = this.rowHeaderColumnKeys;\n if (rowHeaderColumnKeys) {\n let text = [];\n for (let cell of row.childNodes) {\n let column = this.columns[cell.index];\n if (rowHeaderColumnKeys.has(column.key) && cell.textValue) {\n text.push(cell.textValue);\n }\n\n if (text.length === rowHeaderColumnKeys.size) {\n break;\n }\n }\n\n return text.join(' ');\n }\n\n return '';\n }\n}\n"],"names":[],"version":3,"file":"TableCollection.module.js.map"}