Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7112565
table.jdd.tsx
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
table.jdd.tsx
View Options
import
{
FlatTemplatable
,
TempstreamJSX
}
from
"tempstream"
;
import
{
Component
,
ComponentArguments
,
ExtractStructuredComponentArgumentsValues
,
isTableHeader
,
JDDContext
,
}
from
"@sealcode/jdd"
;
const
component_arguments
=
{
table
:
new
ComponentArguments
.
Table
(
new
ComponentArguments
.
ShortText
(),
new
ComponentArguments
.
Structured
({
color
:
new
ComponentArguments
.
Enum
([
"red"
,
"blue"
,
"green"
,
"aquamarine"
]),
word
:
new
ComponentArguments
.
ShortText
().
setExampleValues
([
"apple"
,
"banana"
,
"pineapple"
,
"carrot"
,
]),
})
),
}
as
const
;
export
class
Table
extends
Component
<
typeof
component_arguments
>
{
getArguments
()
{
return
component_arguments
;
}
toHTML
({
table
,
}
:
ExtractStructuredComponentArgumentsValues
<
typeof
component_arguments
>
)
:
FlatTemplatable
{
return
(
<
div
class
=
"table"
>
<
table
>
<
tbody
>
{
table
.
rows
.
map
((
row
)
=>
isTableHeader
(
row
)
?
(
<
tr
>
<
th
colspan
=
{
this
.
getArguments
()
.
table
.
getColumnsCount
(
table
)
.
toString
()}
>
{
row
.
header_content
}
<
/th>
<
/tr>
)
:
(
<
tr
>
{
row
.
cells
.
map
(({
color
,
word
})
=>
(
<
td
style
=
{
`color:
${
color
}
`
}
>
{
word
}
<
/td>
))}
<
/tr>
)
)}
<
/tbody>
<
/table>
<
/div>
);
}
}
File Metadata
Details
Attached
Mime Type
text/html
Expires
Thu, Jul 3, 20:50 (13 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
794883
Default Alt Text
table.jdd.tsx (1 KB)
Attached To
Mode
rPLAY Sealious playground
Attached
Detach File
Event Timeline
Log In to Comment