mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
19 lines
571 B
JavaScript
19 lines
571 B
JavaScript
import Component from "@ember/component";
|
|
import computed from "ember-addons/ember-computed-decorators";
|
|
import { dasherize } from "@ember/string";
|
|
|
|
export default Component.extend({
|
|
classNameBindings: [":wizard-field", "typeClass", "field.invalid"],
|
|
|
|
@computed("field.type")
|
|
typeClass: type => `${dasherize(type)}-field`,
|
|
|
|
@computed("field.id")
|
|
fieldClass: id => `field-${dasherize(id)} wizard-focusable`,
|
|
|
|
@computed("field.type", "field.id")
|
|
inputComponentName(type, id) {
|
|
return type === "component" ? dasherize(id) : `wizard-field-${type}`;
|
|
}
|
|
});
|