Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F996549
component-input-enum.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
730 B
Referenced Files
None
Subscribers
None
component-input-enum.ts
View Options
import
type
{
Enum
}
from
"@sealcode/jdd"
;
import
{
printArgPath
}
from
"./print-arg-path.js"
;
export
function
ComponentInputEnum
<
State
,
S
extends
string
,
T
extends
Enum
<
S
>>
({
arg_path
,
arg
,
value
,
onchange
,
}
:
{
state
:
State
;
arg_path
:
string
[];
arg
:
T
;
value
:
string
;
onchange
?:
string
;
})
{
return
/* HTML */
`<div id=
${
`component-input-enum-
${
arg_path
.
join
(
"-"
)
}
`
}
>
<label>
${
arg_path
.
at
(
-
1
)
||
""
}
<select
name="
${
`$
${
printArgPath
(
arg_path
)
}
`
}
"
onchange="
${
onchange
||
""
}
"
>
${
arg
.
values
.
map
(
(
v
:
S
)
=>
/* HTML */
`<option
value="
${
v
}
"
${
value
==
v
?
"selected"
:
""
}
>
${
v
}
</option>`
)
.
join
(
""
)
}
</select>
</label>
</div>`
;
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Dec 24, 14:05 (10 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557310
Default Alt Text
component-input-enum.ts (730 B)
Attached To
Mode
rJDDE jdd-editor
Attached
Detach File
Event Timeline
Log In to Comment