components

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accordion

type Accordion struct {
	*liveview.ComponentDriver[*Accordion]
	Items []AccordionItem
}

func NewAccordion

func NewAccordion(items []AccordionItem) *Accordion

func (*Accordion) GetDriver

func (a *Accordion) GetDriver() liveview.LiveDriver

func (*Accordion) GetTemplate

func (a *Accordion) GetTemplate() string

func (*Accordion) Start

func (a *Accordion) Start()

func (*Accordion) Toggle

func (a *Accordion) Toggle(data interface{})

type AccordionItem

type AccordionItem struct {
	ID       string
	Title    string
	Content  string
	Expanded bool
}

type Alert

type Alert struct {
	*liveview.ComponentDriver[*Alert]
	Message     string
	Type        string // info, success, warning, error
	Title       string
	Dismissible bool
	Visible     bool
	Icon        bool
}

func NewAlert

func NewAlert(message string, alertType string) *Alert

func (*Alert) Dismiss

func (a *Alert) Dismiss(data interface{})

func (*Alert) GetDriver

func (a *Alert) GetDriver() liveview.LiveDriver

func (*Alert) GetTemplate

func (a *Alert) GetTemplate() string

func (*Alert) Show

func (a *Alert) Show(message string, alertType string)

func (*Alert) Start

func (a *Alert) Start()

type Animation

type Animation struct {
	*liveview.ComponentDriver[*Animation]
	Content        string
	Type           AnimationType
	Duration       string
	Delay          string
	IterationCount string
	IsPlaying      bool
}

func (*Animation) Animate

func (a *Animation) Animate(animType AnimationType, duration string)

func (*Animation) ChangeDuration

func (a *Animation) ChangeDuration(data interface{})

func (*Animation) ChangeIterations

func (a *Animation) ChangeIterations(data interface{})

func (*Animation) ChangeType

func (a *Animation) ChangeType(data interface{})

func (*Animation) GetDriver

func (a *Animation) GetDriver() liveview.LiveDriver

func (*Animation) GetTemplate

func (a *Animation) GetTemplate() string

func (*Animation) Play

func (a *Animation) Play(data interface{})

func (*Animation) SetContent

func (a *Animation) SetContent(content string)

func (*Animation) Start

func (a *Animation) Start()

func (*Animation) StartAnimation

func (a *Animation) StartAnimation(data interface{})

func (*Animation) Stop

func (a *Animation) Stop(data interface{})

type AnimationType

type AnimationType string
const (
	AnimationFadeIn   AnimationType = "fadeIn"
	AnimationFadeOut  AnimationType = "fadeOut"
	AnimationSlideIn  AnimationType = "slideIn"
	AnimationSlideOut AnimationType = "slideOut"
	AnimationBounce   AnimationType = "bounce"
	AnimationRotate   AnimationType = "rotate"
	AnimationPulse    AnimationType = "pulse"
	AnimationShake    AnimationType = "shake"
)

type BoxType

type BoxType string
const (
	BoxTypeStart    BoxType = "start"
	BoxTypeProcess  BoxType = "process"
	BoxTypeDecision BoxType = "decision"
	BoxTypeData     BoxType = "data"
	BoxTypeEnd      BoxType = "end"
	BoxTypeCustom   BoxType = "custom"
)
type Breadcrumb struct {
	*liveview.ComponentDriver[*Breadcrumb]
	Items     []BreadcrumbItem
	Separator string
}

func NewBreadcrumb

func NewBreadcrumb(items []BreadcrumbItem) *Breadcrumb
func (b *Breadcrumb) AddItem(label, href string)
func (b *Breadcrumb) GetDriver() liveview.LiveDriver
func (b *Breadcrumb) GetTemplate() string
func (b *Breadcrumb) Navigate(data interface{})
func (b *Breadcrumb) Start()
type BreadcrumbItem struct {
	Label  string
	Href   string
	Active bool
	Icon   string
}

type Button

type Button struct {
	*liveview.ComponentDriver[*Button]
	I       int
	Caption string
}

func (*Button) GetDriver

func (t *Button) GetDriver() liveview.LiveDriver

func (*Button) GetTemplate

func (t *Button) GetTemplate() string

func (*Button) SetClick

func (t *Button) SetClick(fx func(c *Button, data interface{})) *Button

func (*Button) Start

func (t *Button) Start()

type Calendar

type Calendar struct {
	*liveview.ComponentDriver[*Calendar]
	SelectedDate time.Time
	CurrentMonth time.Time
	MinDate      time.Time
	MaxDate      time.Time
	OnSelect     func(date time.Time)
}

func (*Calendar) GetCalendarDays

func (c *Calendar) GetCalendarDays() []CalendarDay

func (*Calendar) GetCurrentMonthYear

func (c *Calendar) GetCurrentMonthYear() string

func (*Calendar) GetDriver

func (c *Calendar) GetDriver() liveview.LiveDriver

func (*Calendar) GetSelectedDate

func (c *Calendar) GetSelectedDate() time.Time

func (*Calendar) GetTemplate

func (c *Calendar) GetTemplate() string

func (*Calendar) NextMonth

func (c *Calendar) NextMonth(data interface{})

func (*Calendar) PrevMonth

func (c *Calendar) PrevMonth(data interface{})

func (*Calendar) SelectDate

func (c *Calendar) SelectDate(data interface{})

func (*Calendar) SetSelectedDate

func (c *Calendar) SetSelectedDate(date time.Time)

func (*Calendar) Start

func (c *Calendar) Start()

type CalendarDay

type CalendarDay struct {
	Day      int
	Date     string
	Classes  string
	Disabled bool
}

type Card

type Card struct {
	*liveview.ComponentDriver[*Card]
	Title     string
	Subtitle  string
	Content   string
	ImageURL  string
	Footer    string
	Actions   []CardAction
	Width     string
	Elevated  bool
	Hoverable bool
}

