2022-11-02 23:00:04 +00:00
|
|
|
{{!
|
|
|
|
See @typedef MenuDefinition
|
|
|
|
}}
|
|
|
|
{{! this template must be used with Dropdown/Close to avoid unclosed HTML tags }}
|
2023-06-26 16:54:44 +00:00
|
|
|
<div id="{{id}}" class="vector-dropdown{{#class}} {{.}}{{/class}}" {{{html-tooltip}}} {{{html-user-language-attributes}}}>
|
2022-11-02 23:00:04 +00:00
|
|
|
{{!
|
|
|
|
Dropdown menus use the checkbox hack and require `input` and `label` elements.
|
2023-01-24 18:03:54 +00:00
|
|
|
The `label` element functions as the "visual" button and is hidden from screenreader users (T325026)
|
|
|
|
while the `input` element is the actual semantic button for toggling the dropdown.
|
|
|
|
The `input` element will always have an `aria-label`, which will usually match the
|
|
|
|
text inside the `label` element, unless an alternative label is provided via the `#aria-label`
|
|
|
|
mustache template data.
|
2022-11-02 23:00:04 +00:00
|
|
|
}}
|
|
|
|
<input type="checkbox"
|
|
|
|
id="{{id}}-checkbox"
|
|
|
|
role="button"
|
|
|
|
aria-haspopup="true"
|
|
|
|
data-event-name="ui.dropdown-{{id}}"
|
2023-06-26 16:54:44 +00:00
|
|
|
class="vector-dropdown-checkbox{{#checkbox-class}} {{.}}{{/checkbox-class}}"
|
2022-11-02 23:00:04 +00:00
|
|
|
{{#aria-label}}aria-label="{{.}}"{{/aria-label}}
|
2023-01-24 18:03:54 +00:00
|
|
|
{{^aria-label}}aria-label="{{label}}"{{/aria-label}}
|
2022-11-02 23:00:04 +00:00
|
|
|
{{{html-vector-menu-checkbox-attributes}}}
|
|
|
|
/>
|
|
|
|
<label
|
|
|
|
id="{{id}}-label"
|
|
|
|
for="{{id}}-checkbox"
|
2023-06-26 16:54:44 +00:00
|
|
|
class="vector-dropdown-label{{#label-class}} {{.}}{{/label-class}}"
|
2023-01-24 18:03:54 +00:00
|
|
|
aria-hidden="true"
|
2023-06-22 19:22:07 +00:00
|
|
|
{{{html-vector-menu-label-attributes}}}
|
2022-11-02 23:00:04 +00:00
|
|
|
>
|
2023-02-16 19:41:35 +00:00
|
|
|
{{#icon}}{{>Icon}}{{/icon}}
|
2023-06-26 16:54:44 +00:00
|
|
|
<span class="vector-dropdown-label-text">{{label}}</span>
|
2022-11-02 23:00:04 +00:00
|
|
|
</label>
|
2023-06-26 16:54:44 +00:00
|
|
|
<div class="vector-dropdown-content">
|
2022-11-02 23:00:04 +00:00
|
|
|
|