24 lines
853 B
Plaintext
24 lines
853 B
Plaintext
<#macro kw invalid name autofocus=false disabled=false message=true required=true rest...>
|
|
<label class="sr-only" for="${name}">
|
|
<#nested>
|
|
</label>
|
|
<input
|
|
<#if autofocus>autofocus</#if>
|
|
<#if disabled>disabled</#if>
|
|
<#if required>required</#if>
|
|
aria-invalid="${messagesPerField.existsError(invalid)?c}"
|
|
class="block border-gray-300 mt-1 rounded-md w-full focus:border-primary-300 focus:ring focus:ring-primary-200 focus:ring-opacity-50 sm:text-sm"
|
|
id="${name}"
|
|
name="${name}"
|
|
placeholder="<#compress><#nested></#compress>"
|
|
<#list rest as attrName, attrValue>
|
|
${attrName}="${attrValue}"
|
|
</#list>
|
|
>
|
|
<#if message && messagesPerField.existsError(invalid)>
|
|
<div class="mt-2 text-red-600 text-sm">
|
|
${kcSanitize(messagesPerField.getFirstError(invalid))?no_esc}
|
|
</div>
|
|
</#if>
|
|
</#macro>
|