func NewCard

func NewCard(title, content string) *Card

func (*Card) Action

func (c *Card) Action(data interface{})

func (*Card) GetDriver

func (c *Card) GetDriver() liveview.LiveDriver

func (*Card) GetTemplate

func (c *Card) GetTemplate() string

func (*Card) Start

func (c *Card) Start()

type CardAction

type CardAction struct {
	ID    string
	Label string
	Style string
}

type Chart

type Chart struct {
	*liveview.ComponentDriver[*Chart]
	Type   ChartType
	Data   []ChartData
	Width  int
	Height int
	Title  string
}

func (*Chart) AddAngles

func (c *Chart) AddAngles(a1, a2 float64) float64

func (*Chart) AddData

func (c *Chart) AddData(label string, value float64, color string)

func (*Chart) BarClick

func (c *Chart) BarClick(data interface{})

func (*Chart) ClearData

func (c *Chart) ClearData()

func (*Chart) GetAngle

func (c *Chart) GetAngle(value, total float64) float64

func (*Chart) GetBarHeight

func (c *Chart) GetBarHeight(value, maxValue float64) int

func (*Chart) GetBarLabelX

func (c *Chart) GetBarLabelX(index int) int

func (*Chart) GetBarWidth

func (c *Chart) GetBarWidth() int

func (*Chart) GetBarX

func (c *Chart) GetBarX(index int) int

func (*Chart) GetBarY

func (c *Chart) GetBarY(value, maxValue float64) int

func (*Chart) GetCenterX

func (c *Chart) GetCenterX() int

func (*Chart) GetCenterY

func (c *Chart) GetCenterY() int

func (*Chart) GetDefaultColor

func (c *Chart) GetDefaultColor(index int) string

func (*Chart) GetDriver

func (c *Chart) GetDriver() liveview.LiveDriver

func (*Chart) GetMaxValue

func (c *Chart) GetMaxValue() float64

func (*Chart) GetPieSlicePath

func (c *Chart) GetPieSlicePath(cx, cy, radius int, startAngle, sweepAngle float64) string

func (*Chart) GetRadius

func (c *Chart) GetRadius() int

func (*Chart) GetTemplate

func (c *Chart) GetTemplate() string

func (*Chart) GetTotal

func (c *Chart) GetTotal() float64

func (*Chart) SliceClick

func (c *Chart) SliceClick(data interface{})

func (*Chart) Start

func (c *Chart) Start()

func (*Chart) UpdateData

func (c *Chart) UpdateData(data []ChartData)

type ChartData

type ChartData struct {
	Label string
	Value float64
	Color string
}

type ChartType

type ChartType string
const (
	ChartBar   ChartType = "bar"
	ChartLine  ChartType = "line"
	ChartPie   ChartType = "pie"
	ChartDonut ChartType = "donut"
)

type Clock

type Clock struct {
	*liveview.ComponentDriver[*Clock]
	ActualTime string
}

func (*Clock) GetDriver

func (t *Clock) GetDriver() liveview.LiveDriver

func (*Clock) GetTemplate

func (t *Clock) GetTemplate() string

func (*Clock) Start

func (t *Clock) Start()

type CollaborativeCanvas

type CollaborativeCanvas struct {
	*liveview.ComponentDriver[*CollaborativeCanvas]
	*liveview.CollaborativeComponent

	// Canvas properties
	Width      int    `json:"width"`
	Height     int    `json:"height"`
	Background string `json:"background"`

	// Drawing state
	Shapes      []Shape `json:"shapes"`
	CurrentTool string  `json:"current_tool"`
	StrokeColor string  `json:"stroke_color"`
	FillColor   string  `json:"fill_color"`
	StrokeWidth int     `json:"stroke_width"`

	// Collaboration
	Cursors    map[string]*CursorInfo `json:"cursors"`
	Selections map[string][]string    `json:"selections"` // user -> selected shape IDs
}

CollaborativeCanvas provides real-time collaborative drawing

func (*CollaborativeCanvas) ChangeFillColor

func (c *CollaborativeCanvas) ChangeFillColor(data interface{})

ChangeFillColor updates fill color

func (*CollaborativeCanvas) ChangeStrokeColor

func (c *CollaborativeCanvas) ChangeStrokeColor(data interface{})

ChangeStrokeColor updates stroke color

func (*CollaborativeCanvas) ChangeStrokeWidth

func (c *CollaborativeCanvas) ChangeStrokeWidth(data interface{})

ChangeStrokeWidth updates stroke width

func (*CollaborativeCanvas) Clear

func (c *CollaborativeCanvas) Clear(data interface{})

Clear removes all shapes

func (*CollaborativeCanvas) Drawing

func (c *CollaborativeCanvas) Drawing(data interface{})

Drawing handles ongoing drawing

func (*CollaborativeCanvas) EndDrawing

func (c *CollaborativeCanvas) EndDrawing(data interface{})

EndDrawing completes a shape

func (*CollaborativeCanvas) Export

func (c *CollaborativeCanvas) Export(data interface{})

Export exports canvas as JSON

func (*CollaborativeCanvas) GetDriver

func (c *CollaborativeCanvas) GetDriver() liveview.LiveDriver

GetDriver returns the component driver

func (*CollaborativeCanvas) GetTemplate

func (c *CollaborativeCanvas) GetTemplate() string

GetTemplate returns the canvas HTML template

func (*CollaborativeCanvas) HandleRemoteUpdate

func (c *CollaborativeCanvas) HandleRemoteUpdate(data interface{})

HandleRemoteUpdate processes updates from other users

func (*CollaborativeCanvas) Import

func (c *CollaborativeCanvas) Import(data interface{})

Import imports canvas from JSON

func (*CollaborativeCanvas) Redo

func (c *CollaborativeCanvas) Redo(data interface{})

