salix/front/core/lib/input.js

30 lines
664 B
JavaScript

import Component from './component';
/**
* Component that host an input.
*/
export default class Input extends Component {
constructor($element, $scope) {
super($element, $scope);
this.input = this.element.querySelector('input');
}
set disabled(value) {
this.input.disabled = value == true;
this.mdlUpdate();
}
get disabled() {
return this.input.disabled;
}
select() {
this.input.select();
}
focus() {
this.input.focus();
}
mdlUpdate() {
if (this.mdlElement)
this.mdlElement.updateClasses_();
}
}
Input.$inject = ['$element', '$scope'];