ActionLink¶
-
/libs/granite/ui/components/coral/foundation/collection/actionlink
ActionLink is a component specializing to render foundation-collection-action. It will be rendered as a
<a>
.It has the following content structure:
-
granite:CollectionActionLink
- granite:commonAttrs
- granite:renderCondition
- targetstring
The selector to the
.foundation-collection
. This is optional and used when the component is placed outside the.foundation-collection
.
-
activeCount
- 0
- >0
Show or hide the component according to how many
.foundation-collection-item
in the collection.Values:
- 0
- The property type is
long
. Show when there is no item at all; hide otherwise. - >0
- The property type is
string
. Show when there is at least one item; hide otherwise.
-
activeSelectionCountstring
- none
- single
- multiple
Show or hide the component according to how many
.foundation-selections-item
in the collection.Values:
- none
- Show when there is no selection at all; hide otherwise.
- single
- Show when there is exactly one selection; hide otherwise.
- multiple
- Show when there is one or more selections; hide otherwise.
- activeConditionstring
The pluggable condition to show or hide the component.
- actionstring
The pluggable action to be performed when the component is activated. If this property is not specified, no action will be performed.
- commandstring
Command used as a shortcut for the action. It accepts single keys, sequenques and key modifiers. Command will override actionConfigName.
When
ctrl
orcmd
is used, it will be normalized based on the client’s OS.Grammar (ABNF)
command ::= key / sequence / modifier-cmd key ::= valid-keyboard-key sequence ::= key 1*("-" key) modifier-cmd ::= modifier *("+" modifier) "+" key modifier ::= "ctrl" / "alt" / "meta" / "shift" / "cmd"
e.g.
d
,m
,c
,l-c
,c-r
,ctrl+c
,alt+1
,meta+t
,shift+a
,cmd+i
- actionConfigNamestring
The actionConfigName directs to the central configuration for a keyboard shortcut. An actionConfigName will set following attributes of this action to the global standard definitions: command, icon, text, and text_commentI18n. Example value: granite/ui/shell/actions/edit The example will set for this action the attributes command, text and icon to the edit use case to the global default values under /conf/settings/granite/ui/shell/actions/edit. The global defaults could be changed under /conf/settings/granite/ui/shell/actions to other default values.
-
relScopestring
- item
- none
- item
- collection
The scope of the relationship.
When deciding if the action is shown or hidden, the relationship of the item or collection is checked (the
isCommon()
algorithm). See “Showing and Hiding Behavior” section of foundation-collection-action.- none
- Skip the processing of relationship.
- item
- Read the relationship from the item.
- collection
- Read the relationship from the collection.
- ignoreRelboolean
The equivalence to
relScope
=none
.
- textstring
- i18n
The body text of the element.
- text_commentI18nstring
I18n comment for the body text of the element.
- hideTextboolean
Visually hide the text. It is RECOMMENDED that every button has a text for a11y purpose. Use this property to hide it visually, while still making it available for a11y.
- iconstring
The icon name. e.g. “search”.
- hrefstringel
The href attribute.
- relstring
The value of the
rel
attribute on the actionlink.
-
iconSizestring
- S
- XS
- S
- M
- L
The size of the icon.
- trackingFeaturestring
The name of the feature that the interaction takes place.
See foundation-tracking.
- trackingElementstring
The element this component represent for the purpose of tracking. By default the value of
text
orgranite:title
is used.See foundation-tracking.
- trackingWidgetNamestring
The name of the widget.
See foundation-tracking.
- data
Indicates the data property of
foundation-collection-action
. It will be converted to JSON.Its child nodes support property names with the following regex:
- /(.+).uritemplate/
Indicate the value is a URITemplate. Context path is appended accordingly. It supports EL. The
.uritemplate
suffix is removed from the property name. Example:+ data - href.uritemplate = "/action.html{+item}" // will produce {"href" : "/ctx/action.html{+item}"}
- /(.+).uritemplate.abs/
Indicate the value is a URITemplate that is resolved into an absolute path. Context path will be appended. It supports EL. The
.uritemplate.abs
suffix is removed from the property name. This scenario is important when you use the variable at the first char of the URITemplate, thus this component cannot know if the variable is going to be resolved as a relative path or absolute path. Example:+ data - href.uritemplate.abs = "{+item}.html" // will produce {"href" : "/ctx{+item}.html"}
- /(.+).url/
Indicate the value is a URL. Context path is appended accordingly. It supports EL. The
.url
suffix is removed from the property name. Example:+ data - href.url = "/action.html" // will produce {"href" : "/ctx/action.html"}
- /.+/
No processing is done. The value is passed as is. Example:
+ data - href = "/action.html" // will produce {"href" : "/action.html"} - int = 123 // will produce {"int" : 123}
-
granite:CollectionActionLink