|
1 | | -<ScrollView |
2 | | - class="CollectionScrollView" |
3 | | - @contentHeight={{this.scrollHeight}} |
4 | | - @scrollTopOffset={{@scrollTopOffset}} |
5 | | - @initialScrollTop={{@initialScrollTop}} |
6 | | - @key={{@key}} |
7 | | - @auxiliaryComponent={{if @auxiliaryComponent |
8 | | - (component @auxiliaryComponent |
9 | | - cellLayout=this.cellLayout |
10 | | - items=@items |
11 | | - clientSize=this.collectionClientSize |
12 | | - scrollTop=this.collectionScrollTop |
13 | | - verticalOffset=this.visibleHeaderHeight |
14 | | - ) |
15 | | - }} |
16 | | - @clientSizeChange={{this.clientSizeChange}} |
17 | | - @scrollChange={{this.scrollChange}} |
18 | | - @scrolledToTopChange={{this.onScrolledToTopChange}} |
19 | | - {{create-ref 'element'}} |
20 | | - ...attributes |
21 | | - as |scrollViewApi| |
| 1 | +<div |
| 2 | + class="CollectionScrollView-scrollContainer" |
| 3 | + data-test-scroll-container |
| 4 | + {{this.registerScrollElement}} |
| 5 | + {{on "scroll" this.handleScroll}} |
| 6 | + {{on-resize this.handleResize}} |
22 | 7 | > |
23 | | - |
24 | | - {{#if (has-block 'header')}} |
25 | | - <div {{on-resize (fn this.updateHeaderDimensions scrollViewApi)}}> |
26 | | - {{yield to="header"}} |
27 | | - </div> |
28 | | - {{/if}} |
29 | | - |
30 | | - {{#if (not (and (has-block 'header') (is-empty this.headerDimensions)))}} |
31 | | - <div data-test-collection-items-container style={{html-safe (concat "position:relative;height:" this.contentSize.height "px;width:" this.contentSize.width "px")}}> |
32 | | - <CollectionScrollView::CollectionItems |
33 | | - @clientSize={{this.collectionClientSize}} |
34 | | - @scrollTop={{this.collectionScrollTop}} |
35 | | - @estimatedSize={{hash width=@estimated-width height=@estimated-height}} |
36 | | - @items={{@items}} |
37 | | - @buffer={{@buffer}} |
38 | | - @cellLayout={{this.cellLayout}} |
39 | | - @onContentSizeUpdated={{this.updateContentSizeAfterRender}} |
40 | | - as |cells| |
41 | | - > |
42 | | - {{~#each cells as |cell|~}} |
43 | | - <div style={{html-safe cell.style}} data-collection-scroll-view-cell-container-id={{cell.containerId}}>{{yield cell.item cell.index scrollViewApi to="row"}}</div> |
44 | | - {{~/each~}} |
45 | | - </CollectionScrollView::CollectionItems> |
46 | | - </div> |
| 8 | + {{#if @auxiliaryComponent}} |
| 9 | + {{component @auxiliaryComponent |
| 10 | + cellLayout=@cellLayout |
| 11 | + items=@items |
| 12 | + clientSize=this.collectionClientSize |
| 13 | + scrollTop=this.scrollTop |
| 14 | + verticalOffset=this.visibleHeaderHeight |
| 15 | + }} |
47 | 16 | {{/if}} |
| 17 | + <VerticalCollection |
| 18 | + @bufferSize={{@buffer}} |
| 19 | + @estimateHeight={{@estimateItemHeight}} |
| 20 | + @firstVisibleChanged={{this.firstVisibleChanged}} |
| 21 | + @items={{@items}} |
| 22 | + @key={{or @itemKey "id"}} |
| 23 | + @registerAPI={{this.registerAPI}} |
| 24 | + @renderAll={{false}} |
| 25 | + @staticHeight={{@staticHeight}} |
| 26 | + @width={{@width}} |
| 27 | + as |item index| |
| 28 | + > |
| 29 | + {{yield item index to="row"}} |
| 30 | + </VerticalCollection> |
| 31 | + {{emitter-action |
| 32 | + emitter=this.windowRef |
| 33 | + eventName="requestScrollToTop" |
| 34 | + action=this.scrollToTopIfInViewport |
| 35 | + }} |
48 | 36 |
|
49 | 37 | {{#if @revealService}} |
50 | 38 | {{emitter-action |
51 | 39 | emitter=@revealService |
52 | 40 | eventName="revealItemById" |
53 | | - action=(fn this.scrollToItem scrollViewApi) |
| 41 | + action=this.scrollToItem |
54 | 42 | }} |
55 | 43 | {{/if}} |
56 | | -</ScrollView> |
| 44 | +</div> |
0 commit comments