Allow placeholder to be configured for `combo-box`.
This commit is contained in:
parent
a64cc9a990
commit
27f06505b1
|
@ -24,8 +24,11 @@ export default SingleSelectComponent.extend({
|
|||
|
||||
@on("didReceiveAttrs")
|
||||
_setComboBoxOptions() {
|
||||
const placeholder = this.get('placeholder');
|
||||
|
||||
this.get("headerComponentOptions").setProperties({
|
||||
clearable: this.get("clearable"),
|
||||
placeholder: placeholder ? I18n.t(placeholder) : "",
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -7,5 +7,6 @@ export default SelectKitHeaderComponent.extend({
|
|||
clearable: Ember.computed.alias("options.clearable"),
|
||||
caretUpIcon: Ember.computed.alias("options.caretUpIcon"),
|
||||
caretDownIcon: Ember.computed.alias("options.caretDownIcon"),
|
||||
shouldDisplayClearableButton: Ember.computed.and("clearable", "computedContent.hasSelection")
|
||||
shouldDisplayClearableButton: Ember.computed.and("clearable", "computedContent.hasSelection"),
|
||||
placeholder: Ember.computed.alias("options.placeholder"),
|
||||
});
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
{{#each icons as |icon|}} {{d-icon icon}} {{/each}}
|
||||
|
||||
<span class="selected-name">
|
||||
{{{label}}}
|
||||
</span>
|
||||
{{#if label}}
|
||||
<span class="selected-name">
|
||||
{{{label}}}
|
||||
</span>
|
||||
{{else}}
|
||||
<span class="combo-box-placeholder">
|
||||
{{placeholder}}
|
||||
</span>
|
||||
{{/if}}
|
||||
|
||||
{{#if shouldDisplayClearableButton}}
|
||||
<button class="btn-clear" {{action onClearSelection bubbles=false}}>
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
.select-kit {
|
||||
&.combo-box {
|
||||
.combo-box-placeholder {
|
||||
color: dark-light-choose($primary-high, $secondary-low);
|
||||
}
|
||||
|
||||
.select-kit-body {
|
||||
width: 100%;
|
||||
|
|
Loading…
Reference in New Issue