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
|
|
|
}}
|
2023-07-05 17:19:37 +00:00
|
|
|
<input {{!
|
|
|
|
}}type="checkbox" {{!
|
|
|
|
}}id="{{id}}-checkbox" {{!
|
|
|
|
}}role="button" {{!
|
|
|
|
}}aria-haspopup="true" {{!
|
|
|
|
}}data-event-name="ui.dropdown-{{id}}" {{!--
|
|
|
|
}}class="vector-dropdown-checkbox{{#checkbox-class}} {{.}}{{/checkbox-class}}" {{!
|
|
|
|
}}{{#aria-label}}aria-label="{{.}}"{{/aria-label}} {{!
|
|
|
|
}}{{^aria-label}}aria-label="{{label}}"{{/aria-label}} {{!
|
2023-07-20 10:56:06 +00:00
|
|
|
}}{{#html-vector-menu-checkbox-attributes}} {{{.}}}{{/html-vector-menu-checkbox-attributes}}>
|
2023-07-05 17:19:37 +00:00
|
|
|
<label {{!
|
|
|
|
}}id="{{id}}-label" {{!
|
|
|
|
}}for="{{id}}-checkbox" {{!
|
|
|
|
}}class="vector-dropdown-label{{#label-class}} {{.}}{{/label-class}}" {{!
|
|
|
|
}}aria-hidden="true" {{!
|
2023-07-20 10:56:06 +00:00
|
|
|
}}{{#html-vector-menu-label-attributes}} {{{.}}}{{/html-vector-menu-label-attributes}}>{{!
|
2023-07-05 17:19:37 +00:00
|
|
|
}}{{#icon}}{{>Icon}}{{/icon}}{{!
|
|
|
|
}}<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
|
|
|
|