Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F10352741
form-control.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
882 B
Referenced Files
None
Subscribers
None
form-control.ts
View Options
import
Router
from
"@koa/router"
;
import
{
Context
}
from
"koa"
;
import
{
FlatTemplatable
}
from
"tempstream"
;
import
{
FormMessage
,
FormData
}
from
"../form-types.js"
;
import
type
{
Form
}
from
"../form.js"
;
export
type
FieldMessages
<
Fieldnames
extends
string
=
string
>
=
Record
<
Fieldnames
,
{
type
:
"error"
|
"info"
;
message
:
string
}
>
;
export
class
FormControlContext
{
constructor
(
public
ctx
:
Context
,
public
data
:
FormData
,
public
messages
:
FormMessage
[],
public
field_name_prefix
:
string
,
public
form_id
:
string
,
public
validate
:
boolean
)
{}
}
export
abstract
class
FormControl
{
abstract
render
(
fctx
:
FormControlContext
)
:
FlatTemplatable
|
Promise
<
FlatTemplatable
>
;
abstract
role
:
"input"
|
"decoration"
|
"messages"
|
"submit"
;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
mount
(
_router
:
Router
,
_form
:
Form
<
any
,
any
>
)
{}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Sun, Nov 2, 18:53 (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1028695
Default Alt Text
form-control.ts (882 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment