Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22397457
radio.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
916 B
Referenced Files
None
Subscribers
None
radio.ts
View Options
import
{
Context
}
from
"koa"
;
import
{
FormField
}
from
"../fields/field.js"
;
import
{
FormDataValue
}
from
"../form-types.js"
;
import
{
Tickable
}
from
"./tickable.js"
;
export
class
Radio
extends
Tickable
<
string
>
{
type
=
<
const
>
"radio"
;
constructor
(
public
field
:
FormField
<
boolean
,
string
>
,
public
value
:
string
,
options
:
{
label
?:
string
}
)
{
super
(
field
,
{
default_value
:
""
,
...
options
});
}
makeInputID
()
:
string
{
return
this
.
field
.
name
+
"-"
+
this
.
value
.
replaceAll
(
/\W/g
,
"-"
);
}
getValueAttribute
()
:
string
{
return
this
.
value
;
}
getWrapperClasses
(
ctx
:
Context
,
data
:
Record
<
string
,
FormDataValue
>
,
value
:
string
)
:
string
[]
{
return
[
...
super
.
getWrapperClasses
(
ctx
,
data
,
value
),
this
.
value
.
replaceAll
(
/\W/g
,
"-"
),
];
}
isChecked
(
_ctx
:
Context
,
_data
:
Record
<
string
,
FormDataValue
>
,
value
:
string
)
:
boolean
{
return
this
.
value
===
value
;
}
}
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Fri, Nov 27, 17:11 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1200782
Default Alt Text
radio.ts (916 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline