@react-stately/collections 3.0.0-alpha.1 → 3.0.0-nightly-4980928d3-240906

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +1 -1
  2. package/dist/CollectionBuilder.main.js +210 -0
  3. package/dist/CollectionBuilder.main.js.map +1 -0
  4. package/dist/CollectionBuilder.mjs +201 -0
  5. package/dist/CollectionBuilder.module.js +201 -0
  6. package/dist/CollectionBuilder.module.js.map +1 -0
  7. package/dist/Item.main.js +68 -0
  8. package/dist/Item.main.js.map +1 -0
  9. package/dist/Item.mjs +59 -0
  10. package/dist/Item.module.js +59 -0
  11. package/dist/Item.module.js.map +1 -0
  12. package/dist/Section.main.js +60 -0
  13. package/dist/Section.main.js.map +1 -0
  14. package/dist/Section.mjs +51 -0
  15. package/dist/Section.module.js +51 -0
  16. package/dist/Section.module.js.map +1 -0
  17. package/dist/getChildNodes.main.js +80 -0
  18. package/dist/getChildNodes.main.js.map +1 -0
  19. package/dist/getChildNodes.mjs +71 -0
  20. package/dist/getChildNodes.module.js +71 -0
  21. package/dist/getChildNodes.module.js.map +1 -0
  22. package/dist/getItemCount.main.js +35 -0
  23. package/dist/getItemCount.main.js.map +1 -0
  24. package/dist/getItemCount.mjs +30 -0
  25. package/dist/getItemCount.module.js +30 -0
  26. package/dist/getItemCount.module.js.map +1 -0
  27. package/dist/import.mjs +27 -0
  28. package/dist/main.js +24 -4427
  29. package/dist/main.js.map +1 -0
  30. package/dist/module.js +9 -2881
  31. package/dist/module.js.map +1 -0
  32. package/dist/types.d.ts +22 -577
  33. package/dist/types.d.ts.map +1 -1
  34. package/dist/useCollection.main.js +44 -0
  35. package/dist/useCollection.main.js.map +1 -0
  36. package/dist/useCollection.mjs +39 -0
  37. package/dist/useCollection.module.js +39 -0
  38. package/dist/useCollection.module.js.map +1 -0
  39. package/package.json +16 -8
  40. package/src/CollectionBuilder.ts +275 -0
  41. package/src/Item.ts +80 -0
  42. package/src/Section.ts +59 -0
  43. package/src/getChildNodes.ts +92 -0
  44. package/src/getItemCount.ts +38 -0
  45. package/src/index.ts +19 -0
  46. package/src/types.ts +31 -0
  47. package/src/useCollection.ts +34 -0
  48. package/LICENSE +0 -201
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-stately/collections/src/index.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 type {PartialNode} from './types';\nexport {Item} from './Item';\nexport {Section} from './Section';\nexport {useCollection} from './useCollection';\nexport {getItemCount} from './getItemCount';\nexport {getChildNodes, getFirstItem, getLastItem, getNthItem, compareNodeOrder} from './getChildNodes';\nexport {CollectionBuilder} from './CollectionBuilder';\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
@@ -1,591 +1,36 @@
1
- import { Key, ReactElement, ReactNode } from "react";
2
- import { ItemProps, ItemRenderer, CollectionBase, CollectionElement, SectionProps, KeyboardDelegate, AsyncListOptions, AsyncListProps } from "@react-types/shared";
3
- export class Point {
4
- /** The x-coordinate of the point */
5
- x: number;
6
- /** The y-coordinate of the point */
7
- y: number;
8
- constructor(x?: number, y?: number);
9
- /**
10
- * Returns a copy of this point
11
- */
12
- copy(): Point;
13
- /**
14
- * Checks if two points are equal
15
- */
16
- equals(point: Point): boolean;
17
- /**
18
- * Returns true if this point is the origin
19
- */
20
- isOrigin(): boolean;
21
- }
22
- export class Size {
23
- width: number;
24
- height: number;
25
- constructor(width?: number, height?: number);
26
- /**
27
- * Returns a copy of this size
28
- */
29
- copy(): Size;
30
- /**
31
- * Returns whether this size is equal to another one
32
- */
33
- equals(other: Size): boolean;
34
- }
35
- export type RectCorner = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
36
- /**
37
- * Represents a rectangle
38
- */
39
- export class Rect {
40
- /** The x-coordinate of the rectangle */
41
- x: number;
42
- /** The y-coordinate of the rectangle */
43
- y: number;
44
- /** The width of the rectangle */
45
- width: number;
46
- /** The height of the rectangle */
47
- height: number;
48
- constructor(x?: number, y?: number, width?: number, height?: number);
49
- /**
50
- * The maximum x-coordinate in the rectangle
51
- */
52
- readonly maxX: number;
53
- /**
54
- * The maximum y-coordinate in the rectangle
55
- */
56
- readonly maxY: number;
57
- /**
58
- * The area of the rectangle
59
- */
60
- readonly area: number;
61
- /**
62
- * The top left corner of the rectangle
63
- */
64
- readonly topLeft: Point;
65
- /**
66
- * The top right corner of the rectangle
67
- */
68
- readonly topRight: Point;
69
- /**
70
- * The bottom left corner of the rectangle
71
- */
72
- readonly bottomLeft: Point;
73
- /**
74
- * The bottom right corner of the rectangle
75
- */
76
- readonly bottomRight: Point;
77
- /**
78
- * Returns whether this rectangle intersects another rectangle
79
- * @param rect - The rectangle to check
80
- */
81
- intersects(rect: Rect): boolean;
82
- /**
83
- * Returns whether this rectangle fully contains another rectangle
84
- * @param rect - The rectangle to check
85
- */
86
- containsRect(rect: Rect): boolean;
87
- /**
88
- * Returns whether the rectangle contains the given point
89
- * @param point - The point to check
90
- */
91
- containsPoint(point: Point): boolean;
92
- /**
93
- * Returns the first corner of this rectangle (from top to bottom, left to right)
94
- * that is contained in the given rectangle, or null of the rectangles do not intersect.
95
- * @param rect - The rectangle to check
96
- */
97
- getCornerInRect(rect: Rect): RectCorner | null;
98
- equals(rect: Rect): boolean;
99
- pointEquals(point: Point | Rect): boolean;
100
- sizeEquals(size: Size | Rect): boolean;
101
- /**
102
- * Returns a copy of this rectangle
103
- */
104
- copy(): Rect;
105
- }
106
- /**
107
- * Instances of this lightweight class are created by {@link Layout} subclasses
108
- * to represent each view in the {@link CollectionView}. LayoutInfo objects describe
109
- * various properties of a view, such as its position and size, and style information.
110
- * The collection view uses this information when creating actual views to display.
111
- */
112
- export class LayoutInfo {
113
- /**
114
- * A string representing the view type. Should be `'item'` for item views.
115
- * Other types are used by supplementary views.
116
- */
117
- type: string;
118
- /**
119
- * A unique key for this view. For item views, it should match the content key.
120
- */
121
- key: Key;
122
- /**
123
- * The key for a parent layout info, if any.
124
- */
125
- parentKey: Key | null;
126
- /**
127
- * The rectangle describing the size and position of this view.
128
- */
129
- rect: Rect;
130
- /**
131
- * Whether the size is estimated. `false` by default.
132
- */
133
- estimatedSize: boolean;
134
- /**
135
- * The view's opacity. 1 by default.
136
- */
137
- opacity: number;
138
- /**
139
- * A CSS transform string to apply to the view. `null` by default.
140
- */
141
- transform: string | null;
142
- /**
143
- * The z-index of the view. 0 by default.
144
- */
145
- zIndex: number;
146
- /**
147
- * @param type A string representing the view type. Should be `'item'` for item views.
148
- Other types are used by supplementary views.
149
- * @param key The unique key for this view.
150
- * @param rect The rectangle describing the size and position of this view.
151
- */
152
- constructor(type: string, key: Key, rect: Rect);
153
- /**
154
- * Returns a copy of the LayoutInfo.
155
- */
156
- copy(): LayoutInfo;
157
- }
158
- /**
159
- * {@link CollectionView} supports arbitrary layout objects, which compute what views are visible, and how
160
- * to position and style them. However, layouts do not create the views themselves directly. Instead,
161
- * layouts produce lightweight {@link LayoutInfo} objects which describe various properties of a view,
162
- * such as its position and size. The {@link CollectionView} is then responsible for creating the actual
163
- * views as needed, based on this layout information.
164
- *
165
- * Every layout extends from the {@link Layout} abstract base class. Layouts must implement a minimum of the
166
- * two methods listed below. All other methods can be optionally overridden to implement custom behavior.
167
- *
168
- * - {@link getVisibleLayoutInfos}
169
- * - {@link getLayoutInfo}
170
- */
171
- export abstract class Layout<T extends object> {
172
- /** The CollectionView the layout is currently attached to */
173
- collectionManager: CollectionManager<T, any, any>;
174
- /**
175
- * Returns whether the layout should invalidate in response to
176
- * visible rectangle changes. By default, it only invalidates
177
- * when the collection view's size changes. Return true always
178
- * to make the layout invalidate while scrolling (e.g. sticky headers).
179
- */
180
- shouldInvalidate(rect: Rect): boolean;
181
- /**
182
- * This method allows the layout to perform any pre-computation
183
- * it needs to in order to prepare {@link LayoutInfo}s for retrieval.
184
- * Called by the collection view before {@link getVisibleLayoutInfos}
185
- * or {@link getLayoutInfo} are called.
186
- */
187
- validate(invalidationContext: InvalidationContext<T, any>): void;
188
- /**
189
- * Returns an array of {@link LayoutInfo} objects which are inside the given rectangle.
190
- * Should be implemented by subclasses.
191
- * @param rect The rectangle that should contain the returned LayoutInfo objects
192
- */
193
- getVisibleLayoutInfos(rect: Rect): LayoutInfo[];
194
- /**
195
- * Returns a {@link LayoutInfo} for the given type, section, and index.
196
- * Should be implemented by subclasses.
197
- * @param type The type of the LayoutInfo to retrieve
198
- * @param key The key of the LayoutInfo to retrieve
199
- */
200
- getLayoutInfo(type: string, key: Key): LayoutInfo;
201
- /**
202
- * Returns size of the content. By default, it returns collectionView's size.
203
- */
204
- getContentSize(): Size;
205
- /**
206
- * Returns a {@link DragTarget} describing a view at the given point to be dragged.
207
- * Return `null` to cancel the drag. The default implementation returns the view at the given point.
208
- * @param point The point at which the drag occurred
209
- */
210
- /**
211
- * Returns a {@link DragTarget} object describing where a drop should occur. Return `null`
212
- * to reject the drop. The dropped items will be inserted before the resulting target.
213
- * @param point The point at which the drop occurred
214
- */
215
- /**
216
- * Returns the starting attributes for an animated insertion.
217
- * The view is animated from this {@link LayoutInfo} to the one returned by {@link getLayoutInfo}.
218
- * The default implementation just returns its input.
219
- *
220
- * @param layoutInfo The proposed LayoutInfo for this view
221
- */
222
- getInitialLayoutInfo(layoutInfo: LayoutInfo): LayoutInfo;
223
- /**
224
- * Returns the ending attributes for an animated removal.
225
- * The view is animated from the {@link LayoutInfo} returned by {@link getLayoutInfo}
226
- * to the one returned by this method. The default implementation returns its input.
227
- *
228
- * @param layoutInfo The original LayoutInfo for this view
229
- */
230
- getFinalLayoutInfo(layoutInfo: LayoutInfo): LayoutInfo;
231
- }
232
- type LayoutInfoMap = Map<Key, LayoutInfo>;
233
- declare class Transaction<T extends object, V> {
234
- level: number;
235
- actions: (() => void)[];
236
- animated: boolean;
237
- initialMap: LayoutInfoMap;
238
- finalMap: LayoutInfoMap;
239
- initialLayoutInfo: LayoutInfoMap;
240
- finalLayoutInfo: LayoutInfoMap;
241
- removed: Map<Key, ReusableView<T, V>>;
242
- toRemove: Map<Key, ReusableView<T, V>>;
243
- }
244
- export interface CollectionManagerOptions<T extends object, V, W> {
245
- collection?: Collection<T>;
246
- layout?: Layout<T>;
247
- delegate?: CollectionManagerDelegate<T, V, W>;
248
- transitionDuration?: number;
249
- anchorScrollPosition?: boolean;
250
- anchorScrollPositionAtTop?: boolean;
251
- shouldOverscan?: boolean;
252
- }
253
- /**
254
- * The CollectionView class renders a scrollable collection of data using customizable layouts,
255
- * and manages animated updates to the data over time. It supports very large collections by
256
- * only rendering visible views to the DOM, reusing them as you scroll. Collection views can
257
- * present any type of view, including non-item views such as section headers and footers.
258
- * Optionally, the {@link EditableCollectionView} subclass can be used to enable user interaction
259
- * with the collection, including drag and drop, multiple selection, and keyboard interacton.
260
- *
261
- * Collection views get their data from a {@link DataSource} object that you provide. Items are
262
- * grouped into sections by the data source, and the collection view calls its methods to retrieve
263
- * the data. When data changes, the data source emits change events, and the collection view
264
- * updates as appropriate, optionally with an animated transition. There is one built-in data source
265
- * implementation, {@link ArrayDataSource}, which renders content from a 2d array.
266
- *
267
- * Collection views use {@link Layout} objects to compute what views should be visible, and how
268
- * to position and style them. This means that collection views can have their items arranged in
269
- * a stack, a grid, a circle, or any other layout you can think of. The layout can be changed
270
- * dynamically at runtime as well, optionally with an animated transition between the layouts.
271
- *
272
- * Layouts produce information on what views should appear in the collection view, but do not create
273
- * the views themselves directly. It is the responsibility of the {@link CollectionViewDelegate} object
274
- * to create instances of {@link ReusableView} subclasses which render the items into DOM nodes.
275
- * The delegate determines what type of view to display for each item, and creates instances of
276
- * views as needed by the collection view. Those views are then reused by the collection view as
277
- * the user scrolls through the content.
278
- */
279
- export class CollectionManager<T extends object, V, W> {
280
- /**
281
- * The collection view delegate. The delegate is used by the collection view
282
- * to create and configure views.
283
- */
284
- delegate: CollectionManagerDelegate<T, V, W>;
285
- /** The duration of animated layout changes, in milliseconds. Default is 500ms. */
286
- transitionDuration: number;
287
- /**
288
- * Whether to enable scroll anchoring. This will attempt to restore the scroll position
289
- * after layout changes outside the viewport. Default is off.
290
- */
291
- anchorScrollPosition: boolean;
292
- /** Whether to anchor the scroll position when at the top of the content. Default is off. */
293
- anchorScrollPositionAtTop: boolean;
294
- /**
295
- * Whether to overscan the visible area to pre-render items slightly outside and
296
- * improve performance. Default is on.
297
- */
298
- shouldOverscan: boolean;
299
- constructor(options?: CollectionManagerOptions<T, V, W>);
300
- _setContentSize(size: Size): void;
301
- _setContentOffset(offset: Point): void;
302
- /**
303
- * Get the size of the scrollable content
304
- */
305
- readonly contentSize: Size;
306
- /**
307
- * Get the collection view's currently visible rectangle
308
- */
309
- /**
310
- * Set the collection view's currently visible rectangle
311
- */
312
- visibleRect: Rect;
313
- _setVisibleRect(rect: Rect, forceUpdate?: boolean): void;
314
- collection: Collection<T>;
315
- /**
316
- * Reloads the data from the data source and relayouts the collection view.
317
- * Does not animate any changes. Equivalent to re-assigning the same data source
318
- * to the collection view.
319
- */
320
- reloadData(): void;
321
- /**
322
- * Returns the item with the given key.
323
- */
324
- getItem(key: Key): T;
325
- /**
326
- * Get the collection view's layout
327
- */
328
- /**
329
- * Set the collection view's layout
330
- */
331
- layout: Layout<T>;
332
- /**
333
- * Sets the collection view's layout, optionally with an animated transition
334
- * from the current layout to the new layout.
335
- * @param layout The layout to switch to
336
- * @param animated Whether to animate the layout change
337
- */
338
- setLayout(layout: Layout<T>, animated?: boolean): void;
339
- getReusableView(layoutInfo: LayoutInfo): ReusableView<T, V>;
340
- /**
341
- * Returns an array of all currently visible views, including both
342
- * item views and supplementary views.
343
- */
344
- readonly visibleViews: ReusableView<T, V>[];
345
- /**
346
- * Gets the visible item view for the given key. Returns null if
347
- * the view is not currently visible.
348
- */
349
- getItemView(key: Key): ReusableView<T, V> | null;
350
- /**
351
- * Gets the visible view for the given type and key. Returns null if
352
- * the view is not currently visible.
353
- *
354
- * @param type The view type. `'item'` for an item view.
355
- * @param key The key of the view to retrieve
356
- */
357
- getView(type: string, key: Key): ReusableView<T, V> | null;
358
- /**
359
- * Returns an array of visible views matching the given type.
360
- * @param type The view type to find. `'item'` for item views.
361
- */
362
- getViewsOfType(type: string): ReusableView<T, V>[];
363
- /**
364
- * Reloads the content of the supplementary view matching the given parameters.
365
- * This method does not work with item views. You should emit a "reloadItem" or
366
- * "reloadSection" event from your data source instead.
367
- *
368
- * @param type The view type. `'item'` for an item view.
369
- * @param key The key of the view to reload.
370
- */
371
- reloadSupplementaryView(type: string, key: Key): void;
372
- /**
373
- * Reloads the content of all visible supplementary views of the given type.
374
- * @param type The view type to reload. `'item'` for an item view.
375
- */
376
- reloadSupplementaryViewsOfType(type: string): void;
377
- /**
378
- * Returns the key for the given view. Returns null
379
- * if the view is not currently visible.
380
- */
381
- keyForView(view: ReusableView<T, V>): Key | null;
382
- /**
383
- * Returns the key for the item view currently at the given point.
384
- */
385
- keyAtPoint(point: Point): Key | null;
386
- /**
387
- * Triggers a layout invalidation, and updates the visible subviews.
388
- */
389
- relayout(context?: InvalidationContext<T, V>): void;
390
- /**
391
- * Performs a relayout immediately. Prefer {@link relayout} over this method
392
- * where possible, since it coalesces multiple layout passes in the same tick.
393
- */
394
- relayoutNow(context?: InvalidationContext<T, V>): void;
395
- getVisibleRect(): Rect;
396
- getVisibleLayoutInfos(): Map<Key, LayoutInfo>;
397
- updateSubviews(forceUpdate?: boolean): void;
398
- afterRender(): void;
399
- reuseView(view: ReusableView<T, V>): void;
400
- removeViews(toRemove: Set<ReusableView<T, V>>): void;
401
- updateItemSize(key: Key, size: Size): void;
402
- startScrolling(): void;
403
- endScrolling(): void;
404
- /**
405
- * Scrolls the item with the given key into view, optionally with an animation.
406
- * @param key The key of the item to scroll into view
407
- * @param duration The duration of the scroll animation
408
- */
409
- scrollToItem(key: Key, duration?: number): Promise<void>;
410
- /**
411
- * Performs an animated scroll to the given offset.
412
- * @param offset - The offset to scroll to
413
- * @param duration The duration of the animation
414
- * @return a promise that resolves when the animation is complete
415
- */
416
- scrollTo(offset: Point, duration?: number): Promise<void>;
417
- }
418
- /**
419
- * {@link CollectionView} creates instances of the {@link ReusableView} class to
420
- * represent views currently being displayed. ReusableViews manage a DOM node, handle
421
- * applying {@link LayoutInfo} objects to the view, and render content
422
- * as needed. Subclasses must implement the {@link render} method at a
423
- * minimum. Other methods can be overrided to customize behavior.
424
- */
425
- export class ReusableView<T extends object, V> {
426
- /** The CollectionManager this view is a part of */
427
- collectionManager: CollectionManager<T, V, unknown>;
428
- /** The LayoutInfo this view is currently representing. */
429
- layoutInfo: LayoutInfo | null;
430
- /** The content currently being displayed by this view, set by the collection view. */
431
- content: T;
432
- rendered: V;
433
- viewType: string;
434
- key: Key;
435
- constructor(collectionManager: CollectionManager<T, V, unknown>);
436
- /**
437
- * Prepares the view for reuse. Called just before the view is removed from the DOM.
438
- */
439
- prepareForReuse(): void;
440
- }
441
- export interface ItemStates {
442
- isSelected?: boolean;
443
- isExpanded?: boolean;
444
- isDisabled?: boolean;
445
- isFocused?: boolean;
446
- }
447
- export interface Node<T> extends ItemStates {
448
- type: 'section' | 'item';
449
- key: Key;
450
- value: T;
451
- level: number;
452
- hasChildNodes: boolean;
453
- childNodes: Iterable<Node<T>>;
454
- rendered: ReactNode;
455
- textValue: string;
456
- 'aria-label'?: string;
457
- index?: number;
458
- wrapper?: ((element: ReactElement) => ReactElement) | void;
459
- parentKey?: Key;
460
- prevKey?: Key;
461
- nextKey?: Key;
462
- props?: ItemProps<T>;
463
- }
1
+ import { Key, ItemProps, SectionProps, CollectionBase, Node, Collection, CollectionStateBase } from "@react-types/shared";
2
+ import { ReactElement, ReactNode, JSX } from "react";
464
3
  export interface PartialNode<T> {
465
- type?: 'section' | 'item';
4
+ type?: string;
466
5
  key?: Key;
467
6
  value?: T;
468
7
  element?: ReactElement;
469
- wrapper?: ((element: ReactElement) => ReactElement) | void;
8
+ wrapper?: (element: ReactElement) => ReactElement;
470
9
  rendered?: ReactNode;
471
10
  textValue?: string;
472
11
  'aria-label'?: string;
473
- renderer?: ItemRenderer<T>;
12
+ index?: number;
13
+ renderer?: (item: T) => ReactElement;
474
14
  hasChildNodes?: boolean;
475
15
  childNodes?: () => IterableIterator<PartialNode<T>>;
476
- props?: ItemProps<T>;
477
- }
478
- export interface Collection<T> extends Iterable<T> {
479
- readonly size: number;
480
- getKeys(): Iterable<Key>;
481
- getItem(key: Key): T;
482
- getKeyBefore(key: Key): Key | null;
483
- getKeyAfter(key: Key): Key | null;
484
- getFirstKey(): Key | null;
485
- getLastKey(): Key | null;
486
- }
487
- export interface InvalidationContext<T extends object, V> {
488
- contentChanged?: boolean;
489
- offsetChanged?: boolean;
490
- sizeChanged?: boolean;
491
- animated?: boolean;
492
- beforeLayout?(): void;
493
- afterLayout?(): void;
494
- afterAnimation?(): void;
495
- transaction?: Transaction<T, V>;
496
- }
497
- export interface CollectionManagerDelegate<T extends object, V, W> {
498
- setVisibleViews(views: W[]): void;
499
- setContentSize(size: Size): void;
500
- setVisibleRect(rect: Rect): void;
501
- getType?(content: T): string;
502
- renderView(type: string, content: T): V;
503
- renderWrapper(parent: ReusableView<T, V> | null, reusableView: ReusableView<T, V>, children: ReusableView<T, V>[], renderChildren: (views: ReusableView<T, V>[]) => W[]): W;
504
- beginAnimations(): void;
505
- endAnimations(): void;
506
- getScrollAnchor?(rect: Rect): Key;
507
- }
508
- export class CollectionBuilder<T> {
509
- constructor(itemKey: string);
510
- build(props: CollectionBase<T>, getItemStates?: (key: Key) => ItemStates): Iterable<Node<T>>;
511
- iterateCollection(props: CollectionBase<T>): IterableIterator<Node<T>>;
512
- getKey(item: CollectionElement<T>, value: T, parentKey?: Key): Key;
513
- getCached(item: T): Node<T>;
514
- getFullNode(partialNode: PartialNode<T>, renderer?: ItemRenderer<T>, parentKey?: Key, parentNode?: Node<T>): Node<T>;
16
+ props?: any;
17
+ shouldInvalidate?: (context: unknown) => boolean;
515
18
  }
