Namespace: components

Granite.author. components

Array of components available on the page

Available on cq-components-loaded

Source:
storage/components.js

Members


<static> allowedComponents :Array.<Granite.author.Component>

All the allowed components in the page

Available on cq-components-filtered

Type:
Source:
storage/components.js

<static> allowedComponentsFor :Object

Allowed components for a given path

Where the key is the path of an Granite.author.Editable


Available on cq-components-filtered

Type:
  • Object
Source:
storage/components.js

Methods


<static> add(components)

Adds one or more components to the components store

Parameters:
Name Type Description
components Array.<Granite.author.Component> | Granite.author.Component

List of components to be added

Source:
storage/components.js

<static> clean()

Deletes all components from the components store

Source:
storage/components.js
Fires:

<static> computeAllowedComponents(editable, design)

Returns an array of string representing the list of allowed components

Those could be either a path, a resource type or component group

The component store also stores the list in its Granite.author.components.allowedComponentsFor registry later usage and retrieval

Parameters:
Name Type Description
editable Granite.author.Editable

Editable for which to compute a list of allowed components

design Object

Design configuration object from which to get the actual configuration

Source:
storage/components.js
Returns:
  • An array of string in case of a configuration object has been found or undefined otherwise
Type
Array.<string> | undefined

<static> filterAllowedComponents(filter, append)

Updates the allowed components based on the given filter

Parameters:
Name Type Argument Description
filter Array.<string>

list of terms to search for. May be paths, resource types or groups

append boolean <optional>

Should the found list of components be added to the allowed components of the current store

Source:
storage/components.js
Fires:

<static> find(search)

Find components based ont the give search criteria

Parameters:
Name Type Description
search string | Object | Object

Component path or RegExp to match multiple path of components

Source:
storage/components.js
Returns:

List of components

Type
Array.<Granite.author.Component>

<static> getGroups(components)

Returns the groups fro the given components

Parameters:
Name Type Description
components Granite.author.Component

The list of components from which to get the groups

Source:
storage/components.js
Returns:
Type
Array.<string>

<static> remove(components)

Removes components from the components store

Parameters:
Name Type Description
components Array.<Granite.author.Component> | Granite.author.Component

List of components to be removed

Source:
storage/components.js

<static> set(components)

Sets components in the components store and deletes all previous existing components

Parameters:
Name Type Description
components Array.<Granite.author.Component> | Granite.author.Component

List of components to be added

Source:
storage/components.js
Fires: