mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-11 00:02:05 -05:00
17 lines
517 B
JavaScript
17 lines
517 B
JavaScript
import computed from 'ember-addons/ember-computed-decorators';
|
|
|
|
export default Ember.Component.extend({
|
|
classNameBindings: [':wizard-field', 'typeClass', 'field.invalid'],
|
|
|
|
@computed('field.type')
|
|
typeClass: type => `${Ember.String.dasherize(type)}-field`,
|
|
|
|
@computed('field.id')
|
|
fieldClass: id => `field-${Ember.String.dasherize(id)}`,
|
|
|
|
@computed('field.type', 'field.id')
|
|
inputComponentName(type, id) {
|
|
return (type === 'component') ? Ember.String.dasherize(id) : `wizard-field-${type}`;
|
|
}
|
|
|
|
});
|