WIP pull #1

Merged
ErikaHarker merged 8 commits from goffee/core:main into main 2024-12-16 15:39:01 -05:00
4 changed files with 16 additions and 10 deletions
Showing only changes of commit 5896e6e617 - Show all commits

View file

@ -1,6 +1,8 @@
package components
type FormButton struct {
ID string
Value string
Text string
Icon string
IsSubmit bool

View file

@ -1,5 +1,5 @@
{{define "form_button"}}
<button class="btn btn-{{.TypeClass}}" {{if eq .IsSubmit true}}type="submit"{{else}}type="button"{{end}} {{if .IsDisabled}}disabled{{end}}>
<button {{if .ID }}id="{{.ID}}" name="{{.ID}}"{{end}} {{if .Value }}value="{{.Value}}" name="{{.ID}}"{{end}} class="btn btn-{{.TypeClass}}" {{if eq .IsSubmit true}}type="submit"{{else}}type="button"{{end}} {{if .IsDisabled}}disabled{{end}}>
{{.Text}}
</button>
<!-- tailwind heroicons -->

View file

@ -1,13 +1,14 @@
package components
type FormInput struct {
ID string
Label string
Type string
Placeholder string
Value string
Hint string
Error string
IsDisabled bool
IsRequired bool
ID string
Label string
Type string
Placeholder string
Value string
Hint string
Error string
IsDisabled bool
Autocomplete bool
IsRequired bool
}

View file

@ -8,6 +8,9 @@
{{if eq .IsRequired true}}
required
{{end}}
{{if eq .Autocomplete false}}
autocomplete="off"
{{end}}
{{if ne .Value ""}}
value="{{.Value}}"
{{end}}