-
Notifications
You must be signed in to change notification settings - Fork 2
/
textarea.ts
49 lines (38 loc) · 1007 Bytes
/
textarea.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { Component } from "./core";
class TextArea extends Component {
constructor(props:any) {
if (props) {
super(props);
this.htmlString = /*html*/ `<textarea type="text" class="form-TextArea"></textarea>`;
this.createNode();
if (props.parent) {
this.appendTo(props.parent);
}
if (props.hint){
this.setPlaceholder(props.hint);
}
}
}
setText(text:string) {
this.node.value = text;
}
getText() {
return this.node.value;
}
setPlaceholder(text: string) {
this.node.placeholder = text;
}
setRow(r: string) {
this.node.rows = r;
}
setCols(c: string) {
this.node.cols = c;
}
setWidth(w: string) {
this.node.style.width = w;
}
setHeight(h: string) {
this.node.style.height = h;
}
}
export { TextArea };