META-INF.resources.cards_treeview.CardsTreeview.soy Maven / Gradle / Ivy
{namespace liferay.frontend.CardsTreeview}
/**
* This renders the main element.
*/
{template .render}
{@param nodes: list}
{@param pathThemeImages: string}
{@param? viewType: string}
{call .nodes}
{param nodes: $nodes /}
{param pathThemeImages: $pathThemeImages /}
{param viewType: $viewType /}
{/call}
{/template}
/**
* Renders the list of tree nodes. Uses the same markup as the parent Treeview component
*/
{template .nodes}
{@param nodes: list}
{@param? parentPath: string}
{@param pathThemeImages: string}
{@param? viewType: string}
{if $nodes}
{foreach $node in $nodes}
{let $index: index($node) /}
{call .node}
{param node: $node /}
{param path: isNonnull($parentPath) ? ($parentPath + '-' + $index) : '' + $index /}
{param pathThemeImages: $pathThemeImages /}
{param viewType: $viewType /}
{/call}
{/foreach}
{/if}
{/template}
/**
* Overrides the parent Treeview node template to show a Lexicon card instead of the simple label
*/
{template .node}
{@param node: [
children: list,
disabled: bool,
expanded: bool,
icon: string,
id: string,
name: string,
selected: bool,
value: string
]}
{@param path: string}
{@param pathThemeImages: string}
{@param? viewType: string}
{if $node}
{/template}
/**
* Renders a Lexicon Horizontal Card
*/
{template .card}
{@param? disabled: bool}
{@param icon: string}
{@param path: string}
{@param pathThemeImages: string}
{@param title: string}
{let $nodeAttributes kind="attributes"}
class="card card-horizontal"
{if not $disabled}
data-onclick="handleNodeClicked_"
{/if}
data-onkeyup="handleNodeKeyUp_"
tabindex="{$path == 0 ? '0' : '-1'}"
{/let}
{/if}
{if $icon}
{/if}
{$title}
{/template}