entities

package
v0.0.0-...-253b25b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Form

type Form struct {
	Fields []FormField
	// ValidationController validationcontroller.IValidationController
	SucessTemplate templ.Component
}

type FormField

type FormField struct {
	Name                           string
	FieldName                      string
	FieldLabel                     string
	FieldPlaceholder               string
	FieldType                      FormFieldType
	FieldValidationState           ValidationStateType
	FieldValidationFeedbackMessage string
	FieldValue                     string
	FieldListItems                 []base.FormListProps
	FieldValidationType            []ValidationType
}

func (*FormField) ValidateField

func (ff *FormField) ValidateField() (FieldIsValid bool)

type FormFieldType

type FormFieldType struct {
	InputType InputType
	Settings  map[string]interface{}
}

type FormFieldValidation

type FormFieldValidation struct {
	IsRequired      bool
	ValidationState ValidationStateType
}

type IFormController

type IFormController interface {
	GetFormComponent() templ.Component
	DoValidation() templ.Component
}

type IPageProps

type IPageProps interface {
	GetNavItems(currentPageName string) []*navitem.NavItemProps
	GetBreadcrumbs() []*breadcrumbitem.BreadcrumbItemProps
	GetTitle() string
}

func NewPageProps

func NewPageProps(
	title string,
	currentPageName string,
	componentsNavItems []*navitem.NavItemProps,
	componentsNavItemsSidebar []navitem.NavItemProps,
	breadcrumbItems []*breadcrumbitem.BreadcrumbItemProps,
) IPageProps

type InputType

type InputType string
const BooleanType InputType = "boolean"
const ColorType InputType = "color"
const DatalistType InputType = "datalist"
const EmailType InputType = "email"
const FileType InputType = "file"
const HiddenType InputType = "hidden"
const NumberType InputType = "number"
const PasswordType InputType = "password"
const PlainTextType InputType = "plaintext"
const TextType InputType = "text"
const TextareaType InputType = "textarea"

type PageProps

type PageProps struct {
	Title                     string
	CurrentPageName           string
	ComponentsNavItems        []*navitem.NavItemProps
	ComponentsNavItemsSidebar []navitem.NavItemProps
	BreadcrumbItems           []*breadcrumbitem.BreadcrumbItemProps
}

func (PageProps) GetBreadcrumbs

func (pp PageProps) GetBreadcrumbs() []*breadcrumbitem.BreadcrumbItemProps

func (PageProps) GetNavItems

func (pp PageProps) GetNavItems(currentPageName string) []*navitem.NavItemProps

func (PageProps) GetTitle

func (pp PageProps) GetTitle() string

type ValidationStateType

type ValidationStateType string
const FieldIsInvalidValidationStatusType ValidationStateType = "is-invalid"
const FieldIsValidValidationStatusType ValidationStateType = "is-valid"

type ValidationType

type ValidationType string
const FieldEmptyIsInvalid ValidationType = "empty-field-invalid"
const FieldRegexMatchIsInvalid ValidationType = "regex-field-invalid"

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL