release: WRNexusJS 0.3.5
This commit is contained in:
@@ -1,24 +1,14 @@
|
||||
component Table {
|
||||
props {
|
||||
size = "default"
|
||||
color = "primary"
|
||||
caption = "Table"
|
||||
columns = []
|
||||
rows = []
|
||||
striped = true
|
||||
class = ""
|
||||
caption = "Data table"
|
||||
responsive = true
|
||||
striped = false
|
||||
hoverable = true
|
||||
compact = false
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="wire-table-wrap rounded-2xl border border-[var(--wire-color-border)] bg-[var(--wire-color-surface)] shadow-[var(--wire-shadow-sm)] {class}">
|
||||
<table
|
||||
class="wire-table min-w-[640px]"
|
||||
class:wire-table--striped='{striped}'
|
||||
class:wire-table--compact='{compact}'
|
||||
class:wire-table--hoverable='{hoverable}'
|
||||
>
|
||||
<caption class="wire-visually-hidden">{caption}</caption>
|
||||
<slot />
|
||||
</table>
|
||||
</div>
|
||||
<div class="wire-next wire-next--color-{color} wire-next--size-{size} wire-next--table {class}"><table><caption>{caption}</caption><thead><tr>{#each columns as column}<th>{column.label}</th>{/each}</tr></thead><tbody>{#each rows as row}<tr>{#each columns as column}<td>{row[column.key]}</td>{/each}</tr>{/each}</tbody></table><slot /></div>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user