[TASK] add input group element with interaction
This commit is contained in:
@ -174,9 +174,40 @@ function setChoiceByLabel(choicesInstance, label) {
|
||||
{% if autofocus %}autofocus{% endif %}
|
||||
{% if accept %}accept="{{ accept }}"{% endif %}
|
||||
{% if pattern %}pattern="{{ pattern }}"{% endif %}
|
||||
{% if readonly %}readonly{% endif %}>
|
||||
{% if readonly %}readonly{% endif %}/>
|
||||
</div>
|
||||
{% endmacro input %}
|
||||
|
||||
{% macro inputgroup(label, name, type, required=false, class='', value='', min='', hide_label=false, id='', autofocus=false, wrapper_class='', pattern='', readonly=false, accept='') %}
|
||||
<div class="{{ wrapper_class }}">
|
||||
<label for="{{ name }}"
|
||||
class="{% if hide_label %} sr-only {% else %} text-sm text-gray-600 dark:text-white {% endif %}">
|
||||
{{ label }}
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<input {% if type=='datetime-local' %}onclick='if (!this.value) setCurrentdate(this)'{% endif %}
|
||||
{% if id %} id="{{ id }}" {% else %} id="{{ name }}" {% endif %}
|
||||
name="{{ name }}"
|
||||
type="{{ type }}"
|
||||
{% if required %}required{% endif %}
|
||||
value="{{ value }}"
|
||||
class="input {% if readonly %}rounded-md{% else %}rounded-l-md{% endif %} {{ class }}"
|
||||
placeholder="{% if hide_label %}{{ label }}{% endif %}"
|
||||
{% if min is defined %}min="{{ min }}"{% endif %}
|
||||
{% if autofocus %}autofocus{% endif %}
|
||||
{% if accept %}accept="{{ accept }}"{% endif %}
|
||||
{% if pattern %}pattern="{{ pattern }}"{% endif %}
|
||||
readonly/>
|
||||
{% if allowed_to_edit %}
|
||||
<button type="button" class="btn btn-primary rounded-l-none-important edit-js">Ändern</button>
|
||||
<input value="x" type="reset" class="edit-js btn btn-alert btn-hidden rounded-none-important"/>
|
||||
<input value="💾" type="submit" class="btn btn-primary btn-hidden rounded-l-none-important" />
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro inputgroup %}
|
||||
|
||||
|
||||
{% macro checkbox(label, name, id='', checked=false, class='', disabled=false, readonly=false) %}
|
||||
<label for="{{ name }}{{ id }}"
|
||||
class="flex items-center cursor-pointer text-black dark:text-white hover:text-gray-900 dark:hover:text-gray-100 {{ class }}">
|
||||
|
Reference in New Issue
Block a user