mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 03:58:34 +08:00
19 lines
602 B
JavaScript
19 lines
602 B
JavaScript
import Component from "@ember/component";
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
import { dasherize } from "@ember/string";
|
|
|
|
export default Component.extend({
|
|
classNameBindings: [":wizard-field", "typeClass", "field.invalid"],
|
|
|
|
@discourseComputed("field.type")
|
|
typeClass: type => `${dasherize(type)}-field`,
|
|
|
|
@discourseComputed("field.id")
|
|
fieldClass: id => `field-${dasherize(id)} wizard-focusable`,
|
|
|
|
@discourseComputed("field.type", "field.id")
|
|
inputComponentName(type, id) {
|
|
return type === "component" ? dasherize(id) : `wizard-field-${type}`;
|
|
}
|
|
});
|