Reference Source
import {Masonry} from '@adobe/coral-spectrum'
public class | source

MasonryLayout

Direct Subclass:

MasonryColumnLayout

Base class for masonry layouts.

Whenever a change is detected, the Coral.Masonry.Layout#layout method is called. This method must then ensure that all the items are positioned correctly.

Layout-specific keyboard support must be handled by adding event listeners to the masonry in the constructor. Such event listeners must be removed in the Coral.Masonry.Layout#destroy method.

See:

Example:

JS constructor
new Coral.Masonry.Layout();

Static Method Summary

Static Public Methods
public static

Defines the name of the Layout

Constructor Summary

Public Constructor
public

constructor(arg1: number, arg2: string[])

this is constructor description.

Member Summary

Public Members
public

Layout name.

Method Summary

Public Methods
public

Removes all layout-specific attributes, style, data and event listeners from the masonry and its items.

public

Removes the item from the control of the layout.

public

itemAt(x: number, y: number): Coral.Masonry.Item

Returns the item at the given position.

public

layout()

Lays out the masonry items according to the implementation.

public

Adds the item to the control of the layout again.

Static Public Methods

public static defineName(name: String) source

Defines the name of the Layout

Params:

NameTypeAttributeDescription
name String

Public Constructors

public constructor(arg1: number, arg2: string[]) source

this is constructor description.

Params:

NameTypeAttributeDescription
arg1 number

this is arg1 description.

arg2 string[]

this is arg2 description.

Public Members

public name: String source

Layout name. Uses the constructor given name by default if defined.

Public Methods

public destroy() source

Removes all layout-specific attributes, style, data and event listeners from the masonry and its items.

public detach(item: MasonryItem) source

Removes the item from the control of the layout. This can be used to position the item differently, for example for drag&drop.

Params:

NameTypeAttributeDescription
item MasonryItem

public itemAt(x: number, y: number): Coral.Masonry.Item source

Returns the item at the given position. The position coordinates are relative to the masonry.

If an item is being transitioned when this method is called, then it must choose the item based on the final instead of the current position.

Params:

NameTypeAttributeDescription
x number
y number

Return:

Coral.Masonry.Item (nullable: true)

public layout() source

Lays out the masonry items according to the implementation.

public reattach(item: MasonryItem) source

Adds the item to the control of the layout again. The layout has to ensure that the item will be transitioned to its normal position flawlessly.

Params:

NameTypeAttributeDescription
item MasonryItem