2016-08-26 01:14:56 +08:00
|
|
|
import computed from 'ember-addons/ember-computed-decorators';
|
|
|
|
|
|
|
|
export default Ember.Component.extend({
|
2016-09-09 04:58:07 +08:00
|
|
|
classNameBindings: [':wizard-field', 'typeClass', 'field.invalid'],
|
|
|
|
|
|
|
|
@computed('field.type')
|
|
|
|
typeClass: type => `${Ember.String.dasherize(type)}-field`,
|
2016-08-26 01:14:56 +08:00
|
|
|
|
|
|
|
@computed('field.id')
|
2016-09-23 01:38:40 +08:00
|
|
|
fieldClass: id => `field-${Ember.String.dasherize(id)} wizard-focusable`,
|
2016-09-01 01:35:49 +08:00
|
|
|
|
2016-09-02 23:42:14 +08:00
|
|
|
@computed('field.type', 'field.id')
|
|
|
|
inputComponentName(type, id) {
|
|
|
|
return (type === 'component') ? Ember.String.dasherize(id) : `wizard-field-${type}`;
|
|
|
|
}
|
|
|
|
|
2016-08-26 01:14:56 +08:00
|
|
|
});
|