Skip to main content
Version: Previous

foundation-layout.foundationlayout

Home > @genesislcap/foundation-layout > FoundationLayout

FoundationLayout class

Top level web component which is used to initialise a custom layout

Signature:

export declare class FoundationLayout extends FoundationElement implements LayoutComponent 

Extends: FoundationElement

Implements: LayoutComponent

Remarks

Can be used in a composition to customise the styles of the layout.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the FoundationLayout class.

Properties

PropertyModifiersTypeDescription
autoSaveKey?string(Optional) Attribute which if set will auto save and load the layout as the user changes it. Omit this attribute to disable this feature. Set attribute using auto-save-key.
draggingbooleanSet to true when the user is currently dragging the panes inside of the layout
hasFirstLoadedbooleanBoolean signifies whether the layout has loaded for the first time or not.
missingItemPlaceholder(missingItem: string) => stringFunction which is used to generate the placeholder text when a layout is loaded with a missing item.
reloadBuffernumberNumber describing how long to wait in ms before reloading the config when adding items declaratively by the html API. Default 500 (ms).

Methods

MethodModifiersDescription
addItem(config, placement)Dynamically add a new item to the layout. The user can move the new plane to whenever they want once it has been added.
getLayout()Gets a minified string containing the config describing the current layout of the layout object to later restore in function
layoutRequiredRegistrations(layout)staticGets all of the required element registry function names for a set of config
loadLayout(layout, handleMissingItem)Restores a layout described in the config from getLayout()
registeredItems()Gets all of the currently registered names
registerItem(registration, elements)Register a collection of Element and associate them with an ID with the layout system for later use.
tryLoadLayoutFromLocalStorage()Try to load a layout from local storage, or return false. Only required if manually calling FoundationLayout.registerItem()