Redo re-adds a removed shape

func (*CollaborativeCanvas) SelectTool

func (c *CollaborativeCanvas) SelectTool(data interface{})

SelectTool changes the current drawing tool

func (*CollaborativeCanvas) Start

func (c *CollaborativeCanvas) Start()

Start initializes the canvas

func (*CollaborativeCanvas) StartDrawing

func (c *CollaborativeCanvas) StartDrawing(data interface{})

StartDrawing begins a new shape

func (*CollaborativeCanvas) Undo

func (c *CollaborativeCanvas) Undo(data interface{})

Undo removes the last shape

func (*CollaborativeCanvas) UpdateCursor

func (c *CollaborativeCanvas) UpdateCursor(data interface{})

UpdateCursor updates cursor position for collaboration

type Column

type Column struct {
	Key      string
	Title    string
	Width    string
	Sortable bool
	Filter   bool
}

type Comment

type Comment struct {
	ID        string    `json:"id"`
	UserID    string    `json:"user_id"`
	UserName  string    `json:"user_name"`
	Text      string    `json:"text"`
	CreatedAt time.Time `json:"created_at"`
}

Comment on a card

type CursorInfo

type CursorInfo struct {
	X      float64 `json:"x"`
	Y      float64 `json:"y"`
	Color  string  `json:"color"`
	Name   string  `json:"name"`
	Active bool    `json:"active"`
}

CursorInfo tracks cursor information

type DragItem

type DragItem struct {
	ID      string
	Content string
	Group   string
	Data    interface{}
}

type Draggable

type Draggable struct {
	*liveview.ComponentDriver[*Draggable]
	Items      []DragItem
	Containers []string
	OnDrop     func(itemID, fromContainer, toContainer string)
	OnReorder  func(items []DragItem)
}

func (*Draggable) AddItem

func (d *Draggable) AddItem(id, content, group string, data interface{})

func (*Draggable) Drop

func (d *Draggable) Drop(data interface{})

func (*Draggable) GetDriver

func (d *Draggable) GetDriver() liveview.LiveDriver

func (*Draggable) GetItemsByGroup

func (d *Draggable) GetItemsByGroup(group string) []DragItem

func (*Draggable) GetTemplate

func (d *Draggable) GetTemplate() string

func (*Draggable) MoveItem

func (d *Draggable) MoveItem(itemID, toGroup string)

func (*Draggable) RemoveItem

func (d *Draggable) RemoveItem(id string)

func (*Draggable) Start

func (d *Draggable) Start()
type Dropdown struct {
	*liveview.ComponentDriver[*Dropdown]
	Options     []DropdownOption
	Selected    string
	Placeholder string
	IsOpen      bool
	Width       string
}

func NewDropdown

func NewDropdown(options []DropdownOption, placeholder string) *Dropdown
func (d *Dropdown) Close(data interface{})
func (d *Dropdown) GetDriver() liveview.LiveDriver
func (d *Dropdown) GetSelectedLabel() string
func (d *Dropdown) GetTemplate() string
func (d *Dropdown) Select(data interface{})
func (d *Dropdown) Start()
func (d *Dropdown) Toggle(data interface{})
type DropdownOption struct {
	Value    string
	Label    string
	Disabled bool
	Icon     string
}

type EdgeStyle

type EdgeStyle string
const (
	EdgeStyleSolid  EdgeStyle = "solid"
	EdgeStyleDashed EdgeStyle = "dashed"
	EdgeStyleDotted EdgeStyle = "dotted"
)

type EdgeType

type EdgeType string
const (
	EdgeTypeStraight EdgeType = "straight"
	EdgeTypeCurved   EdgeType = "curved"
	EdgeTypeStep     EdgeType = "step"
	EdgeTypeBezier   EdgeType = "bezier"
)

type FileInfo

type FileInfo struct {
	Name     string
	Size     int64
	Type     string
	Data     string
	Preview  string
	Progress int
}

type FileUpload

type FileUpload struct {
	*liveview.ComponentDriver[*FileUpload]
	Multiple       bool
	Accept         string
	MaxSize        int64
	MaxFiles       int
	Files          []FileInfo
	DragActive     bool
	UploadProgress int
	Label          string
	OnUpload       func(files []FileInfo) error
}

func (*FileUpload) Clear

func (f *FileUpload) Clear()

func (*FileUpload) DragLeave

func (f *FileUpload) DragLeave(data interface{})

func (*FileUpload) DragOver

func (f *FileUpload) DragOver(data interface{})

func (*FileUpload) Drop

func (f *FileUpload) Drop(data interface{})

func (*FileUpload) GetDriver

func (f *FileUpload) GetDriver() liveview.LiveDriver

func (*FileUpload) GetFileData

func (f *FileUpload) GetFileData(index int) ([]byte, error)

func (*FileUpload) GetTemplate

func (f *FileUpload) GetTemplate() string

func (*FileUpload) RemoveFile

func (f *FileUpload) RemoveFile(data interface{})

func (*FileUpload) Select

func (f *FileUpload) Select(data interface{})

func (*FileUpload) Start

func (f *FileUpload) Start()

func (*FileUpload) Upload

func (f *FileUpload) Upload(data interface{})

type FlowBox

type FlowBox struct {
	*liveview.ComponentDriver[*FlowBox]

	ID          string
	Label       string
	Description string
	Type        BoxType
	X           int
	Y           int
	Width       int
	Height      int
	Selected    bool
	Dragging    bool
	Color       string
	Icon        string
	Ports       []Port
	Data        map[string]interface{}
	OnClick     func(boxID string)
	OnConnect   func(fromBox, fromPort, toBox, toPort string)
}

func NewFlowBox

func NewFlowBox(id, label string, boxType BoxType, x, y int) *FlowBox

func (*FlowBox) AddPort

func (b *FlowBox) AddPort(port Port)

func (*FlowBox) EndDrag

func (b *FlowBox) EndDrag(data interface{})

func (*FlowBox) GetDriver

func (b *FlowBox) GetDriver() liveview.LiveDriver

func (*FlowBox) GetTemplate

func (b *FlowBox) GetTemplate() string

func (*FlowBox) HandleClick

func (b *FlowBox) HandleClick(data interface{})

func (*FlowBox) HandleDrag

func (b *FlowBox) HandleDrag(data interface{})

func (*FlowBox) HandlePortConnect

func (b *FlowBox) HandlePortConnect(data interface{})

func (*FlowBox) HandlePortDisconnect

func (b *FlowBox) HandlePortDisconnect(data interface{})

func (*FlowBox) MoveTo

func (b *FlowBox) MoveTo(x, y int)

func (*FlowBox) RemovePort

func (b *FlowBox) RemovePort(portID string)

func (*FlowBox) Resize

func (b *FlowBox) Resize(width, height int)

func (*FlowBox) SetSelected

func (b *FlowBox) SetSelected(selected bool)

func (*FlowBox) Start

func (b *FlowBox) Start()

func (*FlowBox) StartDrag

func (b *FlowBox) StartDrag(data interface{})

func (*FlowBox) UpdateDescription

func (b *FlowBox) UpdateDescription(description string)

func (*FlowBox) UpdateLabel

func (b *FlowBox) UpdateLabel(label string)

type FlowCanvas

type FlowCanvas struct {
	*liveview.ComponentDriver[*FlowCanvas]

	ID             string
	Width          int
	Height         int
	Boxes          map[string]*FlowBox
	Edges          map[string]*FlowEdge
	GridSize       GridSize
	ShowGrid       bool
	Zoom           float64
	PanX           int
	PanY           int
	SelectedBox    string
	SelectedEdge   string
	ConnectingFrom string
	ConnectingPort string
	IsConnecting   bool
	ReadOnly       bool
	OnBoxClick     func(boxID string)
	OnEdgeClick    func(edgeID string)
	OnConnection   func(fromBox, fromPort, toBox, toPort string)
	OnBoxMove      func(boxID string, x, y int)
	OnCanvasClick  func(x, y int)
}

func NewFlowCanvas

func NewFlowCanvas(id string, width, height int) *FlowCanvas

func (*FlowCanvas) AddBox

func (c *FlowCanvas) AddBox(box *FlowBox)

func (*FlowCanvas) AddEdge

func (c *FlowCanvas) AddEdge(edge *FlowEdge)

func (*FlowCanvas) Clear

func (c *FlowCanvas) Clear()

func (*FlowCanvas) ExportJSON

func (c *FlowCanvas) ExportJSON() map[string]interface{}

func (*FlowCanvas) GetDriver

func (c *FlowCanvas) GetDriver() liveview.LiveDriver

func (*FlowCanvas) GetTemplate

func (c *FlowCanvas) GetTemplate() string

func (*FlowCanvas) HandleAddBox

func (c *FlowCanvas) HandleAddBox(data interface{})

func (*FlowCanvas) HandleAddEdge

func (c *FlowCanvas) HandleAddEdge(data interface{})

func (*FlowCanvas) HandleCancelConnection

func (c *FlowCanvas) HandleCancelConnection(data interface{})

func (*FlowCanvas) HandleCanvasClick

func (c *FlowCanvas) HandleCanvasClick(data interface{})

func (*FlowCanvas) HandleClear

func (c *FlowCanvas) HandleClear(data interface{})

func (*FlowCanvas) HandleCompleteConnection

func (c *FlowCanvas) HandleCompleteConnection(data interface{})

func (*FlowCanvas) HandleMoveBox

func (c *FlowCanvas) HandleMoveBox(data interface{})

func (*FlowCanvas) HandleRemoveBox

func (c *FlowCanvas) HandleRemoveBox(data interface{})

func (*FlowCanvas) HandleRemoveEdge

func (c *FlowCanvas) HandleRemoveEdge(data interface{})

func (*FlowCanvas) HandleResetView

func (c *FlowCanvas) HandleResetView(data interface{})

func (*FlowCanvas) HandleSelectBox

func (c *FlowCanvas) HandleSelectBox(data interface{})

func (*FlowCanvas) HandleSelectEdge

func (c *FlowCanvas) HandleSelectEdge(data interface{})

func (*FlowCanvas) HandleStartConnection

func (c *FlowCanvas) HandleStartConnection(data interface{})

func (*FlowCanvas) HandleToggleGrid

func (c *FlowCanvas) HandleToggleGrid(data interface{})

func (*FlowCanvas) HandleZoomIn

func (c *FlowCanvas) HandleZoomIn(data interface{})

func (*FlowCanvas) HandleZoomOut

func (c *FlowCanvas) HandleZoomOut(data interface{})

func (*FlowCanvas) RemoveBox

func (c *FlowCanvas) RemoveBox(boxID string)

func (*FlowCanvas) RemoveEdge

func (c *FlowCanvas) RemoveEdge(edgeID string)

func (*FlowCanvas) Start

func (c *FlowCanvas) Start()

func (*FlowCanvas) ZoomPercent

func (c *FlowCanvas) ZoomPercent() int

type FlowEdge

type FlowEdge struct {
	*liveview.ComponentDriver[*FlowEdge]

	ID            string
	FromBox       string
	FromPort      string
	ToBox         string
	ToPort        string
	FromX         int
	FromY         int
	ToX           int
	ToY           int
	Type          EdgeType
	Style         EdgeStyle
	Color         string
	Width         int
	Label         string
	Selected      bool
	Animated      bool
	ArrowHead     bool
	Bidirectional bool
	OnClick       func(edgeID string)
}

func NewFlowEdge

func NewFlowEdge(id, fromBox, fromPort, toBox, toPort string) *FlowEdge

func (*FlowEdge) CalculateBezierPath

func (e *FlowEdge) CalculateBezierPath() string

func (*FlowEdge) CalculateCurvedPath

func (e *FlowEdge) CalculateCurvedPath() string

func (*FlowEdge) CalculateStepPath

func (e *FlowEdge) CalculateStepPath() string

func (*FlowEdge) GetDriver

func (e *FlowEdge) GetDriver() liveview.LiveDriver

func (*FlowEdge) GetLabelTextY

func (e *FlowEdge) GetLabelTextY() int

func (*FlowEdge) GetLabelX

func (e *FlowEdge) GetLabelX() int

Helper methods for template positioning

func (*FlowEdge) GetLabelY

func (e *FlowEdge) GetLabelY() int

func (*FlowEdge) GetLength

func (e *FlowEdge) GetLength() float64

func (*FlowEdge) GetMidX

func (e *FlowEdge) GetMidX() int

func (*FlowEdge) GetMidY

func (e *FlowEdge) GetMidY() int

func (*FlowEdge) GetRemoveTextY

func (e *FlowEdge) GetRemoveTextY() int

func (*FlowEdge) GetRemoveY

func (e *FlowEdge) GetRemoveY() int

func (*FlowEdge) GetTemplate

func (e *FlowEdge) GetTemplate() string

func (*FlowEdge) HandleClick

func (e *FlowEdge) HandleClick(data interface{})

func (*FlowEdge) HandleRemove

func (e *FlowEdge) HandleRemove(data interface{})

func (*FlowEdge) SetAnimated

func (e *FlowEdge) SetAnimated(animated bool)

func (*FlowEdge) SetEdgeStyle

func (e *FlowEdge) SetEdgeStyle(style EdgeStyle)

func (*FlowEdge) SetSelected

func (e *FlowEdge) SetSelected(selected bool)

func (*FlowEdge) SetType

func (e *FlowEdge) SetType(edgeType EdgeType)

func (*FlowEdge) Start

func (e *FlowEdge) Start()

func (*FlowEdge) UpdatePosition

func (e *FlowEdge) UpdatePosition(fromX, fromY, toX, toY int)

type Form

type Form struct {
	*liveview.ComponentDriver[*Form]
	Fields      []FormField
	SubmitLabel string
	Errors      map[string]string
	IsValid     bool
	OnSubmit    func(data map[string]string) error
}

func (*Form) AddField

func (f *Form) AddField(field FormField) *Form

func (*Form) ClearErrors

func (f *Form) ClearErrors() *Form

func (*Form) GetDriver

func (f *Form) GetDriver() liveview.LiveDriver

func (*Form) GetField

func (f *Form) GetField(name string) *FormField

func (*Form) GetTemplate

func (f *Form) GetTemplate() string

func (*Form) GetValues

func (f *Form) GetValues() map[string]string

func (*Form) Input

func (f *Form) Input(data interface{})

func (*Form) Reset

func (f *Form) Reset() *Form

func (*Form) SetField

func (f *Form) SetField(name string, value string) *Form

func (*Form) SetValues

func (f *Form) SetValues(values map[string]string) *Form

func (*Form) Start

func (f *Form) Start()

func (*Form) Submit

func (f *Form) Submit(data interface{})

func (*Form) Validate

func (f *Form) Validate(data interface{})

func (*Form) ValidateEmail

func (f *Form) ValidateEmail(email string) bool

func (*Form) ValidatePhone

func (f *Form) ValidatePhone(phone string) bool

type FormField

type FormField struct {
	Name        string
	Label       string
	Type        string
	Value       string
	Placeholder string
	Required    bool
	Pattern     string
	MinLength   int
	MaxLength   int
	Min         string
	Max         string
	Error       string
	Rules       []ValidationRule
}

type GridSize

type GridSize int
const (
	GridNone   GridSize = 0
	GridSmall  GridSize = 10
	GridMedium GridSize = 20
	GridLarge  GridSize = 40
)
type Header struct {
	*liveview.ComponentDriver[*Header]
	Title      string
	MenuItems  []HeaderMenuItem
	Background string
	Height     string
	ShowMenu   bool
}

func NewHeader

func NewHeader(title string, menuItems []HeaderMenuItem) *Header

func (*Header) GetDriver

func (h *Header) GetDriver() liveview.LiveDriver

func (*Header) GetTemplate

func (h *Header) GetTemplate() string

func (*Header) Navigate

func (h *Header) Navigate(data interface{})

func (*Header) Start

func (h *Header) Start()

func (*Header) ToggleMenu

func (h *Header) ToggleMenu(data interface{})

type HeaderMenuItem

type HeaderMenuItem struct {
	ID    string
	Label string
	Href  string
}

type InputText

type InputText struct {
	*liveview.ComponentDriver[*InputText]
}

func (*InputText) Change

func (t *InputText) Change(data interface{})

func (*InputText) GetDriver

func (t *InputText) GetDriver() liveview.LiveDriver

func (*InputText) GetTemplate

func (t *InputText) GetTemplate() string

func (*InputText) KeyPress

func (t *InputText) KeyPress(data interface{})

func (*InputText) KeyUp

func (t *InputText) KeyUp(data interface{})

func (*InputText) SetKeyUp

func (t *InputText) SetKeyUp(fx func(c *InputText, data interface{})) *InputText

func (*InputText) Start

func (t *InputText) Start()

type KanbanBoard

