2017-11-16 13:30:17 +00:00
|
|
|
import Component from './component';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Component that host an input.
|
|
|
|
*/
|
|
|
|
export default class Input extends Component {
|
2018-02-12 12:16:49 +00:00
|
|
|
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;
|
|
|
|
}
|
2017-11-16 13:30:17 +00:00
|
|
|
select() {
|
|
|
|
this.input.select();
|
|
|
|
}
|
|
|
|
focus() {
|
|
|
|
this.input.focus();
|
|
|
|
}
|
2018-02-12 12:16:49 +00:00
|
|
|
mdlUpdate() {
|
|
|
|
if (this.mdlElement)
|
|
|
|
this.mdlElement.updateClasses_();
|
|
|
|
}
|
2017-11-16 13:30:17 +00:00
|
|
|
}
|
2018-02-12 12:16:49 +00:00
|
|
|
Input.$inject = ['$element', '$scope'];
|