style(templates): format Selmer .html templates for readability
Many templates were minified onto a single line. Reformatted every template under
resources/templates/ with djLint (django profile, 2-space indent) so the markup,
{% %} blocks, and {{ }} interpolations are human-readable, plus hand-split the two
multi-<span> option partials (invoice-option / rule-option). Pure reflow — no markup,
tag, or text content changed (the only content-adjacent delta is harmless trailing
whitespace inside single-interpolation elements). link.html / panel-empty.html stay on
one line (single element). resources/public/index.html left as-is (already readable,
non-template static).
Full e2e suite 72/72 green (no rendering regressions).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@@ -1 +1,9 @@
|
||||
<a class="{{ classes }}"{{ attrs|safe }}>{% if indicator %}<div class="htmx-indicator flex items-center">{% include "templates/components/spinner.html" %}<div class="ml-3">Loading...</div></div>{% endif %}<div class="inline-flex gap-2 items-center justify-center{% if indicator %} htmx-indicator-hidden{% endif %}">{{ body|safe }}</div></a>
|
||||
<a class="{{ classes }}"{{ attrs|safe }}>
|
||||
{% if indicator %}
|
||||
<div class="htmx-indicator flex items-center">
|
||||
{% include "templates/components/spinner.html" %}
|
||||
<div class="ml-3">Loading...</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="inline-flex gap-2 items-center justify-center{% if indicator %} htmx-indicator-hidden{% endif %}">{{ body|safe }}</div>
|
||||
</a>
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
<a class="{{ classes }}"{{ attrs|safe }}><div class="h-4 w-4">{{ body|safe }}</div></a>
|
||||
<a class="{{ classes }}"{{ attrs|safe }}>
|
||||
<div class="h-4 w-4">{{ body|safe }}</div>
|
||||
</a>
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
<div class="{{ classes }}"{{ attrs|safe }}>{{ body|safe }}</div>
|
||||
<div class="{{ classes }}"{{ attrs|safe }}>{{ body|safe }}
|
||||
</div>
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
<button class="{{ classes }}"{{ attrs|safe }}>{{ body|safe }}</button>
|
||||
<button class="{{ classes }}"{{ attrs|safe }}>{{ body|safe }}
|
||||
</button>
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
<div class="inline-flex rounded-md shadow-sm" role="group" hx-on:click="this.querySelector("input").value = event.target.value; this.querySelector("input").dispatchEvent(new Event('change', {bubbles: true}));"><input type="hidden" name="{{ name }}">{{ body|safe }}</div>
|
||||
<div class="inline-flex rounded-md shadow-sm"
|
||||
role="group"
|
||||
hx-on:click="this.querySelector("input").value = event.target.value; this.querySelector("input").dispatchEvent(new Event('change', {bubbles: true}));">
|
||||
<input type="hidden" name="{{ name }}">
|
||||
{{ body|safe }}
|
||||
</div>
|
||||
|
||||
@@ -1 +1,7 @@
|
||||
<button class="{{ classes }}"{{ attrs|safe }}><div class="htmx-indicator flex items-center absolute inset-0 justify-center">{% include "templates/components/spinner.html" %}{% if loading_label %}<div class="ml-3">Loading...</div>{% endif %}</div><div class="htmx-indicator-invisible inline-flex gap-2 items-center justify-center">{{ body|safe }}</div></button>
|
||||
<button class="{{ classes }}"{{ attrs|safe }}>
|
||||
<div class="htmx-indicator flex items-center absolute inset-0 justify-center">
|
||||
{% include "templates/components/spinner.html" %}
|
||||
{% if loading_label %}<div class="ml-3">Loading...</div>{% endif %}
|
||||
</div>
|
||||
<div class="htmx-indicator-invisible inline-flex gap-2 items-center justify-center">{{ body|safe }}</div>
|
||||
</button>
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
<td class="px-4 py-2{% if klass %} {{ klass }}{% endif %}"{{ attrs|safe }}>{{ body|safe }}</td>
|
||||
<td class="px-4 py-2{% if klass %} {{ klass }}{% endif %}"
|
||||
{{ attrs|safe }}>{{ body|safe }}
|
||||
</td>
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<th class="px-4 py-3{% if klass %} {{ klass }}{% endif %}" scope="col" @click="{{ click|safe }}"{{ attrs|safe }}>{% if sort_key %}<a href="#">{{ body|safe }}</a>{% else %}{{ body|safe }}{% endif %}</th>
|
||||
<th class="px-4 py-3{% if klass %} {{ klass }}{% endif %}"
|
||||
scope="col"
|
||||
@click="{{ click|safe }}"
|
||||
{{ attrs|safe }}>
|
||||
{% if sort_key %}
|
||||
<a href="#">{{ body|safe }}</a>
|
||||
{% else %}
|
||||
{{ body|safe }}
|
||||
{% endif %}
|
||||
</th>
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
<tr class="{{ classes }}"{{ attrs|safe }}>{{ body|safe }}</tr>
|
||||
<tr class="{{ classes }}"{{ attrs|safe }}>{{ body|safe }}
|
||||
</tr>
|
||||
|
||||
@@ -1 +1,11 @@
|
||||
<div class="shrink overflow-y-scroll"><table class="{{ table_class }}"{{ table_attrs|safe }}><thead class="{{ thead_class }}"><tr>{{ headers|safe }}</tr></thead><tbody>{{ rows|safe }}</tbody>{{ footer_tbody|safe }}</table></div>
|
||||
<div class="shrink overflow-y-scroll">
|
||||
<table class="{{ table_class }}"{{ table_attrs|safe }}>
|
||||
<thead class="{{ thead_class }}">
|
||||
<tr>{{ headers|safe }}</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ rows|safe }}
|
||||
</tbody>
|
||||
{{ footer_tbody|safe }}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
surrounding Hiccup row via the auto-ap.ssr.selmer interop bridge. #}
|
||||
<select name="{{ name }}" class="{{ classes }}">
|
||||
{% for opt in options %}
|
||||
<option value="{{ opt.value }}"{% if opt.selected %} selected{% endif %}>{{ opt.label }}</option>
|
||||
<option value="{{ opt.value }}"{% if opt.selected %} selected{% endif %}>{{ opt.label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
<div class="{{ classes }}" @click.outside="open=false"{{ attrs|safe }}>{{ body|safe }}</div>
|
||||
<div class="{{ classes }}" @click.outside="open=false"{{ attrs|safe }}>{{ body|safe }}
|
||||
</div>
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
{# Money input (number, step=0.01, right-aligned). sc/money-input builds `attrs`. #}
|
||||
<input{{ attrs|safe }}>
|
||||
<input {{ attrs|safe }}>
|
||||
|
||||
@@ -1 +1,16 @@
|
||||
<ul class="{{ ul_class }}">{% for opt in options %}<li class="{{ li_class }}"><div class="{{ div_class }}"><input id="{{ opt.id }}" type="radio" value="{{ opt.value }}" name="{{ name }}" class="{{ input_class }}"{{ input_attrs|safe }}{% if opt.checked %} checked{% endif %}><label for="{{ opt.id }}" class="{{ label_class }}">{{ opt.content|safe }}</label></div></li>{% endfor %}</ul>
|
||||
<ul class="{{ ul_class }}">
|
||||
{% for opt in options %}
|
||||
<li class="{{ li_class }}">
|
||||
<div class="{{ div_class }}">
|
||||
<input id="{{ opt.id }}"
|
||||
type="radio"
|
||||
value="{{ opt.value }}"
|
||||
name="{{ name }}"
|
||||
class="{{ input_class }}"
|
||||
{{ input_attrs|safe }}
|
||||
{% if opt.checked %}checked{% endif %}>
|
||||
<label for="{{ opt.id }}" class="{{ label_class }}">{{ opt.content|safe }}</label>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{# Generic <select>. options = [{value, label, selected}]. Plain-HTML attributes -- the
|
||||
Selmer migration target (no Hiccup keyword/string attribute ambiguity). Extra attrs
|
||||
(hx-*, x-*) ride through {{ attrs|safe }}. #}
|
||||
<select name="{{ name }}" class="{{ classes }}"{{ attrs|safe }}>{% for opt in options %}<option value="{{ opt.value }}"{% if opt.selected %} selected{% endif %}>{{ opt.label }}</option>{% endfor %}</select>
|
||||
<select name="{{ name }}" class="{{ classes }}"{{ attrs|safe }}>
|
||||
{% for opt in options %}
|
||||
<option value="{{ opt.value }}"{% if opt.selected %} selected{% endif %}>{{ opt.label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
@@ -1 +1,11 @@
|
||||
<svg aria-hidden="true" class="animate-spin inline w-4 h-4 text-white" fill="none" role="status" viewbox="0 0 100 101" xmlns="http://www.w3.org/2000/svg"><path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="#E5E7EB"></path><path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentColor"></path></svg>
|
||||
<svg aria-hidden="true"
|
||||
class="animate-spin inline w-4 h-4 text-white"
|
||||
fill="none"
|
||||
role="status"
|
||||
viewbox="0 0 100 101"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="#E5E7EB">
|
||||
</path>
|
||||
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentColor">
|
||||
</path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
@@ -1 +1,7 @@
|
||||
<svg aria-hidden="true" fill="none" stroke="currentColor" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19 9l-7 7-7-7" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path></svg>
|
||||
<svg aria-hidden="true"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewbox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M19 9l-7 7-7-7" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 216 B After Width: | Height: | Size: 240 B |
@@ -1 +1,8 @@
|
||||
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><defs></defs><title>navigation-next</title><path d="M23,9.5H12.387a4,4,0,0,0-4,4v2" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor"></path><polyline fill="none" points="19 13.498 23 9.498 19 5.498" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor"></polyline><path d="M14.387,13v5.5a1,1,0,0,1-1,1h-12a1,1,0,0,1-1-1V6.5a1,1,0,0,1,1-1h12a1,1,0,0,1,1,1V7" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor"></path></svg>
|
||||
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs></defs><title>navigation-next</title>
|
||||
<path d="M23,9.5H12.387a4,4,0,0,0-4,4v2" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor">
|
||||
</path>
|
||||
<polyline fill="none" points="19 13.498 23 9.498 19 5.498" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor"></polyline>
|
||||
<path d="M14.387,13v5.5a1,1,0,0,1-1,1h-12a1,1,0,0,1-1-1V6.5a1,1,0,0,1,1-1h12a1,1,0,0,1,1,1V7" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor">
|
||||
</path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 560 B After Width: | Height: | Size: 579 B |
@@ -1 +1,3 @@
|
||||
<svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><defs></defs><title>delete-2</title><circle cx="12" cy="12" fill="none" r="11.5" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor"></circle><line fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" x1="7" x2="17" y1="7" y2="17"></line><line fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" x1="17" x2="7" y1="7" y2="17"></line></svg>
|
||||
<svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs></defs><title>delete-2</title><circle cx="12" cy="12" fill="none" r="11.5" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor"></circle><line fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" x1="7" x2="17" y1="7" y2="17"></line><line fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" x1="17" x2="7" y1="7" y2="17"></line>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 478 B |
@@ -1,3 +1,3 @@
|
||||
{# Text input. sc/text-input builds the full attr map (type/autocomplete/class+size
|
||||
already merged, reusing inputs/default-input-classes + hh/add-class) into `attrs`. #}
|
||||
<input{{ attrs|safe }}>
|
||||
<input {{ attrs|safe }}>
|
||||
|
||||
@@ -1,4 +1,60 @@
|
||||
{# Click-to-select typeahead (Alpine + tippy). Survives whole-form swaps; null-guarded
|
||||
tippy?. / $refs.input? throughout. The Clojure wrapper (sc/typeahead) resolves the
|
||||
initial {value,label} server-side and builds x_data + the hidden-input attrs. #}
|
||||
<div class="relative" x-data="{{ x_data }}" x-modelable="value.value"{% if x_model %} x-model="{{ x_model }}"{% endif %}{% if key %} key="{{ key }}"{% endif %}>{% if disabled %}<span x-text="value.label"></span>{% else %}<a class="{{ a_class }}" x-tooltip.on.click="{content: ()=>($refs.dropdown?.innerHTML ?? ''), placement: 'bottom', onMount(i) {htmx.process(i.popper); }, popperOptions: {strategy: 'fixed', modifiers: [{name: 'flip', options: {fallbackPlacements: ['top']}}]}, theme: 'dropdown', allowHTML: true, interactive:true}" @keydown.down.prevent.stop="tippy?.show();" @keydown.backspace="tippy?.hide(); value = {value: '', label: '' }" tabindex="0" x-init="{{ a_xinit }}" x-ref="input"><input{{ hidden_attrs|safe }}><div class="flex w-full justify-items-stretch"><span class="flex-grow text-left" x-text="value.label"></span><div class="w-3 h-3 m-1 inline ml-1 justify-self-end text-gray-500 self-center">{% include "templates/components/svg-drop-down.html" %}</div><div x-show="value.warning"><div class="peer absolute inline-flex items-center z-10 justify-center w-6 h-6 text-xs font-black text-white border-3 border-white rounded-full -top-2 -right-2 dark:border-gray-900 bg-red-300" x-tooltip="value.warning">!</div></div></div></a>{% endif %}<template x-ref="dropdown"><ul class="dropdown-contents bg-gray-100 dark:bg-gray-600 ring-1" @keydown.escape="$refs.input?.__x_tippy?.hide(); value = {value: '', label: '' }; " x-destroy="if ($refs.input) {$refs.input.focus();}"><input type="text" autofocus class="{{ search_class }}" x-model="search" placeholder="{{ placeholder }}" @change.stop="" @keydown.down.prevent="active ++; active = active >= elements.length - 1 ? elements.length - 1 : active" @keydown.up.prevent="active --; active = active < 0 ? 0 : active" @keydown.enter.prevent.stop="$refs.input?.__x_tippy?.hide(); value = elements.length > 0 ? $data.elements[active >= 0 ? active : 0] : {'value': '', label: ''}; $refs.input?.focus()" x-init="$el.focus(); $watch('search', s => { if($el.value.length > 2) {fetch(addQueryParam(baseUrl, 'q', s)).then(data=>data.json()).then(data => {elements = data; active=-1; $refs.input?.__x_tippy?.popperInstance?.update()}) }})"><div class="dropdown-options rounded-b-lg overflow-hidden"><template x-for="(element, index) in elements"><li><a class="px-4 py-2 flex gap-2 items-center outline-0 focus:bg-neutral-100 hover:bg-neutral-100 whitespace-nowrap [&.active]:bg-primary-500 [&.active]:dark:bg-primary-700 text-gray-800 dark:text-gray-100" href="#" :class="active == index ? 'active' : ''" @mouseover="active = index" @mouseout="active = -1" @click.prevent="value = element; $refs.input?.__x_tippy?.hide(); setTimeout(() => $refs.input?.focus(), 10)" x-html="element.label"></a></li></template><template x-if="elements.length == 0"><li class="px-4 py-2 flex gap-2 items-center outline-0 focus:bg-neutral-100 hover:bg-neutral-100 whitespace-nowrap [&.active]:bg-primary-500 text-gray-800 dark:text-gray-100 text-xs ">No results found</li></template></div></ul></template></div>
|
||||
<div class="relative"
|
||||
x-data="{{ x_data }}"
|
||||
x-modelable="value.value"
|
||||
{% if x_model %}x-model="{{ x_model }}"{% endif %}
|
||||
{% if key %}key="{{ key }}"{% endif %}>
|
||||
{% if disabled %}
|
||||
<span x-text="value.label"></span>
|
||||
{% else %}
|
||||
<a class="{{ a_class }}"
|
||||
x-tooltip.on.click="{content: ()=>($refs.dropdown?.innerHTML ?? ''), placement: 'bottom', onMount(i) {htmx.process(i.popper); }, popperOptions: {strategy: 'fixed', modifiers: [{name: 'flip', options: {fallbackPlacements: ['top']}}]}, theme: 'dropdown', allowHTML: true, interactive:true}"
|
||||
@keydown.down.prevent.stop="tippy?.show();"
|
||||
@keydown.backspace="tippy?.hide(); value = {value: '', label: '' }"
|
||||
tabindex="0"
|
||||
x-init="{{ a_xinit }}"
|
||||
x-ref="input"><input {{ hidden_attrs|safe }}>
|
||||
<div class="flex w-full justify-items-stretch">
|
||||
<span class="flex-grow text-left" x-text="value.label"></span>
|
||||
<div class="w-3 h-3 m-1 inline ml-1 justify-self-end text-gray-500 self-center">
|
||||
{% include "templates/components/svg-drop-down.html" %}
|
||||
</div>
|
||||
<div x-show="value.warning">
|
||||
<div class="peer absolute inline-flex items-center z-10 justify-center w-6 h-6 text-xs font-black text-white border-3 border-white rounded-full -top-2 -right-2 dark:border-gray-900 bg-red-300"
|
||||
x-tooltip="value.warning">!</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{% endif %}
|
||||
<template x-ref="dropdown">
|
||||
<ul class="dropdown-contents bg-gray-100 dark:bg-gray-600 ring-1"
|
||||
@keydown.escape="$refs.input?.__x_tippy?.hide(); value = {value: '', label: '' }; "
|
||||
x-destroy="if ($refs.input) {$refs.input.focus();}">
|
||||
<input type="text"
|
||||
autofocus
|
||||
class="{{ search_class }}"
|
||||
x-model="search"
|
||||
placeholder="{{ placeholder }}"
|
||||
@change.stop=""
|
||||
@keydown.down.prevent="active ++; active = active >= elements.length - 1 ? elements.length - 1 : active"
|
||||
@keydown.up.prevent="active --; active = active < 0 ? 0 : active"
|
||||
@keydown.enter.prevent.stop="$refs.input?.__x_tippy?.hide(); value = elements.length > 0 ? $data.elements[active >= 0 ? active : 0] : {'value': '', label: ''}; $refs.input?.focus()"
|
||||
x-init="$el.focus(); $watch('search', s => { if($el.value.length > 2) {fetch(addQueryParam(baseUrl, 'q', s)).then(data=>data.json()).then(data => {elements = data; active=-1; $refs.input?.__x_tippy?.popperInstance?.update()}) }})">
|
||||
<div class="dropdown-options rounded-b-lg overflow-hidden">
|
||||
<template x-for="(element, index) in elements">
|
||||
<li><a class="px-4 py-2 flex gap-2 items-center outline-0 focus:bg-neutral-100 hover:bg-neutral-100 whitespace-nowrap [&.active]:bg-primary-500 [&.active]:dark:bg-primary-700 text-gray-800 dark:text-gray-100"
|
||||
href="#"
|
||||
:class="active == index ? 'active' : ''"
|
||||
@mouseover="active = index"
|
||||
@mouseout="active = -1"
|
||||
@click.prevent="value = element; $refs.input?.__x_tippy?.hide(); setTimeout(() => $refs.input?.focus(), 10)"
|
||||
x-html="element.label"></a></li>
|
||||
</template><template x-if="elements.length == 0">
|
||||
<li class="px-4 py-2 flex gap-2 items-center outline-0 focus:bg-neutral-100 hover:bg-neutral-100 whitespace-nowrap [&.active]:bg-primary-500 text-gray-800 dark:text-gray-100 text-xs ">No results found</li>
|
||||
</template>
|
||||
</div>
|
||||
</ul>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -3,4 +3,10 @@
|
||||
carries any pass-through div attributes (the per-row location cell hangs its hx-* /
|
||||
x-dispatch swap wiring here); `body` is the pre-rendered inner control HTML;
|
||||
`errors_str` is the comma-joined string errors (empty when none). #}
|
||||
<div class="{{ classes }}"{{ attrs|safe }}>{% if label %}<label class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{{ label }}</label>{% endif %}{{ body|safe }}<p class="mt-2 text-xs text-red-600 dark:text-red-500 h-4">{{ errors_str }}</p></div>
|
||||
<div class="{{ classes }}"{{ attrs|safe }}>
|
||||
{% if label %}
|
||||
<label class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{{ label }}</label>
|
||||
{% endif %}
|
||||
{{ body|safe }}
|
||||
<p class="mt-2 text-xs text-red-600 dark:text-red-500 h-4">{{ errors_str }}</p>
|
||||
</div>
|
||||
|
||||