516
19
  export let Item: <T>(props: ItemProps<T>) => JSX.Element;
517
20
  export let Section: <T>(props: SectionProps<T>) => JSX.Element;
518
- export class TreeCollection<T> implements Collection<Node<T>> {
519
- constructor(nodes: Iterable<Node<T>>);
520
- [Symbol.iterator](): IterableIterator<Node<T>>;
521
- readonly size: number;
522
- getKeys(): IterableIterator<Key>;
523
- getKeyBefore(key: Key): Key;
524
- getKeyAfter(key: Key): Key;
525
- getFirstKey(): Key;
526
- getLastKey(): Key;
527
- getItem(key: Key): Node<T>;
528
- }
529
- type ListLayoutOptions<T> = {
530
- /** the height of a row in px. */
531
- rowHeight?: number;
532
- estimatedRowHeight?: number;
533
- headingHeight?: number;
534
- estimatedHeadingHeight?: number;
535
- padding?: number;
536
- indentationForItem?: (collection: Collection<Node<T>>, key: Key) => number;
537
- collator?: Intl.Collator;
538
- };
539
- /**
540
- * The ListLayout class is an implementation of a collection view {@link Layout}
541
- * it is used for creating lists and lists with indented sub-lists
542
- *
543
- * To configure a ListLayout, you can use the properties to define the
544
- * layouts and/or use the method for defining indentation.
545
- * The {@link ListLayoutDelegate} extends the existing collection view
546
- * delegate with an additional method to do this (it uses the same delegate object as
547
- * the collection view itself).
548
- */
549
- export class ListLayout<T> extends Layout<Node<T>> implements KeyboardDelegate {
550
- collection: Collection<Node<T>>;
551
- /**
552
- * Creates a new ListLayout with options. See the list of properties below for a description
553
- * of the options that can be provided.
554
- */
555
- constructor(options?: ListLayoutOptions<T>);
556
- getLayoutInfo(type: string, key: Key): LayoutInfo;
557
- getVisibleLayoutInfos(rect: Rect): LayoutInfo[];
558
- validate(): void;
559
- updateItemSize(key: Key, size: Size): boolean;
560
- getContentSize(): Size;
561
- getKeyAbove(key: Key): Key;
562
- getKeyBelow(key: Key): Key;
563
- getKeyPageAbove(key: Key): Key;
564
- getKeyPageBelow(key: Key): Key;
565
- getFirstKey(): Key;
566
- getLastKey(): Key;
567
- getKeyForSearch(search: string, fromKey?: Key): Key;
568
- getInitialLayoutInfo(layoutInfo: LayoutInfo): LayoutInfo;
569
- getFinalLayoutInfo(layoutInfo: LayoutInfo): LayoutInfo;
570
- }
571
- interface CollectionProps<T extends object, V, W> {
572
- renderView(type: string, content: T): V;
573
- renderWrapper(parent: ReusableView<T, V> | null, reusableView: ReusableView<T, V>, children: ReusableView<T, V>[], renderChildren: (views: ReusableView<T, V>[]) => W[]): W;
574
- layout: Layout<T>;
575
- collection: Collection<T>;
576
- getScrollAnchor?(rect: Rect): Key;
577
- }
578
- interface CollectionState<T extends object, V, W> {
579
- visibleViews: W[];
580
- visibleRect: Rect;
581
- setVisibleRect: (rect: Rect) => void;
582
- contentSize: Size;
583
- isAnimating: boolean;
584
- collectionManager: CollectionManager<T, V, W>;
585
- startScrolling: () => void;
586
- endScrolling: () => void;
587
- }
588
- export function useCollectionState<T extends object, V, W>(opts: CollectionProps<T, V, W>): CollectionState<T, V, W>;
589
- export function useAsyncList<T>(options: AsyncListOptions<T>): AsyncListProps<T>;
21
+ export class CollectionBuilder<T extends object> {
22
+ build(props: CollectionBase<T>, context?: unknown): Iterable<Node<T>>;
23
+ }
24
+ interface CollectionOptions<T, C extends Collection<Node<T>>> extends Omit<CollectionStateBase<T, C>, 'children'> {
25
+ children?: ReactElement<any> | ReactElement<any>[] | ((item: T) => ReactElement<any>);
26
+ }
27
+ type CollectionFactory<T, C extends Collection<Node<T>>> = (node: Iterable<Node<T>>) => C;
28
+ export function useCollection<T extends object, C extends Collection<Node<T>> = Collection<Node<T>>>(props: CollectionOptions<T, C>, factory: CollectionFactory<T, C>, context?: unknown): C;
29
+ export function getChildNodes<T>(node: Node<T>, collection: Collection<Node<T>>): Iterable<Node<T>>;
30
+ export function getFirstItem<T>(iterable: Iterable<T>): T | undefined;
31
+ export function getNthItem<T>(iterable: Iterable<T>, index: number): T | undefined;
32
+ export function getLastItem<T>(iterable: Iterable<T>): T | undefined;
33
+ export function compareNodeOrder<T>(collection: Collection<Node<T>>, a: Node<T>, b: Node<T>): number;
34
+ export function getItemCount<T>(collection: Collection<Node<T>>): number;
590
35
 
