crudview

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.0.11

type Config struct {
	// ParentID is the DOM id the form mounts under.
	ParentID string
	// Presenter is built by the module via view.New(...). Required.
	Presenter view.Presenter
}

Config is what a renderer needs to draw a view.Presenter — nothing about ops, transport, or codec: that is ALL inside the Presenter already. The module builds the Presenter via view.New(...) (importing view+model+router, never layout) and hands it here.

type CrudView

type CrudView struct {
	Element // value embed — NEVER *dom.Element

	Title             string
	Form              Component // what Render paints (may stay nil in standalone mode)
	Presenter         view.Presenter
	SearchPlaceholder string

	// Additive user hooks — called AFTER the built-in behavior. Assigning them
	// can never disable list→form fill, save or delete wiring.
	OnSelect  func(it view.Item)
	OnNew     func()
	OnSaved   func(err error)
	OnDeleted func(id string, err error)
	OnCancel  func()
	// contains filtered or unexported fields
}

func New added in v0.0.11

func New(cfg Config) (*CrudView, error)

New builds the renderer around an already-constructed Presenter. It generates the form from Presenter.Record().Schema(), and wires save/delete to sync the form INTO Record() before calling Presenter.Save/Delete — crudview never talks to a Caller directly anymore.

func (*CrudView) IconSvg added in v0.0.19

func (v *CrudView) IconSvg() *sprite.Sprite

IconSvg returns the sprite with the captured Pa100T icons. Captured paths from Pa100T v3.0.1 (base64 SVGs in IE_MODULE_CONTENT.md §2). Method receiver (not a free function) so tinywasm/ssr detects a single receiver type for the package and emits RenderCSS + IconSvg together.

func (*CrudView) Init

func (v *CrudView) Init(ctx Ctx)

func (*CrudView) Reload

func (v *CrudView) Reload() error

func (*CrudView) Render

func (v *CrudView) Render() *Element

func (*CrudView) RenderCSS added in v0.0.19

func (v *CrudView) RenderCSS() *Stylesheet

RenderCSS implements the SSR CSSProvider convention. The method name must be RenderCSS (not GenerateCSS) for tinywasm/ssr to detect and emit these rules. It is a method (not a free function) both to match the platformd/rightpanel convention and because the dot-imported css package already exports a free RenderCSS, which a package-level function here would collide with.

Jump to

Keyboard shortcuts

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