Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F4637611
number.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
number.ts
View Options
import
{
Context
}
from
"koa"
;
import
{
FlatTemplatable
}
from
"tempstream"
;
import
{
FormField
,
NumberField
}
from
"../fields/field"
;
import
{
FormDataValue
}
from
"../form"
;
import
{
FormControlContext
}
from
"./form-control"
;
import
{
SimpleInput
,
SimpleInputOptions
}
from
"./simple-input"
;
export
type
NumberOptions
=
SimpleInputOptions
&
Partial
<
{
step
:
number
}
>
;
export
class
Number
extends
SimpleInput
<
number
|
null
>
{
field
:
NumberField
;
options
:
NumberOptions
;
constructor
(
field
:
NumberField
,
options
:
NumberOptions
)
{
super
(
field
,
options
);
}
getType
()
{
return
"number"
;
}
async
getInputAttributes
(
fctx
:
FormControlContext
)
:
Promise
<
Record
<
string
,
string
|
boolean
>>
{
const
original
=
await
super
.
getInputAttributes
(
fctx
);
return
{
...
original
,
...
Object
.
fromEntries
([
...(
this
.
field
.
options
.
min
?
[[
"min"
,
this
.
field
.
options
.
min
]]
:
[]),
...(
this
.
field
.
options
.
max
?
[[
"max"
,
this
.
field
.
options
.
max
]]
:
[]),
...(
this
.
options
.
step
?
[[
"step"
,
this
.
options
.
step
]]
:
[]),
]),
};
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, May 27, 23:48 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
663147
Default Alt Text
number.ts (1 KB)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment