2021-01-26 09:05:10 +01:00
|
|
|
import Component from "@ember/component";
|
|
|
|
import { not } from "@ember/object/computed";
|
|
|
|
import { observes } from "discourse-common/utils/decorators";
|
|
|
|
|
|
|
|
export default Component.extend({
|
|
|
|
classNameBindings: ['isValid', 'isInvalid'],
|
|
|
|
validMessageKey: null,
|
|
|
|
invalidMessageKey: null,
|
|
|
|
isValid: null,
|
|
|
|
isInvalid: not('isValid'),
|
|
|
|
layoutName: 'components/validator', // useful for sharing the template with extending components
|
2021-01-30 18:46:04 +01:00
|
|
|
didInsertElement() {
|
|
|
|
this.appEvents.on('custom-wizard:validate', this, this.validate);
|
2021-01-26 09:05:10 +01:00
|
|
|
},
|
2021-01-30 18:46:04 +01:00
|
|
|
|
|
|
|
willDestroyElement() {
|
|
|
|
this.appEvents.off('custom-wizard:validate', this, this.validate);
|
|
|
|
}
|
2021-01-26 09:05:10 +01:00
|
|
|
});
|