type KanbanBoard struct {
	*liveview.ComponentDriver[*KanbanBoard]
	*liveview.CollaborativeComponent

	// Board structure
	Title       string         `json:"title"`
	Description string         `json:"description"`
	Columns     []KanbanColumn `json:"columns"`
	Cards       []KanbanCard   `json:"cards"`
	Labels      []KanbanLabel  `json:"labels"`

	// UI state
	DraggedCard   *KanbanCard `json:"-"`
	SelectedCard  *KanbanCard `json:"-"`
	ShowCardModal bool        `json:"show_modal"`
	EditingCard   *KanbanCard `json:"editing_card"`
	Filter        string      `json:"filter"`
	SearchQuery   string      `json:"search_query"`

	// Collaboration
	ActiveUsers map[string]*UserActivity `json:"active_users"`
}

KanbanBoard provides a collaborative task management board

func (*KanbanBoard) AddCard

func (k *KanbanBoard) AddCard(data interface{})

AddCard adds a new card to a column

func (*KanbanBoard) AddComment

func (k *KanbanBoard) AddComment(data interface{})

AddComment adds a comment to a card

func (*KanbanBoard) ExportBoard

func (k *KanbanBoard) ExportBoard(data interface{})

ExportBoard exports the board as JSON

func (*KanbanBoard) FilterBy

func (k *KanbanBoard) FilterBy(data interface{})

FilterBy updates the filter

func (*KanbanBoard) GetCardCount

func (k *KanbanBoard) GetCardCount(columnID string) int

GetCardCount returns the number of cards in a column

func (*KanbanBoard) GetCardsForColumn

func (k *KanbanBoard) GetCardsForColumn(columnID string) []KanbanCard

GetCardsForColumn returns cards in a specific column

func (*KanbanBoard) GetDriver

func (k *KanbanBoard) GetDriver() liveview.LiveDriver

GetDriver returns the component driver

func (*KanbanBoard) GetLabel

func (k *KanbanBoard) GetLabel(labelID string) *KanbanLabel

GetLabel returns a label by ID

func (*KanbanBoard) GetTemplate

func (k *KanbanBoard) GetTemplate() string

GetTemplate returns the Kanban board HTML

func (*KanbanBoard) HandleCollaborationMessage

func (k *KanbanBoard) HandleCollaborationMessage(data interface{})

HandleCollaborationMessage handles incoming collaboration messages

func (*KanbanBoard) HandleRemoteUpdate

func (k *KanbanBoard) HandleRemoteUpdate(data interface{})

HandleRemoteUpdate handles updates from other users

func (*KanbanBoard) ImportBoard

func (k *KanbanBoard) ImportBoard(data interface{})

ImportBoard imports board data from JSON

func (*KanbanBoard) MoveCard

func (k *KanbanBoard) MoveCard(data interface{})

MoveCard moves a card to a different column

func (*KanbanBoard) Search

func (k *KanbanBoard) Search(data interface{})

Search updates the search query

func (*KanbanBoard) SelectCard

func (k *KanbanBoard) SelectCard(data interface{})

SelectCard selects a card for viewing/editing

func (*KanbanBoard) Start

func (k *KanbanBoard) Start()

Start initializes the Kanban board

func (*KanbanBoard) StartDrag

func (k *KanbanBoard) StartDrag(data interface{})

StartDrag handles drag start

func (*KanbanBoard) UpdateCard

func (k *KanbanBoard) UpdateCard(data interface{})

UpdateCard updates card details

type KanbanCard

type KanbanCard struct {
	ID           string     `json:"id"`
	Title        string     `json:"title"`
	Description  string     `json:"description"`
	ColumnID     string     `json:"column_id"`
	AssigneeID   string     `json:"assignee_id"`
	AssigneeName string     `json:"assignee_name"`
	Labels       []string   `json:"labels"`
	DueDate      *time.Time `json:"due_date,omitempty"`
	Priority     string     `json:"priority"` // low, medium, high, urgent
	Points       int        `json:"points"`   // Story points
	Order        int        `json:"order"`
	CreatedBy    string     `json:"created_by"`
	CreatedAt    time.Time  `json:"created_at"`
	UpdatedAt    time.Time  `json:"updated_at"`
	Comments     []Comment  `json:"comments"`
	Attachments  []string   `json:"attachments"`
	Completed    bool       `json:"completed"`
	Blocked      bool       `json:"blocked"`
	BlockReason  string     `json:"block_reason,omitempty"`
}

KanbanCard represents a task card

type KanbanColumn

type KanbanColumn struct {
	ID        string `json:"id"`
	Title     string `json:"title"`
	Color     string `json:"color"`
	Order     int    `json:"order"`
	WIPLimit  int    `json:"wip_limit"` // Work in progress limit
	Collapsed bool   `json:"collapsed"`
}

KanbanColumn represents a column in the board

type KanbanLabel

type KanbanLabel struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Color string `json:"color"`
}

KanbanLabel for categorizing cards

type Modal struct {
	*liveview.ComponentDriver[*Modal]
	IsOpen     bool
	Title      string
	Content    string
	Size       string
	Closable   bool
	ShowFooter bool
	OkText     string
	CancelText string
	OnOk       func()
	OnCancel   func()
	OnClose    func()
}

func (*Modal) Cancel

func (m *Modal) Cancel(data interface{})

func (*Modal) Close

func (m *Modal) Close(data interface{})

func (*Modal) GetDriver

func (m *Modal) GetDriver() liveview.LiveDriver

func (*Modal) GetTemplate

func (m *Modal) GetTemplate() string

func (*Modal) Hide

func (m *Modal) Hide()

func (*Modal) Ok

func (m *Modal) Ok(data interface{})

func (*Modal) Open

func (m *Modal) Open()

func (*Modal) OverlayClick

func (m *Modal) OverlayClick(data interface{})

func (*Modal) SetContent

func (m *Modal) SetContent(content string)

func (*Modal) SetTitle

func (m *Modal) SetTitle(title string)

func (*Modal) Show

func (m *Modal) Show(title, content string)

func (*Modal) Start

func (m *Modal) Start()

func (*Modal) Toggle

func (m *Modal) Toggle()

type Notification

type Notification struct {
	ID       string
	Type     NotificationType
	Title    string
	Message  string
	Duration int
	Show     bool
}

type NotificationSystem

type NotificationSystem struct {
	*liveview.ComponentDriver[*NotificationSystem]
	Notifications []Notification
	Position      string
	MaxVisible    int
}

func (*NotificationSystem) Clear

func (n *NotificationSystem) Clear()

func (*NotificationSystem) Close

func (n *NotificationSystem) Close(data interface{})

func (*NotificationSystem) Error

func (n *NotificationSystem) Error(title, message string)

func (*NotificationSystem) GetDriver

func (n *NotificationSystem) GetDriver() liveview.LiveDriver

func (*NotificationSystem) GetProgressColor

func (n *NotificationSystem) GetProgressColor(notifType NotificationType) string

func (*NotificationSystem) GetTemplate

func (n *NotificationSystem) GetTemplate() string

func (*NotificationSystem) GetVisibleNotifications

func (n *NotificationSystem) GetVisibleNotifications() []Notification

func (*NotificationSystem) Info

func (n *NotificationSystem) Info(title, message string)

func (*NotificationSystem) SetPosition

func (n *NotificationSystem) SetPosition(position string)

func (*NotificationSystem) Show

func (n *NotificationSystem) Show(notifType NotificationType, title, message string, duration int)

func (*NotificationSystem) Start

func (n *NotificationSystem) Start()

func (*NotificationSystem) Success

func (n *NotificationSystem) Success(title, message string)

func (*NotificationSystem) Warning

func (n *NotificationSystem) Warning(title, message string)

type NotificationType

type NotificationType string
const (
	NotificationSuccess NotificationType = "success"
	NotificationError   NotificationType = "error"
	NotificationWarning NotificationType = "warning"
	NotificationInfo    NotificationType = "info"
)

type Pagination

type Pagination struct {
	*liveview.ComponentDriver[*Pagination]

	CurrentPage  int
	TotalPages   int
	TotalItems   int
	ItemsPerPage int
	MaxButtons   int
	OnPageChange func(page int)
}

func NewPagination

func NewPagination(id string, totalItems, itemsPerPage, currentPage int) *Pagination

func (*Pagination) EndItem

func (p *Pagination) EndItem() int

func (*Pagination) First

func (p *Pagination) First(data interface{})

func (*Pagination) GetDriver

func (p *Pagination) GetDriver() liveview.LiveDriver

func (*Pagination) GetTemplate

func (p *Pagination) GetTemplate() string

func (*Pagination) GoToPage

func (p *Pagination) GoToPage(data interface{})

func (*Pagination) Last

func (p *Pagination) Last(data interface{})

func (*Pagination) Next

func (p *Pagination) Next(data interface{})

func (*Pagination) PageNumbers

func (p *Pagination) PageNumbers() []int

func (*Pagination) Previous

func (p *Pagination) Previous(data interface{})

func (*Pagination) Start

func (p *Pagination) Start()

func (*Pagination) StartItem

func (p *Pagination) StartItem() int

func (*Pagination) UpdateTotal

func (p *Pagination) UpdateTotal(totalItems int)

type Point

type Point struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
}

Point represents a coordinate

type Port

type Port struct {
	ID        string
	Type      string // "input" or "output"
	Position  string // "top", "right", "bottom", "left"
	Label     string
	Connected bool
}

type RichEditor

type RichEditor struct {
	*liveview.ComponentDriver[*RichEditor]
	Content     string
	Placeholder string
	Height      string
	OnChange    func(content string)
}

func (*RichEditor) Change

func (r *RichEditor) Change(data interface{})

func (*RichEditor) Clear

func (r *RichEditor) Clear()

func (*RichEditor) Format

func (r *RichEditor) Format(data interface{})

func (*RichEditor) GetContent

func (r *RichEditor) GetContent() string

func (*RichEditor) GetDriver

func (r *RichEditor) GetDriver() liveview.LiveDriver

func (*RichEditor) GetTemplate

func (r *RichEditor) GetTemplate() string

func (*RichEditor) SetContent

func (r *RichEditor) SetContent(content string)

func (*RichEditor) Start

func (r *RichEditor) Start()

type Row

type Row map[string]interface{}
type SearchBox struct {
	*liveview.ComponentDriver[*SearchBox]

	Query       string
	Results     []SearchResult
	ShowResults bool
	IsLoading   bool
	Placeholder string
	MinChars    int
	DebounceMs  int
	MaxResults  int
	OnSearch    func(query string) []SearchResult
	OnSelect    func(result SearchResult)
	// contains filtered or unexported fields
}

func NewSearchBox

func NewSearchBox(id string) *SearchBox

func (*SearchBox) ClearSearch

func (s *SearchBox) ClearSearch(data interface{})

func (*SearchBox) GetDriver

func (s *SearchBox) GetDriver() liveview.LiveDriver

func (*SearchBox) GetTemplate

func (s *SearchBox) GetTemplate() string

func (*SearchBox) HideResults

func (s *SearchBox) HideResults(data interface{})

func (*SearchBox) SelectResult

func (s *SearchBox) SelectResult(data interface{})

func (*SearchBox) SetResults

func (s *SearchBox) SetResults(results []SearchResult)

func (*SearchBox) ShowLoading

func (s *SearchBox) ShowLoading(show bool)

func (*SearchBox) Start

func (s *SearchBox) Start()

func (*SearchBox) UpdateQuery

func (s *SearchBox) UpdateQuery(data interface{})

type SearchResult

type SearchResult struct {
	ID          string
	Title       string
	Description string
	Category    string
	Icon        string
	URL         string
}

type Shape

type Shape struct {
	ID          string    `json:"id"`
	Type        string    `json:"type"` // line, rect, circle, path, text
	X           float64   `json:"x"`
	Y           float64   `json:"y"`
	Width       float64   `json:"width,omitempty"`
	Height      float64   `json:"height,omitempty"`
	Radius      float64   `json:"radius,omitempty"`
	Points      []Point   `json:"points,omitempty"`
	Text        string    `json:"text,omitempty"`
	StrokeColor string    `json:"stroke_color"`
	FillColor   string    `json:"fill_color"`
	StrokeWidth int       `json:"stroke_width"`
	CreatedBy   string    `json:"created_by"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
	Locked      bool      `json:"locked"`
	Layer       int       `json:"layer"`
}

Shape represents a drawable shape

type Sidebar struct {
	*liveview.ComponentDriver[*Sidebar]
	Items      []SidebarItem
	Collapsed  bool
	Width      string
	Background string
}

func NewSidebar

func NewSidebar(items []SidebarItem) *Sidebar

func (*Sidebar) Expand

func (s *Sidebar) Expand(data interface{})

func (*Sidebar) GetDriver

func (s *Sidebar) GetDriver() liveview.LiveDriver

func (*Sidebar) GetTemplate

func (s *Sidebar) GetTemplate() string

func (*Sidebar) Select

func (s *Sidebar) Select(data interface{})

func (*Sidebar) Start

func (s *Sidebar) Start()

func (*Sidebar) Toggle

func (s *Sidebar) Toggle(data interface{})

type SidebarItem

type SidebarItem struct {
	ID       string
	Label    string
	Icon     string
	Active   bool
	Children []SidebarItem
	Expanded bool
}

type Step

type Step struct {
	ID          string
	Title       string
	Description string
	Completed   bool
	Active      bool
	Error       bool
	Icon        string
}

type Stepper

type Stepper struct {
	*liveview.ComponentDriver[*Stepper]

	Steps        []Step
	CurrentStep  int
	Orientation  string
	AllowSkip    bool
	OnStepChange func(stepIndex int)
}

func NewStepper

func NewStepper(id string, steps []Step) *Stepper

func (*Stepper) CompleteCurrentStep

func (s *Stepper) CompleteCurrentStep()

func (*Stepper) GetDriver

func (s *Stepper) GetDriver() liveview.LiveDriver

func (*Stepper) GetTemplate

func (s *Stepper) GetTemplate() string

func (*Stepper) GoToStep

func (s *Stepper) GoToStep(data interface{})

func (*Stepper) NextStep

func (s *Stepper) NextStep(data interface{})

func (*Stepper) PreviousStep

func (s *Stepper) PreviousStep(data interface{})

func (*Stepper) Reset

func (s *Stepper) Reset()

func (*Stepper) SetStepError

func (s *Stepper) SetStepError(stepIndex int, hasError bool)

func (*Stepper) Start

func (s *Stepper) Start()

type Tab

type Tab struct {
	ID      string
	Label   string
	Content string
	Active  bool
}

type Table

type Table struct {
	*liveview.ComponentDriver[*Table]
	Columns        []Column
	Rows           []Row
	FilteredRows   []Row
	CurrentPage    int
	PageSize       int
	TotalPages     int
	SortColumn     string
	SortDirection  string
	FilterText     string
	Selectable     bool
	SelectedRows   map[int]bool
	OnRowClick     func(row Row, index int)
	OnSort         func(column string, direction string)
	ShowPagination bool
}

func (*Table) ClearSelection

func (t *Table) ClearSelection()

func (*Table) Filter

func (t *Table) Filter(data interface{})

func (*Table) GetDriver

func (t *Table) GetDriver() liveview.LiveDriver

func (*Table) GetEndIndex

func (t *Table) GetEndIndex() int

func (*Table) GetPageNumbers

func (t *Table) GetPageNumbers() []int

func (*Table) GetPageRows

func (t *Table) GetPageRows() []Row

func (*Table) GetSelectedRows

func (t *Table) GetSelectedRows() []Row

func (*Table) GetStartIndex

func (t *Table) GetStartIndex() int

func (*Table) GetTemplate

func (t *Table) GetTemplate() string

func (*Table) Page

func (t *Table) Page(data interface{})

func (*Table) RowClick

func (t *Table) RowClick(data interface{})

func (*Table) SelectAll

func (t *Table) SelectAll(data interface{})

func (*Table) SelectRow

func (t *Table) SelectRow(data interface{})

func (*Table) Sort

func (t *Table) Sort(data interface{})

func (*Table) Start

func (t *Table) Start()

func (*Table) UpdateData

func (t *Table) UpdateData(rows []Row)

type Tabs

type Tabs struct {
	*liveview.ComponentDriver[*Tabs]

	Tabs        []Tab
	ActiveTab   string
	OnTabChange func(tabID string)
}

func (*Tabs) AddTab

func (t *Tabs) AddTab(tab Tab)

func (*Tabs) GetDriver

func (t *Tabs) GetDriver() liveview.LiveDriver

func (*Tabs) GetTemplate

func (t *Tabs) GetTemplate() string

func (*Tabs) RemoveTab

func (t *Tabs) RemoveTab(tabID string)

func (*Tabs) SelectTab

func (t *Tabs) SelectTab(data interface{})

func (*Tabs) SetActiveTab

func (t *Tabs) SetActiveTab(tabID string)

func (*Tabs) Start

func (t *Tabs) Start()

type UserActivity

type UserActivity struct {
	UserID     string    `json:"user_id"`
	UserName   string    `json:"user_name"`
	CardID     string    `json:"card_id,omitempty"`
	ColumnID   string    `json:"column_id,omitempty"`
	Activity   string    `json:"activity"` // viewing, editing, dragging
	LastActive time.Time `json:"last_active"`
	Color      string    `json:"color"`
}

UserActivity tracks what users are doing

type ValidationRule

type ValidationRule struct {
	Type    string
	Value   interface{}
	Message string
}

Jump to

Keyboard shortcuts

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