Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F4637532
textarea.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
textarea.ts
View Options
import
{
Context
}
from
"koa"
;
import
{
FlatTemplatable
,
tempstream
}
from
"tempstream"
;
import
{
attribute
}
from
"../../sanitize"
;
import
{
getRequiredClass
,
inputWrapper
}
from
"../../utils/input-wrapper"
;
import
{
FormField
}
from
"../fields/field"
;
import
{
FormDataValue
}
from
"../form"
;
import
{
FormFieldControl
}
from
"./form-field-control"
;
export
class
Textarea
extends
FormFieldControl
{
constructor
(
public
field
:
FormField
,
public
options
:
{
label
?:
string
;
rows
?:
number
;
cols
?:
number
}
=
{}
)
{
super
([
field
]);
}
async
render
(
ctx
:
Context
,
data
:
Record
<
string
,
FormDataValue
>
)
:
Promise
<
FlatTemplatable
>
{
const
{
raw
}
=
await
this
.
field
.
getValue
(
ctx
,
data
);
const
{
name
,
required
}
=
this
.
field
;
return
inputWrapper
(
[
name
,
getRequiredClass
(
required
)],
/* HTML */
` <label for="
${
name
}
"
>
${
this
.
options
.
label
!=
undefined
?
this
.
options
.
label
:
name
}
</label
>
<textarea
name="
${
name
}
"
id="
${
name
}
"
rows="
${
this
.
options
.
rows
||
5
}
"
cols="
${
this
.
options
.
cols
||
33
}
"
>
${
attribute
((
raw
||
""
).
toString
())
}
</textarea
>`
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, May 27, 23:47 (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
704728
Default Alt Text
textarea.ts (1 KB)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment