aButton
Generates an HTML button or link with various customization options, including color, size, alignment, icon, and title.
Parameters :
- name ( string / optionnel ) - of the button element.
- id ( string / optionnel ) - of the button element.
- href ( string / optionnel ) - which the button will link.
- target ( string / optionnel ) - the link, such as "_blank".
- size ( string / optionnel ) - the button, such as "sm" or "lg".
- color ( string / optionnel ) - the button, such as "primary" or "warning".
- style ( string / optionnel ) - the button, such as "btn" or "card-control".
- align ( string / optionnel ) - the button, such as "left" or "right".
- class ( string / optionnel ) - to apply to the button.
- title ( string / optionnel ) - the button.
- tabIndex ( string / optionnel ) - of the button.
- hideTitle ( list / optionnel ) - screen reader text to hide the title of the button.
- buttonIcon ( string / optionnel ) - display inside the button.
- disabled ( boolean / optionnel ) - the button is disabled.
- iconPosition ( string / optionnel ) - the icon inside the button, such as "left" or "right".
- dropdownMenu ( boolean / optionnel ) - to include a dropdown menu inside the button.
- params ( string / optionnel ) - to apply to the button element.
- deprecated... ( Inconnu / obligatoire ) - Pas de description
<#--
Macro: aButton
Description: Generates an HTML button or link with various customization options, including color, size, alignment, icon, and title.
Parameters:
@param - name - string - optional - of the button element.
@param - id - string - optional - of the button element.
@param - href - string - optional - which the button will link.
@param - target - string - optional - the link, such as "_blank".
@param - size - string - optional - the button, such as "sm" or "lg".
@param - color - string - optional - the button, such as "primary" or "warning".
@param - style - string - optional - the button, such as "btn" or "card-control".
@param - align - string - optional - the button, such as "left" or "right".
@param - class - string - optional - to apply to the button.
@param - params - string - optional - to apply to the button element.
@param - title - string - optional - the button.
@param - tabIndex - string - optional - of the button.
@param - hideTitle - list - optional - screen reader text to hide the title of the button.
@param - buttonIcon - string - optional - display inside the button.
@param - disabled - boolean - optional - the button is disabled.
@param - iconPosition - string - optional - the icon inside the button, such as "left" or "right".
@param - dropdownMenu - boolean - optional - to include a dropdown menu inside the button.
-->
<#macro aButton name='' id='' href='' target='' size='' color='primary' style='btn' align='' class='' title='' tabIndex='' hideTitle=[] buttonIcon='' disabled=false iconPosition='left' dropdownMenu=false params='' deprecated...>
<@deprecatedWarning args=deprecated />
<#local params = params />
<#-- Visibility of button title -->
<#local displayTitleClass = displaySettings( hideTitle, 'block' ) />
<#if color = 'default' || color='btn-default' || color='btn-secondary' || color='secondary'>
<#local buttonColor = 'btn-default' />
<#elseif color=''>
<#local buttonColor = 'btn-primary' />
<#else>
<#if color == 'primary' || color == 'secondary' || color == 'success' || color == 'info' || color == 'warning' || color == 'danger'>
<#local buttonColor = 'btn-' + color />
<#else>
<#local buttonColor = 'bg-' + color />
</#if>
</#if>
<#if style='card-control'>
<#assign style='text-right btn-link' />
</#if>
<#local class += alignmentSettings(align,'') />
<#-- Size class -->
<#local buttonSize = '' />
<#if size?starts_with('style') == true >
<#local params = params + ' ' + size />
<#else>
<#local buttonSize = size />
</#if>
<#if dropdownMenu>
<div class="btn-group">
</#if>
<a class="${style}<#if buttonSize!=''> btn-${buttonSize}</#if><#if color!=''> ${buttonColor}</#if><#if class!=''> ${class}</#if>"<#if name!=''> name="${name}"</#if><#if id!=''> id="${id}"</#if> href="${href}" title="${title}"<#if target!=''> target="${target}"</#if><#if params!=''> ${params}</#if><#if disabled> disabled</#if><#if dropdownMenu> data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"</#if>>
<#if buttonIcon!='' && iconPosition='left'>
<#local buttonIcon = buttonIcon + ' me-1' />
<@icon style=buttonIcon />
</#if>
<span class="${displayTitleClass}">${title}</span>
<#if buttonIcon!='' && iconPosition='right'>
<#local buttonIcon = buttonIcon + ' ms-1' />
<@icon style=buttonIcon />
</#if>
<#if !dropdownMenu>
<#nested>
</#if>
</a>
<#if dropdownMenu>
<div class="dropdown-menu"<#if id!=''> id="${id}" aria-labelledby="${id}"</#if>>
<#nested>
</div>
</div>
</#if>
</#macro>