diff --git a/addon/components/x-file-input.js b/addon/components/x-file-input.js index ea9153d..5a364d1 100644 --- a/addon/components/x-file-input.js +++ b/addon/components/x-file-input.js @@ -9,6 +9,14 @@ export default Component.extend({ layout: layout, tabindex: 0, + /** + * The class given to the label. + * + * @property labelClassName + * @default null + */ + labelClassName: null, + /** * The text displayed when no block is passed. * @@ -49,6 +57,17 @@ export default Component.extend({ return Math.random().toString(36).substring(7); }), + /** + * Allow additiobnal classnames to be passed to the input. + * + * @computedProperty + * @private + */ + inputClassNames: computed('inputClassName', function() { + const inputClassName = this.get('inputClassName'); + return inputClassName ? `x-file--input ${this.get('inputClassName')}` : 'x-file--input'; + }), + /** * Gets files from event object. * diff --git a/addon/templates/components/x-file-input.hbs b/addon/templates/components/x-file-input.hbs index 6c55709..21b7c59 100644 --- a/addon/templates/components/x-file-input.hbs +++ b/addon/templates/components/x-file-input.hbs @@ -1,6 +1,6 @@ - -