591
36
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/Point.ts","/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/Size.ts","/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/Rect.ts","/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/LayoutInfo.ts","/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/Layout.ts","/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/Transaction.ts","/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/CollectionManager.ts","/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/ReusableView.ts","/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/types.ts","/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/CollectionBuilder.ts","/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/Item.ts","/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/Section.ts","/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/TreeCollection.ts","/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/ListLayout.ts","/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/useCollectionState.ts","/Users/govett/dev/react-spectrum/packages/@react-stately/collections/src/packages/@react-stately/collections/src/useAsyncList.ts"],"names":[],"mappings":";;AAYA;IACE,oCAAoC;IACpC,CAAC,EAAE,MAAM,CAAC;IAEV,oCAAoC;IACpC,CAAC,EAAE,MAAM,CAAC;gBAEE,CAAC,SAAI,EAAE,CAAC,SAAI;IAKxB;;OAEG;IACH,IAAI,IAAI,KAAK;IAIb;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IAI7B;;OAEG;IACH,QAAQ,IAAI,OAAO;CAGpB;AChCD;IACE,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;gBAEH,KAAK,SAAI,EAAE,MAAM,SAAI;IAKjC;;OAEG;IACH,IAAI,IAAI,IAAI;IAIZ;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO;CAI7B;ACpBD,yBAAyB,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,aAAa,CAAC;AAE/E;;GAEG;AACH;IACE,wCAAwC;IACxC,CAAC,EAAE,MAAM,CAAC;IAEV,wCAAwC;IACxC,CAAC,EAAE,MAAM,CAAC;IAEV,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IAEd,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;gBAEH,CAAC,SAAI,EAAE,CAAC,SAAI,EAAE,KAAK,SAAI,EAAE,MAAM,SAAI;IAO/C;;OAEG;aACC,IAAI,EAAI,MAAM;IAIlB;;OAEG;aACC,IAAI,EAAI,MAAM;IAIlB;;OAEG;aACC,IAAI,EAAI,MAAM;IAIlB;;OAEG;aACC,OAAO,EAAI,KAAK;IAIpB;;OAEG;aACC,QAAQ,EAAI,KAAK;IAIrB;;OAEG;aACC,UAAU,EAAI,KAAK;IAIvB;;OAEG;aACC,WAAW,EAAI,KAAK;IAIxB;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,IAAI,GAA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AQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAajF;AAED,4BAA4B,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAOnE;AAED,iCAAiC,CAAC,EAAE,UAAU,EAAE,WAAW,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,UA4B1F;AC/DD,6BAA6B,CAAC,EAAE,UAAU,EAAE,WAAW,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAoBvE","sources":["packages/@react-stately/collections/src/packages/@react-stately/collections/src/types.ts","packages/@react-stately/collections/src/packages/@react-stately/collections/src/Item.ts","packages/@react-stately/collections/src/packages/@react-stately/collections/src/Section.ts","packages/@react-stately/collections/src/packages/@react-stately/collections/src/CollectionBuilder.ts","packages/@react-stately/collections/src/packages/@react-stately/collections/src/useCollection.ts","packages/@react-stately/collections/src/packages/@react-stately/collections/src/getChildNodes.ts","packages/@react-stately/collections/src/packages/@react-stately/collections/src/getItemCount.ts","packages/@react-stately/collections/src/packages/@react-stately/collections/src/index.ts","packages/@react-stately/collections/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,"/*\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 type {PartialNode} from './types';\nexport {Item} from './Item';\nexport {Section} from './Section';\nexport {useCollection} from './useCollection';\nexport {getItemCount} from './getItemCount';\nexport {getChildNodes, getFirstItem, getLastItem, getNthItem, compareNodeOrder} from './getChildNodes';\nexport {CollectionBuilder} from './CollectionBuilder';\n"],"names":[],"version":3,"file":"types.d.ts.map"}