2018-06-15 11:03:24 -04:00
|
|
|
import computed from "ember-addons/ember-computed-decorators";
|
2016-08-25 13:14:56 -04:00
|
|
|
|
|
|
|
export default Ember.Component.extend({
|
2018-06-15 11:03:24 -04:00
|
|
|
classNameBindings: [":wizard-field", "typeClass", "field.invalid"],
|
2016-09-08 16:58:07 -04:00
|
|
|
|
2018-06-15 11:03:24 -04:00
|
|
|
@computed("field.type")
|
2016-09-08 16:58:07 -04:00
|
|
|
typeClass: type => `${Ember.String.dasherize(type)}-field`,
|
2016-08-25 13:14:56 -04:00
|
|
|
|
2018-06-15 11:03:24 -04:00
|
|
|
@computed("field.id")
|
2016-09-22 13:38:40 -04:00
|
|
|
fieldClass: id => `field-${Ember.String.dasherize(id)} wizard-focusable`,
|
2016-08-31 13:35:49 -04:00
|
|
|
|
2018-06-15 11:03:24 -04:00
|
|
|
@computed("field.type", "field.id")
|
2016-09-02 11:42:14 -04:00
|
|
|
inputComponentName(type, id) {
|
2018-06-15 11:03:24 -04:00
|
|
|
return type === "component"
|
|
|
|
? Ember.String.dasherize(id)
|
|
|
|
: `wizard-field-${type}`;
|
2016-09-02 11:42:14 -04:00
|
|
|
}
|
2016-08-25 13:14:56 -04:00
|
|
|
});
|