Add fonts, autotable, autotable examples

This commit is contained in:
2026-07-13 13:01:26 -04:00
parent ea3d2a6d03
commit cf8342f8d4
71 changed files with 16084 additions and 1443 deletions

View File

@@ -113,9 +113,9 @@ func calMonthCells(year int, month time.Month) []calCell {
func calWeekdaysRow(rowCls, cellCls string) *vdom.VNode {
mods := []vdom.Mod{vdom.Attr("class", rowCls)}
for _, d := range calDays {
mods = append(mods, vdom.El("div", vdom.Attr("class", cellCls), vdom.Text(d)))
mods = append(mods, vdom.Div(vdom.Attr("class", cellCls), vdom.Text(d)))
}
return vdom.El("div", mods...)
return vdom.Div(mods...)
}
func calDayClassPicker(empty, selected, today bool) string {
@@ -185,15 +185,15 @@ func calPickerDaysGrid(view, sel time.Time, hasSel bool, now time.Time, onSelect
if !cell.empty {
num = strconv.Itoa(cell.date.Day())
}
btnMods = append(btnMods, vdom.El("span", vdom.Attr("class", "leading-none"), vdom.Text(num)))
btnMods = append(btnMods, vdom.Span(vdom.Attr("class", "leading-none"), vdom.Text(num)))
if !cell.empty && renderDay != nil {
if extra := renderDay(calDateKey(cell.date), cell.date); extra != nil {
btnMods = append(btnMods, extra)
}
}
mods = append(mods, vdom.El("button", btnMods...))
mods = append(mods, vdom.Button(btnMods...))
}
return vdom.El("div", mods...)
return vdom.Div(mods...)
}
// calMonthDaysGrid renders the month-variant day grid.
@@ -221,15 +221,15 @@ func calMonthDaysGrid(view, sel time.Time, hasSel bool, now time.Time, onSelect
if !cell.empty {
num = strconv.Itoa(cell.date.Day())
}
btnMods = append(btnMods, vdom.El("span", vdom.Attr("class", calDayNumberClassMonth(today)), vdom.Text(num)))
btnMods = append(btnMods, vdom.Span(vdom.Attr("class", calDayNumberClassMonth(today)), vdom.Text(num)))
if !cell.empty && renderDay != nil {
if extra := renderDay(calDateKey(cell.date), cell.date); extra != nil {
btnMods = append(btnMods, extra)
}
}
mods = append(mods, vdom.El("button", btnMods...))
mods = append(mods, vdom.Button(btnMods...))
}
return vdom.El("div", mods...)
return vdom.Div(mods...)
}
// CalendarProps configures Calendar. It is a controlled component: the visible
@@ -289,17 +289,15 @@ func Calendar(p CalendarProps) *vdom.VNode {
}
}
header := vdom.El("div", vdom.Attr("class", headerCls),
vdom.El("button",
vdom.Attr("type", "button"),
header := vdom.Div(vdom.Attr("class", headerCls),
vdom.Button(vdom.Attr("type", "button"),
vdom.Attr("class", calNavBtn),
vdom.On(vdom.EVENT_CLICK, navigate(prev)),
Icon("chevron-left", 16, ""),
),
vdom.El("span", vdom.Attr("class", myCls),
vdom.Span(vdom.Attr("class", myCls),
vdom.Text(calMonths[int(view.Month())-1]+" "+strconv.Itoa(view.Year()))),
vdom.El("button",
vdom.Attr("type", "button"),
vdom.Button(vdom.Attr("type", "button"),
vdom.Attr("class", calNavBtn),
vdom.On(vdom.EVENT_CLICK, navigate(next)),
Icon("chevron-right", 16, ""),
@@ -313,8 +311,7 @@ func Calendar(p CalendarProps) *vdom.VNode {
daysGrid = calPickerDaysGrid(view, sel, hasSel, now, p.OnSelect, p.RenderDay)
}
return vdom.El("div",
vdom.Attr("class", cx(rootCls, p.Class)),
return vdom.Div(vdom.Attr("class", cx(rootCls, p.Class)),
header,
calWeekdaysRow(weekdaysCls, weekdayCls),
daysGrid,