discourse/app/assets/javascripts/wizard/components/wizard-field.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
602 B
JavaScript
Raw Normal View History

import Component from "@ember/component";
import discourseComputed from "discourse-common/utils/decorators";
import { dasherize } from "@ember/string";
2016-08-26 01:14:56 +08:00
export default Component.extend({
2016-09-09 04:58:07 +08:00
classNameBindings: [":wizard-field", "typeClass", "field.invalid"],
@discourseComputed("field.type")
typeClass: type => `${dasherize(type)}-field`,
2016-08-26 01:14:56 +08:00
@discourseComputed("field.id")
fieldClass: id => `field-${dasherize(id)} wizard-focusable`,
@discourseComputed("field.type", "field.id")
2016-09-02 23:42:14 +08:00
inputComponentName(type, id) {
return type === "component" ? dasherize(id) : `wizard-field-${type}`;
2016-09-02 23:42:14 +08:00
}
2016-08-26 01:14:56 +08:00
});