Slide 100
Slide 100 text
class NumberInput extends HTMLElement {
constructor() {…}
createdCallback() {…}
attachedCallback() {…}
attributeChanged(which, oldV, newV) {}
getValue() {…}
setValue(v) {…}
}
document.registerElement(‘number-input’, NumberInput);
attachedCallback() {
this._input = document.createElement('input');
this._input = 'text';
this._input = this._value;
this.createShadowRoot().appendChild(this._input);
this._input.addEventListener(‘keypress’, _restrict);
this._input.addEventListener(‘input’, _onInput);
}