Browse Source

Move PropertyNumberView to TS

pull/4849/head
Artur Arseniev 4 years ago
parent
commit
4104d04b51
  1. 8
      src/style_manager/view/PropertyNumberView.ts
  2. 3
      src/style_manager/view/PropertyView.ts

8
src/style_manager/view/PropertyNumberView.js → src/style_manager/view/PropertyNumberView.ts

@ -1,6 +1,8 @@
import PropertyView from './PropertyView'; import PropertyView from './PropertyView';
export default class PropertyNumberView extends PropertyView { export default class PropertyNumberView extends PropertyView {
inputInst?: any;
templateInput() { templateInput() {
return ''; return '';
} }
@ -19,10 +21,10 @@ export default class PropertyNumberView extends PropertyView {
const { ppfx, model, el } = this; const { ppfx, model, el } = this;
if (!this.inputInst) { if (!this.inputInst) {
const { input } = model; const { input } = model as any;
input.ppfx = ppfx; input.ppfx = ppfx;
input.render(); input.render();
const fields = el.querySelector(`.${ppfx}fields`); const fields = el.querySelector(`.${ppfx}fields`)!;
fields.appendChild(input.el); fields.appendChild(input.el);
this.input = input.inputEl.get(0); this.input = input.inputEl.get(0);
this.inputInst = input; this.inputInst = input;
@ -30,7 +32,7 @@ export default class PropertyNumberView extends PropertyView {
} }
clearCached() { clearCached() {
PropertyView.prototype.clearCached.apply(this, arguments); PropertyView.prototype.clearCached.apply(this, arguments as any);
this.inputInst = null; this.inputInst = null;
} }
} }

3
src/style_manager/view/PropertyView.ts

@ -17,7 +17,6 @@ export default class PropertyView extends View<Property> {
create?: Function; create?: Function;
destroy?: Function; destroy?: Function;
update?: Function; update?: Function;
onRender?: Function;
emit?: Function; emit?: Function;
unset?: Function; unset?: Function;
clearEl?: HTMLElement; clearEl?: HTMLElement;
@ -266,4 +265,6 @@ export default class PropertyView extends View<Property> {
this.setValue(model.getValue()); this.setValue(model.getValue());
return this; return this;
} }
onRender() {}
} }

Loading…
Cancel
Save