diff --git a/addon/components/ui-filter/input/component.ts b/addon/components/ui-filter/input/component.ts index 519b274..503dabc 100644 --- a/addon/components/ui-filter/input/component.ts +++ b/addon/components/ui-filter/input/component.ts @@ -1,4 +1,4 @@ -import { className, layout } from '@ember-decorators/component'; +import { className, classNames, layout } from '@ember-decorators/component'; import { action } from '@ember/object'; import { empty, or } from '@ember/object/computed'; import Component from '@ember/component'; @@ -7,6 +7,7 @@ import template from './template'; /** * The UiFilterInput component */ +@classNames('ui-filter ui-filter-input') @layout(template) export default class UiFilterInput extends Component { /** @@ -29,6 +30,11 @@ export default class UiFilterInput extends Component { */ public showClearButton = false; + /** + * The name of the icon to use with the close button. + */ + public clearButtonIcon = 'times'; + /** * An array that will be used to populate a menu of options that can * be selected to auto-populate the text input. diff --git a/addon/components/ui-filter/input/template.hbs b/addon/components/ui-filter/input/template.hbs index 2ef2be6..ab1da71 100644 --- a/addon/components/ui-filter/input/template.hbs +++ b/addon/components/ui-filter/input/template.hbs @@ -25,17 +25,16 @@ oninput={{this.handleInputChange}} > -{{#if this.showClearButton}} - - - +{{#if (and this.showClearButton this.value)}} + {{/if}}