Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7188688
number.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
970 B
Referenced Files
None
Subscribers
None
number.ts
View Options
import
{
NumberField
}
from
"../fields/number.js"
;
import
{
FormControlContext
}
from
"./form-control.js"
;
import
{
SimpleInput
,
SimpleInputOptions
}
from
"./simple-input.js"
;
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
]]
:
[]),
]),
}
as
Record
<
string
,
string
>
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Jul 8, 08:27 (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
625011
Default Alt Text
number.ts (970 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment