Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F8922174
field-group.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
807 B
Referenced Files
None
Subscribers
None
field-group.ts
View Options
import
{
Context
}
from
"koa"
;
import
{
FlatTemplatable
,
tempstream
}
from
"tempstream"
;
import
{
FormDataValue
}
from
"../form"
;
import
{
FormControl
}
from
"./form-control"
;
export
class
FieldGroup
extends
FormControl
{
constructor
(
public
controls
:
FormControl
[],
public
options
:
{
label
?:
string
;
classes
?:
string
}
=
{}
)
{
super
();
}
async
render
(
ctx
:
Context
,
data
:
Record
<
string
,
FormDataValue
>
)
:
Promise
<
FlatTemplatable
>
{
const
{
label
,
classes
}
=
this
.
options
;
return
tempstream
/* HTML */
`
<div class="field-group
${
classes
||
""
}
">
${
label
?
`<label>
${
label
}
</label>`
:
""
}
<div class="field-group__fields">
${
this
.
controls
.
map
((
control
)
=>
control
.
render
(
ctx
,
data
,
[],
""
,
""
)
)
}
</div>
</div>
`
;
}
role
=
<
const
>
"decoration"
;
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Sat, Sep 20, 14:20 (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
929900
Default Alt Text
field-group.ts (807 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment