forms
This commit is contained in:
parent
cc0c524337
commit
f03b933359
551 changed files with 1230 additions and 0 deletions
|
|
@ -67,6 +67,273 @@ type TableCell struct {
|
|||
Tags []string
|
||||
}
|
||||
|
||||
// FormtablerTextInput renders a basic text/static/password/textarea input.
|
||||
type FormtablerTextInput struct {
|
||||
Label string
|
||||
Placeholder string
|
||||
Value string
|
||||
Type string // "text", "static", "password", "textarea"
|
||||
Name string
|
||||
}
|
||||
|
||||
// FormtablerIconInput renders an input with an icon or loader.
|
||||
type FormtablerIconInput struct {
|
||||
Label string
|
||||
Placeholder string
|
||||
Icon string // icon name, empty = search icon
|
||||
Prepend bool
|
||||
Loader bool
|
||||
}
|
||||
|
||||
// FormtablerIconSeparated renders a search input with a separate button.
|
||||
type FormtablerIconSeparated struct {
|
||||
Label string
|
||||
Placeholder string
|
||||
ButtonIcon string
|
||||
}
|
||||
|
||||
// FormtablerInputSizing renders three inputs of different sizes.
|
||||
type FormtablerInputSizing struct{}
|
||||
|
||||
// FormtablerFileInput renders a file input.
|
||||
type FormtablerFileInput struct {
|
||||
Label string
|
||||
}
|
||||
|
||||
// FormtablerColorInput renders a color swatch picker (radio or checkbox).
|
||||
type FormtablerColorInput struct {
|
||||
Label string
|
||||
Name string
|
||||
Type string // "radio" or "checkbox"
|
||||
Colors []FormtablerSwatch
|
||||
HideBW bool
|
||||
Rounded bool
|
||||
}
|
||||
|
||||
// FormtablerSwatch is a single color swatch in a color input.
|
||||
type FormtablerSwatch struct {
|
||||
Color string
|
||||
Checked bool
|
||||
}
|
||||
|
||||
// FormtablerColorPicker renders a native HTML5 color picker.
|
||||
type FormtablerColorPicker struct {
|
||||
Label string
|
||||
Color string
|
||||
}
|
||||
|
||||
// FormtablerRangeInput renders range sliders.
|
||||
type FormtablerRangeInput struct {
|
||||
Label string
|
||||
}
|
||||
|
||||
// FormtablerDatalist renders an input with a datalist.
|
||||
type FormtablerDatalist struct {
|
||||
Label string
|
||||
Placeholder string
|
||||
Options []string
|
||||
}
|
||||
|
||||
// FormtablerImageCheck renders image checkboxes.
|
||||
type FormtablerImageCheck struct {
|
||||
Label string
|
||||
Images []FormtablerImageItem
|
||||
}
|
||||
|
||||
// FormtablerImageItem is a single image in an image check group.
|
||||
type FormtablerImageItem struct {
|
||||
Src string
|
||||
Alt string
|
||||
Checked bool
|
||||
}
|
||||
|
||||
// FormtablerImageRadio renders image radio buttons.
|
||||
type FormtablerImageRadio struct {
|
||||
Label string
|
||||
Images []FormtablerImageItem
|
||||
}
|
||||
|
||||
// FormtablerImagePerson renders person avatar checkboxes.
|
||||
type FormtablerImagePerson struct {
|
||||
Label string
|
||||
People []FormtablerPersonItem
|
||||
AvatarSize string
|
||||
}
|
||||
|
||||
// FormtablerPersonItem is a single person in a person check group.
|
||||
type FormtablerPersonItem struct {
|
||||
Name string
|
||||
Src string
|
||||
Checked bool
|
||||
}
|
||||
|
||||
// FormtablerCheckboxes renders a group of checkboxes.
|
||||
type FormtablerCheckboxes struct {
|
||||
Label string
|
||||
Checkboxes []FormtablerCheckItem
|
||||
}
|
||||
|
||||
// FormtablerCheckItem is a single checkbox/radio/switch item.
|
||||
type FormtablerCheckItem struct {
|
||||
Title string
|
||||
Checked bool
|
||||
Disabled bool
|
||||
}
|
||||
|
||||
// FormtablerCheckboxesInline renders inline checkboxes.
|
||||
type FormtablerCheckboxesInline struct {
|
||||
Label string
|
||||
Checkboxes []FormtablerCheckItem
|
||||
}
|
||||
|
||||
// FormtablerRadios renders a group of radio buttons.
|
||||
type FormtablerRadios struct {
|
||||
Label string
|
||||
Name string
|
||||
Radios []FormtablerCheckItem
|
||||
}
|
||||
|
||||
// FormtablerRadiosInline renders inline radio buttons.
|
||||
type FormtablerRadiosInline struct {
|
||||
Label string
|
||||
Name string
|
||||
Radios []FormtablerCheckItem
|
||||
}
|
||||
|
||||
// FormtablerToggle renders toggle switch checkboxes.
|
||||
type FormtablerToggle struct {
|
||||
Label string
|
||||
Toggles []FormtablerCheckItem
|
||||
}
|
||||
|
||||
// FormtablerToggleSingle renders a single toggle switch.
|
||||
type FormtablerToggleSingle struct {
|
||||
Label string
|
||||
Title string
|
||||
}
|
||||
|
||||
// FormtablerSelect renders a select dropdown.
|
||||
type FormtablerSelect struct {
|
||||
Label string
|
||||
Options []string
|
||||
Multiple bool
|
||||
}
|
||||
|
||||
// FormtablerSelectgroup renders a selectgroup (pill-style toggle buttons).
|
||||
type FormtablerSelectgroup struct {
|
||||
Label string
|
||||
Groups []FormtablerSelectGroup
|
||||
Pills bool
|
||||
}
|
||||
|
||||
// FormtablerSelectGroup is a single selectgroup set.
|
||||
type FormtablerSelectGroup struct {
|
||||
Title string
|
||||
Values []FormtablerSelectGroupValue
|
||||
Type string // "radio" or "checkbox"
|
||||
Name string
|
||||
Pills bool
|
||||
WithText bool
|
||||
}
|
||||
|
||||
// FormtablerSelectGroupValue is a single option in a selectgroup.
|
||||
type FormtablerSelectGroupValue struct {
|
||||
Label string
|
||||
Value string
|
||||
Icon string // icon name like "home", "user"
|
||||
Checked bool
|
||||
WithText bool
|
||||
}
|
||||
|
||||
// FormtablerSelectgroupPayments renders payment method selectgroups.
|
||||
type FormtablerSelectgroupPayments struct {
|
||||
Label string
|
||||
Items []FormtablerPaymentItem
|
||||
}
|
||||
|
||||
// FormtablerPaymentItem is a single payment option.
|
||||
type FormtablerPaymentItem struct {
|
||||
Provider string // "visa", "mastercard", "paypal"
|
||||
Ending string // last 4 digits (optional)
|
||||
Checked bool
|
||||
}
|
||||
|
||||
// FormtablerSelectgroupProjectManager renders a project manager selectgroup.
|
||||
type FormtablerSelectgroupProjectManager struct {
|
||||
Label string
|
||||
Managers []FormtablerPersonItemWithJob
|
||||
}
|
||||
|
||||
// FormtablerPersonItemWithJob extends FormtablerPersonItem with a job title.
|
||||
type FormtablerPersonItemWithJob struct {
|
||||
Name string
|
||||
Src string
|
||||
JobTitle string
|
||||
Checked bool
|
||||
}
|
||||
|
||||
// FormtablerFieldset renders a fieldset with inputs.
|
||||
type FormtablerFieldset struct {
|
||||
Label string
|
||||
Inputs []FormtablerFieldsetInput
|
||||
}
|
||||
|
||||
// FormtablerFieldsetInput is a single input inside a fieldset.
|
||||
type FormtablerFieldsetInput struct {
|
||||
Label string
|
||||
Type string // "text", "email", "tel"
|
||||
Required bool
|
||||
Placeholder string
|
||||
}
|
||||
|
||||
// FormtablerCheckboxesList renders a list of toggle switches with labels.
|
||||
type FormtablerCheckboxesList struct {
|
||||
Label string
|
||||
Items []FormtablerCheckListItem
|
||||
}
|
||||
|
||||
// FormtablerCheckListItem is a single item in a checkboxes list.
|
||||
type FormtablerCheckListItem struct {
|
||||
Title string
|
||||
Checked bool
|
||||
}
|
||||
|
||||
// FormtablerValidationStates renders validation state inputs.
|
||||
type FormtablerValidationStates struct {
|
||||
Label string
|
||||
Lite bool
|
||||
}
|
||||
|
||||
// FormtablerFormElementsPage is the page-specific struct for the form elements demo.
|
||||
// Each field is one of the 25 form element groups.
|
||||
type FormtablerFormElementsPage struct {
|
||||
TextInputs []FormtablerTextInput
|
||||
IconInputs []FormtablerIconInput
|
||||
IconSeparated FormtablerIconSeparated
|
||||
InputSizing FormtablerInputSizing
|
||||
FileInput FormtablerFileInput
|
||||
ColorInput FormtablerColorInput
|
||||
ColorPicker FormtablerColorPicker
|
||||
RangeInput FormtablerRangeInput
|
||||
Datalist FormtablerDatalist
|
||||
ImageCheck FormtablerImageCheck
|
||||
ImageRadio FormtablerImageRadio
|
||||
ImagePerson FormtablerImagePerson
|
||||
Checkboxes FormtablerCheckboxes
|
||||
CheckboxesInline FormtablerCheckboxesInline
|
||||
Radios FormtablerRadios
|
||||
RadiosInline FormtablerRadiosInline
|
||||
Toggles FormtablerToggle
|
||||
ToggleSingle FormtablerToggleSingle
|
||||
Select FormtablerSelect
|
||||
Selectgroups []FormtablerSelectGroup
|
||||
SelectgroupPayments FormtablerSelectgroupPayments
|
||||
SelectgroupProjectManager FormtablerSelectgroupProjectManager
|
||||
Fieldset FormtablerFieldset
|
||||
CheckboxesList FormtablerCheckboxesList
|
||||
ValidationStates FormtablerValidationStates
|
||||
}
|
||||
|
||||
// TablerPageData holds the common data for all tabler pages.
|
||||
// It should NOT contain component-specific fields like tables or forms.
|
||||
// Add those by creating a page-specific struct that embeds TablerPageData
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue