2019-10-23 12:30:52 -04:00
|
|
|
import Component from "@ember/component";
|
2023-10-10 14:38:59 -04:00
|
|
|
import { computed } from "@ember/object";
|
2019-10-31 13:37:24 -04:00
|
|
|
import { isEmpty } from "@ember/utils";
|
2015-08-21 14:39:21 -04:00
|
|
|
|
2023-02-23 10:32:53 -05:00
|
|
|
export default class Bool extends Component {
|
|
|
|
@computed("value")
|
|
|
|
get enabled() {
|
|
|
|
if (isEmpty(this.value)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return this.value.toString() === "true";
|
|
|
|
}
|
|
|
|
|
|
|
|
set enabled(value) {
|
|
|
|
this.set("value", value ? "true" : "false");
|
|
|
|
}
|
|
|
|
}
|