{# @description The band above a full-page table. A bar that is always shown holds the title. A panel under it holds search and filters, and the controls sit at the end of the panel's row. A toggle in the bar opens and closes the panel; closed, the controls move up into the bar. The choice is remembered in the browser. #} {# @prop title:text | description:"Start of the bar: the heading and anything beside it." #} {# @prop heading:text | description:"The page title. Drawn at the start of the bar, or above the bar with heading_above." #} {# @prop heading_above:boolean | description:"Draw the heading above the bar, for a title layout too tall for one row." #} {# @prop actions:text | description:"End of the bar, before the toggle. Always shown." #} {# @prop controls:text | description:"Buttons such as Filters and Add: at the end of the panel's row while it is open, in the bar while it is closed." #} {# @prop note:text | description:"Words shown in a badge beside the toggle, open or closed, for something in the panel the reader should know about, such as how many filters are applied." #} {# @prop storage_key:text | default:"mvp-table-toolbar" | description:"Name the open or closed choice is remembered under." #} {# @prop class:text | description:"Extra classes on the toolbar's root element." #} {# @slot Search, filters, the applied filters — the panel's content. With none, there is no panel and no toggle. #} {% load i18n mvp %}
{% if heading_above and not heading|slot_is_empty %}
{{ heading }}
{% endif %} {% comment %} One wrapping row, placed by order: the title, the controls when closed, the toggle, then a break, the panel and the controls when open. Closing the panel hands its whole row to the table, and the controls stay. {% endcomment %}
{% if not heading_above %}{{ heading }}{% endif %} {{ title }}
{{ actions }} {% if not slot|slot_is_empty %} {% if note %} {{ note }} {% endif %} {% endif %}
{% if not slot|slot_is_empty %}
{{ slot }}
{% endif %} {% if not controls|slot_is_empty %}
{{ controls }}
{% endif %}