This refactor makes collection renderers responsible for rendering the drop indicators between each item in a collection. That enables Virtualizer layouts to handle positioning them correctly, rather than being inside each item. This is implemented by passing a renderDropIndicator function to the CollectionRoot and CollectionBranch components from the collection component (e.g. ListBox/GridList). Each layout has a getDropTargetLayoutInfo method to retrieve the size and position of a drop indicator on demand. It is not included in the collection or returned as part of the visible layout infos.
There is also a refactor to Virtualizer to remove the renderWrapper function, which has been moved into the Virtualizer component rather than in stately. In RAC we handle this differently since children are rendered on demand (by CollectionBranch rather than eagerly.
Finally, I've added a new GridLayout that is a simplified version of the one from CardView but with fewer Spectrum-specific details. It also implements the new drag and drop methods to position drop indicators, including flipping from vertical to horizontal if only one column is shown in a narrow view.
Also fixes #6617.
This refactor makes collection renderers responsible for rendering the drop indicators between each item in a collection. That enables Virtualizer layouts to handle positioning them correctly, rather than being inside each item. This is implemented by passing a
renderDropIndicator
function to theCollectionRoot
andCollectionBranch
components from the collection component (e.g. ListBox/GridList). Each layout has agetDropTargetLayoutInfo
method to retrieve the size and position of a drop indicator on demand. It is not included in the collection or returned as part of the visible layout infos.There is also a refactor to Virtualizer to remove the
renderWrapper
function, which has been moved into theVirtualizer
component rather than in stately. In RAC we handle this differently since children are rendered on demand (byCollectionBranch
rather than eagerly.Finally, I've added a new GridLayout that is a simplified version of the one from CardView but with fewer Spectrum-specific details. It also implements the new drag and drop methods to position drop indicators, including flipping from vertical to horizontal if only one column is shown in a narrow view.