chore: update templ and templui

This commit is contained in:
juancwu 2026-04-12 16:07:06 +00:00
commit 61eaa268ab
89 changed files with 25776 additions and 8231 deletions

View file

@ -1,4 +1,4 @@
// templui component tooltip - version: v1.2.0 installed by templui v1.2.0
// templui component tooltip - version: v1.9.5 installed by templui v1.9.5
// 📚 Documentation: https://templui.io/docs/components/tooltip
package tooltip
@ -16,7 +16,6 @@ const (
PositionLeft Position = "left"
)
// Map tooltip positions to popover positions
func mapTooltipPositionToPopover(position Position) popover.Placement {
switch position {
case PositionTop:
@ -42,7 +41,6 @@ type TriggerProps struct {
ID string
Class string
Attributes templ.Attributes
For string
}
type ContentProps struct {
@ -56,7 +54,17 @@ type ContentProps struct {
}
templ Tooltip(props ...Props) {
{ children... }
{{ var p Props }}
if len(props) > 0 {
{{ p = props[0] }}
}
@popover.Root(popover.RootProps{
ID: p.ID,
Class: p.Class,
Attributes: p.Attributes,
}) {
{ children... }
}
}
templ Trigger(props ...TriggerProps) {
@ -69,7 +77,6 @@ templ Trigger(props ...TriggerProps) {
Class: p.Class,
Attributes: p.Attributes,
TriggerType: popover.TriggerTypeHover,
For: p.For,
}) {
{ children... }
}
@ -92,3 +99,11 @@ templ Content(props ...ContentProps) {
{ children... }
}
}
var scriptOnce = templ.NewOnceHandle()
templ Script() {
@scriptOnce.Once() {
@popover.Script()
}
}