Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F3010406
checkbox.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
953 B
Referenced Files
None
Subscribers
None
checkbox.ts
View Options
import
{
Context
}
from
"koa"
;
import
{
FormDataValue
}
from
"../form-types.js"
;
import
{
Tickable
,
TickableOptions
}
from
"./tickable.js"
;
import
{
FormField
}
from
"../fields/field.js"
;
export
class
Checkbox
extends
Tickable
<
boolean
>
{
type
=
<
const
>
"checkbox"
;
constructor
(
public
field
:
FormField
<
boolean
,
boolean
>
,
options
:
Partial
<
TickableOptions
<
boolean
>>
=
{}
)
{
super
(
field
,
{
...
options
,
default_value
:
options
.
default_value
==
undefined
?
false
:
options
.
default_value
,
});
}
isChecked
(
_ctx
:
Context
,
_data
:
Record
<
string
,
FormDataValue
>
,
value
:
boolean
)
:
boolean
{
return
value
;
}
getValueAttribute
()
:
string
{
return
""
;
}
}
export
class
CheckboxWithValue
extends
Checkbox
{
constructor
(
public
field
:
FormField
<
boolean
,
boolean
>
,
options
:
TickableOptions
<
boolean
>
,
public
value
:
string
)
{
super
(
field
,
options
);
}
getValueAttribute
()
:
string
{
return
this
.
value
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Wed, May 7, 19:41 (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
625151
Default Alt Text
checkbox.ts (953 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment