Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22396581
table.jdd.tsx
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
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
application/javascript
Expires
Fri, Nov 27, 16:51 (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1228990
Default Alt Text
table.jdd.tsx (1 KB)
Attached To
Mode
rPHOTOAPP photo-app-demo
Attached
Detach File
Event Timeline