@react-stately/table 3.1.1-nightly.3100 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +98 -94
- package/dist/main.js.map +1 -1
- package/dist/module.js +92 -88
- package/dist/module.js.map +1 -1
- package/package.json +8 -8
package/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
1
|
+
var $3T1Wc$reactstatelycollections = require("@react-stately/collections");
|
|
2
|
+
var $3T1Wc$reactstatelygrid = require("@react-stately/grid");
|
|
3
|
+
var $3T1Wc$react = require("react");
|
|
4
4
|
|
|
5
5
|
function $parcel$export(e, n, v, s) {
|
|
6
6
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
@@ -25,15 +25,15 @@ function $parcel$interopDefault(a) {
|
|
|
25
25
|
return a && a.__esModule ? a.default : a;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
$parcel$export(module.exports, "Section", () => $
|
|
29
|
-
var $
|
|
28
|
+
$parcel$export(module.exports, "Section", () => $3T1Wc$reactstatelycollections.Section);
|
|
29
|
+
var $e8a04407cfd5f1b5$exports = {};
|
|
30
30
|
|
|
31
|
-
$parcel$export($
|
|
31
|
+
$parcel$export($e8a04407cfd5f1b5$exports, "useTableState", () => $e8a04407cfd5f1b5$export$907bcc6c48325fd6);
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
const $
|
|
36
|
-
function $
|
|
35
|
+
const $ad3381cb85097bc1$var$ROW_HEADER_COLUMN_KEY = 'row-header-column-' + Math.random().toString(36).slice(2);
|
|
36
|
+
function $ad3381cb85097bc1$var$buildHeaderRows(keyMap, columnNodes) {
|
|
37
37
|
let columns = [];
|
|
38
38
|
let seen = new Map();
|
|
39
39
|
for (let column of columnNodes){
|
|
@@ -150,16 +150,58 @@ function $639771746563c202$var$buildHeaderRows(keyMap, columnNodes) {
|
|
|
150
150
|
return row;
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
|
|
153
|
+
var tmp = Symbol.iterator;
|
|
154
|
+
class $ad3381cb85097bc1$export$596e1b2e2cf93690 extends $3T1Wc$reactstatelygrid.GridCollection {
|
|
155
|
+
*[tmp]() {
|
|
156
|
+
yield* this.body.childNodes;
|
|
157
|
+
}
|
|
158
|
+
get size() {
|
|
159
|
+
return [
|
|
160
|
+
...this.body.childNodes
|
|
161
|
+
].length;
|
|
162
|
+
}
|
|
163
|
+
getKeys() {
|
|
164
|
+
return this.keyMap.keys();
|
|
165
|
+
}
|
|
166
|
+
getKeyBefore(key) {
|
|
167
|
+
let node = this.keyMap.get(key);
|
|
168
|
+
return node ? node.prevKey : null;
|
|
169
|
+
}
|
|
170
|
+
getKeyAfter(key) {
|
|
171
|
+
let node = this.keyMap.get(key);
|
|
172
|
+
return node ? node.nextKey : null;
|
|
173
|
+
}
|
|
174
|
+
getFirstKey() {
|
|
175
|
+
var ref;
|
|
176
|
+
return (ref = [
|
|
177
|
+
...this.body.childNodes
|
|
178
|
+
][0]) === null || ref === void 0 ? void 0 : ref.key;
|
|
179
|
+
}
|
|
180
|
+
getLastKey() {
|
|
181
|
+
var ref;
|
|
182
|
+
let rows = [
|
|
183
|
+
...this.body.childNodes
|
|
184
|
+
];
|
|
185
|
+
return (ref = rows[rows.length - 1]) === null || ref === void 0 ? void 0 : ref.key;
|
|
186
|
+
}
|
|
187
|
+
getItem(key) {
|
|
188
|
+
return this.keyMap.get(key);
|
|
189
|
+
}
|
|
190
|
+
at(idx) {
|
|
191
|
+
const keys = [
|
|
192
|
+
...this.getKeys()
|
|
193
|
+
];
|
|
194
|
+
return this.getItem(keys[idx]);
|
|
195
|
+
}
|
|
154
196
|
constructor(nodes, prev, opts){
|
|
155
197
|
let rowHeaderColumnKeys = new Set();
|
|
156
198
|
let body;
|
|
157
199
|
let columns = [];
|
|
158
200
|
// Add cell for selection checkboxes if needed.
|
|
159
|
-
if (opts
|
|
201
|
+
if (opts === null || opts === void 0 ? void 0 : opts.showSelectionCheckboxes) {
|
|
160
202
|
let rowHeaderColumn = {
|
|
161
203
|
type: 'column',
|
|
162
|
-
key: $
|
|
204
|
+
key: $ad3381cb85097bc1$var$ROW_HEADER_COLUMN_KEY,
|
|
163
205
|
value: null,
|
|
164
206
|
textValue: '',
|
|
165
207
|
level: 0,
|
|
@@ -194,7 +236,7 @@ class $639771746563c202$export$596e1b2e2cf93690 extends $eV1sI$reactstatelygrid.
|
|
|
194
236
|
for (let child of node.childNodes)visit(child);
|
|
195
237
|
};
|
|
196
238
|
for (let node1 of nodes)visit(node1);
|
|
197
|
-
let headerRows = $
|
|
239
|
+
let headerRows = $ad3381cb85097bc1$var$buildHeaderRows(columnKeyMap, columns);
|
|
198
240
|
headerRows.forEach((row, i)=>rows.splice(i, 0, row)
|
|
199
241
|
);
|
|
200
242
|
super({
|
|
@@ -210,58 +252,19 @@ class $639771746563c202$export$596e1b2e2cf93690 extends $eV1sI$reactstatelygrid.
|
|
|
210
252
|
this.body = body;
|
|
211
253
|
this.headerRows = headerRows;
|
|
212
254
|
// Default row header column to the first one.
|
|
213
|
-
if (this.rowHeaderColumnKeys.size === 0) this.rowHeaderColumnKeys.add(this.columns[opts
|
|
214
|
-
}
|
|
215
|
-
*[Symbol.iterator]() {
|
|
216
|
-
yield* this.body.childNodes;
|
|
217
|
-
}
|
|
218
|
-
get size() {
|
|
219
|
-
return [
|
|
220
|
-
...this.body.childNodes
|
|
221
|
-
].length;
|
|
222
|
-
}
|
|
223
|
-
getKeys() {
|
|
224
|
-
return this.keyMap.keys();
|
|
225
|
-
}
|
|
226
|
-
getKeyBefore(key) {
|
|
227
|
-
let node = this.keyMap.get(key);
|
|
228
|
-
return node ? node.prevKey : null;
|
|
229
|
-
}
|
|
230
|
-
getKeyAfter(key) {
|
|
231
|
-
let node = this.keyMap.get(key);
|
|
232
|
-
return node ? node.nextKey : null;
|
|
233
|
-
}
|
|
234
|
-
getFirstKey() {
|
|
235
|
-
return [
|
|
236
|
-
...this.body.childNodes
|
|
237
|
-
][0]?.key;
|
|
238
|
-
}
|
|
239
|
-
getLastKey() {
|
|
240
|
-
let rows = [
|
|
241
|
-
...this.body.childNodes
|
|
242
|
-
];
|
|
243
|
-
return rows[rows.length - 1]?.key;
|
|
244
|
-
}
|
|
245
|
-
getItem(key) {
|
|
246
|
-
return this.keyMap.get(key);
|
|
247
|
-
}
|
|
248
|
-
at(idx) {
|
|
249
|
-
const keys = [
|
|
250
|
-
...this.getKeys()
|
|
251
|
-
];
|
|
252
|
-
return this.getItem(keys[idx]);
|
|
255
|
+
if (this.rowHeaderColumnKeys.size === 0) this.rowHeaderColumnKeys.add(this.columns[(opts === null || opts === void 0 ? void 0 : opts.showSelectionCheckboxes) ? 1 : 0].key);
|
|
253
256
|
}
|
|
254
257
|
}
|
|
255
258
|
|
|
256
259
|
|
|
257
260
|
|
|
258
|
-
const $
|
|
261
|
+
const $e8a04407cfd5f1b5$var$OPPOSITE_SORT_DIRECTION = {
|
|
259
262
|
ascending: 'descending',
|
|
260
263
|
descending: 'ascending'
|
|
261
264
|
};
|
|
262
|
-
function $
|
|
265
|
+
function $e8a04407cfd5f1b5$export$907bcc6c48325fd6(props) {
|
|
263
266
|
let { selectionMode: selectionMode = 'none' } = props;
|
|
264
|
-
let context = $
|
|
267
|
+
let context = $3T1Wc$react.useMemo(()=>({
|
|
265
268
|
showSelectionCheckboxes: props.showSelectionCheckboxes && selectionMode !== 'none',
|
|
266
269
|
selectionMode: selectionMode,
|
|
267
270
|
columns: []
|
|
@@ -271,9 +274,9 @@ function $6f4606b208f83e59$export$907bcc6c48325fd6(props) {
|
|
|
271
274
|
props.showSelectionCheckboxes,
|
|
272
275
|
selectionMode
|
|
273
276
|
]);
|
|
274
|
-
let collection = $
|
|
277
|
+
let collection = $3T1Wc$reactstatelycollections.useCollection(props, (nodes, prev)=>new $ad3381cb85097bc1$export$596e1b2e2cf93690(nodes, prev, context)
|
|
275
278
|
, context);
|
|
276
|
-
let { disabledKeys: disabledKeys , selectionManager: selectionManager } = $
|
|
279
|
+
let { disabledKeys: disabledKeys , selectionManager: selectionManager } = $3T1Wc$reactstatelygrid.useGridState({
|
|
277
280
|
...props,
|
|
278
281
|
collection: collection
|
|
279
282
|
});
|
|
@@ -284,23 +287,24 @@ function $6f4606b208f83e59$export$907bcc6c48325fd6(props) {
|
|
|
284
287
|
showSelectionCheckboxes: props.showSelectionCheckboxes || false,
|
|
285
288
|
sortDescriptor: props.sortDescriptor,
|
|
286
289
|
sort (columnKey) {
|
|
290
|
+
var ref;
|
|
287
291
|
props.onSortChange({
|
|
288
292
|
column: columnKey,
|
|
289
|
-
direction: props.sortDescriptor
|
|
293
|
+
direction: ((ref = props.sortDescriptor) === null || ref === void 0 ? void 0 : ref.column) === columnKey ? $e8a04407cfd5f1b5$var$OPPOSITE_SORT_DIRECTION[props.sortDescriptor.direction] : 'ascending'
|
|
290
294
|
});
|
|
291
295
|
}
|
|
292
296
|
};
|
|
293
297
|
}
|
|
294
298
|
|
|
295
299
|
|
|
296
|
-
var $
|
|
300
|
+
var $ab69e241adb4db9a$exports = {};
|
|
297
301
|
|
|
298
|
-
$parcel$export($
|
|
302
|
+
$parcel$export($ab69e241adb4db9a$exports, "TableHeader", () => $ab69e241adb4db9a$export$f850895b287ef28e);
|
|
299
303
|
|
|
300
|
-
function $
|
|
304
|
+
function $ab69e241adb4db9a$var$TableHeader(props) {
|
|
301
305
|
return null;
|
|
302
306
|
}
|
|
303
|
-
$
|
|
307
|
+
$ab69e241adb4db9a$var$TableHeader.getCollectionNode = function* getCollectionNode(props) {
|
|
304
308
|
let { children: children , columns: columns } = props;
|
|
305
309
|
if (typeof children === 'function') {
|
|
306
310
|
if (!columns) throw new Error('props.children was a function but props.columns is missing');
|
|
@@ -311,7 +315,7 @@ $38b416f8214f8fe1$var$TableHeader.getCollectionNode = function* getCollectionNod
|
|
|
311
315
|
};
|
|
312
316
|
} else {
|
|
313
317
|
let columns = [];
|
|
314
|
-
($parcel$interopDefault($
|
|
318
|
+
($parcel$interopDefault($3T1Wc$react)).Children.forEach(children, (column)=>{
|
|
315
319
|
columns.push({
|
|
316
320
|
type: 'column',
|
|
317
321
|
element: column
|
|
@@ -324,17 +328,17 @@ $38b416f8214f8fe1$var$TableHeader.getCollectionNode = function* getCollectionNod
|
|
|
324
328
|
* A TableHeader is a container for the Column elements in a Table. Columns can be statically defined
|
|
325
329
|
* as children, or generated dynamically using a function based on the data passed to the `columns` prop.
|
|
326
330
|
*/ // We don't want getCollectionNode to show up in the type definition
|
|
327
|
-
let $
|
|
331
|
+
let $ab69e241adb4db9a$export$f850895b287ef28e = $ab69e241adb4db9a$var$TableHeader;
|
|
328
332
|
|
|
329
333
|
|
|
330
|
-
var $
|
|
334
|
+
var $5523918a064f3e82$exports = {};
|
|
331
335
|
|
|
332
|
-
$parcel$export($
|
|
336
|
+
$parcel$export($5523918a064f3e82$exports, "TableBody", () => $5523918a064f3e82$export$76ccd210b9029917);
|
|
333
337
|
|
|
334
|
-
function $
|
|
338
|
+
function $5523918a064f3e82$var$TableBody(props) {
|
|
335
339
|
return null;
|
|
336
340
|
}
|
|
337
|
-
$
|
|
341
|
+
$5523918a064f3e82$var$TableBody.getCollectionNode = function* getCollectionNode(props) {
|
|
338
342
|
let { children: children , items: items1 } = props;
|
|
339
343
|
yield {
|
|
340
344
|
type: 'body',
|
|
@@ -350,7 +354,7 @@ $346e4da968fff62e$var$TableBody.getCollectionNode = function* getCollectionNode(
|
|
|
350
354
|
};
|
|
351
355
|
} else {
|
|
352
356
|
let items = [];
|
|
353
|
-
($parcel$interopDefault($
|
|
357
|
+
($parcel$interopDefault($3T1Wc$react)).Children.forEach(children, (item)=>{
|
|
354
358
|
items.push({
|
|
355
359
|
type: 'item',
|
|
356
360
|
element: item
|
|
@@ -365,23 +369,23 @@ $346e4da968fff62e$var$TableBody.getCollectionNode = function* getCollectionNode(
|
|
|
365
369
|
* A TableBody is a container for the Row elements of a Table. Rows can be statically defined
|
|
366
370
|
* as children, or generated dynamically using a function based on the data passed to the `items` prop.
|
|
367
371
|
*/ // We don't want getCollectionNode to show up in the type definition
|
|
368
|
-
let $
|
|
372
|
+
let $5523918a064f3e82$export$76ccd210b9029917 = $5523918a064f3e82$var$TableBody;
|
|
369
373
|
|
|
370
374
|
|
|
371
|
-
var $
|
|
375
|
+
var $7391cc655de6832d$exports = {};
|
|
372
376
|
|
|
373
|
-
$parcel$export($
|
|
377
|
+
$parcel$export($7391cc655de6832d$exports, "Column", () => $7391cc655de6832d$export$816b5d811295e6bc);
|
|
374
378
|
|
|
375
|
-
function $
|
|
379
|
+
function $7391cc655de6832d$var$Column(props) {
|
|
376
380
|
return null;
|
|
377
381
|
}
|
|
378
|
-
$
|
|
382
|
+
$7391cc655de6832d$var$Column.getCollectionNode = function* getCollectionNode(props, context1) {
|
|
379
383
|
let { title: title , children: children , childColumns: childColumns1 } = props;
|
|
380
384
|
let rendered = title || children;
|
|
381
385
|
let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'];
|
|
382
386
|
let fullNodes = yield {
|
|
383
387
|
type: 'column',
|
|
384
|
-
hasChildNodes: !!childColumns1 || title && ($parcel$interopDefault($
|
|
388
|
+
hasChildNodes: !!childColumns1 || title && ($parcel$interopDefault($3T1Wc$react)).Children.count(children) > 0,
|
|
385
389
|
rendered: rendered,
|
|
386
390
|
textValue: textValue,
|
|
387
391
|
props: props,
|
|
@@ -392,7 +396,7 @@ $f62ff72fddbd5ba7$var$Column.getCollectionNode = function* getCollectionNode(pro
|
|
|
392
396
|
};
|
|
393
397
|
else if (title) {
|
|
394
398
|
let childColumns = [];
|
|
395
|
-
($parcel$interopDefault($
|
|
399
|
+
($parcel$interopDefault($3T1Wc$react)).Children.forEach(children, (child)=>{
|
|
396
400
|
childColumns.push({
|
|
397
401
|
type: 'column',
|
|
398
402
|
element: child
|
|
@@ -420,17 +424,17 @@ $f62ff72fddbd5ba7$var$Column.getCollectionNode = function* getCollectionNode(pro
|
|
|
420
424
|
* Column elements to represent column groups. Nested columns can be statically defined as
|
|
421
425
|
* children, or dynamically generated using a function based on the `childColumns` prop.
|
|
422
426
|
*/ // We don't want getCollectionNode to show up in the type definition
|
|
423
|
-
let $
|
|
427
|
+
let $7391cc655de6832d$export$816b5d811295e6bc = $7391cc655de6832d$var$Column;
|
|
424
428
|
|
|
425
429
|
|
|
426
|
-
var $
|
|
430
|
+
var $acd7f2c292e16424$exports = {};
|
|
427
431
|
|
|
428
|
-
$parcel$export($
|
|
432
|
+
$parcel$export($acd7f2c292e16424$exports, "Row", () => $acd7f2c292e16424$export$b59bdbef9ce70de2);
|
|
429
433
|
|
|
430
|
-
function $
|
|
434
|
+
function $acd7f2c292e16424$var$Row(props) {
|
|
431
435
|
return null;
|
|
432
436
|
}
|
|
433
|
-
$
|
|
437
|
+
$acd7f2c292e16424$var$Row.getCollectionNode = function* getCollectionNode(props, context) {
|
|
434
438
|
let { children: children , textValue: textValue } = props;
|
|
435
439
|
yield {
|
|
436
440
|
type: 'item',
|
|
@@ -454,7 +458,7 @@ $72a40b771d6aae35$var$Row.getCollectionNode = function* getCollectionNode(props,
|
|
|
454
458
|
};
|
|
455
459
|
else {
|
|
456
460
|
let cells = [];
|
|
457
|
-
($parcel$interopDefault($
|
|
461
|
+
($parcel$interopDefault($3T1Wc$react)).Children.forEach(children, (cell)=>{
|
|
458
462
|
cells.push({
|
|
459
463
|
type: 'cell',
|
|
460
464
|
element: cell
|
|
@@ -476,16 +480,16 @@ $72a40b771d6aae35$var$Row.getCollectionNode = function* getCollectionNode(props,
|
|
|
476
480
|
* Cells can be statically defined as children, or generated dynamically using a function
|
|
477
481
|
* based on the columns defined in the TableHeader.
|
|
478
482
|
*/ // We don't want getCollectionNode to show up in the type definition
|
|
479
|
-
let $
|
|
483
|
+
let $acd7f2c292e16424$export$b59bdbef9ce70de2 = $acd7f2c292e16424$var$Row;
|
|
480
484
|
|
|
481
485
|
|
|
482
|
-
var $
|
|
486
|
+
var $ea5f941262e5426a$exports = {};
|
|
483
487
|
|
|
484
|
-
$parcel$export($
|
|
485
|
-
function $
|
|
488
|
+
$parcel$export($ea5f941262e5426a$exports, "Cell", () => $ea5f941262e5426a$export$f6f0c3fe4ec306ea);
|
|
489
|
+
function $ea5f941262e5426a$var$Cell(props) {
|
|
486
490
|
return null;
|
|
487
491
|
}
|
|
488
|
-
$
|
|
492
|
+
$ea5f941262e5426a$var$Cell.getCollectionNode = function* getCollectionNode(props) {
|
|
489
493
|
let { children: children } = props;
|
|
490
494
|
let textValue = props.textValue || (typeof children === 'string' ? children : '') || props['aria-label'] || '';
|
|
491
495
|
yield {
|
|
@@ -500,16 +504,16 @@ $c1db2632f7f804b2$var$Cell.getCollectionNode = function* getCollectionNode(props
|
|
|
500
504
|
/**
|
|
501
505
|
* A Cell represents the value of a single Column within a Table Row.
|
|
502
506
|
*/ // We don't want getCollectionNode to show up in the type definition
|
|
503
|
-
let $
|
|
507
|
+
let $ea5f941262e5426a$export$f6f0c3fe4ec306ea = $ea5f941262e5426a$var$Cell;
|
|
504
508
|
|
|
505
509
|
|
|
506
510
|
|
|
507
|
-
$parcel$exportWildcard(module.exports, $
|
|
508
|
-
$parcel$exportWildcard(module.exports, $
|
|
509
|
-
$parcel$exportWildcard(module.exports, $
|
|
510
|
-
$parcel$exportWildcard(module.exports, $
|
|
511
|
-
$parcel$exportWildcard(module.exports, $
|
|
512
|
-
$parcel$exportWildcard(module.exports, $
|
|
511
|
+
$parcel$exportWildcard(module.exports, $e8a04407cfd5f1b5$exports);
|
|
512
|
+
$parcel$exportWildcard(module.exports, $ab69e241adb4db9a$exports);
|
|
513
|
+
$parcel$exportWildcard(module.exports, $5523918a064f3e82$exports);
|
|
514
|
+
$parcel$exportWildcard(module.exports, $7391cc655de6832d$exports);
|
|
515
|
+
$parcel$exportWildcard(module.exports, $acd7f2c292e16424$exports);
|
|
516
|
+
$parcel$exportWildcard(module.exports, $ea5f941262e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AAC,OAAO,CAAC,MAAM,IACzD,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,GAAK,CAAC,CAAC,GAAG,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG;iBAClE,UAAU,CAAC,uBAAuB,KAAK,OAAO,CAAC,uBAAuB,IACtE,UAAU,CAAC,aAAa,KAAK,OAAO,CAAC,aAAa;QACtD,CAAC;IACH,CAAC;AACH,CAAC;AAED,EAIG,AAJH;;;;CAIG,AAJH,EAIG,CACH,EAAoE,AAApE,kEAAoE;AACpE,GAAG,CAAC,yCAAI,GAAG,yBAAG;;;;;;SClEL,0BAAI,CAAC,KAAgB,EAAgB,CAAC;IAC7C,MAAM,CAAC,IAAI;AACb,CAAC;AAED,0BAAI,CAAC,iBAAiB,GAAG,QAAQ,EAAE,iBAAiB,CAAI,KAAgB,EAA6B,CAAC;IACpG,GAAG,CAAC,CAAC,WAAA,QAAQ,EAAA,CAAC,GAAG,KAAK;IAEtB,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC,QAAQ,KAAK,CAAQ,UAAG,QAAQ,GAAG,CAAE,MAAK,KAAK,CAAC,CAAY,gBAAK,CAAE;UACxG,CAAC;QACL,IAAI,EAAE,CAAM;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;mBAClB,SAAS;QACT,CAAY,aAAE,KAAK,CAAC,CAAY;QAChC,aAAa,EAAE,KAAK;IACtB,CAAC;AACH,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,EAAoE,AAApE,kEAAoE;AACpE,GAAG,CAAC,yCAAK,GAAG,0BAAI;;","sources":["packages/@react-stately/table/src/index.ts","packages/@react-stately/table/src/useTableState.ts","packages/@react-stately/table/src/TableCollection.ts","packages/@react-stately/table/src/TableHeader.ts","packages/@react-stately/table/src/TableBody.ts","packages/@react-stately/table/src/Column.ts","packages/@react-stately/table/src/Row.ts","packages/@react-stately/table/src/Cell.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\nexport * from './useTableState';\nexport * from './TableHeader';\nexport * from './TableBody';\nexport * from './Column';\nexport * from './Row';\nexport * from './Cell';\nexport {Section} from '@react-stately/collections';\n","/*\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 {CollectionBase, Node, SelectionMode, Sortable, SortDescriptor, SortDirection} from '@react-types/shared';\nimport {GridState, useGridState} from '@react-stately/grid';\nimport {TableCollection as ITableCollection} from '@react-types/table';\nimport {Key, useMemo} from 'react';\nimport {MultipleSelectionStateProps} from '@react-stately/selection';\nimport {TableCollection} from './TableCollection';\nimport {useCollection} from '@react-stately/collections';\n\nexport interface TableState<T> extends GridState<T, ITableCollection<T>> {\n /** A collection of rows and columns in the table. */\n collection: ITableCollection<T>,\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes: boolean,\n /** The current sorted column and direction. */\n sortDescriptor: SortDescriptor,\n /** Calls the provided onSortChange handler with the provided column key and sort direction. */\n sort(columnKey: Key): void\n}\n\nexport interface CollectionBuilderContext<T> {\n showSelectionCheckboxes: boolean,\n selectionMode: SelectionMode,\n columns: Node<T>[]\n}\n\nexport interface TableStateProps<T> extends CollectionBase<T>, MultipleSelectionStateProps, Sortable {\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes?: boolean\n}\n\nconst OPPOSITE_SORT_DIRECTION = {\n ascending: 'descending' as SortDirection,\n descending: 'ascending' as SortDirection\n};\n\n/**\n * Provides state management for a table component. Handles building a collection\n * of columns and rows from props. In addition, it tracks row selection and manages sort order changes.\n */\nexport function useTableState<T extends object>(props: TableStateProps<T>): TableState<T> {\n let {selectionMode = 'none'} = props;\n\n let context = useMemo(() => ({\n showSelectionCheckboxes: props.showSelectionCheckboxes && selectionMode !== 'none',\n selectionMode,\n columns: []\n }), [props.children, props.showSelectionCheckboxes, selectionMode]);\n\n let collection = useCollection<T, TableCollection<T>>(\n props,\n (nodes, prev) => new TableCollection(nodes, prev, context),\n context\n );\n let {disabledKeys, selectionManager} = useGridState({...props, collection});\n\n return {\n collection,\n disabledKeys,\n selectionManager,\n showSelectionCheckboxes: props.showSelectionCheckboxes || false,\n sortDescriptor: props.sortDescriptor,\n sort(columnKey: Key) {\n props.onSortChange({\n column: columnKey,\n direction: props.sortDescriptor?.column === columnKey\n ? OPPOSITE_SORT_DIRECTION[props.sortDescriptor.direction]\n : 'ascending'\n });\n }\n };\n}\n","/*\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 */\nimport {GridCollection} from '@react-stately/grid';\nimport {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\ninterface GridCollectionOptions {\n showSelectionCheckboxes?: boolean\n}\n\nconst ROW_HEADER_COLUMN_KEY = 'row-header-column-' + Math.random().toString(36).slice(2);\n\nfunction buildHeaderRows<T>(keyMap: Map<Key, GridNode<T>>, columnNodes: GridNode<T>[]): GridNode<T>[] {\n let columns = [];\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\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 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 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.index = 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> {\n headerRows: GridNode<T>[];\n columns: GridNode<T>[];\n rowHeaderColumnKeys: Set<Key>;\n body: GridNode<T>;\n\n constructor(nodes: Iterable<GridNode<T>>, prev?: TableCollection<T>, opts?: GridCollectionOptions) {\n let rowHeaderColumnKeys: Set<Key> = new Set();\n let body: GridNode<T>;\n let columns = [];\n\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: 0,\n hasChildNodes: false,\n rendered: null,\n childNodes: [],\n props: {\n isSelectionCell: 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 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\n // Default row header column to the first one.\n if (this.rowHeaderColumnKeys.size === 0) {\n this.rowHeaderColumnKeys.add(this.columns[opts?.showSelectionCheckboxes ? 1 : 0].key);\n }\n }\n\n *[Symbol.iterator]() {\n yield* this.body.childNodes;\n }\n\n get size() {\n return [...this.body.childNodes].length;\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 [...this.body.childNodes][0]?.key;\n }\n\n getLastKey() {\n let rows = [...this.body.childNodes];\n return rows[rows.length - 1]?.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","/*\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, {ReactElement} from 'react';\nimport {TableHeaderProps} from '@react-types/table';\n\nfunction TableHeader<T>(props: TableHeaderProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nTableHeader.getCollectionNode = function* getCollectionNode<T>(props: TableHeaderProps<T>): Generator<PartialNode<T>, void, any> {\n let {children, columns} = props;\n if (typeof children === 'function') {\n if (!columns) {\n throw new Error('props.children was a function but props.columns is missing');\n }\n\n for (let column of columns) {\n yield {\n type: 'column',\n value: column,\n renderer: children\n };\n }\n } else {\n let columns: PartialNode<T>[] = [];\n React.Children.forEach(children, column => {\n columns.push({\n type: 'column',\n element: column\n });\n });\n\n yield* columns;\n }\n};\n\n/**\n * A TableHeader is a container for the Column elements in a Table. Columns can be statically defined\n * as children, or generated dynamically using a function based on the data passed to the `columns` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _TableHeader = TableHeader as <T>(props: TableHeaderProps<T>) => JSX.Element;\nexport {_TableHeader as TableHeader};\n","/*\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, {ReactElement} from 'react';\nimport {TableBodyProps} from '@react-types/table';\n\nfunction TableBody<T>(props: TableBodyProps<T>): ReactElement { // 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","/*\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, {ReactElement} from 'react';\n\nfunction Column<T>(props: ColumnProps<T>): ReactElement { // 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","/*\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, {ReactElement} from 'react';\nimport {RowProps} from '@react-types/table';\n\nfunction Row(props: RowProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nRow.getCollectionNode = function* getCollectionNode<T>(props: RowProps, context: CollectionBuilderContext<T>): Generator<PartialNode<T>> {\n let {children, textValue} = 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.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 } else {\n let cells: PartialNode<T>[] = [];\n React.Children.forEach(children, cell => {\n cells.push({\n type: 'cell',\n element: cell\n });\n });\n\n if (cells.length !== context.columns.length) {\n throw new Error(`Cell count must match column count. Found ${cells.length} cells and ${context.columns.length} columns.`);\n }\n\n yield* cells;\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.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 (props: RowProps) => JSX.Element;\nexport {_Row as Row};\n","/*\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 {CellProps} from '@react-types/table';\nimport {PartialNode} from '@react-stately/collections';\nimport {ReactElement} from 'react';\n\nfunction Cell(props: CellProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nCell.getCollectionNode = function* getCollectionNode<T>(props: CellProps): Generator<PartialNode<T>> {\n let {children} = props;\n\n let textValue = props.textValue || (typeof children === 'string' ? children : '') || props['aria-label'] || '';\n yield {\n type: 'cell',\n props: props,\n rendered: children,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: false\n };\n};\n\n/**\n * A Cell represents the value of a single Column within a Table Row.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Cell = Cell as (props: CellProps) => JSX.Element;\nexport {_Cell as Cell};\n"],"names":[],"version":3,"file":"main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEmBA,KAAK,CAAC,2CAAqB,GAAG,CAAoB,sBAAG,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAE9E,qCAAe,CAAI,MAA6B,EAAE,WAA0B,EAAiB,CAAC;IACrG,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC;IAChB,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG;IAClB,GAAG,EAAE,GAAG,CAAC,MAAM,IAAI,WAAW,CAAE,CAAC;QAC/B,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS;QAChC,GAAG,CAAC,GAAG,GAAG,CAAC;YAAA,MAAM;QAAA,CAAC;cAEX,SAAS,CAAE,CAAC;YACjB,GAAG,CAAC,MAAM,GAAgB,MAAM,CAAC,GAAG,CAAC,SAAS;YAE9C,EAAuD,AAAvD,qDAAuD;YACvD,EAA0D,AAA1D,wDAA0D;YAC1D,EAA6D,AAA7D,2DAA6D;YAC7D,EAAgE,AAAhE,8DAAgE;YAChE,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC;gBACrB,MAAM,CAAC,OAAO;gBAEd,GAAG,CAAC,CAAC,SAAA,MAAM,UAAE,KAAK,EAAA,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM;gBACrC,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,MAAM,EACpB,KAAK;gBAGP,GAAG,CAAE,GAAG,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GACnC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,E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,KAAK,CAAQ,UAAG,QAAQ,GAAG,CAAE,MAAK,KAAK,CAAC,CAAY,gBAAK,CAAE;UACxG,CAAC;QACL,IAAI,EAAE,CAAM;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;mBAClB,SAAS;QACT,CAAY,aAAE,KAAK,CAAC,CAAY;QAChC,aAAa,EAAE,KAAK;IACtB,CAAC;AACH,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,EAAoE,AAApE,kEAAoE;AACpE,GAAG,CAAC,yCAAK,GAAG,0BAAI;;","sources":["packages/@react-stately/table/src/index.ts","packages/@react-stately/table/src/useTableState.ts","packages/@react-stately/table/src/TableCollection.ts","packages/@react-stately/table/src/TableHeader.ts","packages/@react-stately/table/src/TableBody.ts","packages/@react-stately/table/src/Column.ts","packages/@react-stately/table/src/Row.ts","packages/@react-stately/table/src/Cell.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\nexport * from './useTableState';\nexport * from './TableHeader';\nexport * from './TableBody';\nexport * from './Column';\nexport * from './Row';\nexport * from './Cell';\nexport {Section} from '@react-stately/collections';\n","/*\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 {CollectionBase, Node, SelectionMode, Sortable, SortDescriptor, SortDirection} from '@react-types/shared';\nimport {GridState, useGridState} from '@react-stately/grid';\nimport {TableCollection as ITableCollection} from '@react-types/table';\nimport {Key, useMemo} from 'react';\nimport {MultipleSelectionStateProps} from '@react-stately/selection';\nimport {TableCollection} from './TableCollection';\nimport {useCollection} from '@react-stately/collections';\n\nexport interface TableState<T> extends GridState<T, ITableCollection<T>> {\n /** A collection of rows and columns in the table. */\n collection: ITableCollection<T>,\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes: boolean,\n /** The current sorted column and direction. */\n sortDescriptor: SortDescriptor,\n /** Calls the provided onSortChange handler with the provided column key and sort direction. */\n sort(columnKey: Key): void\n}\n\nexport interface CollectionBuilderContext<T> {\n showSelectionCheckboxes: boolean,\n selectionMode: SelectionMode,\n columns: Node<T>[]\n}\n\nexport interface TableStateProps<T> extends CollectionBase<T>, MultipleSelectionStateProps, Sortable {\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes?: boolean\n}\n\nconst OPPOSITE_SORT_DIRECTION = {\n ascending: 'descending' as SortDirection,\n descending: 'ascending' as SortDirection\n};\n\n/**\n * Provides state management for a table component. Handles building a collection\n * of columns and rows from props. In addition, it tracks row selection and manages sort order changes.\n */\nexport function useTableState<T extends object>(props: TableStateProps<T>): TableState<T> {\n let {selectionMode = 'none'} = props;\n\n let context = useMemo(() => ({\n showSelectionCheckboxes: props.showSelectionCheckboxes && selectionMode !== 'none',\n selectionMode,\n columns: []\n }), [props.children, props.showSelectionCheckboxes, selectionMode]);\n\n let collection = useCollection<T, TableCollection<T>>(\n props,\n (nodes, prev) => new TableCollection(nodes, prev, context),\n context\n );\n let {disabledKeys, selectionManager} = useGridState({...props, collection});\n\n return {\n collection,\n disabledKeys,\n selectionManager,\n showSelectionCheckboxes: props.showSelectionCheckboxes || false,\n sortDescriptor: props.sortDescriptor,\n sort(columnKey: Key) {\n props.onSortChange({\n column: columnKey,\n direction: props.sortDescriptor?.column === columnKey\n ? OPPOSITE_SORT_DIRECTION[props.sortDescriptor.direction]\n : 'ascending'\n });\n }\n };\n}\n","/*\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 */\nimport {GridCollection} from '@react-stately/grid';\nimport {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\ninterface GridCollectionOptions {\n showSelectionCheckboxes?: boolean\n}\n\nconst ROW_HEADER_COLUMN_KEY = 'row-header-column-' + Math.random().toString(36).slice(2);\n\nfunction buildHeaderRows<T>(keyMap: Map<Key, GridNode<T>>, columnNodes: GridNode<T>[]): GridNode<T>[] {\n let columns = [];\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\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 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 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.index = 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> {\n headerRows: GridNode<T>[];\n columns: GridNode<T>[];\n rowHeaderColumnKeys: Set<Key>;\n body: GridNode<T>;\n\n constructor(nodes: Iterable<GridNode<T>>, prev?: TableCollection<T>, opts?: GridCollectionOptions) {\n let rowHeaderColumnKeys: Set<Key> = new Set();\n let body: GridNode<T>;\n let columns = [];\n\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: 0,\n hasChildNodes: false,\n rendered: null,\n childNodes: [],\n props: {\n isSelectionCell: 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 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\n // Default row header column to the first one.\n if (this.rowHeaderColumnKeys.size === 0) {\n this.rowHeaderColumnKeys.add(this.columns[opts?.showSelectionCheckboxes ? 1 : 0].key);\n }\n }\n\n *[Symbol.iterator]() {\n yield* this.body.childNodes;\n }\n\n get size() {\n return [...this.body.childNodes].length;\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 [...this.body.childNodes][0]?.key;\n }\n\n getLastKey() {\n let rows = [...this.body.childNodes];\n return rows[rows.length - 1]?.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","/*\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, {ReactElement} from 'react';\nimport {TableHeaderProps} from '@react-types/table';\n\nfunction TableHeader<T>(props: TableHeaderProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nTableHeader.getCollectionNode = function* getCollectionNode<T>(props: TableHeaderProps<T>): Generator<PartialNode<T>, void, any> {\n let {children, columns} = props;\n if (typeof children === 'function') {\n if (!columns) {\n throw new Error('props.children was a function but props.columns is missing');\n }\n\n for (let column of columns) {\n yield {\n type: 'column',\n value: column,\n renderer: children\n };\n }\n } else {\n let columns: PartialNode<T>[] = [];\n React.Children.forEach(children, column => {\n columns.push({\n type: 'column',\n element: column\n });\n });\n\n yield* columns;\n }\n};\n\n/**\n * A TableHeader is a container for the Column elements in a Table. Columns can be statically defined\n * as children, or generated dynamically using a function based on the data passed to the `columns` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _TableHeader = TableHeader as <T>(props: TableHeaderProps<T>) => JSX.Element;\nexport {_TableHeader as TableHeader};\n","/*\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, {ReactElement} from 'react';\nimport {TableBodyProps} from '@react-types/table';\n\nfunction TableBody<T>(props: TableBodyProps<T>): ReactElement { // 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","/*\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, {ReactElement} from 'react';\n\nfunction Column<T>(props: ColumnProps<T>): ReactElement { // 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","/*\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, {ReactElement} from 'react';\nimport {RowProps} from '@react-types/table';\n\nfunction Row(props: RowProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nRow.getCollectionNode = function* getCollectionNode<T>(props: RowProps, context: CollectionBuilderContext<T>): Generator<PartialNode<T>> {\n let {children, textValue} = 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.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 } else {\n let cells: PartialNode<T>[] = [];\n React.Children.forEach(children, cell => {\n cells.push({\n type: 'cell',\n element: cell\n });\n });\n\n if (cells.length !== context.columns.length) {\n throw new Error(`Cell count must match column count. Found ${cells.length} cells and ${context.columns.length} columns.`);\n }\n\n yield* cells;\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.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 (props: RowProps) => JSX.Element;\nexport {_Row as Row};\n","/*\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 {CellProps} from '@react-types/table';\nimport {PartialNode} from '@react-stately/collections';\nimport {ReactElement} from 'react';\n\nfunction Cell(props: CellProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nCell.getCollectionNode = function* getCollectionNode<T>(props: CellProps): Generator<PartialNode<T>> {\n let {children} = props;\n\n let textValue = props.textValue || (typeof children === 'string' ? children : '') || props['aria-label'] || '';\n yield {\n type: 'cell',\n props: props,\n rendered: children,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: false\n };\n};\n\n/**\n * A Cell represents the value of a single Column within a Table Row.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Cell = Cell as (props: CellProps) => JSX.Element;\nexport {_Cell as Cell};\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {Section as $
|
|
2
|
-
import {useGridState as $
|
|
3
|
-
import $
|
|
1
|
+
import {Section as $d9194dbb8d71f3c7$re_export$Section, useCollection as $lqH1y$useCollection} from "@react-stately/collections";
|
|
2
|
+
import {useGridState as $lqH1y$useGridState, GridCollection as $lqH1y$GridCollection} from "@react-stately/grid";
|
|
3
|
+
import $lqH1y$react, {useMemo as $lqH1y$useMemo} from "react";
|
|
4
4
|
|
|
5
5
|
function $parcel$export(e, n, v, s) {
|
|
6
6
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
7
7
|
}
|
|
8
|
-
var $
|
|
8
|
+
var $faf2b44c080fba5d$exports = {};
|
|
9
9
|
|
|
10
|
-
$parcel$export($
|
|
10
|
+
$parcel$export($faf2b44c080fba5d$exports, "useTableState", () => $faf2b44c080fba5d$export$907bcc6c48325fd6);
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
const $
|
|
15
|
-
function $
|
|
14
|
+
const $52fd3153b80928bf$var$ROW_HEADER_COLUMN_KEY = 'row-header-column-' + Math.random().toString(36).slice(2);
|
|
15
|
+
function $52fd3153b80928bf$var$buildHeaderRows(keyMap, columnNodes) {
|
|
16
16
|
let columns = [];
|
|
17
17
|
let seen = new Map();
|
|
18
18
|
for (let column of columnNodes){
|
|
@@ -129,16 +129,58 @@ function $1ca231328db2f66a$var$buildHeaderRows(keyMap, columnNodes) {
|
|
|
129
129
|
return row;
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
|
|
132
|
+
var tmp = Symbol.iterator;
|
|
133
|
+
class $52fd3153b80928bf$export$596e1b2e2cf93690 extends $lqH1y$GridCollection {
|
|
134
|
+
*[tmp]() {
|
|
135
|
+
yield* this.body.childNodes;
|
|
136
|
+
}
|
|
137
|
+
get size() {
|
|
138
|
+
return [
|
|
139
|
+
...this.body.childNodes
|
|
140
|
+
].length;
|
|
141
|
+
}
|
|
142
|
+
getKeys() {
|
|
143
|
+
return this.keyMap.keys();
|
|
144
|
+
}
|
|
145
|
+
getKeyBefore(key) {
|
|
146
|
+
let node = this.keyMap.get(key);
|
|
147
|
+
return node ? node.prevKey : null;
|
|
148
|
+
}
|
|
149
|
+
getKeyAfter(key) {
|
|
150
|
+
let node = this.keyMap.get(key);
|
|
151
|
+
return node ? node.nextKey : null;
|
|
152
|
+
}
|
|
153
|
+
getFirstKey() {
|
|
154
|
+
var ref;
|
|
155
|
+
return (ref = [
|
|
156
|
+
...this.body.childNodes
|
|
157
|
+
][0]) === null || ref === void 0 ? void 0 : ref.key;
|
|
158
|
+
}
|
|
159
|
+
getLastKey() {
|
|
160
|
+
var ref;
|
|
161
|
+
let rows = [
|
|
162
|
+
...this.body.childNodes
|
|
163
|
+
];
|
|
164
|
+
return (ref = rows[rows.length - 1]) === null || ref === void 0 ? void 0 : ref.key;
|
|
165
|
+
}
|
|
166
|
+
getItem(key) {
|
|
167
|
+
return this.keyMap.get(key);
|
|
168
|
+
}
|
|
169
|
+
at(idx) {
|
|
170
|
+
const keys = [
|
|
171
|
+
...this.getKeys()
|
|
172
|
+
];
|
|
173
|
+
return this.getItem(keys[idx]);
|
|
174
|
+
}
|
|
133
175
|
constructor(nodes, prev, opts){
|
|
134
176
|
let rowHeaderColumnKeys = new Set();
|
|
135
177
|
let body;
|
|
136
178
|
let columns = [];
|
|
137
179
|
// Add cell for selection checkboxes if needed.
|
|
138
|
-
if (opts
|
|
180
|
+
if (opts === null || opts === void 0 ? void 0 : opts.showSelectionCheckboxes) {
|
|
139
181
|
let rowHeaderColumn = {
|
|
140
182
|
type: 'column',
|
|
141
|
-
key: $
|
|
183
|
+
key: $52fd3153b80928bf$var$ROW_HEADER_COLUMN_KEY,
|
|
142
184
|
value: null,
|
|
143
185
|
textValue: '',
|
|
144
186
|
level: 0,
|
|
@@ -173,7 +215,7 @@ class $1ca231328db2f66a$export$596e1b2e2cf93690 extends $85LnJ$GridCollection {
|
|
|
173
215
|
for (let child of node.childNodes)visit(child);
|
|
174
216
|
};
|
|
175
217
|
for (let node1 of nodes)visit(node1);
|
|
176
|
-
let headerRows = $
|
|
218
|
+
let headerRows = $52fd3153b80928bf$var$buildHeaderRows(columnKeyMap, columns);
|
|
177
219
|
headerRows.forEach((row, i)=>rows.splice(i, 0, row)
|
|
178
220
|
);
|
|
179
221
|
super({
|
|
@@ -189,58 +231,19 @@ class $1ca231328db2f66a$export$596e1b2e2cf93690 extends $85LnJ$GridCollection {
|
|
|
189
231
|
this.body = body;
|
|
190
232
|
this.headerRows = headerRows;
|
|
191
233
|
// Default row header column to the first one.
|
|
192
|
-
if (this.rowHeaderColumnKeys.size === 0) this.rowHeaderColumnKeys.add(this.columns[opts
|
|
193
|
-
}
|
|
194
|
-
*[Symbol.iterator]() {
|
|
195
|
-
yield* this.body.childNodes;
|
|
196
|
-
}
|
|
197
|
-
get size() {
|
|
198
|
-
return [
|
|
199
|
-
...this.body.childNodes
|
|
200
|
-
].length;
|
|
201
|
-
}
|
|
202
|
-
getKeys() {
|
|
203
|
-
return this.keyMap.keys();
|
|
204
|
-
}
|
|
205
|
-
getKeyBefore(key) {
|
|
206
|
-
let node = this.keyMap.get(key);
|
|
207
|
-
return node ? node.prevKey : null;
|
|
208
|
-
}
|
|
209
|
-
getKeyAfter(key) {
|
|
210
|
-
let node = this.keyMap.get(key);
|
|
211
|
-
return node ? node.nextKey : null;
|
|
212
|
-
}
|
|
213
|
-
getFirstKey() {
|
|
214
|
-
return [
|
|
215
|
-
...this.body.childNodes
|
|
216
|
-
][0]?.key;
|
|
217
|
-
}
|
|
218
|
-
getLastKey() {
|
|
219
|
-
let rows = [
|
|
220
|
-
...this.body.childNodes
|
|
221
|
-
];
|
|
222
|
-
return rows[rows.length - 1]?.key;
|
|
223
|
-
}
|
|
224
|
-
getItem(key) {
|
|
225
|
-
return this.keyMap.get(key);
|
|
226
|
-
}
|
|
227
|
-
at(idx) {
|
|
228
|
-
const keys = [
|
|
229
|
-
...this.getKeys()
|
|
230
|
-
];
|
|
231
|
-
return this.getItem(keys[idx]);
|
|
234
|
+
if (this.rowHeaderColumnKeys.size === 0) this.rowHeaderColumnKeys.add(this.columns[(opts === null || opts === void 0 ? void 0 : opts.showSelectionCheckboxes) ? 1 : 0].key);
|
|
232
235
|
}
|
|
233
236
|
}
|
|
234
237
|
|
|
235
238
|
|
|
236
239
|
|
|
237
|
-
const $
|
|
240
|
+
const $faf2b44c080fba5d$var$OPPOSITE_SORT_DIRECTION = {
|
|
238
241
|
ascending: 'descending',
|
|
239
242
|
descending: 'ascending'
|
|
240
243
|
};
|
|
241
|
-
function $
|
|
244
|
+
function $faf2b44c080fba5d$export$907bcc6c48325fd6(props) {
|
|
242
245
|
let { selectionMode: selectionMode = 'none' } = props;
|
|
243
|
-
let context = $
|
|
246
|
+
let context = $lqH1y$useMemo(()=>({
|
|
244
247
|
showSelectionCheckboxes: props.showSelectionCheckboxes && selectionMode !== 'none',
|
|
245
248
|
selectionMode: selectionMode,
|
|
246
249
|
columns: []
|
|
@@ -250,9 +253,9 @@ function $494692f36da31136$export$907bcc6c48325fd6(props) {
|
|
|
250
253
|
props.showSelectionCheckboxes,
|
|
251
254
|
selectionMode
|
|
252
255
|
]);
|
|
253
|
-
let collection = $
|
|
256
|
+
let collection = $lqH1y$useCollection(props, (nodes, prev)=>new $52fd3153b80928bf$export$596e1b2e2cf93690(nodes, prev, context)
|
|
254
257
|
, context);
|
|
255
|
-
let { disabledKeys: disabledKeys , selectionManager: selectionManager } = $
|
|
258
|
+
let { disabledKeys: disabledKeys , selectionManager: selectionManager } = $lqH1y$useGridState({
|
|
256
259
|
...props,
|
|
257
260
|
collection: collection
|
|
258
261
|
});
|
|
@@ -263,23 +266,24 @@ function $494692f36da31136$export$907bcc6c48325fd6(props) {
|
|
|
263
266
|
showSelectionCheckboxes: props.showSelectionCheckboxes || false,
|
|
264
267
|
sortDescriptor: props.sortDescriptor,
|
|
265
268
|
sort (columnKey) {
|
|
269
|
+
var ref;
|
|
266
270
|
props.onSortChange({
|
|
267
271
|
column: columnKey,
|
|
268
|
-
direction: props.sortDescriptor
|
|
272
|
+
direction: ((ref = props.sortDescriptor) === null || ref === void 0 ? void 0 : ref.column) === columnKey ? $faf2b44c080fba5d$var$OPPOSITE_SORT_DIRECTION[props.sortDescriptor.direction] : 'ascending'
|
|
269
273
|
});
|
|
270
274
|
}
|
|
271
275
|
};
|
|
272
276
|
}
|
|
273
277
|
|
|
274
278
|
|
|
275
|
-
var $
|
|
279
|
+
var $c66ef8364f10cc32$exports = {};
|
|
276
280
|
|
|
277
|
-
$parcel$export($
|
|
281
|
+
$parcel$export($c66ef8364f10cc32$exports, "TableHeader", () => $c66ef8364f10cc32$export$f850895b287ef28e);
|
|
278
282
|
|
|
279
|
-
function $
|
|
283
|
+
function $c66ef8364f10cc32$var$TableHeader(props) {
|
|
280
284
|
return null;
|
|
281
285
|
}
|
|
282
|
-
$
|
|
286
|
+
$c66ef8364f10cc32$var$TableHeader.getCollectionNode = function* getCollectionNode(props) {
|
|
283
287
|
let { children: children , columns: columns } = props;
|
|
284
288
|
if (typeof children === 'function') {
|
|
285
289
|
if (!columns) throw new Error('props.children was a function but props.columns is missing');
|
|
@@ -290,7 +294,7 @@ $3657764c2db588d6$var$TableHeader.getCollectionNode = function* getCollectionNod
|
|
|
290
294
|
};
|
|
291
295
|
} else {
|
|
292
296
|
let columns = [];
|
|
293
|
-
$
|
|
297
|
+
$lqH1y$react.Children.forEach(children, (column)=>{
|
|
294
298
|
columns.push({
|
|
295
299
|
type: 'column',
|
|
296
300
|
element: column
|
|
@@ -303,17 +307,17 @@ $3657764c2db588d6$var$TableHeader.getCollectionNode = function* getCollectionNod
|
|
|
303
307
|
* A TableHeader is a container for the Column elements in a Table. Columns can be statically defined
|
|
304
308
|
* as children, or generated dynamically using a function based on the data passed to the `columns` prop.
|
|
305
309
|
*/ // We don't want getCollectionNode to show up in the type definition
|
|
306
|
-
let $
|
|
310
|
+
let $c66ef8364f10cc32$export$f850895b287ef28e = $c66ef8364f10cc32$var$TableHeader;
|
|
307
311
|
|
|
308
312
|
|
|
309
|
-
var $
|
|
313
|
+
var $6616af99b4843f0d$exports = {};
|
|
310
314
|
|
|
311
|
-
$parcel$export($
|
|
315
|
+
$parcel$export($6616af99b4843f0d$exports, "TableBody", () => $6616af99b4843f0d$export$76ccd210b9029917);
|
|
312
316
|
|
|
313
|
-
function $
|
|
317
|
+
function $6616af99b4843f0d$var$TableBody(props) {
|
|
314
318
|
return null;
|
|
315
319
|
}
|
|
316
|
-
$
|
|
320
|
+
$6616af99b4843f0d$var$TableBody.getCollectionNode = function* getCollectionNode(props) {
|
|
317
321
|
let { children: children , items: items1 } = props;
|
|
318
322
|
yield {
|
|
319
323
|
type: 'body',
|
|
@@ -329,7 +333,7 @@ $99858a7515d0e6da$var$TableBody.getCollectionNode = function* getCollectionNode(
|
|
|
329
333
|
};
|
|
330
334
|
} else {
|
|
331
335
|
let items = [];
|
|
332
|
-
$
|
|
336
|
+
$lqH1y$react.Children.forEach(children, (item)=>{
|
|
333
337
|
items.push({
|
|
334
338
|
type: 'item',
|
|
335
339
|
element: item
|
|
@@ -344,23 +348,23 @@ $99858a7515d0e6da$var$TableBody.getCollectionNode = function* getCollectionNode(
|
|
|
344
348
|
* A TableBody is a container for the Row elements of a Table. Rows can be statically defined
|
|
345
349
|
* as children, or generated dynamically using a function based on the data passed to the `items` prop.
|
|
346
350
|
*/ // We don't want getCollectionNode to show up in the type definition
|
|
347
|
-
let $
|
|
351
|
+
let $6616af99b4843f0d$export$76ccd210b9029917 = $6616af99b4843f0d$var$TableBody;
|
|
348
352
|
|
|
349
353
|
|
|
350
|
-
var $
|
|
354
|
+
var $ea4ade809d4abb07$exports = {};
|
|
351
355
|
|
|
352
|
-
$parcel$export($
|
|
356
|
+
$parcel$export($ea4ade809d4abb07$exports, "Column", () => $ea4ade809d4abb07$export$816b5d811295e6bc);
|
|
353
357
|
|
|
354
|
-
function $
|
|
358
|
+
function $ea4ade809d4abb07$var$Column(props) {
|
|
355
359
|
return null;
|
|
356
360
|
}
|
|
357
|
-
$
|
|
361
|
+
$ea4ade809d4abb07$var$Column.getCollectionNode = function* getCollectionNode(props, context1) {
|
|
358
362
|
let { title: title , children: children , childColumns: childColumns1 } = props;
|
|
359
363
|
let rendered = title || children;
|
|
360
364
|
let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'];
|
|
361
365
|
let fullNodes = yield {
|
|
362
366
|
type: 'column',
|
|
363
|
-
hasChildNodes: !!childColumns1 || title && $
|
|
367
|
+
hasChildNodes: !!childColumns1 || title && $lqH1y$react.Children.count(children) > 0,
|
|
364
368
|
rendered: rendered,
|
|
365
369
|
textValue: textValue,
|
|
366
370
|
props: props,
|
|
@@ -371,7 +375,7 @@ $687413af9bbb06c5$var$Column.getCollectionNode = function* getCollectionNode(pro
|
|
|
371
375
|
};
|
|
372
376
|
else if (title) {
|
|
373
377
|
let childColumns = [];
|
|
374
|
-
$
|
|
378
|
+
$lqH1y$react.Children.forEach(children, (child)=>{
|
|
375
379
|
childColumns.push({
|
|
376
380
|
type: 'column',
|
|
377
381
|
element: child
|
|
@@ -399,17 +403,17 @@ $687413af9bbb06c5$var$Column.getCollectionNode = function* getCollectionNode(pro
|
|
|
399
403
|
* Column elements to represent column groups. Nested columns can be statically defined as
|
|
400
404
|
* children, or dynamically generated using a function based on the `childColumns` prop.
|
|
401
405
|
*/ // We don't want getCollectionNode to show up in the type definition
|
|
402
|
-
let $
|
|
406
|
+
let $ea4ade809d4abb07$export$816b5d811295e6bc = $ea4ade809d4abb07$var$Column;
|
|
403
407
|
|
|
404
408
|
|
|
405
|
-
var $
|
|
409
|
+
var $e2dc941fd2e6f314$exports = {};
|
|
406
410
|
|
|
407
|
-
$parcel$export($
|
|
411
|
+
$parcel$export($e2dc941fd2e6f314$exports, "Row", () => $e2dc941fd2e6f314$export$b59bdbef9ce70de2);
|
|
408
412
|
|
|
409
|
-
function $
|
|
413
|
+
function $e2dc941fd2e6f314$var$Row(props) {
|
|
410
414
|
return null;
|
|
411
415
|
}
|
|
412
|
-
$
|
|
416
|
+
$e2dc941fd2e6f314$var$Row.getCollectionNode = function* getCollectionNode(props, context) {
|
|
413
417
|
let { children: children , textValue: textValue } = props;
|
|
414
418
|
yield {
|
|
415
419
|
type: 'item',
|
|
@@ -433,7 +437,7 @@ $f711e0e1fe2dac16$var$Row.getCollectionNode = function* getCollectionNode(props,
|
|
|
433
437
|
};
|
|
434
438
|
else {
|
|
435
439
|
let cells = [];
|
|
436
|
-
$
|
|
440
|
+
$lqH1y$react.Children.forEach(children, (cell)=>{
|
|
437
441
|
cells.push({
|
|
438
442
|
type: 'cell',
|
|
439
443
|
element: cell
|
|
@@ -455,16 +459,16 @@ $f711e0e1fe2dac16$var$Row.getCollectionNode = function* getCollectionNode(props,
|
|
|
455
459
|
* Cells can be statically defined as children, or generated dynamically using a function
|
|
456
460
|
* based on the columns defined in the TableHeader.
|
|
457
461
|
*/ // We don't want getCollectionNode to show up in the type definition
|
|
458
|
-
let $
|
|
462
|
+
let $e2dc941fd2e6f314$export$b59bdbef9ce70de2 = $e2dc941fd2e6f314$var$Row;
|
|
459
463
|
|
|
460
464
|
|
|
461
|
-
var $
|
|
465
|
+
var $d002254cbf65adb0$exports = {};
|
|
462
466
|
|
|
463
|
-
$parcel$export($
|
|
464
|
-
function $
|
|
467
|
+
$parcel$export($d002254cbf65adb0$exports, "Cell", () => $d002254cbf65adb0$export$f6f0c3fe4ec306ea);
|
|
468
|
+
function $d002254cbf65adb0$var$Cell(props) {
|
|
465
469
|
return null;
|
|
466
470
|
}
|
|
467
|
-
$
|
|
471
|
+
$d002254cbf65adb0$var$Cell.getCollectionNode = function* getCollectionNode(props) {
|
|
468
472
|
let { children: children } = props;
|
|
469
473
|
let textValue = props.textValue || (typeof children === 'string' ? children : '') || props['aria-label'] || '';
|
|
470
474
|
yield {
|
|
@@ -479,11 +483,11 @@ $7926cbd9620c5dcc$var$Cell.getCollectionNode = function* getCollectionNode(props
|
|
|
479
483
|
/**
|
|
480
484
|
* A Cell represents the value of a single Column within a Table Row.
|
|
481
485
|
*/ // We don't want getCollectionNode to show up in the type definition
|
|
482
|
-
let $
|
|
486
|
+
let $d002254cbf65adb0$export$f6f0c3fe4ec306ea = $d002254cbf65adb0$var$Cell;
|
|
483
487
|
|
|
484
488
|
|
|
485
489
|
|
|
486
490
|
|
|
487
491
|
|
|
488
|
-
export {$
|
|
492
|
+
export {$d9194dbb8d71f3c7$re_export$Section as Section, $faf2b44c080fba5d$export$907bcc6c48325fd6 as useTableState, $c66ef8364f10cc32$export$f850895b287ef28e as TableHeader, $6616af99b4843f0d$export$76ccd210b9029917 as TableBody, $ea4ade809d4abb07$export$816b5d811295e6bc as Column, $e2dc941fd2e6f314$export$b59bdbef9ce70de2 as Row, $d002254cbf65adb0$export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OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,GAAK,CAAC,CAAC,GAAG,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG;iBAClE,UAAU,CAAC,uBAAuB,KAAK,OAAO,CAAC,uBAAuB,IACtE,UAAU,CAAC,aAAa,KAAK,OAAO,CAAC,aAAa;QACtD,CAAC;IACH,CAAC;AACH,CAAC;AAED,EAIG,AAJH;;;;CAIG,AAJH,EAIG,CACH,EAAoE,AAApE,kEAAoE;AACpE,GAAG,CAAC,yCAAI,GAAG,yBAAG;;;;;;SClEL,0BAAI,CAAC,KAAgB,EAAgB,CAAC;IAC7C,MAAM,CAAC,IAAI;AACb,CAAC;AAED,0BAAI,CAAC,iBAAiB,GAAG,QAAQ,EAAE,iBAAiB,CAAI,KAAgB,EAA6B,CAAC;IACpG,GAAG,CAAC,CAAC,WAAA,QAAQ,EAAA,CAAC,GAAG,KAAK;IAEtB,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC,QAAQ,KAAK,CAAQ,UAAG,QAAQ,GAAG,CAAE,MAAK,KAAK,CAAC,CAAY,gBAAK,CAAE;UACxG,CAAC;QACL,IAAI,EAAE,CAAM;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;mBAClB,SAAS;QACT,CAAY,aAAE,KAAK,CAAC,CAAY;QAChC,aAAa,EAAE,KAAK;IACtB,CAAC;AACH,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,EAAoE,AAApE,kEAAoE;AACpE,GAAG,CAAC,yCAAK,GAAG,0BAAI;;","sources":["packages/@react-stately/table/src/index.ts","packages/@react-stately/table/src/useTableState.ts","packages/@react-stately/table/src/TableCollection.ts","packages/@react-stately/table/src/TableHeader.ts","packages/@react-stately/table/src/TableBody.ts","packages/@react-stately/table/src/Column.ts","packages/@react-stately/table/src/Row.ts","packages/@react-stately/table/src/Cell.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\nexport * from './useTableState';\nexport * from './TableHeader';\nexport * from './TableBody';\nexport * from './Column';\nexport * from './Row';\nexport * from './Cell';\nexport {Section} from '@react-stately/collections';\n","/*\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 {CollectionBase, Node, SelectionMode, Sortable, SortDescriptor, SortDirection} from '@react-types/shared';\nimport {GridState, useGridState} from '@react-stately/grid';\nimport {TableCollection as ITableCollection} from '@react-types/table';\nimport {Key, useMemo} from 'react';\nimport {MultipleSelectionStateProps} from '@react-stately/selection';\nimport {TableCollection} from './TableCollection';\nimport {useCollection} from '@react-stately/collections';\n\nexport interface TableState<T> extends GridState<T, ITableCollection<T>> {\n /** A collection of rows and columns in the table. */\n collection: ITableCollection<T>,\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes: boolean,\n /** The current sorted column and direction. */\n sortDescriptor: SortDescriptor,\n /** Calls the provided onSortChange handler with the provided column key and sort direction. */\n sort(columnKey: Key): void\n}\n\nexport interface CollectionBuilderContext<T> {\n showSelectionCheckboxes: boolean,\n selectionMode: SelectionMode,\n columns: Node<T>[]\n}\n\nexport interface TableStateProps<T> extends CollectionBase<T>, MultipleSelectionStateProps, Sortable {\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes?: boolean\n}\n\nconst OPPOSITE_SORT_DIRECTION = {\n ascending: 'descending' as SortDirection,\n descending: 'ascending' as SortDirection\n};\n\n/**\n * Provides state management for a table component. Handles building a collection\n * of columns and rows from props. In addition, it tracks row selection and manages sort order changes.\n */\nexport function useTableState<T extends object>(props: TableStateProps<T>): TableState<T> {\n let {selectionMode = 'none'} = props;\n\n let context = useMemo(() => ({\n showSelectionCheckboxes: props.showSelectionCheckboxes && selectionMode !== 'none',\n selectionMode,\n columns: []\n }), [props.children, props.showSelectionCheckboxes, selectionMode]);\n\n let collection = useCollection<T, TableCollection<T>>(\n props,\n (nodes, prev) => new TableCollection(nodes, prev, context),\n context\n );\n let {disabledKeys, selectionManager} = useGridState({...props, collection});\n\n return {\n collection,\n disabledKeys,\n selectionManager,\n showSelectionCheckboxes: props.showSelectionCheckboxes || false,\n sortDescriptor: props.sortDescriptor,\n sort(columnKey: Key) {\n props.onSortChange({\n column: columnKey,\n direction: props.sortDescriptor?.column === columnKey\n ? OPPOSITE_SORT_DIRECTION[props.sortDescriptor.direction]\n : 'ascending'\n });\n }\n };\n}\n","/*\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 */\nimport {GridCollection} from '@react-stately/grid';\nimport {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\ninterface GridCollectionOptions {\n showSelectionCheckboxes?: boolean\n}\n\nconst ROW_HEADER_COLUMN_KEY = 'row-header-column-' + Math.random().toString(36).slice(2);\n\nfunction buildHeaderRows<T>(keyMap: Map<Key, GridNode<T>>, columnNodes: GridNode<T>[]): GridNode<T>[] {\n let columns = [];\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\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 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 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.index = 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> {\n headerRows: GridNode<T>[];\n columns: GridNode<T>[];\n rowHeaderColumnKeys: Set<Key>;\n body: GridNode<T>;\n\n constructor(nodes: Iterable<GridNode<T>>, prev?: TableCollection<T>, opts?: GridCollectionOptions) {\n let rowHeaderColumnKeys: Set<Key> = new Set();\n let body: GridNode<T>;\n let columns = [];\n\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: 0,\n hasChildNodes: false,\n rendered: null,\n childNodes: [],\n props: {\n isSelectionCell: 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 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\n // Default row header column to the first one.\n if (this.rowHeaderColumnKeys.size === 0) {\n this.rowHeaderColumnKeys.add(this.columns[opts?.showSelectionCheckboxes ? 1 : 0].key);\n }\n }\n\n *[Symbol.iterator]() {\n yield* this.body.childNodes;\n }\n\n get size() {\n return [...this.body.childNodes].length;\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 [...this.body.childNodes][0]?.key;\n }\n\n getLastKey() {\n let rows = [...this.body.childNodes];\n return rows[rows.length - 1]?.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","/*\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, {ReactElement} from 'react';\nimport {TableHeaderProps} from '@react-types/table';\n\nfunction TableHeader<T>(props: TableHeaderProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nTableHeader.getCollectionNode = function* getCollectionNode<T>(props: TableHeaderProps<T>): Generator<PartialNode<T>, void, any> {\n let {children, columns} = props;\n if (typeof children === 'function') {\n if (!columns) {\n throw new Error('props.children was a function but props.columns is missing');\n }\n\n for (let column of columns) {\n yield {\n type: 'column',\n value: column,\n renderer: children\n };\n }\n } else {\n let columns: PartialNode<T>[] = [];\n React.Children.forEach(children, column => {\n columns.push({\n type: 'column',\n element: column\n });\n });\n\n yield* columns;\n }\n};\n\n/**\n * A TableHeader is a container for the Column elements in a Table. Columns can be statically defined\n * as children, or generated dynamically using a function based on the data passed to the `columns` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _TableHeader = TableHeader as <T>(props: TableHeaderProps<T>) => JSX.Element;\nexport {_TableHeader as TableHeader};\n","/*\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, {ReactElement} from 'react';\nimport {TableBodyProps} from '@react-types/table';\n\nfunction TableBody<T>(props: TableBodyProps<T>): ReactElement { // 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","/*\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, {ReactElement} from 'react';\n\nfunction Column<T>(props: ColumnProps<T>): ReactElement { // 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","/*\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, {ReactElement} from 'react';\nimport {RowProps} from '@react-types/table';\n\nfunction Row(props: RowProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nRow.getCollectionNode = function* getCollectionNode<T>(props: RowProps, context: CollectionBuilderContext<T>): Generator<PartialNode<T>> {\n let {children, textValue} = 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.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 } else {\n let cells: PartialNode<T>[] = [];\n React.Children.forEach(children, cell => {\n cells.push({\n type: 'cell',\n element: cell\n });\n });\n\n if (cells.length !== context.columns.length) {\n throw new Error(`Cell count must match column count. Found ${cells.length} cells and ${context.columns.length} columns.`);\n }\n\n yield* cells;\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.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 (props: RowProps) => JSX.Element;\nexport {_Row as Row};\n","/*\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 {CellProps} from '@react-types/table';\nimport {PartialNode} from '@react-stately/collections';\nimport {ReactElement} from 'react';\n\nfunction Cell(props: CellProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nCell.getCollectionNode = function* getCollectionNode<T>(props: CellProps): Generator<PartialNode<T>> {\n let {children} = props;\n\n let textValue = props.textValue || (typeof children === 'string' ? children : '') || props['aria-label'] || '';\n yield {\n type: 'cell',\n props: props,\n rendered: children,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: false\n };\n};\n\n/**\n * A Cell represents the value of a single Column within a Table Row.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Cell = Cell as (props: CellProps) => JSX.Element;\nexport {_Cell as Cell};\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AEmBA,KAAK,CAAC,2CAAqB,GAAG,CAAoB,sBAAG,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAE9E,qCAAe,CAAI,MAA6B,EAAE,WAA0B,EAAiB,CAAC;IACrG,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC;IAChB,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG;IAClB,GAAG,EAAE,GAAG,CAAC,MAAM,IAAI,WAAW,CAAE,CAAC;QAC/B,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS;QAChC,GAAG,CAAC,GAAG,GAAG,CAAC;YAAA,MAAM;QAAA,CAAC;cAEX,SAAS,CAAE,CAAC;YACjB,GAAG,CAAC,MAAM,GAAgB,MAAM,CAAC,GAAG,CAAC,SAAS;YAE9C,EAAuD,AAAvD,qDAAuD;YACvD,EAA0D,AAA1D,wDAA0D;YAC1D,EAA6D,AAA7D,2DAA6D;YAC7D,EAAgE,AAAhE,8DAAgE;YAChE,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC;gBACrB,MAAM,CAAC,OAAO;gBAEd,GAAG,CAAC,CAAC,SAAA,MAAM,UAAE,KAAK,EAAA,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM;gBACrC,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,MAAM,EACpB,KAAK;gBAGP,GAAG,CAAE,GAAG,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GACnC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI;gBAG1B,EAAyB,AAAzB,uBAAyB;gBACzB,GAAG,CAAE,GAAG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AE;UACxG,CAAC;QACL,IAAI,EAAE,CAAM;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;mBAClB,SAAS;QACT,CAAY,aAAE,KAAK,CAAC,CAAY;QAChC,aAAa,EAAE,KAAK;IACtB,CAAC;AACH,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,EAAoE,AAApE,kEAAoE;AACpE,GAAG,CAAC,yCAAK,GAAG,0BAAI;;","sources":["packages/@react-stately/table/src/index.ts","packages/@react-stately/table/src/useTableState.ts","packages/@react-stately/table/src/TableCollection.ts","packages/@react-stately/table/src/TableHeader.ts","packages/@react-stately/table/src/TableBody.ts","packages/@react-stately/table/src/Column.ts","packages/@react-stately/table/src/Row.ts","packages/@react-stately/table/src/Cell.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\nexport * from './useTableState';\nexport * from './TableHeader';\nexport * from './TableBody';\nexport * from './Column';\nexport * from './Row';\nexport * from './Cell';\nexport {Section} from '@react-stately/collections';\n","/*\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 {CollectionBase, Node, SelectionMode, Sortable, SortDescriptor, SortDirection} from '@react-types/shared';\nimport {GridState, useGridState} from '@react-stately/grid';\nimport {TableCollection as ITableCollection} from '@react-types/table';\nimport {Key, useMemo} from 'react';\nimport {MultipleSelectionStateProps} from '@react-stately/selection';\nimport {TableCollection} from './TableCollection';\nimport {useCollection} from '@react-stately/collections';\n\nexport interface TableState<T> extends GridState<T, ITableCollection<T>> {\n /** A collection of rows and columns in the table. */\n collection: ITableCollection<T>,\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes: boolean,\n /** The current sorted column and direction. */\n sortDescriptor: SortDescriptor,\n /** Calls the provided onSortChange handler with the provided column key and sort direction. */\n sort(columnKey: Key): void\n}\n\nexport interface CollectionBuilderContext<T> {\n showSelectionCheckboxes: boolean,\n selectionMode: SelectionMode,\n columns: Node<T>[]\n}\n\nexport interface TableStateProps<T> extends CollectionBase<T>, MultipleSelectionStateProps, Sortable {\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes?: boolean\n}\n\nconst OPPOSITE_SORT_DIRECTION = {\n ascending: 'descending' as SortDirection,\n descending: 'ascending' as SortDirection\n};\n\n/**\n * Provides state management for a table component. Handles building a collection\n * of columns and rows from props. In addition, it tracks row selection and manages sort order changes.\n */\nexport function useTableState<T extends object>(props: TableStateProps<T>): TableState<T> {\n let {selectionMode = 'none'} = props;\n\n let context = useMemo(() => ({\n showSelectionCheckboxes: props.showSelectionCheckboxes && selectionMode !== 'none',\n selectionMode,\n columns: []\n }), [props.children, props.showSelectionCheckboxes, selectionMode]);\n\n let collection = useCollection<T, TableCollection<T>>(\n props,\n (nodes, prev) => new TableCollection(nodes, prev, context),\n context\n );\n let {disabledKeys, selectionManager} = useGridState({...props, collection});\n\n return {\n collection,\n disabledKeys,\n selectionManager,\n showSelectionCheckboxes: props.showSelectionCheckboxes || false,\n sortDescriptor: props.sortDescriptor,\n sort(columnKey: Key) {\n props.onSortChange({\n column: columnKey,\n direction: props.sortDescriptor?.column === columnKey\n ? OPPOSITE_SORT_DIRECTION[props.sortDescriptor.direction]\n : 'ascending'\n });\n }\n };\n}\n","/*\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 */\nimport {GridCollection} from '@react-stately/grid';\nimport {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\ninterface GridCollectionOptions {\n showSelectionCheckboxes?: boolean\n}\n\nconst ROW_HEADER_COLUMN_KEY = 'row-header-column-' + Math.random().toString(36).slice(2);\n\nfunction buildHeaderRows<T>(keyMap: Map<Key, GridNode<T>>, columnNodes: GridNode<T>[]): GridNode<T>[] {\n let columns = [];\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\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 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 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.index = 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> {\n headerRows: GridNode<T>[];\n columns: GridNode<T>[];\n rowHeaderColumnKeys: Set<Key>;\n body: GridNode<T>;\n\n constructor(nodes: Iterable<GridNode<T>>, prev?: TableCollection<T>, opts?: GridCollectionOptions) {\n let rowHeaderColumnKeys: Set<Key> = new Set();\n let body: GridNode<T>;\n let columns = [];\n\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: 0,\n hasChildNodes: false,\n rendered: null,\n childNodes: [],\n props: {\n isSelectionCell: 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 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\n // Default row header column to the first one.\n if (this.rowHeaderColumnKeys.size === 0) {\n this.rowHeaderColumnKeys.add(this.columns[opts?.showSelectionCheckboxes ? 1 : 0].key);\n }\n }\n\n *[Symbol.iterator]() {\n yield* this.body.childNodes;\n }\n\n get size() {\n return [...this.body.childNodes].length;\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 [...this.body.childNodes][0]?.key;\n }\n\n getLastKey() {\n let rows = [...this.body.childNodes];\n return rows[rows.length - 1]?.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","/*\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, {ReactElement} from 'react';\nimport {TableHeaderProps} from '@react-types/table';\n\nfunction TableHeader<T>(props: TableHeaderProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nTableHeader.getCollectionNode = function* getCollectionNode<T>(props: TableHeaderProps<T>): Generator<PartialNode<T>, void, any> {\n let {children, columns} = props;\n if (typeof children === 'function') {\n if (!columns) {\n throw new Error('props.children was a function but props.columns is missing');\n }\n\n for (let column of columns) {\n yield {\n type: 'column',\n value: column,\n renderer: children\n };\n }\n } else {\n let columns: PartialNode<T>[] = [];\n React.Children.forEach(children, column => {\n columns.push({\n type: 'column',\n element: column\n });\n });\n\n yield* columns;\n }\n};\n\n/**\n * A TableHeader is a container for the Column elements in a Table. Columns can be statically defined\n * as children, or generated dynamically using a function based on the data passed to the `columns` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _TableHeader = TableHeader as <T>(props: TableHeaderProps<T>) => JSX.Element;\nexport {_TableHeader as TableHeader};\n","/*\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, {ReactElement} from 'react';\nimport {TableBodyProps} from '@react-types/table';\n\nfunction TableBody<T>(props: TableBodyProps<T>): ReactElement { // 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","/*\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, {ReactElement} from 'react';\n\nfunction Column<T>(props: ColumnProps<T>): ReactElement { // 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","/*\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, {ReactElement} from 'react';\nimport {RowProps} from '@react-types/table';\n\nfunction Row(props: RowProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nRow.getCollectionNode = function* getCollectionNode<T>(props: RowProps, context: CollectionBuilderContext<T>): Generator<PartialNode<T>> {\n let {children, textValue} = 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.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 } else {\n let cells: PartialNode<T>[] = [];\n React.Children.forEach(children, cell => {\n cells.push({\n type: 'cell',\n element: cell\n });\n });\n\n if (cells.length !== context.columns.length) {\n throw new Error(`Cell count must match column count. Found ${cells.length} cells and ${context.columns.length} columns.`);\n }\n\n yield* cells;\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.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 (props: RowProps) => JSX.Element;\nexport {_Row as Row};\n","/*\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 {CellProps} from '@react-types/table';\nimport {PartialNode} from '@react-stately/collections';\nimport {ReactElement} from 'react';\n\nfunction Cell(props: CellProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nCell.getCollectionNode = function* getCollectionNode<T>(props: CellProps): Generator<PartialNode<T>> {\n let {children} = props;\n\n let textValue = props.textValue || (typeof children === 'string' ? children : '') || props['aria-label'] || '';\n yield {\n type: 'cell',\n props: props,\n rendered: children,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: false\n };\n};\n\n/**\n * A Cell represents the value of a single Column within a Table Row.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Cell = Cell as (props: CellProps) => JSX.Element;\nexport {_Cell as Cell};\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-stately/table",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.6.2",
|
|
21
|
-
"@react-stately/collections": "3.
|
|
22
|
-
"@react-stately/grid": "3.1.
|
|
23
|
-
"@react-stately/selection": "3.
|
|
24
|
-
"@react-types/grid": "3.0.
|
|
25
|
-
"@react-types/shared": "3.
|
|
26
|
-
"@react-types/table": "3.1.
|
|
21
|
+
"@react-stately/collections": "^3.3.6",
|
|
22
|
+
"@react-stately/grid": "^3.1.2",
|
|
23
|
+
"@react-stately/selection": "^3.9.2",
|
|
24
|
+
"@react-types/grid": "^3.0.2",
|
|
25
|
+
"@react-types/shared": "^3.11.1",
|
|
26
|
+
"@react-types/table": "^3.1.2"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"react": "^16.8.0 || ^17.0.0-rc.1"
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "404d41859b7d6f56201d7fc01bd9f22ae3512937"
|
|
35
35
|
}
|