Add fonts, autotable, autotable examples
This commit is contained in:
@@ -51,11 +51,11 @@ func SidebarNav(items []SidebarNavItem, onItemClick func(string), class string)
|
||||
vdom.On(vdom.EVENT_CLICK, func() { handleClick(id) }),
|
||||
}
|
||||
if item.Icon != nil {
|
||||
btnMods = append(btnMods, vdom.El("span", vdom.Attr("class", sidebarNavIcon), item.Icon))
|
||||
btnMods = append(btnMods, vdom.Span(vdom.Attr("class", sidebarNavIcon), item.Icon))
|
||||
}
|
||||
btnMods = append(btnMods, vdom.Text(item.Label))
|
||||
|
||||
liMods := []vdom.Mod{vdom.El("button", btnMods...)}
|
||||
liMods := []vdom.Mod{vdom.Button(btnMods...)}
|
||||
|
||||
if len(item.Children) > 0 {
|
||||
subListMods := []vdom.Mod{vdom.Attr("class", sidebarNavList)}
|
||||
@@ -66,20 +66,19 @@ func SidebarNav(items []SidebarNavItem, onItemClick func(string), class string)
|
||||
vdom.On(vdom.EVENT_CLICK, func() { handleClick(sid) }),
|
||||
}
|
||||
if sub.Icon != nil {
|
||||
subBtnMods = append(subBtnMods, vdom.El("span", vdom.Attr("class", sidebarNavIcon), sub.Icon))
|
||||
subBtnMods = append(subBtnMods, vdom.Span(vdom.Attr("class", sidebarNavIcon), sub.Icon))
|
||||
}
|
||||
subBtnMods = append(subBtnMods, vdom.Text(sub.Label))
|
||||
subListMods = append(subListMods, vdom.El("li", vdom.El("button", subBtnMods...)))
|
||||
subListMods = append(subListMods, vdom.Li(vdom.Button(subBtnMods...)))
|
||||
}
|
||||
liMods = append(liMods, vdom.El("ul", subListMods...))
|
||||
liMods = append(liMods, vdom.Ul(subListMods...))
|
||||
}
|
||||
|
||||
listMods = append(listMods, vdom.El("li", liMods...))
|
||||
listMods = append(listMods, vdom.Li(liMods...))
|
||||
}
|
||||
|
||||
return vdom.El("nav",
|
||||
vdom.Attr("class", cx(sidebarNavRoot, class)),
|
||||
vdom.El("ul", listMods...),
|
||||
return vdom.Nav(vdom.Attr("class", cx(sidebarNavRoot, class)),
|
||||
vdom.Ul(listMods...),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -108,7 +107,7 @@ func SidebarLayout(p SidebarLayoutProps, children ...*vdom.VNode) *vdom.VNode {
|
||||
|
||||
asideMods := []vdom.Mod{
|
||||
vdom.Attr("class", sidebarLayoutSidebar),
|
||||
vdom.El("div", kids([]vdom.Mod{vdom.Attr("class", sticky)}, []*vdom.VNode{p.Sidebar})...),
|
||||
vdom.Div(kids([]vdom.Mod{vdom.Attr("class", sticky)}, []*vdom.VNode{p.Sidebar})...),
|
||||
}
|
||||
if p.Collapsible {
|
||||
btnMods := []vdom.Mod{
|
||||
@@ -118,14 +117,13 @@ func SidebarLayout(p SidebarLayoutProps, children ...*vdom.VNode) *vdom.VNode {
|
||||
if p.OnToggleCollapse != nil {
|
||||
btnMods = append(btnMods, vdom.On(vdom.EVENT_CLICK, p.OnToggleCollapse))
|
||||
}
|
||||
asideMods = append(asideMods, vdom.El("button", btnMods...))
|
||||
asideMods = append(asideMods, vdom.Button(btnMods...))
|
||||
}
|
||||
|
||||
main := vdom.El("main", kids([]vdom.Mod{vdom.Attr("class", sidebarLayoutMain)}, children)...)
|
||||
main := vdom.Main(kids([]vdom.Mod{vdom.Attr("class", sidebarLayoutMain)}, children)...)
|
||||
|
||||
return vdom.El("div",
|
||||
vdom.Attr("class", cx(sidebarLayoutRoot, p.Class)),
|
||||
vdom.El("aside", asideMods...),
|
||||
return vdom.Div(vdom.Attr("class", cx(sidebarLayoutRoot, p.Class)),
|
||||
vdom.Aside(asideMods...),
|
||||
main,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user