{% load static components %} {# ─── USX Table Row ───────────────────────────────────────────────────────────── #} {# Props (passed via {% include ... with ... %}): #} {# row dict the data row #} {# rowIndex int 0-based row index #} {# leaf_columns list[dict] visible leaf column definitions #} {# total_cols int total column count #} {# primaryKey str default 'id' #} {# select list selected primary-key values #} {# disabled list disabled primary-key values #} {# selectionMode 'checkbox'|'radio'|None #} {# selectionPosition 'left'|'right' #} {# onClickRow truthy when rows are navigable #} {# rowUrlField str row dict key for the navigation URL #} {# rowDetails truthy when row-detail toggle column is present #} {# rowDetailTemplate str|None path to partial template for detail #} {# rowDetailField str|None row dict key for inline detail content #} {# expandedRows list primary-key values with detail open #} {# responsive 'stack'|'stack-header'|False #} {# ──────────────────────────────────────────────────────────────────────────────── #} {% with pk=row.id|default:"" %} {# ── Data row ────────────────────────────────────────────────────────────── #} {# ── Row detail toggle cell ─────────────────────────────────────────────── #} {% if rowDetails and rowDetails != "null" %}
{% icon name='expand_more' className='usx-table__detail-icon' %}{% endicon %} Toggle row details
{% endif %} {# ── Selection cell (left) ──────────────────────────────────────────────── #} {% if selectionMode and selectionMode != "null" and selectionPosition != 'right' %} {% endif %} {# ── Data cells ─────────────────────────────────────────────────────────── #} {% for col in leaf_columns %} {% if col.primary %} {% for rk, rv in row.items %}{% if rk == col.key %}{{ rv }}{% endif %}{% endfor %} {% else %} {% for rk, rv in row.items %}{% if rk == col.key %}{{ rv }}{% endif %}{% endfor %} {% endif %} {% endfor %}{# /leaf_columns #} {# ── Selection cell (right) ─────────────────────────────────────────────── #} {% if selectionMode and selectionMode != "null" and selectionPosition == 'right' %} {% endif %} {# ── Detail row (expands below;
open state controls visibility) ── #} {% if rowDetails and rowDetails != "null" %} {% if rowDetailField %} {% for rk, rv in row.items %}{% if rk == rowDetailField %}{{ rv }}{% endif %}{% endfor %} {% endif %} {% endif %} {% endwith %}