This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/templates/components/select-box.hbs
Joffrey JAFFEUX 746c5927e1 Replaces remaining {{category-chooser}} by {{category-select-box}}
To achieve replacement, this commit also adds support for:
- clearSelectionLabel which will allows to unselect any chosen category
- select-box inside a modal
- fixes minor css positioning issues

Note: {{category-chooser}} will be removed in the next weeks.
2017-08-30 17:04:17 +02:00

52 lines
1.2 KiB
Handlebars

<input
class="select-box-offscreen"
type="text"
aria-haspopup="true"
role="button"
aria-labelledby="select-box-input-{{componentId}}"
tabindex={{tabindex}}
/>
{{component selectBoxHeaderComponent
text=generatedHeadertext
focused=focused
caretUpIcon=caretUpIcon
caretDownIcon=caretDownIcon
onToggle=(action "onToggle")
icon=icon
expanded=expanded
value=value
}}
<div class="select-box-body">
{{#if renderBody}}
{{#if filterable}}
{{component selectBoxFilterComponent
onFilterChange=(action "onFilterChange")
icon=filterIcon
focused=filterFocused
placeholder=filterPlaceholder
}}
{{/if}}
{{component selectBoxCollectionComponent
clearSelectionLabel=clearSelectionLabel
filteredContent=filteredContent
selectBoxRowComponent=selectBoxRowComponent
templateForRow=templateForRow
shouldHighlightRow=shouldHighlightRow
titleForRow=titleForRow
lastHovered=lastHovered
onSelectRow=(action "onSelectRow")
onHoverRow=(action "onHoverRow")
onClearSelection=(action "onClearSelection")
noContentLabel=noContentLabel
value=value
}}
{{/if}}
</div>
{{#if wrapper}}
<div class="select-box-wrapper"></div>
{{/if}}