// templui component modal - version: main installed by templui v0.71.0 package modal import ( "git.jmbit.de/jmb/scanfile/server/web/templui/utils" "strconv" ) type Props struct { ID string Class string Attributes templ.Attributes DisableClickAway bool DisableESC bool } type TriggerProps struct { ID string Class string Attributes templ.Attributes Disabled bool ModalID string // ID of the modal to trigger } type CloseProps struct { ID string Class string Attributes templ.Attributes ModalID string // ID of the modal to close (optional, defaults to closest modal) } type HeaderProps struct { ID string Class string Attributes templ.Attributes } type BodyProps struct { ID string Class string Attributes templ.Attributes } type FooterProps struct { ID string Class string Attributes templ.Attributes } templ Modal(props ...Props) { @Script() {{ var p Props }} if len(props) > 0 { {{ p = props[0] }} } if p.ID == "" { {{ p.ID = "modal-" + utils.RandomID() }} } } templ Trigger(props ...TriggerProps) { {{ var p TriggerProps }} if len(props) > 0 { {{ p = props[0] }} } { children... } } templ Close(props ...CloseProps) { {{ var p CloseProps }} if len(props) > 0 { {{ p = props[0] }} } { children... } } templ Header(props ...HeaderProps) { {{ var p HeaderProps }} if len(props) > 0 { {{ p = props[0] }} }

// Ensure title ID matches aria-labelledby { children... }

} templ Body(props ...BodyProps) { {{ var p BodyProps }} if len(props) > 0 { {{ p = props[0] }} }
{ children... }
} templ Footer(props ...FooterProps) { {{ var p FooterProps }} if len(props) > 0 { {{ p = props[0] }} }
{ children... }
} var handle = templ.NewOnceHandle() templ Script() { @handle.Once() { } }