Documentation
¶
Overview ¶
Package ui is the self-drawn GUI layer of Tango: an immediate-mode API over retained widget state, rendered by a pure-Go pipeline (no cgo) with the visual language of Ant Design 6.7 (default), Element Plus and shadcn/ui.
Programming model ¶
A page is a plain function called every frame:
func page(c *ui.Context) {
ui.Input(c, &name).Placeholder("用户名")
if ui.Button(c, "保存").Primary().Clicked() {
save(name)
}
}
Calls build a tree of layout nodes; chained modifiers (Primary, Disabled, ...) configure the widget before layout and paint run at the end of the frame. Interaction (Clicked, Hovered, focus) is answered from the previous frame's geometry, keyed by widget ID. IDs derive from the enclosing scope, widget kind, label and occurrence; wrap dynamic lists in ui.Key. Values live in the app (pointers); widgets only retain transient state (caret, scroll, open dropdowns, animations) via ui.State. Frames are event driven. A static UI stays idle until input or a request for a new frame. In a page function, call Context.WakeAt to schedule a frame. For example, compute a countdown from its deadline each frame, and call c.WakeAt(time.Now().Add(time.Second)) while it is still running. From a background goroutine, use Runner.Post to update application state on the UI thread and request a redraw.
Layers ¶
ui/theme design tokens (AntDesign, ElementPlus, Shadcn, Dark, derived palettes) ui/layout flex/stack/absolute solver with two-axis measurement ui/paint display list + Renderer interface + CPU rasterizer ui/text shaping (go-text/typesetting), fallback fonts, line breaking ui/input events, keys, IME composition, cursors, focus order ui/icon built-in vector icons ui Context, Runner, Driver, Window/Host contracts, components
Platform integration ¶
A platform backend implements Window (size, scale, invalidation, cursor, clipboard, IME, Present) and Host (open a window bound to a Runner); see window.go for the exact contract. The headless Driver implements Window for tests and screenshots. See AUTHORING.md for writing components.
Accessibility ¶
A window that also implements AccessibilityHost receives a semantics tree (package ui/a11y: roles, names, states, values, bounds, actions) after every frame that changed it, and forwards screen-reader requests through Runner.PerformAction. Nothing is built while the host reports accessibility disabled. Keyboard access (Tab order, roving arrow keys, focus traps in dialogs, focus return from popups), the reduced-motion preference (RunnerOptions.ReduceMotion) and theme contrast checks (theme.CheckContrast) complete the picture; docs/accessibility.md maps every role to NSAccessibility, UI Automation, AT-SPI, UIAccessibility and AccessibilityNodeInfo.
API tiers: only the symbols listed in api/stable/ui.txt are covered by the compatibility promise of docs/release.md ("API 稳定性"); every other exported symbol is Experimental and may change in any 0.x release. The API reference on the documentation site marks the experimental symbols.
Index ¶
- Constants
- Variables
- func AcceptPatterns(accept string) []string
- func BreakpointMins(th *theme.Theme) [5]float32
- func CloseContextMenu(c *Context, owner ID)
- func ContextMenuAt(c *Context, owner ID, pos geom.Point, items []MenuItem, ...)
- func ContextMenuAtWith(c *Context, owner ID, pos geom.Point, items []MenuItem, ...)
- func ContextMenuOpen(c *Context, owner ID) bool
- func Disabled(c *Context, on bool, fn func())
- func FieldSet(c *Context, f *FormW, fs ProFieldSet, vals ProValues)
- func FillLocale(l, base *Locale)
- func FormStatus(err string) string
- func FormatDuration(d time.Duration, format string) string
- func FormatMoney(loc *Locale, amount float64, currency string) string
- func FormatNumber(v float64, precision int) string
- func Gap(c *Context, size float32)
- func HoverDelay(c *Context, key ID, hovering bool, enter, leave time.Duration) bool
- func Invalidate(w Window)
- func Key(c *Context, key any, fn func())
- func MarkdownInsertBlock(src string, at int, block string) (string, int, int)
- func MarkdownLinePrefix(src string, a, b int, prefix string) (string, int, int)
- func MarkdownWrap(src string, a, b int, pre, suf, placeholder string) (string, int, int)
- func MessageDestroy(c *Context, key string)
- func NotificationDestroy(c *Context, key string)
- func OpenDialogs(c *Context) int
- func PlainText(spans []Span) string
- func ProFormItems(c *Context, f *FormW, fields []ProField, vals ProValues)
- func ProFormat(valueType string, enum []ProEnum, v any) string
- func ProFormatLocale(loc *Locale, valueType string, enum []ProEnum, v any) string
- func ProLayout(c *Context, cfg ProLayoutConfig, content func())
- func ProSettingsProvider(c *Context, s *ProSettings, fn func())
- func Prop[T any](c *Context, component, key string, def T) T
- func QRDataCapacity(v int, level QRLevel) int
- func QRFormatBits(level QRLevel, mask int) uint32
- func QRVersionBits(v int) uint32
- func RegisterLocale(l *Locale)
- func SetCodeHighlighter(h CodeHighlighter)
- func SetDefaultDirection(d Direction)
- func SetDefaultLocale(l *Locale)
- func SetHoverOpen(c *Context, key ID, open bool)
- func ShortcutKeys(accel string) []string
- func ShortcutLabel(accel string) string
- func SkeletonAvatar(c *Context, size float32, square, active bool)
- func SkeletonButton(c *Context, size ControlSize, shape string, active bool)
- func SkeletonImage(c *Context, w, h float32, active bool)
- func SkeletonInput(c *Context, size ControlSize, active bool)
- func Spacer(c *Context)
- func State[T any](c *Context, id ID, init func() T) *T
- func ToggleMarkdownTask(src string, index int) string
- func VDivider(c *Context)
- type A11yLocale
- type ANSIColor
- type ANSIColorKind
- type ANSIParser
- type ANSISpan
- type ANSIStyle
- type AccessibilityHost
- type AddonW
- type AffixW
- type AlertEffect
- type AlertW
- func (a *AlertW) Action(fn func()) *AlertW
- func (a *AlertW) Banner() *AlertW
- func (a *AlertW) Center() *AlertW
- func (a *AlertW) Closable() *AlertW
- func (a *AlertW) CloseDisabled(on bool) *AlertW
- func (a *AlertW) CloseIcon(ic *icon.Icon) *AlertW
- func (a *AlertW) CloseText(s string) *AlertW
- func (a *AlertW) Closed() bool
- func (a *AlertW) Description(d string) *AlertW
- func (a *AlertW) Effect(e AlertEffect) *AlertW
- func (a *AlertW) Icon(ic *icon.Icon) *AlertW
- func (a *AlertW) NoIcon() *AlertW
- func (a *AlertW) Show() *AlertW
- func (a *AlertW) ShowIcon(on bool) *AlertW
- func (a *AlertW) Variant(v string) *AlertW
- type AnchorItem
- type AnchorSectionW
- type AnchorW
- func (a *AnchorW) Active() string
- func (a *AnchorW) Bounds(px float32) *AnchorW
- func (a *AnchorW) Changed() bool
- func (a *AnchorW) Clicked() string
- func (a *AnchorW) CurrentAnchor(fn func(active string) string) *AnchorW
- func (a *AnchorW) Direction(d string) *AnchorW
- func (a *AnchorW) Horizontal() *AnchorW
- func (a *AnchorW) NoInk() *AnchorW
- func (a *AnchorW) Show() *AnchorW
- func (a *AnchorW) Target(id ID) *AnchorW
- func (a *AnchorW) TargetOffset(px float32) *AnchorW
- func (a *AnchorW) Type(t string) *AnchorW
- type AppAPI
- type AppMessageConfig
- type AppNotificationConfig
- type AppW
- type ApprovalChoice
- type ApprovalW
- func (w *ApprovalW) Body(fn func()) *ApprovalW
- func (w *ApprovalW) Choices(ch ...ApprovalChoice) *ApprovalW
- func (w *ApprovalW) Command(code, lang string) *ApprovalW
- func (w *ApprovalW) Decided() (ApprovalChoice, bool)
- func (w *ApprovalW) Decision(d ApprovalChoice) *ApprovalW
- func (w *ApprovalW) Description(s string) *ApprovalW
- func (w *ApprovalW) Feedback(note *string) *ApprovalW
- func (w *ApprovalW) Field(label, value string) *ApprovalW
- func (w *ApprovalW) Layout(opts ...layout.Option) *ApprovalW
- func (w *ApprovalW) Risk(level string) *ApprovalW
- type AspectRatioW
- type AuditIssue
- type AuditKind
- type AuditReport
- type AutoCompleteW
- func (w *AutoCompleteW) A11yLabel(s string) *AutoCompleteW
- func (w *AutoCompleteW) AllowClear() *AutoCompleteW
- func (w *AutoCompleteW) Changed() bool
- func (w *AutoCompleteW) DataVersion(v int) *AutoCompleteW
- func (w *AutoCompleteW) Debounce(d time.Duration) *AutoCompleteW
- func (w *AutoCompleteW) Disabled(on bool) *AutoCompleteW
- func (w *AutoCompleteW) Highlight() *AutoCompleteW
- func (w *AutoCompleteW) IsOpen() bool
- func (w *AutoCompleteW) Layout(o ...layout.Option) *AutoCompleteW
- func (w *AutoCompleteW) Loading(on bool) *AutoCompleteW
- func (w *AutoCompleteW) NotFoundContent(s string) *AutoCompleteW
- func (w *AutoCompleteW) Open() *AutoCompleteW
- func (w *AutoCompleteW) Placeholder(s string) *AutoCompleteW
- func (w *AutoCompleteW) Placement(p Placement) *AutoCompleteW
- func (w *AutoCompleteW) Prefix(ic *icon.Icon) *AutoCompleteW
- func (w *AutoCompleteW) Remote(fn func(query string)) *AutoCompleteW
- func (w *AutoCompleteW) Selected() (string, bool)
- func (w *AutoCompleteW) Size(s ControlSize) *AutoCompleteW
- func (w *AutoCompleteW) Source(fn func(q string) []Option) *AutoCompleteW
- func (w *AutoCompleteW) Status(s string) *AutoCompleteW
- func (w *AutoCompleteW) TriggerOnFocus() *AutoCompleteW
- func (w *AutoCompleteW) Variant(v FieldVariant) *AutoCompleteW
- func (w *AutoCompleteW) Virtual(on bool) *AutoCompleteW
- func (w *AutoCompleteW) Width(px float32) *AutoCompleteW
- type AvatarGroupW
- type AvatarW
- func (a *AvatarW) A11yLabel(s string) *AvatarW
- func (a *AvatarW) Bg(col theme.Color) *AvatarW
- func (a *AvatarW) Gap(px float32) *AvatarW
- func (a *AvatarW) Icon(ic *icon.Icon) *AvatarW
- func (a *AvatarW) Image(img image.Image) *AvatarW
- func (a *AvatarW) Large() *AvatarW
- func (a *AvatarW) Shape(s string) *AvatarW
- func (a *AvatarW) Size(px float32) *AvatarW
- func (a *AvatarW) Small() *AvatarW
- func (a *AvatarW) Square() *AvatarW
- type BackTopW
- func (b *BackTopW) Clicked() bool
- func (b *BackTopW) Content(fn func()) *BackTopW
- func (b *BackTopW) Description(s string) *BackTopW
- func (b *BackTopW) Duration(d time.Duration) *BackTopW
- func (b *BackTopW) Icon(ic *icon.Icon) *BackTopW
- func (b *BackTopW) Position(right, bottom float32) *BackTopW
- func (b *BackTopW) Primary() *BackTopW
- func (b *BackTopW) Show() *BackTopW
- func (b *BackTopW) Square() *BackTopW
- func (b *BackTopW) VisibilityHeight(px float32) *BackTopW
- type BackWindow
- type BadgeRibbonW
- type BadgeW
- func (b *BadgeW) Body(fn func()) *Box
- func (b *BadgeW) Color(col string) *BadgeW
- func (b *BadgeW) Count(n int) *BadgeW
- func (b *BadgeW) Dot() *BadgeW
- func (b *BadgeW) Hidden(on bool) *BadgeW
- func (b *BadgeW) Layout(o ...layout.Option) *BadgeW
- func (b *BadgeW) Max(n int) *BadgeW
- func (b *BadgeW) Offset(x, y float32) *BadgeW
- func (b *BadgeW) ShowZero() *BadgeW
- func (b *BadgeW) Small() *BadgeW
- func (b *BadgeW) Status(status, label string) *BadgeW
- func (b *BadgeW) Text(s string) *BadgeW
- func (b *BadgeW) Title(s string) *BadgeW
- type BeamStop
- type BorderBeamW
- func (w *BorderBeamW) Active(on bool) *BorderBeamW
- func (w *BorderBeamW) Body(fn func()) *Box
- func (w *BorderBeamW) Color(col theme.Color) *BorderBeamW
- func (w *BorderBeamW) Count(n int) *BorderBeamW
- func (w *BorderBeamW) Duration(d time.Duration) *BorderBeamW
- func (w *BorderBeamW) Gradient(stops ...BeamStop) *BorderBeamW
- func (w *BorderBeamW) Layout(o ...layout.Option) *BorderBeamW
- func (w *BorderBeamW) LineWidth(px float32) *BorderBeamW
- func (w *BorderBeamW) Outset(px float32) *BorderBeamW
- func (w *BorderBeamW) Radius(px float32) *BorderBeamW
- func (w *BorderBeamW) Size(px float32) *BorderBeamW
- type Box
- func Column(c *Context, fn func(), opts ...layout.Option) *Box
- func Content(c *Context, fn func(), opts ...layout.Option) *Box
- func Custom(c *Context, measure func(maxW, maxH float32) geom.Size, p PaintFunc, ...) *Box
- func Div(c *Context, opts ...layout.Option) *Box
- func Footer(c *Context, fn func(), opts ...layout.Option) *Box
- func Header(c *Context, fn func(), opts ...layout.Option) *Box
- func Layout(c *Context, fn func(), opts ...layout.Option) *Box
- func Overlay(c *Context, o OverlayOptions, fn func(), opts ...layout.Option) *Box
- func Row(c *Context, fn func(), opts ...layout.Option) *Box
- func StackBox(c *Context, fn func(), opts ...layout.Option) *Box
- func (b *Box) A11y(fn func(s *a11y.Node)) *Box
- func (b *Box) A11yHidden() *Box
- func (b *Box) A11yKeyboard() *Box
- func (b *Box) A11yScroller() *Box
- func (b *Box) A11yState(s a11y.State) *Box
- func (b *Box) Bg(col theme.Color) *Box
- func (b *Box) Body(fn func()) *Box
- func (b *Box) Border(w float32, col theme.Color) *Box
- func (b *Box) Clicked() bool
- func (b *Box) Clip() *Box
- func (b *Box) Cursor(cursor input.Cursor) *Box
- func (b *Box) DashedBorder(w float32, col theme.Color) *Box
- func (b *Box) Focusable(cursor input.Cursor) Interaction
- func (b *Box) Hovered() bool
- func (b *Box) ID() ID
- func (b *Box) Interact(cursor input.Cursor) Interaction
- func (b *Box) Label(s string) *Box
- func (b *Box) Opacity(a float32) *Box
- func (b *Box) Paint(fn PaintFunc) *Box
- func (b *Box) PaintOver(fn PaintFunc) *Box
- func (b *Box) Radii(r geom.Radii) *Box
- func (b *Box) Radius(r float32) *Box
- func (b *Box) RawTouch() *Box
- func (b *Box) Rect() geom.Rect
- func (b *Box) Scale(k float32) *Box
- func (b *Box) ScrollShift(r geom.Rect, d geom.Point)
- func (b *Box) Semantics(role a11y.Role, name string) *Box
- func (b *Box) Shadow(s []paint.Shadow) *Box
- func (b *Box) Style(opts ...layout.Option) *Box
- func (b *Box) TakePointer(axes PanAxis) *Box
- func (b *Box) Touches() []input.TouchEvent
- func (b *Box) Transform(m geom.Affine) *Box
- type BreadcrumbItem
- type BreadcrumbW
- func (b *BreadcrumbW) Clicked() int
- func (b *BreadcrumbW) ClickedHref() string
- func (b *BreadcrumbW) DropdownIcon(ic *icon.Icon) *BreadcrumbW
- func (b *BreadcrumbW) MenuClicked() string
- func (b *BreadcrumbW) Separator(s string) *BreadcrumbW
- func (b *BreadcrumbW) SeparatorIcon(ic *icon.Icon) *BreadcrumbW
- func (b *BreadcrumbW) Show() *BreadcrumbW
- type Breakpoint
- type BubbleAction
- type BubbleListW
- func (w *BubbleListW) A11yLabel(s string) *BubbleListW
- func (w *BubbleListW) Following() bool
- func (w *BubbleListW) Gap(px float32) *BubbleListW
- func (w *BubbleListW) ID() ID
- func (w *BubbleListW) NoAutoScroll() *BubbleListW
- func (w *BubbleListW) Overscan(px float32) *BubbleListW
- func (w *BubbleListW) Padding(px float32) *BubbleListW
- func (w *BubbleListW) Range() (first, end int)
- func (w *BubbleListW) ScrollToBottom() *BubbleListW
- func (w *BubbleListW) TopReached() bool
- type BubbleVariant
- type BubbleW
- func (w *BubbleW) Actions(a BubbleAction) *BubbleW
- func (w *BubbleW) ActionsAlways() *BubbleW
- func (w *BubbleW) Avatar(fn func()) *BubbleW
- func (w *BubbleW) AvatarIcon(ic *icon.Icon) *BubbleW
- func (w *BubbleW) AvatarText(s string) *BubbleW
- func (w *BubbleW) ClickedLink() string
- func (w *BubbleW) Copied() bool
- func (w *BubbleW) Edited() (string, bool)
- func (w *BubbleW) Editing() bool
- func (w *BubbleW) Extra(fn func()) *BubbleW
- func (w *BubbleW) ID() ID
- func (w *BubbleW) Layout(opts ...layout.Option) *BubbleW
- func (w *BubbleW) Loading(on bool) *BubbleW
- func (w *BubbleW) Markdown() *BubbleW
- func (w *BubbleW) Meta(s string) *BubbleW
- func (w *BubbleW) Name(s string) *BubbleW
- func (w *BubbleW) NoAvatar() *BubbleW
- func (w *BubbleW) Plain() *BubbleW
- func (w *BubbleW) Retried() bool
- func (w *BubbleW) Typing(on bool) *BubbleW
- func (w *BubbleW) TypingSpeed(cps float32) *BubbleW
- func (w *BubbleW) Variant(v BubbleVariant) *BubbleW
- type ButtonAppearance
- type ButtonColor
- type ButtonGroupW
- func (g *ButtonGroupW) A11yLabel(s string) *ButtonGroupW
- func (g *ButtonGroupW) Appearance(a ButtonAppearance) *ButtonGroupW
- func (g *ButtonGroupW) Body(fn func()) *ButtonGroupW
- func (g *ButtonGroupW) Color(col ButtonColor) *ButtonGroupW
- func (g *ButtonGroupW) ID() ID
- func (g *ButtonGroupW) Layout(o ...layout.Option) *ButtonGroupW
- func (g *ButtonGroupW) Size(s ControlSize) *ButtonGroupW
- func (g *ButtonGroupW) Variant(v ButtonVariant) *ButtonGroupW
- func (g *ButtonGroupW) Vertical() *ButtonGroupW
- type ButtonVariant
- type ButtonW
- func (b *ButtonW) A11yLabel(s string) *ButtonW
- func (b *ButtonW) Appearance(a ButtonAppearance) *ButtonW
- func (b *ButtonW) AutoInsertSpace(on bool) *ButtonW
- func (b *ButtonW) Block() *ButtonW
- func (b *ButtonW) Circle() *ButtonW
- func (b *ButtonW) Clicked() bool
- func (b *ButtonW) Color(col ButtonColor) *ButtonW
- func (b *ButtonW) Danger() *ButtonW
- func (b *ButtonW) Dashed() *ButtonW
- func (b *ButtonW) Disabled(on bool) *ButtonW
- func (b *ButtonW) Ghost() *ButtonW
- func (b *ButtonW) Hovered() bool
- func (b *ButtonW) ID() ID
- func (b *ButtonW) Icon(ic *icon.Icon) *ButtonW
- func (b *ButtonW) IconPlacement(p string) *ButtonW
- func (b *ButtonW) IconRight(ic *icon.Icon) *ButtonW
- func (b *ButtonW) Info() *ButtonW
- func (b *ButtonW) Large() *ButtonW
- func (b *ButtonW) Layout(opts ...layout.Option) *ButtonW
- func (b *ButtonW) Link() *ButtonW
- func (b *ButtonW) Loading(on bool) *ButtonW
- func (b *ButtonW) LoadingDelay(d time.Duration) *ButtonW
- func (b *ButtonW) LoadingIcon(ic *icon.Icon) *ButtonW
- func (b *ButtonW) Plain() *ButtonW
- func (b *ButtonW) Primary() *ButtonW
- func (b *ButtonW) Round() *ButtonW
- func (b *ButtonW) Secondary() *ButtonW
- func (b *ButtonW) Size(s ControlSize) *ButtonW
- func (b *ButtonW) Small() *ButtonW
- func (b *ButtonW) Success() *ButtonW
- func (b *ButtonW) Text() *ButtonW
- func (b *ButtonW) Variant(v ButtonVariant) *ButtonW
- func (b *ButtonW) Warning() *ButtonW
- type CalendarLocale
- type CalendarW
- func (w *CalendarW) Card() *CalendarW
- func (w *CalendarW) CellHeight(px float32) *CalendarW
- func (w *CalendarW) CellRender(fn func(d time.Time)) *CalendarW
- func (w *CalendarW) Changed() bool
- func (w *CalendarW) ControllerType(t string) *CalendarW
- func (w *CalendarW) DisabledDate(fn func(d time.Time) bool) *CalendarW
- func (w *CalendarW) Formatter(fn func(v int, kind string) string) *CalendarW
- func (w *CalendarW) Layout(o ...layout.Option) *CalendarW
- func (w *CalendarW) Mode(m *string) *CalendarW
- func (w *CalendarW) MonthCellRender(fn func(m time.Time)) *CalendarW
- func (w *CalendarW) NoHeader() *CalendarW
- func (w *CalendarW) PanelChanged() bool
- func (w *CalendarW) Range(start, end time.Time) *CalendarW
- func (w *CalendarW) ShowWeek(on bool) *CalendarW
- func (w *CalendarW) ValidRange(start, end time.Time) *CalendarW
- type CardActionW
- type CardMetaW
- type CardW
- func (w *CardW) Actions(fns ...func()) *CardW
- func (w *CardW) Body(fn func()) *CardW
- func (w *CardW) Borderless() *CardWdeprecated
- func (w *CardW) Clicked() bool
- func (w *CardW) Cover(fn func()) *CardW
- func (w *CardW) Extra(fn func()) *CardW
- func (w *CardW) Footer(fn func()) *CardW
- func (w *CardW) Hoverable() *CardW
- func (w *CardW) Inner() *CardW
- func (w *CardW) Layout(o ...layout.Option) *CardW
- func (w *CardW) Loading(on bool) *CardW
- func (w *CardW) Padding(in geom.Insets) *CardW
- func (w *CardW) Shadow(mode string) *CardW
- func (w *CardW) Small() *CardW
- func (w *CardW) TabBarExtra(fn func()) *CardW
- func (w *CardW) TabChanged() bool
- func (w *CardW) Tabs(active *string, items []TabItem) *CardW
- func (w *CardW) Variant(v string) *CardW
- type CarouselLocale
- type CarouselW
- func (w *CarouselW) Arrows(mode string) *CarouselW
- func (w *CarouselW) Autoplay(d time.Duration) *CarouselW
- func (w *CarouselW) Card() *CarouselW
- func (w *CarouselW) CardScale(k float32) *CarouselW
- func (w *CarouselW) Changed() bool
- func (w *CarouselW) Current(i *int) *CarouselW
- func (w *CarouselW) DotDuration(on bool) *CarouselW
- func (w *CarouselW) DotOutside() *CarouselW
- func (w *CarouselW) DotPlacement(p string) *CarouselW
- func (w *CarouselW) DotPosition(p string) *CarouselWdeprecated
- func (w *CarouselW) Dots(on bool) *CarouselW
- func (w *CarouselW) Draggable(on bool) *CarouselW
- func (w *CarouselW) Fade() *CarouselW
- func (w *CarouselW) Height(px float32) *CarouselW
- func (w *CarouselW) Loop(on bool) *CarouselW
- func (w *CarouselW) PauseOnHover(on bool) *CarouselW
- func (w *CarouselW) Show() *Box
- func (w *CarouselW) SwipeThreshold(frac float32) *CarouselW
- func (w *CarouselW) Trigger(t string) *CarouselW
- func (w *CarouselW) Vertical() *CarouselW
- type CascaderOption
- type CascaderPanelW
- func (p *CascaderPanelW) A11yLabel(s string) *CascaderPanelW
- func (p *CascaderPanelW) Border(on bool) *CascaderPanelW
- func (p *CascaderPanelW) ChangeOnSelect() *CascaderPanelW
- func (p *CascaderPanelW) Changed() bool
- func (p *CascaderPanelW) CheckedPaths() [][]string
- func (p *CascaderPanelW) DataVersion(v int) *CascaderPanelW
- func (p *CascaderPanelW) Disabled(on bool) *CascaderPanelW
- func (p *CascaderPanelW) Expand(path ...string) *CascaderPanelW
- func (p *CascaderPanelW) ExpandOnHover() *CascaderPanelW
- func (p *CascaderPanelW) Height(px float32) *CascaderPanelW
- func (p *CascaderPanelW) ID() ID
- func (p *CascaderPanelW) LoadData(fn func(path []string, done func([]CascaderOption))) *CascaderPanelW
- func (p *CascaderPanelW) Multiple(vals *[][]string) *CascaderPanelW
- func (p *CascaderPanelW) ShowCheckedStrategy(s CheckedStrategy) *CascaderPanelW
- func (p *CascaderPanelW) StrategyValue(on bool) *CascaderPanelW
- func (p *CascaderPanelW) Virtual(on bool) *CascaderPanelW
- type CascaderW
- func (w *CascaderW) A11yLabel(s string) *CascaderW
- func (w *CascaderW) AllowClear() *CascaderW
- func (w *CascaderW) ChangeOnSelect() *CascaderW
- func (w *CascaderW) Changed() bool
- func (w *CascaderW) CheckedPaths() [][]string
- func (w *CascaderW) DataVersion(v int) *CascaderW
- func (w *CascaderW) Disabled(on bool) *CascaderW
- func (w *CascaderW) DisplayRender(fn func(labels []string, path []CascaderOption) string) *CascaderW
- func (w *CascaderW) Expand(path ...string) *CascaderW
- func (w *CascaderW) ExpandOnHover() *CascaderW
- func (w *CascaderW) FilterMethod(fn func(query string, path []CascaderOption) bool) *CascaderW
- func (w *CascaderW) IsOpen() bool
- func (w *CascaderW) Layout(o ...layout.Option) *CascaderW
- func (w *CascaderW) LoadData(fn func(path []string, done func([]CascaderOption))) *CascaderW
- func (w *CascaderW) MaxTagCount(n int) *CascaderW
- func (w *CascaderW) MaxTagPlaceholder(fn func(omitted []string) string) *CascaderW
- func (w *CascaderW) Multiple(vals *[][]string) *CascaderW
- func (w *CascaderW) NotFoundContent(s string) *CascaderW
- func (w *CascaderW) Open() *CascaderW
- func (w *CascaderW) Placeholder(s string) *CascaderW
- func (w *CascaderW) Placement(p Placement) *CascaderW
- func (w *CascaderW) Searchable() *CascaderW
- func (w *CascaderW) Separator(s string) *CascaderW
- func (w *CascaderW) ShowCheckedStrategy(s CheckedStrategy) *CascaderW
- func (w *CascaderW) Size(s ControlSize) *CascaderW
- func (w *CascaderW) Status(s string) *CascaderW
- func (w *CascaderW) StrategyValue(on bool) *CascaderW
- func (w *CascaderW) Variant(v FieldVariant) *CascaderW
- func (w *CascaderW) Virtual(on bool) *CascaderW
- func (w *CascaderW) Width(px float32) *CascaderW
- type CellEditorTableW
- func (w *CellEditorTableW[T]) Bordered(on bool) *CellEditorTableW[T]
- func (w *CellEditorTableW[T]) Cancel()
- func (w *CellEditorTableW[T]) Changed() bool
- func (w *CellEditorTableW[T]) Edit(k, col string)
- func (w *CellEditorTableW[T]) EditingCell() (key, col string)
- func (w *CellEditorTableW[T]) Errors(k string) map[string]string
- func (w *CellEditorTableW[T]) ID() ID
- func (w *CellEditorTableW[T]) OnSave(fn func(row T, index int, done func(error))) *CellEditorTableW[T]
- func (w *CellEditorTableW[T]) Pagination(n int) *CellEditorTableW[T]
- func (w *CellEditorTableW[T]) RowEditable(fn func(row T) bool) *CellEditorTableW[T]
- func (w *CellEditorTableW[T]) RowKey(f func(T) string) *CellEditorTableW[T]
- func (w *CellEditorTableW[T]) Save()
- func (w *CellEditorTableW[T]) Saved() bool
- func (w *CellEditorTableW[T]) ScrollX(px float32) *CellEditorTableW[T]
- func (w *CellEditorTableW[T]) ScrollY(maxH float32) *CellEditorTableW[T]
- func (w *CellEditorTableW[T]) Show() *CellEditorTableW[T]
- func (w *CellEditorTableW[T]) Size(s ControlSize) *CellEditorTableW[T]
- func (w *CellEditorTableW[T]) Table() *TableW
- func (w *CellEditorTableW[T]) Title(s string) *CellEditorTableW[T]
- func (w *CellEditorTableW[T]) ToolBar(fn func()) *CellEditorTableW[T]
- func (w *CellEditorTableW[T]) Validating(k string) bool
- func (w *CellEditorTableW[T]) Virtual() *CellEditorTableW[T]
- type ChainItem
- type ChainStatus
- type ChartLocale
- type ChatAttachment
- type ChatLocale
- type ChatRole
- type CheckAllW
- type CheckCardGroupW
- func (g *CheckCardGroupW) Body(fn func()) *CheckCardGroupW
- func (g *CheckCardGroupW) Borderless() *CheckCardGroupW
- func (g *CheckCardGroupW) Changed() bool
- func (g *CheckCardGroupW) DefaultValue(v string) *CheckCardGroupW
- func (g *CheckCardGroupW) DefaultValues(v ...string) *CheckCardGroupW
- func (g *CheckCardGroupW) Disabled(on bool) *CheckCardGroupW
- func (g *CheckCardGroupW) Layout(opts ...layout.Option) *CheckCardGroupW
- func (g *CheckCardGroupW) Loading(on bool) *CheckCardGroupW
- func (g *CheckCardGroupW) Multiple() *CheckCardGroupW
- func (g *CheckCardGroupW) Selected() string
- func (g *CheckCardGroupW) SelectedValues() []string
- func (g *CheckCardGroupW) Show() *CheckCardGroupW
- func (g *CheckCardGroupW) Size(s ControlSize) *CheckCardGroupW
- func (g *CheckCardGroupW) Value(v *string) *CheckCardGroupW
- func (g *CheckCardGroupW) Values(v *[]string) *CheckCardGroupW
- func (g *CheckCardGroupW) Width(px float32) *CheckCardGroupW
- type CheckCardOption
- type CheckCardW
- func (w *CheckCardW) Actions(fns ...func()) *CheckCardW
- func (w *CheckCardW) Avatar(s string) *CheckCardW
- func (w *CheckCardW) AvatarIcon(ic *icon.Icon) *CheckCardW
- func (w *CheckCardW) Borderless() *CheckCardW
- func (w *CheckCardW) Changed() bool
- func (w *CheckCardW) Clicked() bool
- func (w *CheckCardW) Content(fn func()) *CheckCardW
- func (w *CheckCardW) Cover(fn func()) *CheckCardW
- func (w *CheckCardW) DefaultChecked(on bool) *CheckCardW
- func (w *CheckCardW) Description(s string) *CheckCardW
- func (w *CheckCardW) Disabled(on bool) *CheckCardW
- func (w *CheckCardW) Extra(fn func()) *CheckCardW
- func (w *CheckCardW) ID() ID
- func (w *CheckCardW) IsChecked() bool
- func (w *CheckCardW) Large() *CheckCardW
- func (w *CheckCardW) Loading(on bool) *CheckCardW
- func (w *CheckCardW) Show() *CheckCardW
- func (w *CheckCardW) Size(s ControlSize) *CheckCardW
- func (w *CheckCardW) Small() *CheckCardW
- func (w *CheckCardW) SubTitle(s string) *CheckCardW
- func (w *CheckCardW) Value(s string) *CheckCardW
- func (w *CheckCardW) Width(px float32) *CheckCardW
- type CheckableTagGroupW
- type CheckableTagW
- func (w *CheckableTagW) A11yLabel(s string) *CheckableTagW
- func (w *CheckableTagW) Changed() bool
- func (w *CheckableTagW) Checked() bool
- func (w *CheckableTagW) Disabled(on bool) *CheckableTagW
- func (w *CheckableTagW) Icon(ic *icon.Icon) *CheckableTagW
- func (w *CheckableTagW) Type(status string) *CheckableTagW
- type CheckboxGroupW
- func (g *CheckboxGroupW) A11yLabel(s string) *CheckboxGroupW
- func (g *CheckboxGroupW) Border() *CheckboxGroupW
- func (g *CheckboxGroupW) Buttons() *CheckboxGroupW
- func (g *CheckboxGroupW) Changed() bool
- func (g *CheckboxGroupW) Disabled(on bool) *CheckboxGroupW
- func (g *CheckboxGroupW) Max(n int) *CheckboxGroupW
- func (g *CheckboxGroupW) Min(n int) *CheckboxGroupW
- func (g *CheckboxGroupW) Size(s ControlSize) *CheckboxGroupW
- type CheckboxW
- func (w *CheckboxW) A11yLabel(s string) *CheckboxW
- func (w *CheckboxW) Border() *CheckboxW
- func (w *CheckboxW) Button() *CheckboxW
- func (w *CheckboxW) Changed() bool
- func (w *CheckboxW) Disabled(on bool) *CheckboxW
- func (w *CheckboxW) Indeterminate(on bool) *CheckboxW
- func (w *CheckboxW) Size(s ControlSize) *CheckboxW
- func (w *CheckboxW) Status(s string) *CheckboxW
- type CheckedStrategy
- type CodeBlockLocale
- type CodeBlockMatch
- type CodeBlockW
- func (w *CodeBlockW) A11yLabel(s string) *CodeBlockW
- func (w *CodeBlockW) ActiveMatch(index int) *CodeBlockW
- func (w *CodeBlockW) Copied() bool
- func (w *CodeBlockW) HeaderStyle(style CodeHeaderStyle) *CodeBlockW
- func (w *CodeBlockW) Height(px float32) *CodeBlockW
- func (w *CodeBlockW) HighlightLines(lines ...int) *CodeBlockW
- func (w *CodeBlockW) Highlighter(h CodeHighlighter) *CodeBlockW
- func (w *CodeBlockW) ID() ID
- func (w *CodeBlockW) Lang(lang string) *CodeBlockW
- func (w *CodeBlockW) Layout(opts ...layout.Option) *CodeBlockW
- func (w *CodeBlockW) LineNumbers(on bool) *CodeBlockW
- func (w *CodeBlockW) MaxHeight(px float32) *CodeBlockW
- func (w *CodeBlockW) NoCopy() *CodeBlockW
- func (w *CodeBlockW) Reveal(offset int) *CodeBlockW
- func (w *CodeBlockW) Search(query string, caseSensitive bool) *CodeBlockW
- func (w *CodeBlockW) SearchLimit(limit int) *CodeBlockW
- func (w *CodeBlockW) SearchMatchCount() (count int, capped bool)
- func (w *CodeBlockW) SearchMatches() []CodeBlockMatch
- func (w *CodeBlockW) Selection() string
- func (w *CodeBlockW) StartLine(n int) *CodeBlockW
- func (w *CodeBlockW) TextID() ID
- func (w *CodeBlockW) Title(s string) *CodeBlockW
- func (w *CodeBlockW) VisibleStartByte() (offset int, ok bool)
- func (w *CodeBlockW) Wrap(on bool) *CodeBlockW
- type CodeDocument
- type CodeHeaderStyle
- type CodeHighlighter
- type CodeSpan
- type CodeTokenKind
- type CollapseItem
- type CollapseW
- func (w *CollapseW) Accordion() *CollapseW
- func (w *CollapseW) BeforeCollapse(fn func(key string) bool) *CollapseW
- func (w *CollapseW) Borderless() *CollapseW
- func (w *CollapseW) Changed() bool
- func (w *CollapseW) Collapsible(mode string) *CollapseW
- func (w *CollapseW) ExpandIcon(ic *icon.Icon) *CollapseW
- func (w *CollapseW) ExpandIconPlacement(p string) *CollapseW
- func (w *CollapseW) Ghost() *CollapseW
- func (w *CollapseW) IconEnd() *CollapseWdeprecated
- func (w *CollapseW) IconStart() *CollapseWdeprecated
- func (w *CollapseW) IsOpen(key string) bool
- func (w *CollapseW) Layout(o ...layout.Option) *CollapseW
- func (w *CollapseW) Show() *CollapseW
- func (w *CollapseW) Size(s ControlSize) *CollapseW
- type ColorPickerLocale
- type ColorPickerPanelW
- func (w *ColorPickerPanelW) AllowClear() *ColorPickerPanelW
- func (w *ColorPickerPanelW) Border(on bool) *ColorPickerPanelW
- func (w *ColorPickerPanelW) Changed() bool
- func (w *ColorPickerPanelW) Disabled(on bool) *ColorPickerPanelW
- func (w *ColorPickerPanelW) DisabledFormat(on bool) *ColorPickerPanelW
- func (w *ColorPickerPanelW) Format(f string) *ColorPickerPanelW
- func (w *ColorPickerPanelW) ID() ID
- func (w *ColorPickerPanelW) NoAlpha() *ColorPickerPanelW
- func (w *ColorPickerPanelW) PresetGroups(groups ...ColorPresetGroup) *ColorPickerPanelW
- func (w *ColorPickerPanelW) PresetLabel(s string) *ColorPickerPanelW
- func (w *ColorPickerPanelW) Presets(cols ...theme.Color) *ColorPickerPanelW
- type ColorPickerW
- func (w *ColorPickerW) A11yLabel(s string) *ColorPickerW
- func (w *ColorPickerW) AllowClear() *ColorPickerW
- func (w *ColorPickerW) Changed() bool
- func (w *ColorPickerW) Cleared() bool
- func (w *ColorPickerW) Disabled(on bool) *ColorPickerW
- func (w *ColorPickerW) DisabledFormat(on bool) *ColorPickerW
- func (w *ColorPickerW) Format(f string) *ColorPickerW
- func (w *ColorPickerW) IsOpen() bool
- func (w *ColorPickerW) NoAlpha() *ColorPickerW
- func (w *ColorPickerW) Open() *ColorPickerW
- func (w *ColorPickerW) Placement(p Placement) *ColorPickerW
- func (w *ColorPickerW) PresetGroups(groups ...ColorPresetGroup) *ColorPickerW
- func (w *ColorPickerW) PresetLabel(s string) *ColorPickerW
- func (w *ColorPickerW) Presets(cols ...theme.Color) *ColorPickerW
- func (w *ColorPickerW) ShowText() *ColorPickerW
- func (w *ColorPickerW) Size(s ControlSize) *ColorPickerW
- func (w *ColorPickerW) Status(s string) *ColorPickerW
- func (w *ColorPickerW) Trigger(t Trigger) *ColorPickerW
- type ColorPresetGroup
- type ColumnsStateFuncs
- type ColumnsStateStore
- type CommandItem
- type CommandLocale
- type CommandW
- func (w *CommandW) DataVersion(v int) *CommandW
- func (w *CommandW) DisablePointerSelection(on bool) *CommandW
- func (w *CommandW) Empty(s string) *CommandW
- func (w *CommandW) Filter(fn func(value, search string, keywords []string) float64) *CommandW
- func (w *CommandW) ID() ID
- func (w *CommandW) Layout(opts ...layout.Option) *CommandW
- func (w *CommandW) Loop(on bool) *CommandW
- func (w *CommandW) MaxHeight(h float32) *CommandW
- func (w *CommandW) Placeholder(s string) *CommandW
- func (w *CommandW) Query() string
- func (w *CommandW) Search(q *string) *CommandW
- func (w *CommandW) Selected() (CommandItem, bool)
- func (w *CommandW) Shadow() *CommandW
- func (w *CommandW) ShouldFilter(on bool) *CommandW
- func (w *CommandW) Value(v *string) *CommandW
- func (w *CommandW) ValueChanged() bool
- func (w *CommandW) VimBindings(on bool) *CommandW
- func (w *CommandW) Virtual(on bool) *CommandW
- type CompactW
- type ConfigProviderW
- func (p *ConfigProviderW) Body(fn func())
- func (p *ConfigProviderW) Compact(on bool) *ConfigProviderW
- func (p *ConfigProviderW) ComponentDisabled(on bool) *ConfigProviderW
- func (p *ConfigProviderW) Components(cs theme.Components) *ConfigProviderW
- func (p *ConfigProviderW) Dark(on bool) *ConfigProviderW
- func (p *ConfigProviderW) Defaults(component string, props Props) *ConfigProviderW
- func (p *ConfigProviderW) Direction(d Direction) *ConfigProviderW
- func (p *ConfigProviderW) Flavor(f theme.Flavor) *ConfigProviderW
- func (p *ConfigProviderW) HighContrast(on bool) *ConfigProviderW
- func (p *ConfigProviderW) Locale(l *Locale) *ConfigProviderW
- func (p *ConfigProviderW) LocaleCode(code string) *ConfigProviderW
- func (p *ConfigProviderW) PrimaryColor(col theme.Color) *ConfigProviderW
- func (p *ConfigProviderW) Size(s ControlSize) *ConfigProviderW
- func (p *ConfigProviderW) Theme(th *theme.Theme) *ConfigProviderW
- type ConfirmAction
- type ConfirmOptions
- type ConfirmRef
- type ContentKind
- type Context
- func (c *Context) A11yAction(id ID) (a11y.Action, string, bool)
- func (c *Context) A11yEnabled() bool
- func (c *Context) A11yScrollRequest(container ID) (ID, bool)
- func (c *Context) Anim(id ID, slot string, target float32, dur time.Duration) float32
- func (c *Context) AnimDone(id ID, slot string) bool
- func (c *Context) AnimFrom(id ID, slot string, initial, target float32, dur time.Duration) float32
- func (c *Context) Announce(text string, live a11y.Live)
- func (c *Context) CaptureTab(id ID)
- func (c *Context) ClaimBack()
- func (c *Context) ClaimEscape(id ID)
- func (c *Context) ClaimKeyboardReveal()
- func (c *Context) ComponentSize() (ControlSize, bool)
- func (c *Context) CompositionFor(id ID) (string, int)
- func (c *Context) ConfigProp(component, key string) (any, bool)
- func (c *Context) ContextMenu() (geom.Point, bool)
- func (c *Context) ContextMenuFor(id ID) (geom.Point, bool)
- func (c *Context) Damage(r geom.Rect)
- func (c *Context) Direction() Direction
- func (c *Context) Dismissed(panel ID, also ...ID) bool
- func (c *Context) Dragging(id ID) bool
- func (c *Context) Escape() bool
- func (c *Context) EscapeAt(panel ID) bool
- func (c *Context) EventsFor(id ID) []input.Event
- func (c *Context) FileDrag() (geom.Point, bool)
- func (c *Context) Focused() ID
- func (c *Context) Inline(r geom.Rect) InlineSpan
- func (c *Context) InlineKey(k input.Key) (prev, next bool)
- func (c *Context) Invalidate()
- func (c *Context) InvalidateImage(img image.Image)
- func (c *Context) Invalidator() func()
- func (c *Context) IsRTL() bool
- func (c *Context) KeepPointer(id ID)
- func (c *Context) KeyboardCover(r geom.Rect) float32
- func (c *Context) KeyboardInset() geom.Insets
- func (c *Context) KeysFor(id ID) []input.KeyEvent
- func (c *Context) Locale() *Locale
- func (c *Context) MiddlePressed(id ID) bool
- func (c *Context) Now() time.Time
- func (c *Context) PaintIcon(l *paint.List, ic *icon.Icon, r geom.Rect, col theme.Color, angle float64)
- func (c *Context) PendingKeyboardReveal() (KeyboardReveal, bool)
- func (c *Context) PixelScale() float32
- func (c *Context) Pointer() (geom.Point, bool)
- func (c *Context) PointerCancelled(id ID) bool
- func (c *Context) PointerDownOutside(rs ...geom.Rect) bool
- func (c *Context) PointerEvents() []input.Pointer
- func (c *Context) PointerMods() input.Modifiers
- func (c *Context) PointerTaken(id ID) (from geom.Point, ok bool)
- func (c *Context) PressCount() int
- func (c *Context) PressMods() input.Modifiers
- func (c *Context) PressPos() geom.Point
- func (c *Context) PressedOutside(ids ...ID) bool
- func (c *Context) RectOf(id ID) (geom.Rect, bool)
- func (c *Context) ReduceMotion() bool
- func (c *Context) ReleasePos(id ID) (geom.Point, bool)
- func (c *Context) SafeArea() geom.Insets
- func (c *Context) ScrollIntoView(scrollID, id ID) bool
- func (c *Context) ScrollIntoViewInset(scrollID, id ID, inset geom.Insets) bool
- func (c *Context) ScrollShift(r geom.Rect, d geom.Point)
- func (c *Context) Semantics(id ID, role a11y.Role, name string, states ...a11y.State)
- func (c *Context) SetFocus(id ID)
- func (c *Context) Size() geom.Size
- func (c *Context) TerminalEvents(id ID, fn func(input.Event) bool)
- func (c *Context) TerminalFocus(id ID, fn func(bool))
- func (c *Context) TextEditsFor(id ID) []input.Event
- func (c *Context) TextFor(id ID) []string
- func (c *Context) TextOpts(o text.Options) text.Options
- func (c *Context) TextStyle(size float32, weight text.Weight) text.Style
- func (c *Context) ThemeFor(k theme.Comp) *theme.Theme
- func (c *Context) Token() *theme.Components
- func (c *Context) TouchCount() int
- func (c *Context) TrapFocus(panel ID)
- func (c *Context) WakeAt(t time.Time)
- func (c *Context) WakeAtDamaged(t time.Time)
- func (c *Context) WantBack() bool
- func (c *Context) WantImagePaste()
- func (c *Context) WantTextInput(caret geom.Rect)
- func (c *Context) WantTextInputState(caret geom.Rect, st input.TextInputState)
- func (c *Context) WheelFor(id ID) (dx, dy float32, ok bool)
- func (c *Context) Window() Window
- func (c *Context) WindowFocused() bool
- type ContextMenuOptions
- type ControlSize
- type Conversation
- type ConversationsW
- func (w *ConversationsW) A11yLabel(s string) *ConversationsW
- func (w *ConversationsW) Deleted() (string, bool)
- func (w *ConversationsW) Height(px float32) *ConversationsW
- func (w *ConversationsW) Layout(opts ...layout.Option) *ConversationsW
- func (w *ConversationsW) NoDelete() *ConversationsW
- func (w *ConversationsW) NoGroups() *ConversationsW
- func (w *ConversationsW) NoRename() *ConversationsW
- func (w *ConversationsW) Renamed() (key, title string, ok bool)
- func (w *ConversationsW) ScrollToKey(key string, align string, offset float64) *ConversationsW
- func (w *ConversationsW) Selected() (string, bool)
- func (w *ConversationsW) Virtual() *ConversationsW
- type CountdownW
- func (w *CountdownW) Color(col theme.Color) *CountdownW
- func (w *CountdownW) Finished() bool
- func (w *CountdownW) Format(f string) *CountdownW
- func (w *CountdownW) OnChange(fn func(d time.Duration)) *CountdownW
- func (w *CountdownW) Prefix(s string) *CountdownW
- func (w *CountdownW) Suffix(s string) *CountdownW
- type DamagePresenter
- type DatePickerLocale
- type DatePickerPanelW
- func (w *DatePickerPanelW) Border(on bool) *DatePickerPanelW
- func (w *DatePickerPanelW) Changed() bool
- func (w *DatePickerPanelW) Disabled(on bool) *DatePickerPanelW
- func (w *DatePickerPanelW) DisabledDate(fn func(time.Time) bool) *DatePickerPanelW
- func (w *DatePickerPanelW) MaxDate(t time.Time) *DatePickerPanelW
- func (w *DatePickerPanelW) MinDate(t time.Time) *DatePickerPanelW
- func (w *DatePickerPanelW) Picker(t PickerType) *DatePickerPanelW
- func (w *DatePickerPanelW) Range(end *time.Time) *DatePickerPanelW
- func (w *DatePickerPanelW) ShowWeek(on bool) *DatePickerPanelW
- func (w *DatePickerPanelW) View() PickerType
- type DatePickerW
- func (w *DatePickerW) A11yLabel(s string) *DatePickerW
- func (w *DatePickerW) AllowClear(on bool) *DatePickerW
- func (w *DatePickerW) Changed() bool
- func (w *DatePickerW) Disabled(on bool) *DatePickerW
- func (w *DatePickerW) DisabledDate(fn func(time.Time) bool) *DatePickerW
- func (w *DatePickerW) Format(f string) *DatePickerW
- func (w *DatePickerW) IsOpen() bool
- func (w *DatePickerW) Layout(o ...layout.Option) *DatePickerW
- func (w *DatePickerW) MaxDate(t time.Time) *DatePickerW
- func (w *DatePickerW) MinDate(t time.Time) *DatePickerW
- func (w *DatePickerW) NeedConfirm(on bool) *DatePickerW
- func (w *DatePickerW) Open() *DatePickerW
- func (w *DatePickerW) Picker(p PickerType) *DatePickerW
- func (w *DatePickerW) Placeholder(s string) *DatePickerW
- func (w *DatePickerW) Placement(p Placement) *DatePickerW
- func (w *DatePickerW) Presets(p ...DatePreset) *DatePickerW
- func (w *DatePickerW) ShowNow(on bool) *DatePickerW
- func (w *DatePickerW) ShowWeek(on bool) *DatePickerW
- func (w *DatePickerW) Size(s ControlSize) *DatePickerW
- func (w *DatePickerW) Status(s string) *DatePickerW
- func (w *DatePickerW) Variant(v string) *DatePickerW
- func (w *DatePickerW) Width(px float32) *DatePickerW
- type DatePreset
- type DateTimePickerW
- func (w *DateTimePickerW) A11yLabel(s string) *DateTimePickerW
- func (w *DateTimePickerW) AllowClear(on bool) *DateTimePickerW
- func (w *DateTimePickerW) Changed() bool
- func (w *DateTimePickerW) DefaultTime(t time.Time) *DateTimePickerW
- func (w *DateTimePickerW) Disabled(on bool) *DateTimePickerW
- func (w *DateTimePickerW) DisabledDate(fn func(time.Time) bool) *DateTimePickerW
- func (w *DateTimePickerW) DisabledTime(fn func(day time.Time) DisabledTimes) *DateTimePickerW
- func (w *DateTimePickerW) Format(f string) *DateTimePickerW
- func (w *DateTimePickerW) IsOpen() bool
- func (w *DateTimePickerW) Layout(o ...layout.Option) *DateTimePickerW
- func (w *DateTimePickerW) MaxDate(t time.Time) *DateTimePickerW
- func (w *DateTimePickerW) MinDate(t time.Time) *DateTimePickerW
- func (w *DateTimePickerW) Open() *DateTimePickerW
- func (w *DateTimePickerW) Placeholder(s string) *DateTimePickerW
- func (w *DateTimePickerW) Placement(p Placement) *DateTimePickerW
- func (w *DateTimePickerW) Presets(p ...DatePreset) *DateTimePickerW
- func (w *DateTimePickerW) ShowNow(on bool) *DateTimePickerW
- func (w *DateTimePickerW) Size(s ControlSize) *DateTimePickerW
- func (w *DateTimePickerW) Status(s string) *DateTimePickerW
- func (w *DateTimePickerW) Steps(h, m, s int) *DateTimePickerW
- func (w *DateTimePickerW) Variant(v string) *DateTimePickerW
- func (w *DateTimePickerW) Width(px float32) *DateTimePickerW
- type DefaultFooterW
- type DescItem
- type DescriptionsW
- func (d *DescriptionsW) Bordered() *DescriptionsW
- func (d *DescriptionsW) Column(n int) *DescriptionsW
- func (d *DescriptionsW) ColumnAt(bp Breakpoint, n int) *DescriptionsW
- func (d *DescriptionsW) Columns(m map[Breakpoint]int) *DescriptionsW
- func (d *DescriptionsW) Extra(fn func()) *DescriptionsW
- func (d *DescriptionsW) LabelBg(col theme.Color) *DescriptionsW
- func (d *DescriptionsW) LabelWidth(px float32) *DescriptionsW
- func (d *DescriptionsW) Layout(o ...layout.Option) *DescriptionsW
- func (d *DescriptionsW) NoColon() *DescriptionsW
- func (d *DescriptionsW) Size(s ControlSize) *DescriptionsW
- func (d *DescriptionsW) Title(s string) *DescriptionsW
- func (d *DescriptionsW) Vertical() *DescriptionsW
- type Direction
- type DisabledTimes
- type DividerW
- func (d *DividerW) Dashed() *DividerW
- func (d *DividerW) Orientation(s string) *DividerW
- func (d *DividerW) Plain() *DividerW
- func (d *DividerW) Size(s ControlSize) *DividerW
- func (d *DividerW) TitlePlacement(s string) *DividerW
- func (d *DividerW) Variant(v string) *DividerW
- func (d *DividerW) Vertical() *DividerW
- type DockAxis
- type DockLayout
- func (l *DockLayout) Activate(key string) bool
- func (l *DockLayout) AddTab(key, group string)
- func (l *DockLayout) FocusGroup() *DockNode
- func (l *DockLayout) Group(id string) *DockNode
- func (l *DockLayout) GroupOf(key string) *DockNode
- func (l *DockLayout) Groups() []*DockNode
- func (l *DockLayout) MoveTab(key, group string, index int) bool
- func (l *DockLayout) Normalize()
- func (l *DockLayout) RemoveTab(key string) bool
- func (l *DockLayout) SplitTab(key, group string, side DockSide) (string, bool)
- type DockLocale
- type DockNode
- type DockSide
- type DockW
- func (d *DockW) BeforeClose(fn func(key string) bool) *DockW
- func (d *DockW) Changed() bool
- func (d *DockW) Closed() string
- func (d *DockW) Content(fn func(key string)) *DockW
- func (d *DockW) OnTearOff(fn func(key string, pos geom.Point)) *DockW
- func (d *DockW) Show() *DockW
- func (d *DockW) Style(opts ...layout.Option) *DockW
- func (d *DockW) Tab(fn func(key string) TabItem) *DockW
- func (d *DockW) TornOff() (key string, pos geom.Point, ok bool)
- type DrawerPlacement
- type DrawerW
- func (d *DrawerW) AfterOpenChanged() bool
- func (d *DrawerW) BindSize(px *float32) *DrawerW
- func (d *DrawerW) Body(fn func()) *DrawerW
- func (d *DrawerW) Closable(on bool) *DrawerW
- func (d *DrawerW) ClosablePlacement(p string) *DrawerW
- func (d *DrawerW) Closed() bool
- func (d *DrawerW) CurrentSize() float32
- func (d *DrawerW) Extra(fn func()) *DrawerW
- func (d *DrawerW) Footer(fn func()) *DrawerW
- func (d *DrawerW) Keyboard(on bool) *DrawerW
- func (d *DrawerW) Large() *DrawerW
- func (d *DrawerW) Loading(on bool) *DrawerW
- func (d *DrawerW) Mask(on bool) *DrawerW
- func (d *DrawerW) MaskBlur(radius float32) *DrawerW
- func (d *DrawerW) MaskClosable(on bool) *DrawerW
- func (d *DrawerW) NoHeader() *DrawerW
- func (d *DrawerW) Placement(p DrawerPlacement) *DrawerW
- func (d *DrawerW) Push(px float32) *DrawerW
- func (d *DrawerW) Resizable(on bool) *DrawerW
- func (d *DrawerW) Resized() bool
- func (d *DrawerW) Size(px float32) *DrawerW
- func (d *DrawerW) SizeLimits(min, max float32) *DrawerW
- type Driver
- func (d *Driver) A11yFind(role a11y.Role, name string) (*a11y.Node, bool)
- func (d *Driver) A11yFindAll(role a11y.Role, name string) []*a11y.Node
- func (d *Driver) A11yFocused() *a11y.Node
- func (d *Driver) A11yPerform(role a11y.Role, name string, act a11y.Action, arg string) error
- func (d *Driver) A11yUpdates() (int, []a11y.NodeID)
- func (d *Driver) AccessibilityTree() *a11y.Tree
- func (d *Driver) Advance(dt time.Duration)
- func (d *Driver) Audit() AuditReport
- func (d *Driver) AuditNoContrast() AuditReport
- func (d *Driver) BackHandling() bool
- func (d *Driver) Click(p geom.Point)
- func (d *Driver) ClickLabel(text string) error
- func (d *Driver) Clipboard() string
- func (d *Driver) Compose(s string, cursor int)
- func (d *Driver) ContentSize() geom.Size
- func (d *Driver) Cursor() input.Cursor
- func (d *Driver) Drag(from, to geom.Point)
- func (d *Driver) DropFiles(p geom.Point, paths ...string)
- func (d *Driver) EnableAccessibility() *a11y.Tree
- func (d *Driver) FileDragLeave()
- func (d *Driver) FileDragOver(p geom.Point)
- func (d *Driver) Find(label string) (geom.Rect, bool)
- func (d *Driver) FindText(text string) (geom.Rect, bool)
- func (d *Driver) Frame() *image.RGBA
- func (d *Driver) Image() *image.RGBA
- func (d *Driver) Inject(e input.Event)
- func (d *Driver) Key(k input.Key, mods input.Modifiers)
- func (d *Driver) MirrorCheck(page func(*Context), setup ...func(*Driver)) MirrorReport
- func (d *Driver) Move(p geom.Point)
- func (d *Driver) NeedsFrame() bool
- func (d *Driver) Now() time.Time
- func (d *Driver) PerformAction(id a11y.NodeID, act a11y.Action, arg string) error
- func (d *Driver) Pinch(center geom.Point, from, to float32)
- func (d *Driver) Presented() int
- func (d *Driver) Resize(w, h float32)
- func (d *Driver) RightClick(p geom.Point)
- func (d *Driver) Runner() *Runner
- func (d *Driver) SavePNG(path string) error
- func (d *Driver) Scroll(p geom.Point, dy float32)
- func (d *Driver) SetClipboard(s string)
- func (d *Driver) SetKeyboardInset(in geom.Insets)
- func (d *Driver) SetSafeArea(in geom.Insets)
- func (d *Driver) SetTheme(t *theme.Theme)
- func (d *Driver) Settle() *image.RGBA
- func (d *Driver) Tap(p geom.Point)
- func (d *Driver) TextInputActive() (bool, geom.Rect)
- func (d *Driver) TextInputState() (input.TextInputState, bool)
- func (d *Driver) Touch(id int64, phase input.TouchPhase, p geom.Point)
- func (d *Driver) TouchDrag(from, to geom.Point)
- func (d *Driver) Touches(evs ...input.TouchEvent)
- func (d *Driver) TwoFingerPan(from, to geom.Point, spread float32)
- func (d *Driver) Type(s string)
- type DriverOptions
- type DropZoneLocale
- type DropZoneW
- func (z *DropZoneW) A11yLabel(s string) *DropZoneW
- func (z *DropZoneW) Dropped() []string
- func (z *DropZoneW) Highlight(on bool) *DropZoneW
- func (z *DropZoneW) ID() ID
- func (z *DropZoneW) Layout(o ...layout.Option) *DropZoneW
- func (z *DropZoneW) Over() bool
- func (z *DropZoneW) TakeDrop() (FileDrop, bool)
- type DropdownW
- func (d *DropdownW) Arrow() *DropdownW
- func (d *DropdownW) ArrowPointAtCenter(on bool) *DropdownW
- func (d *DropdownW) AutoFocus(on bool) *DropdownW
- func (d *DropdownW) Body(trigger func()) *DropdownW
- func (d *DropdownW) Button(label string) *DropdownWdeprecated
- func (d *DropdownW) ButtonClicked() bool
- func (d *DropdownW) Check(key string, on *bool) *DropdownW
- func (d *DropdownW) Clicked() string
- func (d *DropdownW) Danger() *DropdownW
- func (d *DropdownW) Disabled(on bool) *DropdownW
- func (d *DropdownW) HideOnClick(on bool) *DropdownW
- func (d *DropdownW) ID() ID
- func (d *DropdownW) IsOpen() bool
- func (d *DropdownW) MaxHeight(px float32) *DropdownW
- func (d *DropdownW) MenuIcon(ic *icon.Icon) *DropdownW
- func (d *DropdownW) MinWidth(px float32) *DropdownW
- func (d *DropdownW) MouseEnterDelay(dur time.Duration) *DropdownW
- func (d *DropdownW) MouseLeaveDelay(dur time.Duration) *DropdownW
- func (d *DropdownW) Open(open *bool) *DropdownW
- func (d *DropdownW) OpenAt(p geom.Point) *DropdownW
- func (d *DropdownW) OpenChanged() bool
- func (d *DropdownW) OpenSource() string
- func (d *DropdownW) Placement(p Placement) *DropdownW
- func (d *DropdownW) PopupRender(fn func(menu func())) *DropdownW
- func (d *DropdownW) Primary() *DropdownW
- func (d *DropdownW) Radio(value *string, keys ...string) *DropdownW
- func (d *DropdownW) Selected(key string) *DropdownW
- func (d *DropdownW) Size(s ControlSize) *DropdownW
- func (d *DropdownW) Trigger(t Trigger) *DropdownW
- type EditableProTableW
- func (e *EditableProTableW[T]) AddAtTop() *EditableProTableW[T]
- func (e *EditableProTableW[T]) AddRow() string
- func (e *EditableProTableW[T]) Bordered() *EditableProTableW[T]
- func (e *EditableProTableW[T]) Cancel(k string)
- func (e *EditableProTableW[T]) Changed() bool
- func (e *EditableProTableW[T]) Deleted() bool
- func (e *EditableProTableW[T]) DragSort(fn func(from, to int)) *EditableProTableW[T]
- func (e *EditableProTableW[T]) Edit(k string)
- func (e *EditableProTableW[T]) EditableKeys(keys *[]string) *EditableProTableW[T]
- func (e *EditableProTableW[T]) Editing(k string) bool
- func (e *EditableProTableW[T]) Errors(k string) map[string]string
- func (e *EditableProTableW[T]) ID() ID
- func (e *EditableProTableW[T]) MaxLength(n int) *EditableProTableW[T]
- func (e *EditableProTableW[T]) Moved() bool
- func (e *EditableProTableW[T]) Multiple() *EditableProTableW[T]
- func (e *EditableProTableW[T]) NewRow(fn func() T) *EditableProTableW[T]
- func (e *EditableProTableW[T]) NoDelete() *EditableProTableW[T]
- func (e *EditableProTableW[T]) OnDelete(fn func(row T, index int)) *EditableProTableW[T]
- func (e *EditableProTableW[T]) OnSave(fn func(row T, index int, done func(error))) *EditableProTableW[T]
- func (e *EditableProTableW[T]) Pagination(n int) *EditableProTableW[T]
- func (e *EditableProTableW[T]) RowEditable(fn func(row T) bool) *EditableProTableW[T]
- func (e *EditableProTableW[T]) RowKey(f func(T) string) *EditableProTableW[T]
- func (e *EditableProTableW[T]) Save(k string)
- func (e *EditableProTableW[T]) Saved() bool
- func (e *EditableProTableW[T]) ScrollX(w float32) *EditableProTableW[T]
- func (e *EditableProTableW[T]) ScrollY(maxH float32) *EditableProTableW[T]
- func (e *EditableProTableW[T]) Show() *EditableProTableW[T]
- func (e *EditableProTableW[T]) Size(s ControlSize) *EditableProTableW[T]
- func (e *EditableProTableW[T]) Table() *TableW
- func (e *EditableProTableW[T]) Title(s string) *EditableProTableW[T]
- func (e *EditableProTableW[T]) ToolBar(fn func()) *EditableProTableW[T]
- func (e *EditableProTableW[T]) Validating(k string) bool
- func (e *EditableProTableW[T]) Virtual() *EditableProTableW[T]
- type EditableTableLocale
- type EmptyW
- func (e *EmptyW) Body(fn func()) *Box
- func (e *EmptyW) Description(s string) *EmptyW
- func (e *EmptyW) Image(fn func()) *EmptyW
- func (e *EmptyW) ImageSize(px float32) *EmptyW
- func (e *EmptyW) Layout(o ...layout.Option) *EmptyW
- func (e *EmptyW) Simple() *EmptyW
- func (e *EmptyW) Title(s string) *EmptyW
- type FieldVariant
- type FileDrop
- type FlexW
- func (f *FlexW) Align(a layout.Align) *FlexW
- func (f *FlexW) Body(fn func()) *Box
- func (f *FlexW) Gap(s ControlSize) *FlexW
- func (f *FlexW) GapPx(px float32) *FlexW
- func (f *FlexW) Justify(j layout.Justify) *FlexW
- func (f *FlexW) Orientation(o string) *FlexW
- func (f *FlexW) Style(opts ...layout.Option) *FlexW
- func (f *FlexW) Vertical() *FlexW
- func (f *FlexW) Wrap() *FlexW
- type FloatButtonGroupW
- func (g *FloatButtonGroupW) Body(fn func()) *FloatButtonGroupW
- func (g *FloatButtonGroupW) Icon(ic *icon.Icon) *FloatButtonGroupW
- func (g *FloatButtonGroupW) IsOpen() bool
- func (g *FloatButtonGroupW) Open(open *bool) *FloatButtonGroupW
- func (g *FloatButtonGroupW) Position(right, bottom float32) *FloatButtonGroupW
- func (g *FloatButtonGroupW) Primary() *FloatButtonGroupW
- func (g *FloatButtonGroupW) Square() *FloatButtonGroupW
- func (g *FloatButtonGroupW) Trigger(t string) *FloatButtonGroupW
- type FloatButtonW
- func (f *FloatButtonW) A11yLabel(s string) *FloatButtonW
- func (f *FloatButtonW) Badge(n int) *FloatButtonW
- func (f *FloatButtonW) Bottom(px float32) *FloatButtonW
- func (f *FloatButtonW) Clicked() bool
- func (f *FloatButtonW) Description(s string) *FloatButtonW
- func (f *FloatButtonW) ID() ID
- func (f *FloatButtonW) Icon(ic *icon.Icon) *FloatButtonW
- func (f *FloatButtonW) Primary() *FloatButtonW
- func (f *FloatButtonW) Right(px float32) *FloatButtonW
- func (f *FloatButtonW) Square() *FloatButtonW
- func (f *FloatButtonW) Tooltip(s string) *FloatButtonW
- type FooterLink
- type FooterToolbarW
- func (f *FooterToolbarW) Body(fn func()) *FooterToolbarW
- func (f *FooterToolbarW) Extra(fn func()) *FooterToolbarW
- func (f *FooterToolbarW) Fixed(on bool) *FooterToolbarW
- func (f *FooterToolbarW) ID() ID
- func (f *FooterToolbarW) Layout(o ...layout.Option) *FooterToolbarW
- func (f *FooterToolbarW) Sticky() *FooterToolbarW
- func (f *FooterToolbarW) Target(id ID) *FooterToolbarW
- type FormItemW
- func (it *FormItemW) Body(fn func())
- func (it *FormItemW) Dependencies(names ...string) *FormItemW
- func (it *FormItemW) Disabled(on bool) *FormItemW
- func (it *FormItemW) Error(msg string) *FormItemW
- func (it *FormItemW) Extra(s string) *FormItemW
- func (it *FormItemW) ExtraBody(fn func()) *FormItemW
- func (it *FormItemW) Help(msg string) *FormItemW
- func (it *FormItemW) Hidden(on bool) *FormItemW
- func (it *FormItemW) Name(name string) *FormItemW
- func (it *FormItemW) NoLabel() *FormItemW
- func (it *FormItemW) OnDepsChange(fn func()) *FormItemW
- func (it *FormItemW) OnReset(fn func()) *FormItemW
- func (it *FormItemW) Required() *FormItemW
- func (it *FormItemW) Rules(val *string, rules ...Rule) *FormItemW
- func (it *FormItemW) RulesFunc(val func() string, rules ...Rule) *FormItemW
- func (it *FormItemW) Tooltip(tip string) *FormItemW
- func (it *FormItemW) ValidateStatus(s string) *FormItemW
- func (it *FormItemW) ValidateTrigger(t FormTrigger) *FormItemW
- type FormLayout
- type FormListRow
- type FormListW
- func (l *FormListW[T]) AddText(s string) *FormListW[T]
- func (l *FormListW[T]) Body(fn func(row *FormListRow[T])) *FormListW[T]
- func (l *FormListW[T]) Changed() bool
- func (l *FormListW[T]) Creator(fn func() T) *FormListW[T]
- func (l *FormListW[T]) Max(n int) *FormListW[T]
- func (l *FormListW[T]) Min(n int) *FormListW[T]
- func (l *FormListW[T]) NoActions() *FormListW[T]
- func (l *FormListW[T]) Rule(fn func(n int) string) *FormListW[T]
- type FormLocale
- type FormTrigger
- type FormW
- func (f *FormW) Body(fn func()) *FormW
- func (f *FormW) ClearValidate(names ...string)
- func (f *FormW) Colon(on bool) *FormW
- func (f *FormW) Disabled(on bool) *FormW
- func (f *FormW) Errors() map[string]string
- func (f *FormW) Finished() bool
- func (f *FormW) Inline() *FormW
- func (f *FormW) Item(label string) *FormItemW
- func (f *FormW) LabelAlign(a TextAlign) *FormW
- func (f *FormW) LabelWidth(px float32) *FormW
- func (f *FormW) Layout(o ...layout.Option) *FormW
- func (f *FormW) RequiredMark(on bool) *FormW
- func (f *FormW) RequiredMarkOptional() *FormW
- func (f *FormW) ResetFields(names ...string)
- func (f *FormW) ResetValidation()
- func (f *FormW) ScrollToFirstError() *FormW
- func (f *FormW) Size(s ControlSize) *FormW
- func (f *FormW) Submit()
- func (f *FormW) Submitting() bool
- func (f *FormW) Validate() bool
- func (f *FormW) ValidateFields(names ...string) bool
- func (f *FormW) ValidateTrigger(t FormTrigger) *FormW
- func (f *FormW) Validating() bool
- func (f *FormW) Value(name string) string
- func (f *FormW) Vertical() *FormW
- type GraphLocale
- type GridColW
- func (col *GridColW) Body(fn func()) *GridColW
- func (col *GridColW) Flex(n float32) *GridColW
- func (col *GridColW) LG(span int, offset ...int) *GridColW
- func (col *GridColW) MD(span int, offset ...int) *GridColW
- func (col *GridColW) Offset(n int) *GridColW
- func (col *GridColW) Order(n int) *GridColW
- func (col *GridColW) Pull(n int) *GridColW
- func (col *GridColW) Push(n int) *GridColW
- func (col *GridColW) SM(span int, offset ...int) *GridColW
- func (col *GridColW) Style(opts ...layout.Option) *GridColW
- func (col *GridColW) XL(span int, offset ...int) *GridColW
- func (col *GridColW) XS(span int, offset ...int) *GridColW
- func (col *GridColW) XXL(span int, offset ...int) *GridColW
- type GridContentW
- type GridRowW
- func (g *GridRowW) Align(a layout.Align) *GridRowW
- func (g *GridRowW) Body(fn func()) *Box
- func (g *GridRowW) Gutter(h, v float32) *GridRowW
- func (g *GridRowW) GutterAt(bp Breakpoint, px float32) *GridRowW
- func (g *GridRowW) Justify(j layout.Justify) *GridRowW
- func (g *GridRowW) NoWrap() *GridRowW
- func (g *GridRowW) VGutterAt(bp Breakpoint, px float32) *GridRowW
- type Host
- type HotkeyInputLocale
- type HotkeyInputW
- func (w *HotkeyInputW) A11yLabel(s string) *HotkeyInputW
- func (w *HotkeyInputW) AllowBare(on bool) *HotkeyInputW
- func (w *HotkeyInputW) Changed() bool
- func (w *HotkeyInputW) Conflict(fn func(accel string) string) *HotkeyInputW
- func (w *HotkeyInputW) ConflictText() string
- func (w *HotkeyInputW) Disabled(on bool) *HotkeyInputW
- func (w *HotkeyInputW) ID() ID
- func (w *HotkeyInputW) Literal() *HotkeyInputW
- func (w *HotkeyInputW) Placeholder(s string) *HotkeyInputW
- func (w *HotkeyInputW) Recording() bool
- func (w *HotkeyInputW) Size(s ControlSize) *HotkeyInputW
- func (w *HotkeyInputW) Status(s string) *HotkeyInputW
- func (w *HotkeyInputW) Width(px float32) *HotkeyInputW
- type ID
- type IconButtonW
- type IconViolation
- type IconW
- type ImageLocale
- type ImageW
- func (w *ImageW) A11yLabel(s string) *ImageW
- func (w *ImageW) Alt(s string) *ImageW
- func (w *ImageW) CloseOnEscape(on bool) *ImageW
- func (w *ImageW) Failed(on bool) *ImageW
- func (w *ImageW) Fallback(img image.Image) *ImageW
- func (w *ImageW) Fit(f string) *ImageW
- func (w *ImageW) Height(px float32) *ImageW
- func (w *ImageW) ID() ID
- func (w *ImageW) Infinite(on bool) *ImageW
- func (w *ImageW) Layout(o ...layout.Option) *ImageW
- func (w *ImageW) Loading(on bool) *ImageW
- func (w *ImageW) MaskClosable(on bool) *ImageW
- func (w *ImageW) MaxScale(k float32) *ImageW
- func (w *ImageW) MinScale(k float32) *ImageW
- func (w *ImageW) Movable(on bool) *ImageW
- func (w *ImageW) OpenPreview() *ImageW
- func (w *ImageW) Preview(on bool) *ImageW
- func (w *ImageW) PreviewAngle() float64
- func (w *ImageW) PreviewGroup(imgs []image.Image, index int) *ImageW
- func (w *ImageW) PreviewOpen() bool
- func (w *ImageW) PreviewScale() float32
- func (w *ImageW) PreviewSrc(img image.Image) *ImageW
- func (w *ImageW) Radius(px float32) *ImageW
- func (w *ImageW) Rotate(deg float64) *ImageW
- func (w *ImageW) ScaleStep(step float32) *ImageW
- func (w *ImageW) ShowProgress(on bool) *ImageW
- func (w *ImageW) Size(wpx, hpx float32) *ImageW
- func (w *ImageW) Width(px float32) *ImageW
- type InfiniteScrollW
- func (w *InfiniteScrollW) Disabled(on bool) *InfiniteScrollW
- func (w *InfiniteScrollW) Distance(px float32) *InfiniteScrollW
- func (w *InfiniteScrollW) Done(on bool) *InfiniteScrollW
- func (w *InfiniteScrollW) DoneText(s string) *InfiniteScrollW
- func (w *InfiniteScrollW) Height(px float32) *InfiniteScrollW
- func (w *InfiniteScrollW) ID() ID
- func (w *InfiniteScrollW) Layout(opts ...layout.Option) *InfiniteScrollW
- func (w *InfiniteScrollW) Loading(on bool) *InfiniteScrollW
- func (w *InfiniteScrollW) LoadingText(s string) *InfiniteScrollW
- func (w *InfiniteScrollW) NeedMore() bool
- func (w *InfiniteScrollW) Offset() float64
- func (w *InfiniteScrollW) ScrollTo(y float64) *InfiniteScrollW
- type InlineSpan
- type InputNumberW
- func (w *InputNumberW) A11yLabel(s string) *InputNumberW
- func (w *InputNumberW) Changed() bool
- func (w *InputNumberW) Controls(on bool) *InputNumberW
- func (w *InputNumberW) ControlsPosition(pos string) *InputNumberW
- func (w *InputNumberW) Disabled(on bool) *InputNumberW
- func (w *InputNumberW) DownDisabled() bool
- func (w *InputNumberW) Empty(empty *bool) *InputNumberW
- func (w *InputNumberW) Formatter(fn func(value string) string) *InputNumberW
- func (w *InputNumberW) Keyboard(on bool) *InputNumberW
- func (w *InputNumberW) Max(v float64) *InputNumberW
- func (w *InputNumberW) Min(v float64) *InputNumberW
- func (w *InputNumberW) Mode(m string) *InputNumberW
- func (w *InputNumberW) Parser(fn func(display string) string) *InputNumberW
- func (w *InputNumberW) Placeholder(s string) *InputNumberW
- func (w *InputNumberW) Precision(n int) *InputNumberW
- func (w *InputNumberW) Prefix(ic *icon.Icon) *InputNumberW
- func (w *InputNumberW) PrefixText(s string) *InputNumberW
- func (w *InputNumberW) ReadOnly() *InputNumberW
- func (w *InputNumberW) Size(s ControlSize) *InputNumberW
- func (w *InputNumberW) Status(s string) *InputNumberW
- func (w *InputNumberW) Step(v float64) *InputNumberW
- func (w *InputNumberW) StepStrictly() *InputNumberW
- func (w *InputNumberW) StringMode(s *string) *InputNumberW
- func (w *InputNumberW) Submitted() bool
- func (w *InputNumberW) UpDisabled() bool
- func (w *InputNumberW) Variant(v string) *InputNumberW
- func (w *InputNumberW) Wheel() *InputNumberW
- func (w *InputNumberW) Width(px float32) *InputNumberW
- type InputTagW
- func (w *InputTagW) A11yLabel(s string) *InputTagW
- func (w *InputTagW) Added() string
- func (w *InputTagW) AllowClear() *InputTagW
- func (w *InputTagW) Changed() bool
- func (w *InputTagW) Disabled(on bool) *InputTagW
- func (w *InputTagW) Draggable() *InputTagW
- func (w *InputTagW) Layout(o ...layout.Option) *InputTagW
- func (w *InputTagW) MaxTagCount(n int) *InputTagW
- func (w *InputTagW) MaxTags(n int) *InputTagW
- func (w *InputTagW) Placeholder(s string) *InputTagW
- func (w *InputTagW) SaveOnBlur() *InputTagW
- func (w *InputTagW) Separators(seps ...string) *InputTagW
- func (w *InputTagW) Size(s ControlSize) *InputTagW
- func (w *InputTagW) Status(s string) *InputTagW
- func (w *InputTagW) Trigger(key string) *InputTagW
- func (w *InputTagW) Width(px float32) *InputTagW
- type InputW
- func (w *InputW) A11yLabel(s string) *InputW
- func (w *InputW) AllowClear() *InputW
- func (w *InputW) Bg(col theme.Color) *InputW
- func (w *InputW) Borderless() *InputW
- func (w *InputW) Changed() bool
- func (w *InputW) Disabled(on bool) *InputW
- func (w *InputW) EnterKey(k input.EnterKey) *InputW
- func (w *InputW) Focus() *InputW
- func (w *InputW) Focused() bool
- func (w *InputW) ID() ID
- func (w *InputW) Kind(k input.TextKind) *InputW
- func (w *InputW) Layout(opts ...layout.Option) *InputW
- func (w *InputW) MaxLength(n int) *InputW
- func (w *InputW) NoBorder() *InputW
- func (w *InputW) Password() *InputW
- func (w *InputW) Placeholder(s string) *InputW
- func (w *InputW) Prefix(ic *icon.Icon) *InputW
- func (w *InputW) PrefixText(s string) *InputW
- func (w *InputW) ReadOnly() *InputW
- func (w *InputW) SelectAll() *InputW
- func (w *InputW) ShowCount() *InputW
- func (w *InputW) Size(s ControlSize) *InputW
- func (w *InputW) Status(s string) *InputW
- func (w *InputW) Submitted() bool
- func (w *InputW) Suffix(ic *icon.Icon) *InputW
- func (w *InputW) SuffixText(s string) *InputW
- func (w *InputW) Variant(v string) *InputW
- func (w *InputW) VisibilityToggle(on bool) *InputW
- func (w *InputW) Width(px float32) *InputW
- type Interaction
- type ItemGroupW
- type ItemSize
- type ItemVariant
- type ItemW
- func (w *ItemW) A11yLabel(s string) *ItemW
- func (w *ItemW) Actions(fn func()) *ItemW
- func (w *ItemW) Clickable() *ItemW
- func (w *ItemW) Clicked() bool
- func (w *ItemW) Content(fn func()) *ItemW
- func (w *ItemW) Description(s string) *ItemW
- func (w *ItemW) Disabled(on bool) *ItemW
- func (w *ItemW) ID() ID
- func (w *ItemW) Icon(ic *icon.Icon) *ItemW
- func (w *ItemW) Link() *ItemW
- func (w *ItemW) Media(fn func()) *ItemW
- func (w *ItemW) Muted() *ItemW
- func (w *ItemW) Outline() *ItemW
- func (w *ItemW) Size(s ItemSize) *ItemW
- func (w *ItemW) Small() *ItemW
- func (w *ItemW) Variant(v ItemVariant) *ItemW
- type JSONViewLocale
- type JSONViewW
- func (w *JSONViewW) A11yLabel(s string) *JSONViewW
- func (w *JSONViewW) Copied() string
- func (w *JSONViewW) Current() string
- func (w *JSONViewW) DataVersion(v int) *JSONViewW
- func (w *JSONViewW) ExpandDepth(n int) *JSONViewW
- func (w *JSONViewW) Height(px float32) *JSONViewW
- func (w *JSONViewW) ID() ID
- func (w *JSONViewW) Layout(opts ...layout.Option) *JSONViewW
- func (w *JSONViewW) Matches() int
- func (w *JSONViewW) NoToolbar() *JSONViewW
- func (w *JSONViewW) Query(q *string) *JSONViewW
- func (w *JSONViewW) Rows() int
- func (w *JSONViewW) ShowTypes() *JSONViewW
- type KbdW
- type KeyboardInsetWindow
- type KeyboardReveal
- type Label
- func (t *Label) Align(a TextAlign) *Label
- func (t *Label) Code() *Label
- func (t *Label) Color(col theme.Color) *Label
- func (t *Label) Copied() bool
- func (t *Label) CopyText(payload string) *Label
- func (t *Label) Copyable() *Label
- func (t *Label) Delete() *Label
- func (t *Label) Disabled() *Label
- func (t *Label) Editable(val *string) *Label
- func (t *Label) Editing() bool
- func (t *Label) Ellipsis() *Label
- func (t *Label) Expandable(open *bool) *Label
- func (t *Label) ID() ID
- func (t *Label) Italic() *Label
- func (t *Label) Layout(opts ...layout.Option) *Label
- func (t *Label) LineHeight(px float32) *Label
- func (t *Label) Lines(n int) *Label
- func (t *Label) Mark() *Label
- func (t *Label) NoWrap() *Label
- func (t *Label) Secondary() *Label
- func (t *Label) Size(px float32) *Label
- func (t *Label) Strong() *Label
- func (t *Label) Tertiary() *Label
- func (t *Label) TextDir(d text.Direction) *Label
- func (t *Label) Type(status string) *Label
- func (t *Label) Underline() *Label
- func (t *Label) Weight(w text.Weight) *Label
- type LightFilterLocale
- type LightFilterW
- func (f *LightFilterW) Bordered() *LightFilterW
- func (f *LightFilterW) Changed() bool
- func (f *LightFilterW) Collapse(n int) *LightFilterW
- func (f *LightFilterW) ID() ID
- func (f *LightFilterW) OpenKey() string
- func (f *LightFilterW) Params() map[string]string
- func (f *LightFilterW) Show() *LightFilterW
- func (f *LightFilterW) Size(s ControlSize) *LightFilterW
- func (f *LightFilterW) Values(v *ProValues) *LightFilterW
- type LinkW
- type ListActionsW
- type ListItemMetaW
- type ListToolBarW
- func (w *ListToolBarW) Actions(fn func()) *ListToolBarW
- func (w *ListToolBarW) Filter(fn func()) *ListToolBarW
- func (w *ListToolBarW) ID() ID
- func (w *ListToolBarW) Menu(kind string, active *string, items []TabItem) *ListToolBarW
- func (w *ListToolBarW) MultipleLine(on bool) *ListToolBarW
- func (w *ListToolBarW) OnSearch(fn func(string)) *ListToolBarW
- func (w *ListToolBarW) Search(s *string) *ListToolBarW
- func (w *ListToolBarW) Settings(fn func()) *ListToolBarW
- func (w *ListToolBarW) Show() *ListToolBarW
- func (w *ListToolBarW) SubTitle(s string) *ListToolBarW
- func (w *ListToolBarW) Tabs(active *string, items []TabItem) *ListToolBarW
- func (w *ListToolBarW) Title(s string) *ListToolBarW
- func (w *ListToolBarW) Tooltip(s string) *ListToolBarW
- type ListW
- func (w *ListW) Bordered() *ListW
- func (w *ListW) EmptyText(s string) *ListW
- func (w *ListW) EstimatedItemHeight(px float32) *ListW
- func (w *ListW) Footer(fn func()) *ListW
- func (w *ListW) Grid(columns int, gap float32) *ListW
- func (w *ListW) GridAt(bp Breakpoint, columns int) *ListW
- func (w *ListW) Header(fn func()) *ListW
- func (w *ListW) Height(px float32) *ListW
- func (w *ListW) Item(fn func(i int)) *ListW
- func (w *ListW) ItemExtra(fn func(i int)) *ListW
- func (w *ListW) ItemHeight(px float32) *ListW
- func (w *ListW) ItemLayout(s string) *ListW
- func (w *ListW) Layout(o ...layout.Option) *ListW
- func (w *ListW) LoadMore(label string, busy bool) *ListW
- func (w *ListW) LoadMoreClicked() bool
- func (w *ListW) Loading(on bool) *ListW
- func (w *ListW) PageChanged() bool
- func (w *ListW) Pagination(page *int, pageSize int) *ListW
- func (w *ListW) PaginationAlign(a string) *ListW
- func (w *ListW) PaginationPosition(pos string) *ListW
- func (w *ListW) Range() (first, end int)
- func (w *ListW) RowKey(fn func(i int) any) *ListW
- func (w *ListW) ScrollToKey(key any, align string, offset float64) *ListW
- func (w *ListW) Size(s ControlSize) *ListW
- func (w *ListW) Split(on bool) *ListW
- func (w *ListW) Virtual() *ListW
- type ListyW
- func (w *ListyW) Clicked() (int, bool)
- func (w *ListyW) DataVersion(v int) *ListyW
- func (w *ListyW) EndReached() bool
- func (w *ListyW) EstimatedItemHeight(px float32) *ListyW
- func (w *ListyW) Group(key func(i int) string, title func(key string, count int)) *ListyW
- func (w *ListyW) Height(px float32) *ListyW
- func (w *ListyW) ID() ID
- func (w *ListyW) ItemHeight(px float32) *ListyW
- func (w *ListyW) LoadMore(hasMore, loading bool) *ListyW
- func (w *ListyW) Offset() float64
- func (w *ListyW) Range() (first, end int)
- func (w *ListyW) RowHoverable(on bool) *ListyW
- func (w *ListyW) RowKey(fn func(i int) any) *ListyW
- func (w *ListyW) ScrollTo(px float64) *ListyW
- func (w *ListyW) ScrollToGroup(group string, align string, offset float64) *ListyW
- func (w *ListyW) ScrollToKey(key any, align string, offset float64) *ListyW
- func (w *ListyW) Show() *ListyW
- func (w *ListyW) Split(on bool) *ListyW
- func (w *ListyW) Sticky() *ListyW
- func (w *ListyW) Virtual() *ListyW
- type LoadingW
- func (m *LoadingW) Background(col theme.Color) *LoadingW
- func (m *LoadingW) Body(fn func()) *Box
- func (m *LoadingW) Fullscreen() *LoadingW
- func (m *LoadingW) Size(s ControlSize) *LoadingW
- func (m *LoadingW) Spinner(ic *icon.Icon) *LoadingW
- func (m *LoadingW) Text(s string) *LoadingW
- func (m *LoadingW) Tip(s string) *LoadingWdeprecated
- type Locale
- func (l *Locale) Date(y, m, d int) string
- func (l *Locale) Digit(n, total int) string
- func (l *Locale) IsRTL() bool
- func (l *Locale) Items(n int) string
- func (l *Locale) Month(m int) string
- func (l *Locale) Page(n int) string
- func (l *Locale) PageSizeLabel(n int) string
- func (l *Locale) RangeTotal(from, to, total int) string
- func (l *Locale) Rating(v float64, count int) string
- func (l *Locale) RemoveItem(label string) string
- func (l *Locale) Selected(n int) string
- func (l *Locale) Slide(n, total int) string
- func (l *Locale) T(key, fallback string) string
- func (l *Locale) Total(n int) string
- func (l *Locale) WeekdayNames() []string
- func (l *Locale) WithColon(label string) string
- func (l *Locale) Year(y int) string
- func (l *Locale) YearMonth(y, m int) string
- type LogBuffer
- func (b *LogBuffer) Append(lines ...string)
- func (b *LogBuffer) AppendLevel(level LogLevel, lines ...string)
- func (b *LogBuffer) Clear()
- func (b *LogBuffer) Flush()
- func (b *LogBuffer) Len() int
- func (b *LogBuffer) Level(i int) LogLevel
- func (b *LogBuffer) Line(i int) string
- func (b *LogBuffer) OnChange(fn func())
- func (b *LogBuffer) SetDetector(fn func(line string) LogLevel)
- func (b *LogBuffer) Write(p []byte) (int, error)
- type LogLevel
- type LogViewLocale
- type LogViewW
- func (w *LogViewW) A11yLabel(s string) *LogViewW
- func (w *LogViewW) Follow(on *bool) *LogViewW
- func (w *LogViewW) Height(px float32) *LogViewW
- func (w *LogViewW) ID() ID
- func (w *LogViewW) Layout(opts ...layout.Option) *LogViewW
- func (w *LogViewW) LineNumbers(on bool) *LogViewW
- func (w *LogViewW) Matches() int
- func (w *LogViewW) MinLevel(lv *LogLevel) *LogViewW
- func (w *LogViewW) NoLevelColors() *LogViewW
- func (w *LogViewW) NoToolbar() *LogViewW
- func (w *LogViewW) Query(q *string) *LogViewW
- func (w *LogViewW) Selection() string
- func (w *LogViewW) Wrap(on *bool) *LogViewW
- type LoginFormLocale
- type LoginFormW
- func (w *LoginFormW) AccountOnly() *LoginFormW
- func (w *LoginFormW) Actions(fn func()) *LoginFormW
- func (w *LoginFormW) Background(col theme.Color) *LoginFormW
- func (w *LoginFormW) BackgroundImage(img image.Image) *LoginFormW
- func (w *LoginFormW) CodeInterval(sec int) *LoginFormW
- func (w *LoginFormW) CodeSent() bool
- func (w *LoginFormW) Countdown() int
- func (w *LoginFormW) Err() error
- func (w *LoginFormW) Finished() bool
- func (w *LoginFormW) ForgotClicked() bool
- func (w *LoginFormW) ID() ID
- func (w *LoginFormW) LoginType() string
- func (w *LoginFormW) Logo(fn func()) *LoginFormW
- func (w *LoginFormW) MobileOnly() *LoginFormW
- func (w *LoginFormW) MobilePattern(re string) *LoginFormW
- func (w *LoginFormW) OnFinish(fn func(v ProValues, done func(error))) *LoginFormW
- func (w *LoginFormW) OnForgot(fn func()) *LoginFormW
- func (w *LoginFormW) OnSendCode(fn func(mobile string, done func(error))) *LoginFormW
- func (w *LoginFormW) Placement(s string) *LoginFormW
- func (w *LoginFormW) Show() *LoginFormW
- func (w *LoginFormW) Side(fn func()) *LoginFormW
- func (w *LoginFormW) SubTitle(s string) *LoginFormW
- func (w *LoginFormW) Submit()
- func (w *LoginFormW) SubmitText(s string) *LoginFormW
- func (w *LoginFormW) Submitting() bool
- func (w *LoginFormW) Title(s string) *LoginFormW
- func (w *LoginFormW) Values() ProValues
- func (w *LoginFormW) Width(px float32) *LoginFormW
- type MarkdownEditorLocale
- type MarkdownEditorW
- func (w *MarkdownEditorW) Changed() bool
- func (w *MarkdownEditorW) ClickedLink() string
- func (w *MarkdownEditorW) CurrentMode() string
- func (w *MarkdownEditorW) Height(px float32) *MarkdownEditorW
- func (w *MarkdownEditorW) Layout(opts ...layout.Option) *MarkdownEditorW
- func (w *MarkdownEditorW) Mode(m string) *MarkdownEditorW
- func (w *MarkdownEditorW) Placeholder(s string) *MarkdownEditorW
- type MarkdownImage
- type MarkdownListStyle
- type MarkdownLocale
- type MarkdownW
- func (m *MarkdownW) BodyLineHeight(px float32) *MarkdownW
- func (m *MarkdownW) ClickedLink() string
- func (m *MarkdownW) CodeBackground(color theme.Color) *MarkdownW
- func (m *MarkdownW) CodeBorder(color theme.Color) *MarkdownW
- func (m *MarkdownW) CodeHeader(style CodeHeaderStyle) *MarkdownW
- func (m *MarkdownW) CodeLanguage(on bool) *MarkdownW
- func (m *MarkdownW) CodeLineHeight(px float32) *MarkdownW
- func (m *MarkdownW) CodeSize(px float32) *MarkdownW
- func (m *MarkdownW) Color(col theme.Color) *MarkdownW
- func (m *MarkdownW) ContentWidth(px float32) *MarkdownW
- func (m *MarkdownW) CopyCode(on bool) *MarkdownW
- func (m *MarkdownW) HeadingBlock(id string) (int, bool)
- func (m *MarkdownW) HeadingRules(levels ...int) *MarkdownW
- func (m *MarkdownW) HeadingSize(level int, px float32) *MarkdownW
- func (m *MarkdownW) Highlighter(h CodeHighlighter) *MarkdownW
- func (m *MarkdownW) ImageMaxSize(width, height float32) *MarkdownW
- func (m *MarkdownW) Images(load func(src string) image.Image) *MarkdownW
- func (m *MarkdownW) ListStyle(style MarkdownListStyle) *MarkdownW
- func (m *MarkdownW) NoCopy() *MarkdownW
- func (m *MarkdownW) NoSelect() *MarkdownW
- func (m *MarkdownW) QuoteBorder(color theme.Color) *MarkdownW
- func (m *MarkdownW) ReadOnlyTasks(on bool) *MarkdownW
- func (m *MarkdownW) ResolveImage(load func(MarkdownImage) image.Image) *MarkdownW
- func (m *MarkdownW) ScrollToBlock(block int) bool
- func (m *MarkdownW) ScrollToHeading(id string) bool
- func (m *MarkdownW) Size(px float32) *MarkdownW
- func (m *MarkdownW) TaskToggled() (int, bool)
- func (m *MarkdownW) Virtual() *MarkdownW
- type MasonryW
- func (w *MasonryW) Assignment() []int
- func (w *MasonryW) Built() int
- func (w *MasonryW) Columns(n int) *MasonryW
- func (w *MasonryW) ColumnsAt(bp Breakpoint, n int) *MasonryW
- func (w *MasonryW) EstimatedHeight(px float32) *MasonryW
- func (w *MasonryW) Gutter(px float32) *MasonryW
- func (w *MasonryW) Gutters(h, v float32) *MasonryW
- func (w *MasonryW) ID() ID
- func (w *MasonryW) ItemColumn(fn func(i int) int) *MasonryW
- func (w *MasonryW) ItemHeight(fn func(i int) float32) *MasonryW
- func (w *MasonryW) ItemKey(fn func(i int) any) *MasonryW
- func (w *MasonryW) LayoutChanged() bool
- func (w *MasonryW) Show() *MasonryW
- func (w *MasonryW) Virtual(height float32) *MasonryW
- type MentionsW
- func (w *MentionsW) A11yLabel(s string) *MentionsW
- func (w *MentionsW) AllowClear() *MentionsW
- func (w *MentionsW) Changed() bool
- func (w *MentionsW) Cleared() bool
- func (w *MentionsW) DataVersion(v int) *MentionsW
- func (w *MentionsW) Debounce(d time.Duration) *MentionsW
- func (w *MentionsW) Disabled(on bool) *MentionsW
- func (w *MentionsW) IsOpen() bool
- func (w *MentionsW) Layout(o ...layout.Option) *MentionsW
- func (w *MentionsW) Loading(on bool) *MentionsW
- func (w *MentionsW) Open() *MentionsW
- func (w *MentionsW) Placeholder(s string) *MentionsW
- func (w *MentionsW) Placement(p Placement) *MentionsW
- func (w *MentionsW) Prefix(p ...string) *MentionsW
- func (w *MentionsW) Query() (prefix, query string, ok bool)
- func (w *MentionsW) Remote(fn func(prefix, query string)) *MentionsW
- func (w *MentionsW) Rows(n int) *MentionsW
- func (w *MentionsW) Selected() string
- func (w *MentionsW) Size(s ControlSize) *MentionsW
- func (w *MentionsW) Split(s string) *MentionsW
- func (w *MentionsW) Status(s string) *MentionsW
- func (w *MentionsW) Variant(v FieldVariant) *MentionsW
- func (w *MentionsW) Virtual(on bool) *MentionsW
- func (w *MentionsW) Whole() *MentionsW
- func (w *MentionsW) WholeCheck(fn func(prefix, value string) bool) *MentionsW
- func (w *MentionsW) Width(px float32) *MentionsW
- type MenuItem
- type MenuMode
- type MenuW
- func (m *MenuW) Accordion() *MenuW
- func (m *MenuW) Clicked() string
- func (m *MenuW) Collapsed(on bool) *MenuW
- func (m *MenuW) Dark() *MenuW
- func (m *MenuW) DefaultOpen(keys ...string) *MenuW
- func (m *MenuW) Ellipsis(on bool) *MenuW
- func (m *MenuW) ExpandIcon(ic *icon.Icon) *MenuW
- func (m *MenuW) InlineIndent(px float32) *MenuW
- func (m *MenuW) ItemPanel(key string, fn func()) *MenuW
- func (m *MenuW) Mode(md MenuMode) *MenuW
- func (m *MenuW) OpenChanged() bool
- func (m *MenuW) OpenKeys(keys *[]string) *MenuW
- func (m *MenuW) OverflowedIndicator(ic *icon.Icon) *MenuW
- func (m *MenuW) Selectable(on bool) *MenuW
- func (m *MenuW) Show() *MenuW
- func (m *MenuW) SubMenuCloseDelay(d time.Duration) *MenuW
- func (m *MenuW) SubMenuOpenDelay(d time.Duration) *MenuW
- func (m *MenuW) Tooltip(on bool) *MenuW
- func (m *MenuW) TriggerSubMenuAction(t Trigger) *MenuW
- func (m *MenuW) Width(px float32) *MenuW
- type MenubarItem
- type MenubarItemKind
- type MenubarMenu
- type MenubarW
- type MessagePlacement
- type MessageRef
- func (r *MessageRef) Duration(d time.Duration) *MessageRef
- func (r *MessageRef) Grouping() *MessageRef
- func (r *MessageRef) Icon(ic *icon.Icon) *MessageRef
- func (r *MessageRef) Key(key string) *MessageRef
- func (r *MessageRef) Offset(px float32) *MessageRef
- func (r *MessageRef) OnClick(fn func()) *MessageRef
- func (r *MessageRef) OnClose(fn func()) *MessageRef
- func (r *MessageRef) PauseOnHover(on bool) *MessageRef
- func (r *MessageRef) Placement(p MessagePlacement) *MessageRef
- func (r *MessageRef) Plain() *MessageRef
- func (r *MessageRef) ShowClose() *MessageRef
- type MirrorReport
- type MirrorViolation
- type MobileLocale
- type ModalFormW
- func (m *ModalFormW) Columns(n int) *ModalFormW
- func (m *ModalFormW) DestroyOnHidden(on bool) *ModalFormW
- func (m *ModalFormW) Finished() bool
- func (m *ModalFormW) KeepValues() *ModalFormW
- func (m *ModalFormW) OnFinish(fn func(vals ProValues, done func(error))) *ModalFormW
- func (m *ModalFormW) Readonly(on bool) *ModalFormW
- func (m *ModalFormW) Show() *ModalFormW
- func (m *ModalFormW) Values(v *ProValues) *ModalFormW
- func (m *ModalFormW) Width(px float32) *ModalFormW
- type ModalW
- func (m *ModalW) AfterOpenChanged() bool
- func (m *ModalW) Body(fn func()) *ModalW
- func (m *ModalW) CancelText(s string) *ModalW
- func (m *ModalW) Cancelled() bool
- func (m *ModalW) Centered() *ModalW
- func (m *ModalW) Closable(on bool) *ModalW
- func (m *ModalW) ConfirmLoading(on bool) *ModalW
- func (m *ModalW) Danger() *ModalW
- func (m *ModalW) Draggable() *ModalW
- func (m *ModalW) Footer(fn func()) *ModalW
- func (m *ModalW) Fullscreen(on *bool) *ModalW
- func (m *ModalW) FullscreenToggle() *ModalW
- func (m *ModalW) Header(fn func()) *ModalW
- func (m *ModalW) Keyboard(on bool) *ModalW
- func (m *ModalW) Loading(on bool) *ModalW
- func (m *ModalW) Mask(on bool) *ModalW
- func (m *ModalW) MaskBlur(radius float32) *ModalW
- func (m *ModalW) MaskClosable(on bool) *ModalW
- func (m *ModalW) NoFooter() *ModalW
- func (m *ModalW) Ok() bool
- func (m *ModalW) OkText(s string) *ModalW
- func (m *ModalW) Top(px float32) *ModalW
- func (m *ModalW) Width(px float32) *ModalW
- type MultiDatePickerW
- func (w *MultiDatePickerW) A11yLabel(s string) *MultiDatePickerW
- func (w *MultiDatePickerW) AllowClear(on bool) *MultiDatePickerW
- func (w *MultiDatePickerW) Changed() bool
- func (w *MultiDatePickerW) Disabled(on bool) *MultiDatePickerW
- func (w *MultiDatePickerW) DisabledDate(fn func(time.Time) bool) *MultiDatePickerW
- func (w *MultiDatePickerW) Format(f string) *MultiDatePickerW
- func (w *MultiDatePickerW) IsOpen() bool
- func (w *MultiDatePickerW) MaxDate(t time.Time) *MultiDatePickerW
- func (w *MultiDatePickerW) MaxTagCount(n int) *MultiDatePickerW
- func (w *MultiDatePickerW) MinDate(t time.Time) *MultiDatePickerW
- func (w *MultiDatePickerW) NeedConfirm(on bool) *MultiDatePickerW
- func (w *MultiDatePickerW) Open() *MultiDatePickerW
- func (w *MultiDatePickerW) Picker(p PickerType) *MultiDatePickerW
- func (w *MultiDatePickerW) Placeholder(s string) *MultiDatePickerW
- func (w *MultiDatePickerW) Placement(p Placement) *MultiDatePickerW
- func (w *MultiDatePickerW) Size(s ControlSize) *MultiDatePickerW
- func (w *MultiDatePickerW) Status(s string) *MultiDatePickerW
- func (w *MultiDatePickerW) Width(px float32) *MultiDatePickerW
- type MultiSelectW
- func (w *MultiSelectW) A11yLabel(s string) *MultiSelectW
- func (w *MultiSelectW) AllowClear() *MultiSelectW
- func (w *MultiSelectW) AllowCreate() *MultiSelectW
- func (w *MultiSelectW) Changed() bool
- func (w *MultiSelectW) Created() (string, bool)
- func (w *MultiSelectW) DataVersion(v int) *MultiSelectW
- func (w *MultiSelectW) Debounce(d time.Duration) *MultiSelectW
- func (w *MultiSelectW) Disabled(on bool) *MultiSelectW
- func (w *MultiSelectW) FilterMethod(fn func(query string, o Option) bool) *MultiSelectW
- func (w *MultiSelectW) Groups(groups []OptionGroup) *MultiSelectW
- func (w *MultiSelectW) IsOpen() bool
- func (w *MultiSelectW) Layout(o ...layout.Option) *MultiSelectW
- func (w *MultiSelectW) ListHeight(px float32) *MultiSelectW
- func (w *MultiSelectW) Loading(on bool) *MultiSelectW
- func (w *MultiSelectW) MaxCount(n int) *MultiSelectW
- func (w *MultiSelectW) MaxTagCount(n int) *MultiSelectW
- func (w *MultiSelectW) MaxTagPlaceholder(fn func(omitted []string) string) *MultiSelectW
- func (w *MultiSelectW) MaxTagTextLength(n int) *MultiSelectW
- func (w *MultiSelectW) NotFoundContent(s string) *MultiSelectW
- func (w *MultiSelectW) Open() *MultiSelectW
- func (w *MultiSelectW) OpenChanged() bool
- func (w *MultiSelectW) OptionRender(fn func(o Option, s OptionState)) *MultiSelectW
- func (w *MultiSelectW) Placeholder(s string) *MultiSelectW
- func (w *MultiSelectW) Placement(p Placement) *MultiSelectW
- func (w *MultiSelectW) Prefix(ic *icon.Icon) *MultiSelectW
- func (w *MultiSelectW) PrefixText(s string) *MultiSelectW
- func (w *MultiSelectW) Remote(fn func(query string)) *MultiSelectW
- func (w *MultiSelectW) Searchable() *MultiSelectW
- func (w *MultiSelectW) Size(s ControlSize) *MultiSelectW
- func (w *MultiSelectW) Status(s string) *MultiSelectW
- func (w *MultiSelectW) SuffixIcon(ic *icon.Icon) *MultiSelectW
- func (w *MultiSelectW) Variant(v FieldVariant) *MultiSelectW
- func (w *MultiSelectW) Virtual(on bool) *MultiSelectW
- func (w *MultiSelectW) Width(px float32) *MultiSelectW
- type NativeRegion
- type NativeViewW
- type NotificationAction
- type NotificationCenterLocale
- type NotificationCenterW
- func (w *NotificationCenterW) Action() (key, action string, ok bool)
- func (w *NotificationCenterW) Changed() bool
- func (w *NotificationCenterW) Clicked() (string, bool)
- func (w *NotificationCenterW) IsOpen() bool
- func (w *NotificationCenterW) Open(v *bool) *NotificationCenterW
- func (w *NotificationCenterW) Placement(s string) *NotificationCenterW
- func (w *NotificationCenterW) Title(s string) *NotificationCenterW
- func (w *NotificationCenterW) Unread() int
- func (w *NotificationCenterW) Width(px float32) *NotificationCenterW
- type NotificationItem
- type NotificationRef
- func (r *NotificationRef) Actions(fn func()) *NotificationRef
- func (r *NotificationRef) Closable(on bool) *NotificationRef
- func (r *NotificationRef) CloseIcon(ic *icon.Icon) *NotificationRef
- func (r *NotificationRef) Description(s string) *NotificationRef
- func (r *NotificationRef) Duration(d time.Duration) *NotificationRef
- func (r *NotificationRef) Icon(ic *icon.Icon) *NotificationRef
- func (r *NotificationRef) Key(key string) *NotificationRef
- func (r *NotificationRef) NoPause() *NotificationRef
- func (r *NotificationRef) OnClick(fn func()) *NotificationRef
- func (r *NotificationRef) OnClose(fn func()) *NotificationRef
- func (r *NotificationRef) Placement(p NotifyPlacement) *NotificationRef
- func (r *NotificationRef) Role(role string) *NotificationRef
- func (r *NotificationRef) ShowProgress() *NotificationRef
- type NotifyPlacement
- type OTPW
- func (w *OTPW) A11yLabel(s string) *OTPW
- func (w *OTPW) CellID(i int) ID
- func (w *OTPW) Changed() bool
- func (w *OTPW) Completed() bool
- func (w *OTPW) Disabled(on bool) *OTPW
- func (w *OTPW) Focus() *OTPW
- func (w *OTPW) Gap(px float32) *OTPW
- func (w *OTPW) Mask(s string) *OTPW
- func (w *OTPW) Numeric() *OTPW
- func (w *OTPW) ReadOnly() *OTPW
- func (w *OTPW) Separator(s string) *OTPW
- func (w *OTPW) SeparatorFunc(fn func(i int) string) *OTPW
- func (w *OTPW) Size(s ControlSize) *OTPW
- func (w *OTPW) Status(s string) *OTPW
- func (w *OTPW) Variant(v string) *OTPW
- type Option
- type OptionGroup
- type OptionState
- type OverlayOptions
- type PageContainerLocale
- type PageContainerW
- func (p *PageContainerW) Back() *PageContainerW
- func (p *PageContainerW) BackClicked() bool
- func (p *PageContainerW) Body(fn func()) *PageContainerW
- func (p *PageContainerW) Breadcrumb(items ...string) *PageContainerW
- func (p *PageContainerW) Content(fn func()) *PageContainerW
- func (p *PageContainerW) CrumbClicked() int
- func (p *PageContainerW) Extra(fn func()) *PageContainerW
- func (p *PageContainerW) ExtraContent(fn func()) *PageContainerW
- func (p *PageContainerW) Fill() *PageContainerW
- func (p *PageContainerW) Footer(fn func()) *PageContainerW
- func (p *PageContainerW) FooterExtra(fn func()) *PageContainerW
- func (p *PageContainerW) Ghost() *PageContainerW
- func (p *PageContainerW) Layout(o ...layout.Option) *PageContainerW
- func (p *PageContainerW) Loading(on bool) *PageContainerW
- func (p *PageContainerW) NoHeader() *PageContainerW
- func (p *PageContainerW) ScrollID() ID
- func (p *PageContainerW) SubTitle(s string) *PageContainerW
- func (p *PageContainerW) TabChanged() bool
- func (p *PageContainerW) TabExtra(fn func()) *PageContainerW
- func (p *PageContainerW) Tabs(active *string, items []TabItem) *PageContainerW
- func (p *PageContainerW) TabsCard() *PageContainerW
- func (p *PageContainerW) Tags(fn func()) *PageContainerW
- type PageHeaderW
- func (p *PageHeaderW) Avatar(fn func()) *PageHeaderW
- func (p *PageHeaderW) Back() *PageHeaderW
- func (p *PageHeaderW) BackClicked() bool
- func (p *PageHeaderW) BackIcon(ic *icon.Icon) *PageHeaderW
- func (p *PageHeaderW) BackText(s string) *PageHeaderW
- func (p *PageHeaderW) Bordered() *PageHeaderW
- func (p *PageHeaderW) Breadcrumb(items ...string) *PageHeaderW
- func (p *PageHeaderW) BreadcrumbItems(items []BreadcrumbItem) *PageHeaderW
- func (p *PageHeaderW) Content(fn func()) *PageHeaderW
- func (p *PageHeaderW) CrumbClicked() int
- func (p *PageHeaderW) Extra(fn func()) *PageHeaderW
- func (p *PageHeaderW) Footer(fn func()) *PageHeaderW
- func (p *PageHeaderW) Ghost(on bool) *PageHeaderW
- func (p *PageHeaderW) Padding(in geom.Insets) *PageHeaderW
- func (p *PageHeaderW) Show() *PageHeaderW
- func (p *PageHeaderW) SubTitle(s string) *PageHeaderW
- func (p *PageHeaderW) Tags(fn func()) *PageHeaderW
- type PageLoadingW
- type PaginationLocale
- type PaginationPart
- type PaginationW
- func (p *PaginationW) Align(a string) *PaginationW
- func (p *PaginationW) Background(on bool) *PaginationW
- func (p *PaginationW) Changed() bool
- func (p *PaginationW) Disabled(on bool) *PaginationW
- func (p *PaginationW) GoButton(label string) *PaginationW
- func (p *PaginationW) HideOnSinglePage() *PaginationW
- func (p *PaginationW) Layout(parts ...PaginationPart) *PaginationW
- func (p *PaginationW) NextIcon(ic *icon.Icon) *PaginationW
- func (p *PaginationW) NextText(s string) *PaginationW
- func (p *PaginationW) PageSizeOptions(sizes ...int) *PaginationW
- func (p *PaginationW) PagerCount(n int) *PaginationW
- func (p *PaginationW) PrevIcon(ic *icon.Icon) *PaginationW
- func (p *PaginationW) PrevText(s string) *PaginationW
- func (p *PaginationW) ReadOnly() *PaginationW
- func (p *PaginationW) Show() *PaginationW
- func (p *PaginationW) ShowLessItems() *PaginationW
- func (p *PaginationW) ShowQuickJumper() *PaginationW
- func (p *PaginationW) ShowTotal() *PaginationW
- func (p *PaginationW) ShowTotalFunc(fn func(total, from, to int) string) *PaginationW
- func (p *PaginationW) Simple() *PaginationW
- func (p *PaginationW) Size(s ControlSize) *PaginationW
- func (p *PaginationW) SizeChanger(size *int) *PaginationW
- func (p *PaginationW) Small() *PaginationW
- type PaintFunc
- type PanAxis
- type PickerType
- type Placement
- type PopconfirmW
- func (p *PopconfirmW) Arrow(on bool) *PopconfirmW
- func (p *PopconfirmW) CancelText(s string) *PopconfirmW
- func (p *PopconfirmW) CancelType(t string) *PopconfirmW
- func (p *PopconfirmW) Cancelled() bool
- func (p *PopconfirmW) Confirmed() bool
- func (p *PopconfirmW) Description(s string) *PopconfirmW
- func (p *PopconfirmW) Disabled(on bool) *PopconfirmW
- func (p *PopconfirmW) Icon(ic *icon.Icon) *PopconfirmW
- func (p *PopconfirmW) IconColor(col theme.Color) *PopconfirmW
- func (p *PopconfirmW) IsOpen() bool
- func (p *PopconfirmW) OkDanger() *PopconfirmW
- func (p *PopconfirmW) OkText(s string) *PopconfirmW
- func (p *PopconfirmW) OkType(t string) *PopconfirmW
- func (p *PopconfirmW) Placement(s string) *PopconfirmW
- func (p *PopconfirmW) ShowCancel(on bool) *PopconfirmW
- func (p *PopconfirmW) Width(px float32) *PopconfirmW
- type PopoverW
- func (p *PopoverW) Arrow(on bool) *PopoverW
- func (p *PopoverW) Body(fn func()) *Box
- func (p *PopoverW) Content(fn func()) *PopoverW
- func (p *PopoverW) IsOpen() bool
- func (p *PopoverW) MouseEnterDelay(d time.Duration) *PopoverW
- func (p *PopoverW) MouseLeaveDelay(d time.Duration) *PopoverW
- func (p *PopoverW) NoArrow() *PopoverW
- func (p *PopoverW) NoPadding() *PopoverW
- func (p *PopoverW) Open(v *bool) *PopoverW
- func (p *PopoverW) OpenChanged() bool
- func (p *PopoverW) Placement(s string) *PopoverW
- func (p *PopoverW) Text(s string) *PopoverW
- func (p *PopoverW) Title(s string) *PopoverW
- func (p *PopoverW) Trigger(s string) *PopoverW
- func (p *PopoverW) Width(px float32) *PopoverW
- type ProBreadcrumbW
- type ProCardLocale
- type ProCardTab
- type ProCardW
- func (w *ProCardW) Actions(fns ...func()) *ProCardW
- func (w *ProCardW) Body(fn func()) *ProCardW
- func (w *ProCardW) BodyPadding(in geom.Insets) *ProCardW
- func (w *ProCardW) Bordered() *ProCardW
- func (w *ProCardW) Borderless() *ProCardW
- func (w *ProCardW) Box() *Box
- func (w *ProCardW) BoxShadow(on bool) *ProCardW
- func (w *ProCardW) Centered() *ProCardW
- func (w *ProCardW) Clicked() bool
- func (w *ProCardW) ColSpan(span int) *ProCardW
- func (w *ProCardW) ColWidth(px float32) *ProCardW
- func (w *ProCardW) Collapsed(v *bool) *ProCardW
- func (w *ProCardW) Collapsible() *ProCardW
- func (w *ProCardW) DefaultCollapsed() *ProCardW
- func (w *ProCardW) Direction(d string) *ProCardW
- func (w *ProCardW) Extra(fn func()) *ProCardW
- func (w *ProCardW) Ghost() *ProCardW
- func (w *ProCardW) Gutter(px float32) *ProCardW
- func (w *ProCardW) HeaderBordered() *ProCardW
- func (w *ProCardW) Hoverable() *ProCardW
- func (w *ProCardW) ID() ID
- func (w *ProCardW) IsCollapsed() bool
- func (w *ProCardW) Layout(o ...layout.Option) *ProCardW
- func (w *ProCardW) Loading(on bool) *ProCardW
- func (w *ProCardW) Small() *ProCardW
- func (w *ProCardW) Split(dir string) *ProCardW
- func (w *ProCardW) SubTitle(s string) *ProCardW
- func (w *ProCardW) TabChanged() bool
- func (w *ProCardW) TabExtra(fn func()) *ProCardW
- func (w *ProCardW) Tabs(active *string, tabs []ProCardTab) *ProCardW
- func (w *ProCardW) TabsCard() *ProCardW
- func (w *ProCardW) Toggled() bool
- func (w *ProCardW) Tooltip(tip string) *ProCardW
- func (w *ProCardW) Wrap() *ProCardW
- type ProColumn
- type ProDescItem
- type ProDescriptionsLocale
- type ProDescriptionsW
- func (p *ProDescriptionsW) Bordered() *ProDescriptionsW
- func (p *ProDescriptionsW) Column(n int) *ProDescriptionsW
- func (p *ProDescriptionsW) ColumnAt(bp Breakpoint, n int) *ProDescriptionsW
- func (p *ProDescriptionsW) Columns(m map[Breakpoint]int) *ProDescriptionsW
- func (p *ProDescriptionsW) DataSource(v *ProValues) *ProDescriptionsW
- func (p *ProDescriptionsW) Editable(onSave func(key string, v any, all ProValues, done func(error))) *ProDescriptionsW
- func (p *ProDescriptionsW) Editing(key string) bool
- func (p *ProDescriptionsW) Err() error
- func (p *ProDescriptionsW) Extra(fn func()) *ProDescriptionsW
- func (p *ProDescriptionsW) ID() ID
- func (p *ProDescriptionsW) Loading() bool
- func (p *ProDescriptionsW) Reload()
- func (p *ProDescriptionsW) Request(fn func() (map[string]any, error)) *ProDescriptionsW
- func (p *ProDescriptionsW) Saved() string
- func (p *ProDescriptionsW) Show() *ProDescriptionsW
- func (p *ProDescriptionsW) Size(s ControlSize) *ProDescriptionsW
- func (p *ProDescriptionsW) Title(s string) *ProDescriptionsW
- func (p *ProDescriptionsW) Values() ProValues
- func (p *ProDescriptionsW) Vertical() *ProDescriptionsW
- type ProEnum
- type ProField
- type ProFieldCaptcha
- type ProFieldList
- type ProFieldLocale
- type ProFieldMode
- type ProFieldSet
- type ProFieldW
- type ProFormGroupW
- func (g *ProFormGroupW) Body(fn func()) *ProFormGroupW
- func (g *ProFormGroupW) Collapsed(v *bool) *ProFormGroupW
- func (g *ProFormGroupW) Collapsible() *ProFormGroupW
- func (g *ProFormGroupW) Columns(n int) *ProFormGroupW
- func (g *ProFormGroupW) DefaultCollapsed() *ProFormGroupW
- func (g *ProFormGroupW) Description(s string) *ProFormGroupW
- func (g *ProFormGroupW) Extra(fn func()) *ProFormGroupW
- func (g *ProFormGroupW) Gutter(px float32) *ProFormGroupW
- func (g *ProFormGroupW) ID() ID
- func (g *ProFormGroupW) Size(px float32) *ProFormGroupW
- func (g *ProFormGroupW) Toggled() bool
- type ProFormW
- func (p *ProFormW) Children(fn func(f *FormW)) *ProFormW
- func (p *ProFormW) Columns(n int) *ProFormW
- func (p *ProFormW) Err() error
- func (p *ProFormW) Finished() bool
- func (p *ProFormW) Form() *FormW
- func (p *ProFormW) Gutter(px float32) *ProFormW
- func (p *ProFormW) Horizontal() *ProFormW
- func (p *ProFormW) ID() ID
- func (p *ProFormW) LabelWidth(px float32) *ProFormW
- func (p *ProFormW) Loading() bool
- func (p *ProFormW) NoReset() *ProFormW
- func (p *ProFormW) NoSubmitter() *ProFormW
- func (p *ProFormW) OnFinish(fn func(vals ProValues, done func(error))) *ProFormW
- func (p *ProFormW) Readonly(on bool) *ProFormW
- func (p *ProFormW) Request(fn func(done func(ProValues, error))) *ProFormW
- func (p *ProFormW) Reset()
- func (p *ProFormW) ResetText(s string) *ProFormW
- func (p *ProFormW) Show() *ProFormW
- func (p *ProFormW) Submit()
- func (p *ProFormW) SubmitText(s string) *ProFormW
- func (p *ProFormW) Submitter(fn func(s *ProSubmitter)) *ProFormW
- func (p *ProFormW) Submitting() bool
- func (p *ProFormW) Values(v *ProValues) *ProFormW
- type ProLayoutConfig
- type ProListMetas
- type ProListW
- func (p *ProListW[T]) Bordered() *ProListW[T]
- func (p *ProListW[T]) DefaultExpandAllRows(on bool) *ProListW[T]
- func (p *ProListW[T]) EmptyText(s string) *ProListW[T]
- func (p *ProListW[T]) Err() error
- func (p *ProListW[T]) EstimatedItemHeight(px float32) *ProListW[T]
- func (p *ProListW[T]) ExpandRowByClick() *ProListW[T]
- func (p *ProListW[T]) Expandable(fn func(c *Context, row T)) *ProListW[T]
- func (p *ProListW[T]) ExpandedRowKeys(keys *[]string) *ProListW[T]
- func (p *ProListW[T]) Grid(n int) *ProListW[T]
- func (p *ProListW[T]) HeaderTitle(s string) *ProListW[T]
- func (p *ProListW[T]) Height(px float32) *ProListW[T]
- func (p *ProListW[T]) ID() ID
- func (p *ProListW[T]) IsLoading() bool
- func (p *ProListW[T]) ItemLayout(s string) *ProListW[T]
- func (p *ProListW[T]) Loading(on bool) *ProListW[T]
- func (p *ProListW[T]) OnItemClick(fn func(row T)) *ProListW[T]
- func (p *ProListW[T]) Page() int
- func (p *ProListW[T]) Pagination(n int) *ProListW[T]
- func (p *ProListW[T]) Reload()
- func (p *ProListW[T]) Request(fn func(page, size int) ([]T, int, error)) *ProListW[T]
- func (p *ProListW[T]) RowExpandable(fn func(T) bool) *ProListW[T]
- func (p *ProListW[T]) RowKey(f func(T) string) *ProListW[T]
- func (p *ProListW[T]) Selection(keys *[]string) *ProListW[T]
- func (p *ProListW[T]) SelectionChanged() bool
- func (p *ProListW[T]) Show() *ProListW[T]
- func (p *ProListW[T]) Split(on bool) *ProListW[T]
- func (p *ProListW[T]) ToolBar(fn func()) *ProListW[T]
- func (p *ProListW[T]) Total() int
- func (p *ProListW[T]) Virtual() *ProListW[T]
- type ProRequest
- type ProResult
- type ProSettings
- type ProSkeletonW
- func (s *ProSkeletonW) Active(on bool) *ProSkeletonW
- func (s *ProSkeletonW) Layout(o ...layout.Option) *ProSkeletonW
- func (s *ProSkeletonW) List(n int) *ProSkeletonW
- func (s *ProSkeletonW) PageHeader(on bool) *ProSkeletonW
- func (s *ProSkeletonW) Show() *Box
- func (s *ProSkeletonW) Statistic(n int) *ProSkeletonW
- func (s *ProSkeletonW) Toolbar(on bool) *ProSkeletonW
- type ProStatisticW
- func (w *ProStatisticW) Description(fn func()) *ProStatisticW
- func (w *ProStatisticW) Icon(ic *icon.Icon) *ProStatisticW
- func (w *ProStatisticW) Prefix(s string) *ProStatisticW
- func (w *ProStatisticW) Show() *ProStatisticW
- func (w *ProStatisticW) StatisticLayout(s string) *ProStatisticW
- func (w *ProStatisticW) Status(s string) *ProStatisticW
- func (w *ProStatisticW) Suffix(s string) *ProStatisticW
- func (w *ProStatisticW) Tooltip(s string) *ProStatisticW
- func (w *ProStatisticW) Trend(s string) *ProStatisticW
- func (w *ProStatisticW) TrendColors(up, down theme.Color) *ProStatisticW
- func (w *ProStatisticW) Value(v float64, precision int) *ProStatisticW
- func (w *ProStatisticW) ValueColor(col theme.Color) *ProStatisticW
- func (w *ProStatisticW) ValueText(s string) *ProStatisticW
- type ProSubmitter
- type ProTableLocale
- type ProTableW
- func (p *ProTableW[T]) Bordered() *ProTableW[T]
- func (p *ProTableW[T]) ColumnsState(s *TableColumnState) *ProTableW[T]
- func (p *ProTableW[T]) DragSort(fn func(from, to int)) *ProTableW[T]
- func (p *ProTableW[T]) Expandable(fn func(row T)) *ProTableW[T]
- func (p *ProTableW[T]) FullScreen(on bool) *ProTableW[T]
- func (p *ProTableW[T]) Loading() bool
- func (p *ProTableW[T]) MovePageRow(from, to int)
- func (p *ProTableW[T]) NoOptions() *ProTableW[T]
- func (p *ProTableW[T]) NoPagination() *ProTableW[T]
- func (p *ProTableW[T]) NoSearch() *ProTableW[T]
- func (p *ProTableW[T]) NoTableAlert() *ProTableW[T]
- func (p *ProTableW[T]) OnColumnsStateChange(fn func(TableColumnState)) *ProTableW[T]
- func (p *ProTableW[T]) PageSize(n int) *ProTableW[T]
- func (p *ProTableW[T]) Params(v any) *ProTableW[T]
- func (p *ProTableW[T]) PausePolling()
- func (p *ProTableW[T]) PersistColumnsState(key string, store ColumnsStateStore) *ProTableW[T]
- func (p *ProTableW[T]) Polling(d time.Duration) *ProTableW[T]
- func (p *ProTableW[T]) PollingPaused() bool
- func (p *ProTableW[T]) Reload()
- func (p *ProTableW[T]) Request(fn func(req ProRequest, done func(ProResult[T]))) *ProTableW[T]
- func (p *ProTableW[T]) ResumePolling()
- func (p *ProTableW[T]) RowClass(fn func(row T) RowStyle) *ProTableW[T]
- func (p *ProTableW[T]) RowHeight(h float32) *ProTableW[T]
- func (p *ProTableW[T]) RowKey(f func(T) string) *ProTableW[T]
- func (p *ProTableW[T]) Rows() []T
- func (p *ProTableW[T]) ScrollX(w float32) *ProTableW[T]
- func (p *ProTableW[T]) ScrollY(maxH float32) *ProTableW[T]
- func (p *ProTableW[T]) Selection(keys *[]string) *ProTableW[T]
- func (p *ProTableW[T]) Show() *ProTableW[T]
- func (p *ProTableW[T]) Table() *TableW
- func (p *ProTableW[T]) TableAlertOptionRender(fn func(keys []string, clear func())) *ProTableW[T]
- func (p *ProTableW[T]) TableAlertRender(fn func(keys []string, clear func())) *ProTableW[T]
- func (p *ProTableW[T]) Title(s string) *ProTableW[T]
- func (p *ProTableW[T]) ToolBar(fn func()) *ProTableW[T]
- func (p *ProTableW[T]) Toolbar(fn func(*ListToolBarW)) *ProTableW[T]
- func (p *ProTableW[T]) Virtual() *ProTableW[T]
- type ProValues
- func (v ProValues) Bool(k string) bool
- func (v ProValues) Clone() ProValues
- func (v ProValues) DigitRange(k string) [2]float64
- func (v ProValues) Files(k string) []UploadFile
- func (v ProValues) Float(k string) float64
- func (v ProValues) Parts(k string) []any
- func (v ProValues) Range(k string) [2]time.Time
- func (v ProValues) String(k string) string
- func (v ProValues) Strings(k string) []string
- func (v ProValues) Time(k string) time.Time
- type ProgressW
- func (p *ProgressW) A11yLabel(s string) *ProgressW
- func (p *ProgressW) Circle(size float32) *ProgressW
- func (p *ProgressW) Color(col theme.Color) *ProgressW
- func (p *ProgressW) ColorFunc(fn func(percent float64) theme.Color) *ProgressW
- func (p *ProgressW) Dashboard(size float32) *ProgressW
- func (p *ProgressW) Format(f func(percent float64) string) *ProgressW
- func (p *ProgressW) GapDegree(d float64) *ProgressW
- func (p *ProgressW) GapPlacement(s string) *ProgressW
- func (p *ProgressW) Gradient(a, b theme.Color) *ProgressW
- func (p *ProgressW) HideInfo() *ProgressW
- func (p *ProgressW) Indeterminate() *ProgressW
- func (p *ProgressW) Layout(o ...layout.Option) *ProgressW
- func (p *ProgressW) PercentPosition(align, typ string) *ProgressW
- func (p *ProgressW) RailColor(col theme.Color) *ProgressW
- func (p *ProgressW) ShowInfo() *ProgressW
- func (p *ProgressW) Small() *ProgressW
- func (p *ProgressW) Square() *ProgressW
- func (p *ProgressW) Status(s string) *ProgressW
- func (p *ProgressW) Steps(n int) *ProgressW
- func (p *ProgressW) StepsGap(px float32) *ProgressW
- func (p *ProgressW) Striped(flow bool) *ProgressW
- func (p *ProgressW) StrokeWidth(w float32) *ProgressW
- func (p *ProgressW) Success(pct float64) *ProgressW
- func (p *ProgressW) TextInside() *ProgressW
- func (p *ProgressW) TrailColor(col theme.Color) *ProgressWdeprecated
- func (p *ProgressW) Type(t string) *ProgressW
- func (p *ProgressW) Width(px float32) *ProgressW
- type PromptItem
- type PromptsW
- type Props
- type QRCodeLocale
- type QRCodeW
- func (q *QRCodeW) A11yLabel(s string) *QRCodeW
- func (q *QRCodeW) Bg(col theme.Color) *QRCodeW
- func (q *QRCodeW) BoostLevel(on bool) *QRCodeW
- func (q *QRCodeW) Bordered(on bool) *QRCodeW
- func (q *QRCodeW) Color(col theme.Color) *QRCodeW
- func (q *QRCodeW) Icon(img image.Image) *QRCodeW
- func (q *QRCodeW) IconSize(px float32) *QRCodeW
- func (q *QRCodeW) Level(l string) *QRCodeW
- func (q *QRCodeW) MarginSize(n int) *QRCodeW
- func (q *QRCodeW) Matrix() *QRMatrix
- func (q *QRCodeW) Refreshed() bool
- func (q *QRCodeW) Size(px float32) *QRCodeW
- func (q *QRCodeW) Status(s string) *QRCodeW
- type QRLevel
- type QRMatrix
- type QueryFilterW
- func (q *QueryFilterW) DefaultExpanded() *QueryFilterW
- func (q *QueryFilterW) ID() ID
- func (q *QueryFilterW) LabelWidth(px float32) *QueryFilterW
- func (q *QueryFilterW) Loading(on bool) *QueryFilterW
- func (q *QueryFilterW) Params() map[string]string
- func (q *QueryFilterW) ResetClicked() bool
- func (q *QueryFilterW) ResetText(s string) *QueryFilterW
- func (q *QueryFilterW) SearchText(s string) *QueryFilterW
- func (q *QueryFilterW) Searched() bool
- func (q *QueryFilterW) Show() *QueryFilterW
- func (q *QueryFilterW) Values(v *ProValues) *QueryFilterW
- type RadioGroupW
- func (g *RadioGroupW) A11yLabel(s string) *RadioGroupW
- func (g *RadioGroupW) Block() *RadioGroupW
- func (g *RadioGroupW) Border() *RadioGroupW
- func (g *RadioGroupW) Buttons() *RadioGroupW
- func (g *RadioGroupW) Changed() bool
- func (g *RadioGroupW) Disabled(on bool) *RadioGroupW
- func (g *RadioGroupW) Orientation(o string) *RadioGroupW
- func (g *RadioGroupW) Size(s ControlSize) *RadioGroupW
- func (g *RadioGroupW) Solid() *RadioGroupW
- func (g *RadioGroupW) Vertical() *RadioGroupW
- type RadioW
- type RangePickerW
- func (w *RangePickerW) A11yLabel(s string) *RangePickerW
- func (w *RangePickerW) AllowClear(on bool) *RangePickerW
- func (w *RangePickerW) Changed() bool
- func (w *RangePickerW) Disabled(on bool) *RangePickerW
- func (w *RangePickerW) DisabledDate(fn func(time.Time) bool) *RangePickerW
- func (w *RangePickerW) DisabledTime(fn func(day time.Time, end bool) DisabledTimes) *RangePickerW
- func (w *RangePickerW) Format(f string) *RangePickerW
- func (w *RangePickerW) IsOpen() bool
- func (w *RangePickerW) Layout(o ...layout.Option) *RangePickerW
- func (w *RangePickerW) MaxDate(t time.Time) *RangePickerW
- func (w *RangePickerW) MinDate(t time.Time) *RangePickerW
- func (w *RangePickerW) Open() *RangePickerW
- func (w *RangePickerW) Order(on bool) *RangePickerW
- func (w *RangePickerW) Picker(p PickerType) *RangePickerW
- func (w *RangePickerW) Placeholder(start, end string) *RangePickerW
- func (w *RangePickerW) Placement(p Placement) *RangePickerW
- func (w *RangePickerW) Presets(p ...DatePreset) *RangePickerW
- func (w *RangePickerW) Separator(s string) *RangePickerW
- func (w *RangePickerW) ShowTime() *RangePickerW
- func (w *RangePickerW) Size(s ControlSize) *RangePickerW
- func (w *RangePickerW) Status(s string) *RangePickerW
- func (w *RangePickerW) Variant(v string) *RangePickerW
- func (w *RangePickerW) Width(px float32) *RangePickerW
- type RateW
- func (w *RateW) A11yLabel(s string) *RateW
- func (w *RateW) AllowClear(on bool) *RateW
- func (w *RateW) AllowHalf() *RateW
- func (w *RateW) Changed() bool
- func (w *RateW) Character(s string) *RateW
- func (w *RateW) CharacterFunc(fn func(i int) string) *RateW
- func (w *RateW) Color(col theme.Color) *RateW
- func (w *RateW) Colors(cols ...theme.Color) *RateW
- func (w *RateW) Count(n int) *RateW
- func (w *RateW) Disabled(on bool) *RateW
- func (w *RateW) Hovered() float64
- func (w *RateW) Icons(on, void *icon.Icon) *RateW
- func (w *RateW) Keyboard(on bool) *RateW
- func (w *RateW) Large() *RateW
- func (w *RateW) ScoreFormat(fn func(v float64) string) *RateW
- func (w *RateW) ShowScore() *RateW
- func (w *RateW) Size(px float32) *RateW
- func (w *RateW) Small() *RateW
- func (w *RateW) Texts(t ...string) *RateW
- func (w *RateW) Thresholds(low, high float64) *RateW
- func (w *RateW) Tooltips(tips ...string) *RateW
- func (w *RateW) VoidColor(col theme.Color) *RateW
- type ResultW
- type RichTextW
- func (w *RichTextW) Align(a TextAlign) *RichTextW
- func (w *RichTextW) ClickedLink() string
- func (w *RichTextW) Color(col theme.Color) *RichTextW
- func (w *RichTextW) HoveredLink() string
- func (w *RichTextW) ID() ID
- func (w *RichTextW) Layout(opts ...layout.Option) *RichTextW
- func (w *RichTextW) Pre() *RichTextW
- func (w *RichTextW) Selectable() *RichTextW
- func (w *RichTextW) Selection() string
- func (w *RichTextW) Size(px float32) *RichTextW
- type RouteInfo
- type RowEditorTableW
- func (w *RowEditorTableW[T]) AddAtTop() *RowEditorTableW[T]
- func (w *RowEditorTableW[T]) AddRow() string
- func (w *RowEditorTableW[T]) Bordered(on bool) *RowEditorTableW[T]
- func (w *RowEditorTableW[T]) Cancel()
- func (w *RowEditorTableW[T]) Changed() bool
- func (w *RowEditorTableW[T]) Edit(k string)
- func (w *RowEditorTableW[T]) EditingKey() string
- func (w *RowEditorTableW[T]) Errors(k string) map[string]string
- func (w *RowEditorTableW[T]) ID() ID
- func (w *RowEditorTableW[T]) MaxLength(n int) *RowEditorTableW[T]
- func (w *RowEditorTableW[T]) NewRow(fn func() T) *RowEditorTableW[T]
- func (w *RowEditorTableW[T]) OnSave(fn func(row T, index int, done func(error))) *RowEditorTableW[T]
- func (w *RowEditorTableW[T]) Pagination(n int) *RowEditorTableW[T]
- func (w *RowEditorTableW[T]) RowEditable(fn func(row T) bool) *RowEditorTableW[T]
- func (w *RowEditorTableW[T]) RowKey(f func(T) string) *RowEditorTableW[T]
- func (w *RowEditorTableW[T]) Save()
- func (w *RowEditorTableW[T]) Saved() bool
- func (w *RowEditorTableW[T]) ScrollX(px float32) *RowEditorTableW[T]
- func (w *RowEditorTableW[T]) ScrollY(maxH float32) *RowEditorTableW[T]
- func (w *RowEditorTableW[T]) Show() *RowEditorTableW[T]
- func (w *RowEditorTableW[T]) Size(s ControlSize) *RowEditorTableW[T]
- func (w *RowEditorTableW[T]) Table() *TableW
- func (w *RowEditorTableW[T]) Title(s string) *RowEditorTableW[T]
- func (w *RowEditorTableW[T]) ToolBar(fn func()) *RowEditorTableW[T]
- func (w *RowEditorTableW[T]) Validating(k string) bool
- func (w *RowEditorTableW[T]) Virtual() *RowEditorTableW[T]
- type RowStyle
- type Rule
- func AsyncCheck(fn func(v string, done func(msg string))) Rule
- func Check(fn func(v string) string) Rule
- func Email(msg string) Rule
- func Match(other *string, msg string) Rule
- func MaxLen(n int, msg string) Rule
- func MinLen(n int, msg string) Rule
- func Pattern(re string, msg string) Rule
- func Required(msg string) Rule
- type RuleOf
- func CheckValue[T any](fn func(v T) string) RuleOf[T]
- func MaxItems[E any](n int, msg string) RuleOf[[]E]
- func MaxValue[T cmp.Ordered](hi T, msg string) RuleOf[T]
- func MinItems[E any](n int, msg string) RuleOf[[]E]
- func MinValue[T cmp.Ordered](lo T, msg string) RuleOf[T]
- func MustBeTrue(msg string) RuleOf[bool]
- func RangeValue[T cmp.Ordered](lo, hi T, msg string) RuleOf[T]
- func RequiredItems[E any](msg string) RuleOf[[]E]
- func RequiredValue[T comparable](msg string) RuleOf[T]
- type Runner
- func (r *Runner) AccessibilityTree() *a11y.Tree
- func (r *Runner) Animating() bool
- func (r *Runner) Attach(w Window)
- func (r *Runner) BindThread(t *uithread.Thread)
- func (r *Runner) ClearKeyboardInset()
- func (r *Runner) ClearSafeArea()
- func (r *Runner) Close()
- func (r *Runner) Composing() bool
- func (r *Runner) Context() *Context
- func (r *Runner) DragRegions() []geom.Rect
- func (r *Runner) DropFiles(p geom.Point, paths []string)
- func (r *Runner) EnableAccessibility(on bool)
- func (r *Runner) FileDrag() (geom.Point, bool)
- func (r *Runner) FileDragLeave()
- func (r *Runner) FileDragOver(p geom.Point)
- func (r *Runner) Frame() error
- func (r *Runner) FrameMetrics() (size geom.Size, scale float32)
- func (r *Runner) HandleEvent(e input.Event)
- func (r *Runner) Invalidate()
- func (r *Runner) List() *paint.List
- func (r *Runner) NativeRegions() []NativeRegion
- func (r *Runner) NextWake() time.Time
- func (r *Runner) PerformAction(id a11y.NodeID, act a11y.Action, arg string) error
- func (r *Runner) PointerPos() (geom.Point, bool)
- func (r *Runner) Post(fn func())
- func (r *Runner) SetKeyboardInset(in geom.Insets)
- func (r *Runner) SetReduceMotion(on bool)
- func (r *Runner) SetSafeArea(in geom.Insets)
- func (r *Runner) SetTheme(t *theme.Theme)
- func (r *Runner) SetTouchPointerEmulation(on bool)
- func (r *Runner) SetUIScale(scale float32)
- func (r *Runner) TitleBarActed(p geom.Point, act WindowAction)
- func (r *Runner) TrimCaches()
- func (r *Runner) UIScale() float32
- type RunnerOptions
- type SafeAreaWindow
- type SchemaFormW
- func (s *SchemaFormW) Columns(n int) *SchemaFormW
- func (s *SchemaFormW) Finished() bool
- func (s *SchemaFormW) LayoutType(t SchemaLayoutType) *SchemaFormW
- func (s *SchemaFormW) OnFinish(fn func(vals ProValues, done func(error))) *SchemaFormW
- func (s *SchemaFormW) Open(open *bool) *SchemaFormW
- func (s *SchemaFormW) Params() map[string]string
- func (s *SchemaFormW) Readonly(on bool) *SchemaFormW
- func (s *SchemaFormW) Searched() bool
- func (s *SchemaFormW) Show() *SchemaFormW
- func (s *SchemaFormW) Title(t string) *SchemaFormW
- func (s *SchemaFormW) Values(v *ProValues) *SchemaFormW
- func (s *SchemaFormW) Width(px float32) *SchemaFormW
- type SchemaLayoutType
- type ScrollBox
- func (s *ScrollBox) Always() *ScrollBox
- func (s *ScrollBox) Both() *ScrollBox
- func (s *ScrollBox) MaxOffset() (x, y float64)
- func (s *ScrollBox) Offset() (x, y float64)
- func (s *ScrollBox) PaintedOffset() (x, y float64)
- func (s *ScrollBox) Reveal(y, h float64) *ScrollBox
- func (s *ScrollBox) ScrollTo(x, y float64) *ScrollBox
- func (s *ScrollBox) ScrollToSmooth(y float32, dur time.Duration) *ScrollBox
- type SearchW
- func (w *SearchW) A11yLabel(s string) *SearchW
- func (w *SearchW) AllowClear() *SearchW
- func (w *SearchW) Changed() bool
- func (w *SearchW) Disabled(on bool) *SearchW
- func (w *SearchW) EnterButton(s string) *SearchW
- func (w *SearchW) InputID() ID
- func (w *SearchW) Layout(o ...layout.Option) *SearchW
- func (w *SearchW) Loading(on bool) *SearchW
- func (w *SearchW) Placeholder(s string) *SearchW
- func (w *SearchW) Searched() bool
- func (w *SearchW) Size(s ControlSize) *SearchW
- func (w *SearchW) Status(s string) *SearchW
- func (w *SearchW) Variant(v string) *SearchW
- func (w *SearchW) Width(px float32) *SearchW
- type SegmentedShape
- type SegmentedW
- func (w *SegmentedW) A11yLabel(s string) *SegmentedW
- func (w *SegmentedW) Block() *SegmentedW
- func (w *SegmentedW) Changed() bool
- func (w *SegmentedW) Disabled(on bool) *SegmentedW
- func (w *SegmentedW) Icons(ics ...*icon.Icon) *SegmentedW
- func (w *SegmentedW) ItemRender(fn func(o Option, selected bool)) *SegmentedW
- func (w *SegmentedW) Orientation(o string) *SegmentedW
- func (w *SegmentedW) Shape(s SegmentedShape) *SegmentedW
- func (w *SegmentedW) Size(s ControlSize) *SegmentedW
- func (w *SegmentedW) Tooltips(tips ...string) *SegmentedW
- func (w *SegmentedW) Vertical() *SegmentedW
- type SelectW
- func (w *SelectW) A11yLabel(s string) *SelectW
- func (w *SelectW) AllowClear() *SelectW
- func (w *SelectW) AllowCreate() *SelectW
- func (w *SelectW) Changed() bool
- func (w *SelectW) Created() (string, bool)
- func (w *SelectW) DataVersion(v int) *SelectW
- func (w *SelectW) Debounce(d time.Duration) *SelectW
- func (w *SelectW) Disabled(on bool) *SelectW
- func (w *SelectW) FilterMethod(fn func(query string, o Option) bool) *SelectW
- func (w *SelectW) Groups(groups []OptionGroup) *SelectW
- func (w *SelectW) IsOpen() bool
- func (w *SelectW) LabelRender(fn func(o Option) string) *SelectW
- func (w *SelectW) Layout(o ...layout.Option) *SelectW
- func (w *SelectW) ListHeight(px float32) *SelectW
- func (w *SelectW) Loading(on bool) *SelectW
- func (w *SelectW) NotFoundContent(s string) *SelectW
- func (w *SelectW) Open() *SelectW
- func (w *SelectW) OpenChanged() bool
- func (w *SelectW) OptionRender(fn func(o Option, s OptionState)) *SelectW
- func (w *SelectW) Placeholder(s string) *SelectW
- func (w *SelectW) Placement(p Placement) *SelectW
- func (w *SelectW) Prefix(ic *icon.Icon) *SelectW
- func (w *SelectW) PrefixText(s string) *SelectW
- func (w *SelectW) Remote(fn func(query string)) *SelectW
- func (w *SelectW) Searchable() *SelectW
- func (w *SelectW) Size(s ControlSize) *SelectW
- func (w *SelectW) Status(s string) *SelectW
- func (w *SelectW) SuffixIcon(ic *icon.Icon) *SelectW
- func (w *SelectW) Variant(v FieldVariant) *SelectW
- func (w *SelectW) Virtual(on bool) *SelectW
- func (w *SelectW) Width(px float32) *SelectW
- type SenderW
- func (w *SenderW) A11yLabel(s string) *SenderW
- func (w *SenderW) AttachButton() *SenderW
- func (w *SenderW) AttachClicked() bool
- func (w *SenderW) Attachments(files *[]ChatAttachment) *SenderW
- func (w *SenderW) AutoSize(minRows, maxRows int) *SenderW
- func (w *SenderW) Changed() bool
- func (w *SenderW) Commands(opts []Option) *SenderW
- func (w *SenderW) Disabled(on bool) *SenderW
- func (w *SenderW) Header(fn func()) *SenderW
- func (w *SenderW) ID() ID
- func (w *SenderW) Layout(opts ...layout.Option) *SenderW
- func (w *SenderW) Loading(on bool) *SenderW
- func (w *SenderW) MaxLength(n int) *SenderW
- func (w *SenderW) Mentions(opts []Option) *SenderW
- func (w *SenderW) Picked() (prefix string, o Option, ok bool)
- func (w *SenderW) Placeholder(s string) *SenderW
- func (w *SenderW) Removed() (int, bool)
- func (w *SenderW) Stopped() bool
- func (w *SenderW) Submitted() bool
- func (w *SenderW) Suggest(prefix string, src func(query string) []Option) *SenderW
- func (w *SenderW) Toolbar(fn func()) *SenderW
- type SettingDrawerLocale
- type SettingDrawerW
- type ShortcutCaptureWindow
- type SiderBoxW
- type SiderW
- func (s *SiderW) Body(fn func(), opts ...layout.Option) *Box
- func (s *SiderW) Breakpoint(bp Breakpoint) *SiderW
- func (s *SiderW) Broken() bool
- func (s *SiderW) Changed() bool
- func (s *SiderW) CollapsedWidth(px float32) *SiderW
- func (s *SiderW) Light() *SiderW
- func (s *SiderW) NoTrigger() *SiderW
- func (s *SiderW) ReverseArrow() *SiderW
- type SkeletonW
- func (s *SkeletonW) Active() *SkeletonW
- func (s *SkeletonW) Avatar(square bool) *SkeletonW
- func (s *SkeletonW) AvatarSize(px float32) *SkeletonW
- func (s *SkeletonW) Body(fn func()) *Box
- func (s *SkeletonW) Count(n int) *SkeletonW
- func (s *SkeletonW) Loading(on bool) *SkeletonW
- func (s *SkeletonW) NoTitle() *SkeletonW
- func (s *SkeletonW) ParagraphWidth(w ...float32) *SkeletonW
- func (s *SkeletonW) Round() *SkeletonW
- func (s *SkeletonW) Rows(n int) *SkeletonW
- func (s *SkeletonW) Show() *Box
- func (s *SkeletonW) Throttle(leading, trailing time.Duration) *SkeletonW
- func (s *SkeletonW) ThrottleInitial(on bool) *SkeletonW
- func (s *SkeletonW) TitleWidth(w float32) *SkeletonW
- type SliderLocale
- type SliderW
- func (w *SliderW) A11yLabel(s string) *SliderW
- func (w *SliderW) AllowCross(on bool) *SliderW
- func (w *SliderW) ChangeComplete() bool
- func (w *SliderW) Changed() bool
- func (w *SliderW) Disabled(on bool) *SliderW
- func (w *SliderW) Dots() *SliderW
- func (w *SliderW) Included(on bool) *SliderW
- func (w *SliderW) Keyboard(on bool) *SliderW
- func (w *SliderW) Layout(opts ...layout.Option) *SliderW
- func (w *SliderW) Marks(m map[float64]string) *SliderW
- func (w *SliderW) Pushable(gap float64) *SliderW
- func (w *SliderW) Range(hi *float64) *SliderW
- func (w *SliderW) Reverse() *SliderW
- func (w *SliderW) Step(s float64) *SliderW
- func (w *SliderW) Tooltip(format func(float64) string) *SliderW
- func (w *SliderW) TooltipOpen(on bool) *SliderW
- func (w *SliderW) Vertical(height float32) *SliderW
- func (w *SliderW) WithInput() *SliderW
- type SortOrder
- type SortState
- type SpaceW
- func (s *SpaceW) Align(a layout.Align) *SpaceW
- func (s *SpaceW) Body(fn func()) *Box
- func (s *SpaceW) Layout(o ...layout.Option) *SpaceW
- func (s *SpaceW) Orientation(o string) *SpaceW
- func (s *SpaceW) Separator(fn func()) *SpaceW
- func (s *SpaceW) Size(sz ControlSize) *SpaceW
- func (s *SpaceW) SizePx(h, v float32) *SpaceW
- func (s *SpaceW) Split(fn func()) *SpaceWdeprecated
- func (s *SpaceW) Vertical() *SpaceW
- func (s *SpaceW) Wrap() *SpaceW
- type Span
- type SpinW
- func (s *SpinW) Delay(d time.Duration) *SpinW
- func (s *SpinW) Description(t string) *SpinW
- func (s *SpinW) Indicator(ic *icon.Icon) *SpinW
- func (s *SpinW) IndicatorSize(px float32) *SpinW
- func (s *SpinW) Percent(p float64) *SpinW
- func (s *SpinW) PercentAuto() *SpinW
- func (s *SpinW) Size(sz ControlSize) *SpinW
- func (s *SpinW) Spinning(on bool) *SpinW
- func (s *SpinW) Tip(t string) *SpinWdeprecated
- func (s *SpinW) Wrap(fn func()) *Box
- type SplitterPanelW
- func (p *SplitterPanelW) AlwaysShowCollapse(on bool) *SplitterPanelW
- func (p *SplitterPanelW) Body(fn func()) *SplitterPanelW
- func (p *SplitterPanelW) CollapseOffsets(expanded, collapsed float32) *SplitterPanelW
- func (p *SplitterPanelW) CollapseToggle(collapseTip, expandTip string) *SplitterPanelW
- func (p *SplitterPanelW) Collapsed(on bool) *SplitterPanelW
- func (p *SplitterPanelW) Collapsible() *SplitterPanelW
- func (p *SplitterPanelW) DefaultPercent(f float32) *SplitterPanelW
- func (p *SplitterPanelW) DefaultSize(px float32) *SplitterPanelW
- func (p *SplitterPanelW) Max(px float32) *SplitterPanelW
- func (p *SplitterPanelW) MaxPercent(f float32) *SplitterPanelW
- func (p *SplitterPanelW) Min(px float32) *SplitterPanelW
- func (p *SplitterPanelW) MinPercent(f float32) *SplitterPanelW
- func (p *SplitterPanelW) OnCollapse(fn func(bool)) *SplitterPanelW
- func (p *SplitterPanelW) OnResize(fn func(float32)) *SplitterPanelW
- func (p *SplitterPanelW) Resizable(on bool) *SplitterPanelW
- func (p *SplitterPanelW) Size(px float32) *SplitterPanelW
- type SplitterW
- func (s *SplitterW) Body(fn func()) *Box
- func (s *SplitterW) Changed() bool
- func (s *SplitterW) DragEnded() (bar int, ok bool)
- func (s *SplitterW) DragStarted() (bar int, ok bool)
- func (s *SplitterW) Dragging() bool
- func (s *SplitterW) KeyboardMinimumCap(fraction float32) *SplitterW
- func (s *SplitterW) KeyboardStep(step, shiftStep float32) *SplitterW
- func (s *SplitterW) KeyboardStepPixels(step, shiftStep float32) *SplitterW
- func (s *SplitterW) Lazy() *SplitterW
- func (s *SplitterW) Orientation(o string) *SplitterW
- func (s *SplitterW) PixelSizes() []float32
- func (s *SplitterW) Sizes() []float32
- func (s *SplitterW) Style(opts ...layout.Option) *SplitterW
- func (s *SplitterW) Vertical() *SplitterWdeprecated
- func (s *SplitterW) WithHandle() *SplitterW
- type StatisticCardDividerW
- type StatisticCardLocale
- type StatisticCardOperationW
- type StatisticCardW
- func (w *StatisticCardW) Bordered() *StatisticCardW
- func (w *StatisticCardW) Card() *ProCardW
- func (w *StatisticCardW) CardTitle(s string) *StatisticCardW
- func (w *StatisticCardW) Chart(fn func()) *StatisticCardW
- func (w *StatisticCardW) ChartPlace(p string) *StatisticCardW
- func (w *StatisticCardW) Clicked() bool
- func (w *StatisticCardW) ColSpan(span int) *StatisticCardW
- func (w *StatisticCardW) Desc(title, value, trend string) *StatisticCardW
- func (w *StatisticCardW) Description(fn func()) *StatisticCardW
- func (w *StatisticCardW) Extra(fn func()) *StatisticCardW
- func (w *StatisticCardW) Footer(fn func()) *StatisticCardW
- func (w *StatisticCardW) Ghost() *StatisticCardW
- func (w *StatisticCardW) Hoverable() *StatisticCardW
- func (w *StatisticCardW) Icon(ic *icon.Icon) *StatisticCardW
- func (w *StatisticCardW) Layout(o ...layout.Option) *StatisticCardW
- func (w *StatisticCardW) Loading(on bool) *StatisticCardW
- func (w *StatisticCardW) Prefix(s string) *StatisticCardW
- func (w *StatisticCardW) Show() *StatisticCardW
- func (w *StatisticCardW) StatisticLayout(mode string) *StatisticCardW
- func (w *StatisticCardW) Status(s string) *StatisticCardW
- func (w *StatisticCardW) Suffix(s string) *StatisticCardW
- func (w *StatisticCardW) Tooltip(tip string) *StatisticCardW
- func (w *StatisticCardW) Trend(dir string) *StatisticCardW
- func (w *StatisticCardW) TrendColors(up, down theme.Color) *StatisticCardW
- func (w *StatisticCardW) Value(v float64, precision int) *StatisticCardW
- func (w *StatisticCardW) ValueColor(col theme.Color) *StatisticCardW
- func (w *StatisticCardW) ValueText(s string) *StatisticCardW
- type StatisticW
- func (s *StatisticW) Color(col theme.Color) *StatisticW
- func (s *StatisticW) CountUp(v float64, precision int) *StatisticW
- func (s *StatisticW) DecimalSeparator(sep string) *StatisticW
- func (s *StatisticW) Formatter(fn func(v float64) string) *StatisticW
- func (s *StatisticW) GroupSeparator(sep string) *StatisticW
- func (s *StatisticW) Layout(o ...layout.Option) *StatisticW
- func (s *StatisticW) Loading(on bool) *StatisticW
- func (s *StatisticW) Prefix(p string) *StatisticW
- func (s *StatisticW) PrefixIcon(ic *icon.Icon) *StatisticW
- func (s *StatisticW) Suffix(p string) *StatisticW
- func (s *StatisticW) Value(v string) *StatisticW
- func (s *StatisticW) ValueSize(px float32) *StatisticW
- type StatusBarItemW
- func (w *StatusBarItemW) A11yLabel(s string) *StatusBarItemW
- func (w *StatusBarItemW) Badge(n int) *StatusBarItemW
- func (w *StatusBarItemW) BadgeText(s string) *StatusBarItemW
- func (w *StatusBarItemW) Clicked() bool
- func (w *StatusBarItemW) Disabled(on bool) *StatusBarItemW
- func (w *StatusBarItemW) Hovered() bool
- func (w *StatusBarItemW) ID() ID
- func (w *StatusBarItemW) Icon(ic *icon.Icon) *StatusBarItemW
- func (w *StatusBarItemW) Loading(on bool) *StatusBarItemW
- func (w *StatusBarItemW) Progress(p float64) *StatusBarItemW
- func (w *StatusBarItemW) Static() *StatusBarItemW
- func (w *StatusBarItemW) Status(s string) *StatusBarItemW
- func (w *StatusBarItemW) Tooltip(tip string) *StatusBarItemW
- type StatusBarLocale
- type StatusBarW
- type StepDot
- type StepItem
- type StepsFormStep
- type StepsFormW
- func (s *StepsFormW) Current() int
- func (s *StepsFormW) Finished() bool
- func (s *StepsFormW) OnFinish(fn func(vals ProValues, done func(error))) *StepsFormW
- func (s *StepsFormW) SetCurrent(i int) *StepsFormW
- func (s *StepsFormW) Show() *StepsFormW
- func (s *StepsFormW) Values(v *ProValues) *StepsFormW
- func (s *StepsFormW) Width(px float32) *StepsFormW
- type StepsW
- func (s *StepsW) Changed() bool
- func (s *StepsW) Clickable(cur *int) *StepsW
- func (s *StepsW) Current(i int) *StepsW
- func (s *StepsW) Dot() *StepsWdeprecated
- func (s *StepsW) DotRender(fn func(l *paint.List, d StepDot)) *StepsW
- func (s *StepsW) FinishStatus(st string) *StepsW
- func (s *StepsW) Initial(n int) *StepsW
- func (s *StepsW) Inline() *StepsW
- func (s *StepsW) LabelVertical() *StepsWdeprecated
- func (s *StepsW) MaxCount(n int) *StepsW
- func (s *StepsW) Orientation(o string) *StepsW
- func (s *StepsW) Panel() *StepsW
- func (s *StepsW) Percent(p float64) *StepsW
- func (s *StepsW) Show() *StepsW
- func (s *StepsW) Size(sz ControlSize) *StepsW
- func (s *StepsW) Small() *StepsW
- func (s *StepsW) Status(st string) *StepsW
- func (s *StepsW) TitlePlacement(p string) *StepsW
- func (s *StepsW) Type(t string) *StepsW
- func (s *StepsW) Variant(v string) *StepsW
- func (s *StepsW) Vertical() *StepsWdeprecated
- type SwitchW
- func (w *SwitchW) A11yLabel(s string) *SwitchW
- func (w *SwitchW) ActionIcons(on, off *icon.Icon) *SwitchW
- func (w *SwitchW) BeforeChange(fn func(next bool) bool) *SwitchW
- func (w *SwitchW) BeforeChangeAsync(fn func(next bool, done func(ok bool))) *SwitchW
- func (w *SwitchW) Changed() bool
- func (w *SwitchW) Disabled(on bool) *SwitchW
- func (w *SwitchW) Icons(on, off *icon.Icon) *SwitchW
- func (w *SwitchW) Large() *SwitchW
- func (w *SwitchW) Loading(on bool) *SwitchW
- func (w *SwitchW) OuterTexts(on, off string) *SwitchW
- func (w *SwitchW) Size(s ControlSize) *SwitchW
- func (w *SwitchW) Small() *SwitchW
- func (w *SwitchW) Texts(on, off string) *SwitchW
- func (w *SwitchW) Width(px float32) *SwitchW
- type TabItem
- type TableColumn
- type TableColumnState
- type TableDropdownW
- func (w *TableDropdownW) Button(label string) *TableDropdownW
- func (w *TableDropdownW) Clicked() string
- func (w *TableDropdownW) Disabled(on bool) *TableDropdownW
- func (w *TableDropdownW) ID() ID
- func (w *TableDropdownW) IsOpen() bool
- func (w *TableDropdownW) Label(s string) *TableDropdownW
- func (w *TableDropdownW) OnSelect(fn func(string)) *TableDropdownW
- func (w *TableDropdownW) Open(on *bool) *TableDropdownW
- func (w *TableDropdownW) Show() *TableDropdownW
- func (w *TableDropdownW) Trigger(t Trigger) *TableDropdownW
- type TableEditor
- type TableFilterPanel
- type TableLocale
- type TableSelection
- type TableSpan
- type TableW
- func (t *TableW) A11yLabel(s string) *TableW
- func (t *TableW) Bordered() *TableW
- func (t *TableW) Cancel(row int)
- func (t *TableW) CheckLinked() *TableW
- func (t *TableW) CheckStrictly() *TableW
- func (t *TableW) ColumnState(s *TableColumnState) *TableW
- func (t *TableW) CurrentChanged() bool
- func (t *TableW) CurrentRowKey(key *string) *TableW
- func (t *TableW) DefaultExpandAllRows() *TableW
- func (t *TableW) DisplayedRows() []int
- func (t *TableW) DragSort(fn func(from, to int)) *TableW
- func (t *TableW) Edit(row int)
- func (t *TableW) EditableRows(keys *[]string) *TableW
- func (t *TableW) Edited() bool
- func (t *TableW) EmptyText(s string) *TableW
- func (t *TableW) ExpandChanged() bool
- func (t *TableW) ExpandRowByClick() *TableW
- func (t *TableW) Expandable(render func(row int)) *TableW
- func (t *TableW) ExpandedKeys(keys *[]string) *TableW
- func (t *TableW) FilterChanged() bool
- func (t *TableW) Filters(f *map[string][]string) *TableW
- func (t *TableW) Footer(fn func()) *TableW
- func (t *TableW) HeaderHeight(px float32) *TableW
- func (t *TableW) HideExpandColumn() *TableW
- func (t *TableW) HideHeader() *TableW
- func (t *TableW) HideSelectAll() *TableW
- func (t *TableW) HighlightCurrentRow() *TableW
- func (t *TableW) ID() ID
- func (t *TableW) Indent(px float32) *TableW
- func (t *TableW) IsEditing(row int) bool
- func (t *TableW) Loading(on bool) *TableW
- func (t *TableW) Moved() bool
- func (t *TableW) MultiSort(s *[]SortState) *TableW
- func (t *TableW) NoHover() *TableW
- func (t *TableW) PageChanged() bool
- func (t *TableW) PageSizes(sizes ...int) *TableW
- func (t *TableW) Pagination(page, pageSize *int) *TableW
- func (t *TableW) PaginationConfig(fn func(p *PaginationW)) *TableW
- func (t *TableW) PaginationPlacement(p ...string) *TableW
- func (t *TableW) PreserveSelectedRowKeys() *TableW
- func (t *TableW) Resizable() *TableW
- func (t *TableW) Resized() bool
- func (t *TableW) Revision(v uint64) *TableW
- func (t *TableW) RowClass(fn func(i int) RowStyle) *TableW
- func (t *TableW) RowClicked() int
- func (t *TableW) RowDoubleClicked() int
- func (t *TableW) RowExpandable(f func(row int) bool) *TableW
- func (t *TableW) RowHeight(h float32) *TableW
- func (t *TableW) RowKey(f func(int) string) *TableW
- func (t *TableW) Save(row int) bool
- func (t *TableW) ScrollToFirstRowOnChange(on bool) *TableW
- func (t *TableW) ScrollX(totalW float32) *TableW
- func (t *TableW) ScrollY(maxH float32) *TableW
- func (t *TableW) SelectDisabled(f func(row int) bool) *TableW
- func (t *TableW) SelectedKeys(keys *[]string) *TableW
- func (t *TableW) Selection(sel *[]int) *TableW
- func (t *TableW) SelectionChanged() bool
- func (t *TableW) SelectionColumnWidth(px float32) *TableW
- func (t *TableW) SelectionFixed() *TableW
- func (t *TableW) Selections(items ...TableSelection) *TableW
- func (t *TableW) ServerPagination(page, pageSize *int, total int) *TableW
- func (t *TableW) Show() *TableW
- func (t *TableW) ShowOverflowTooltip() *TableW
- func (t *TableW) ShowSorterTooltip(on bool) *TableW
- func (t *TableW) ShowSummary() *TableW
- func (t *TableW) SingleSelect() *TableW
- func (t *TableW) Size(s ControlSize) *TableW
- func (t *TableW) Sort(s *SortState) *TableW
- func (t *TableW) SortChanged() bool
- func (t *TableW) SortDirections(dirs ...SortOrder) *TableW
- func (t *TableW) Span(f func(s TableSpan) (rowSpan, colSpan int)) *TableW
- func (t *TableW) Sticky(offsetTop float32) *TableW
- func (t *TableW) StickyContainer(id ID) *TableW
- func (t *TableW) StickySummary(offsetBottom float32) *TableW
- func (t *TableW) Striped() *TableW
- func (t *TableW) Summary(fn func(col string, rows []int) string) *TableW
- func (t *TableW) SummaryFixed() *TableW
- func (t *TableW) Title(fn func()) *TableW
- func (t *TableW) Transposed() *TableW
- func (t *TableW) TransposedColumnWidth(px float32) *TableW
- func (t *TableW) TransposedHeader(title func(row int) string) *TableW
- func (t *TableW) TransposedHeaderFixed(on bool) *TableW
- func (t *TableW) TransposedHeaderWidth(px float32) *TableW
- func (t *TableW) Tree(roots []int, children func(row int) []int) *TableW
- func (t *TableW) TreeLazy(has func(row int) bool, load func(row int)) *TableW
- func (t *TableW) TreeOpenKeys(keys *[]string) *TableW
- func (t *TableW) Virtual() *TableW
- type TabsLocale
- type TabsW
- func (t *TabsW) ActiveTabFontWeight(weight int) *TabsW
- func (t *TabsW) AddIcon(ic *icon.Icon) *TabsW
- func (t *TabsW) Added() bool
- func (t *TabsW) BeforeLeave(fn func(newKey, oldKey string) bool) *TabsW
- func (t *TabsW) BorderCard() *TabsW
- func (t *TabsW) Card() *TabsW
- func (t *TabsW) Centered() *TabsW
- func (t *TabsW) Changed() bool
- func (t *TabsW) Closable() *TabsW
- func (t *TabsW) Closed() string
- func (t *TabsW) Draggable() *TabsW
- func (t *TabsW) Extra(fn func()) *TabsW
- func (t *TabsW) ExtraLeft(fn func()) *TabsW
- func (t *TabsW) Height(px float32) *TabsW
- func (t *TabsW) Indicator(size float32, align string) *TabsW
- func (t *TabsW) IndicatorThickness(px float32) *TabsW
- func (t *TabsW) MoreIcon(ic *icon.Icon) *TabsW
- func (t *TabsW) NoMargin() *TabsW
- func (t *TabsW) OnAdd(fn func()) *TabsW
- func (t *TabsW) OnTearOff(fn func(key string, pos geom.Point)) *TabsW
- func (t *TabsW) Panel(fn func()) *Box
- func (t *TabsW) Placement(p Placement) *TabsW
- func (t *TabsW) RemoveIcon(ic *icon.Icon) *TabsW
- func (t *TabsW) Reordered() []TabItem
- func (t *TabsW) Show() *TabsW
- func (t *TabsW) Size(s ControlSize) *TabsW
- func (t *TabsW) Stretch() *TabsW
- func (t *TabsW) TabBarGutter(px float32) *TabsW
- func (t *TabsW) TabBarStyle(opts ...layout.Option) *TabsW
- func (t *TabsW) TabClicked() string
- func (t *TabsW) TabItemHeight(px float32) *TabsW
- func (t *TabsW) TabPlacement(p string) *TabsW
- func (t *TabsW) TornOff() (key string, pos geom.Point, ok bool)
- func (t *TabsW) Variant(v string) *TabsW
- type TagW
- func (t *TagW) Borderless() *TagWdeprecated
- func (t *TagW) Closable() *TagW
- func (t *TagW) CloseIcon(ic *icon.Icon) *TagW
- func (t *TagW) Closed() bool
- func (t *TagW) Color(col string) *TagW
- func (t *TagW) Disabled(on bool) *TagW
- func (t *TagW) Effect(e string) *TagW
- func (t *TagW) Icon(ic *icon.Icon) *TagW
- func (t *TagW) Round() *TagW
- func (t *TagW) Size(sz ControlSize) *TagW
- func (t *TagW) Variant(v string) *TagW
- type TextAlign
- type TextAreaW
- func (w *TextAreaW) A11yLabel(s string) *TextAreaW
- func (w *TextAreaW) AllowClear() *TextAreaW
- func (w *TextAreaW) AutoSize(minRows, maxRows int) *TextAreaW
- func (w *TextAreaW) Changed() bool
- func (w *TextAreaW) Disabled(on bool) *TextAreaW
- func (w *TextAreaW) Exceed() *TextAreaW
- func (w *TextAreaW) Focused() bool
- func (w *TextAreaW) ID() ID
- func (w *TextAreaW) Layout(o ...layout.Option) *TextAreaW
- func (w *TextAreaW) MaxLength(n int) *TextAreaW
- func (w *TextAreaW) Placeholder(s string) *TextAreaW
- func (w *TextAreaW) ReadOnly() *TextAreaW
- func (w *TextAreaW) Rows(n int) *TextAreaW
- func (w *TextAreaW) ShowCount() *TextAreaW
- func (w *TextAreaW) Status(s string) *TextAreaW
- func (w *TextAreaW) Variant(v string) *TextAreaW
- func (w *TextAreaW) Width(px float32) *TextAreaW
- type TextInputStateWindow
- type ThoughtChainW
- func (w *ThoughtChainW) Card() *ThoughtChainW
- func (w *ThoughtChainW) DefaultCollapsed() *ThoughtChainW
- func (w *ThoughtChainW) Expanded() bool
- func (w *ThoughtChainW) ItemToggled() (string, bool)
- func (w *ThoughtChainW) Layout(opts ...layout.Option) *ThoughtChainW
- func (w *ThoughtChainW) Title(s string) *ThoughtChainW
- func (w *ThoughtChainW) Toggled() bool
- type TimePanelW
- func (w *TimePanelW) A11yLabel(s string) *TimePanelW
- func (w *TimePanelW) Changed() bool
- func (w *TimePanelW) DisabledHours(fn func(h int) bool) *TimePanelW
- func (w *TimePanelW) DisabledMinutes(fn func(h, m int) bool) *TimePanelW
- func (w *TimePanelW) DisabledSeconds(fn func(h, m, s int) bool) *TimePanelW
- func (w *TimePanelW) Format(f string) *TimePanelW
- func (w *TimePanelW) Height(px float32) *TimePanelW
- func (w *TimePanelW) HideDisabledOptions(on bool) *TimePanelW
- func (w *TimePanelW) Steps(h, m, s int) *TimePanelW
- func (w *TimePanelW) Use12Hours() *TimePanelW
- type TimePickerLocale
- type TimePickerW
- func (w *TimePickerW) A11yLabel(s string) *TimePickerW
- func (w *TimePickerW) AllowClear(on bool) *TimePickerW
- func (w *TimePickerW) Changed() bool
- func (w *TimePickerW) Disabled(on bool) *TimePickerW
- func (w *TimePickerW) DisabledHours(fn func(h int) bool) *TimePickerW
- func (w *TimePickerW) DisabledMinutes(fn func(h, m int) bool) *TimePickerW
- func (w *TimePickerW) DisabledSeconds(fn func(h, m, s int) bool) *TimePickerW
- func (w *TimePickerW) Format(f string) *TimePickerW
- func (w *TimePickerW) HideDisabledOptions(on bool) *TimePickerW
- func (w *TimePickerW) HourStep(n int) *TimePickerW
- func (w *TimePickerW) IsOpen() bool
- func (w *TimePickerW) Layout(o ...layout.Option) *TimePickerW
- func (w *TimePickerW) MinuteStep(n int) *TimePickerW
- func (w *TimePickerW) NeedConfirm(on bool) *TimePickerW
- func (w *TimePickerW) Open() *TimePickerW
- func (w *TimePickerW) Placeholder(s string) *TimePickerW
- func (w *TimePickerW) Placement(p Placement) *TimePickerW
- func (w *TimePickerW) SecondStep(n int) *TimePickerW
- func (w *TimePickerW) ShowNow(on bool) *TimePickerW
- func (w *TimePickerW) Size(s ControlSize) *TimePickerW
- func (w *TimePickerW) Status(s string) *TimePickerW
- func (w *TimePickerW) Steps(h, m, s int) *TimePickerW
- func (w *TimePickerW) Use12Hours() *TimePickerW
- func (w *TimePickerW) Variant(v string) *TimePickerW
- func (w *TimePickerW) Width(px float32) *TimePickerW
- type TimeRangePickerW
- func (w *TimeRangePickerW) A11yLabel(s string) *TimeRangePickerW
- func (w *TimeRangePickerW) AllowClear(on bool) *TimeRangePickerW
- func (w *TimeRangePickerW) Changed() bool
- func (w *TimeRangePickerW) Disabled(on bool) *TimeRangePickerW
- func (w *TimeRangePickerW) DisabledHours(fn func(h int) bool) *TimeRangePickerW
- func (w *TimeRangePickerW) DisabledMinutes(fn func(h, m int) bool) *TimeRangePickerW
- func (w *TimeRangePickerW) DisabledSeconds(fn func(h, m, s int) bool) *TimeRangePickerW
- func (w *TimeRangePickerW) Format(f string) *TimeRangePickerW
- func (w *TimeRangePickerW) HideDisabledOptions(on bool) *TimeRangePickerW
- func (w *TimeRangePickerW) HourStep(n int) *TimeRangePickerW
- func (w *TimeRangePickerW) IsOpen() bool
- func (w *TimeRangePickerW) Layout(o ...layout.Option) *TimeRangePickerW
- func (w *TimeRangePickerW) MinuteStep(n int) *TimeRangePickerW
- func (w *TimeRangePickerW) Open() *TimeRangePickerW
- func (w *TimeRangePickerW) Order(on bool) *TimeRangePickerW
- func (w *TimeRangePickerW) Placeholder(start, end string) *TimeRangePickerW
- func (w *TimeRangePickerW) Placement(p Placement) *TimeRangePickerW
- func (w *TimeRangePickerW) SecondStep(n int) *TimeRangePickerW
- func (w *TimeRangePickerW) Separator(s string) *TimeRangePickerW
- func (w *TimeRangePickerW) Size(s ControlSize) *TimeRangePickerW
- func (w *TimeRangePickerW) Status(s string) *TimeRangePickerW
- func (w *TimeRangePickerW) Use12Hours() *TimeRangePickerW
- func (w *TimeRangePickerW) Variant(v string) *TimeRangePickerW
- func (w *TimeRangePickerW) Width(px float32) *TimeRangePickerW
- type TimeSelectW
- func (w *TimeSelectW) A11yLabel(s string) *TimeSelectW
- func (w *TimeSelectW) Changed() bool
- func (w *TimeSelectW) Clearable(on bool) *TimeSelectW
- func (w *TimeSelectW) Disabled(on bool) *TimeSelectW
- func (w *TimeSelectW) End(s string) *TimeSelectW
- func (w *TimeSelectW) IncludeEndTime(on bool) *TimeSelectW
- func (w *TimeSelectW) IsOpen() bool
- func (w *TimeSelectW) Layout(o ...layout.Option) *TimeSelectW
- func (w *TimeSelectW) MaxTime(s string) *TimeSelectW
- func (w *TimeSelectW) MinTime(s string) *TimeSelectW
- func (w *TimeSelectW) Open() *TimeSelectW
- func (w *TimeSelectW) Options() []Option
- func (w *TimeSelectW) Placeholder(s string) *TimeSelectW
- func (w *TimeSelectW) Placement(p Placement) *TimeSelectW
- func (w *TimeSelectW) Size(s ControlSize) *TimeSelectW
- func (w *TimeSelectW) Start(s string) *TimeSelectW
- func (w *TimeSelectW) Status(s string) *TimeSelectW
- func (w *TimeSelectW) Step(s string) *TimeSelectW
- func (w *TimeSelectW) Variant(v string) *TimeSelectW
- func (w *TimeSelectW) Width(px float32) *TimeSelectW
- type TimelineItem
- type TimelineW
- func (w *TimelineW) Horizontal() *TimelineW
- func (w *TimelineW) Layout(o ...layout.Option) *TimelineW
- func (w *TimelineW) Mode(m string) *TimelineW
- func (w *TimelineW) Orientation(o string) *TimelineW
- func (w *TimelineW) Pending(label string) *TimelineW
- func (w *TimelineW) Reverse() *TimelineW
- func (w *TimelineW) Show() *TimelineW
- func (w *TimelineW) TitleSpan(span float32) *TimelineW
- func (w *TimelineW) Variant(v string) *TimelineW
- type TimerType
- type TitleBarLocale
- type TitleBarW
- func (t *TitleBarW) Action() WindowAction
- func (t *TitleBarW) Center(fn func()) *TitleBarW
- func (t *TitleBarW) Controls(s WindowControlsStyle) *TitleBarW
- func (t *TitleBarW) Frame(f WindowFrame) *TitleBarW
- func (t *TitleBarW) ID() ID
- func (t *TitleBarW) Icon(ic *icon.Icon) *TitleBarW
- func (t *TitleBarW) Layout(o ...layout.Option) *TitleBarW
- func (t *TitleBarW) Manual() *TitleBarW
- func (t *TitleBarW) Menu(fn func()) *TitleBarW
- func (t *TitleBarW) Title(s string) *TitleBarW
- func (t *TitleBarW) Tools(fn func()) *TitleBarW
- type ToggleGroupW
- func (g *ToggleGroupW) A11yLabel(s string) *ToggleGroupW
- func (g *ToggleGroupW) Changed() bool
- func (g *ToggleGroupW) Icons(m map[string]*icon.Icon) *ToggleGroupW
- func (g *ToggleGroupW) Outline() *ToggleGroupW
- func (g *ToggleGroupW) Single() *ToggleGroupW
- func (g *ToggleGroupW) Size(s ControlSize) *ToggleGroupW
- func (g *ToggleGroupW) Spacing(n int) *ToggleGroupW
- func (g *ToggleGroupW) Variant(v string) *ToggleGroupW
- type ToggleW
- func (w *ToggleW) A11yLabel(s string) *ToggleW
- func (w *ToggleW) Changed() bool
- func (w *ToggleW) Disabled(on bool) *ToggleW
- func (w *ToggleW) ID() ID
- func (w *ToggleW) Icon(ic *icon.Icon) *ToggleW
- func (w *ToggleW) IconOnly(ic *icon.Icon) *ToggleW
- func (w *ToggleW) Outline() *ToggleW
- func (w *ToggleW) Size(s ControlSize) *ToggleW
- func (w *ToggleW) Variant(v string) *ToggleW
- type ToolCallW
- func (w *ToolCallW) Args(s string) *ToolCallW
- func (w *ToolCallW) Body(fn func()) *ToolCallW
- func (w *ToolCallW) DefaultOpen() *ToolCallW
- func (w *ToolCallW) Duration(d time.Duration) *ToolCallW
- func (w *ToolCallW) Icon(ic *icon.Icon) *ToolCallW
- func (w *ToolCallW) Lang(args, result string) *ToolCallW
- func (w *ToolCallW) Layout(opts ...layout.Option) *ToolCallW
- func (w *ToolCallW) Open() bool
- func (w *ToolCallW) Result(s string) *ToolCallW
- func (w *ToolCallW) Started(t time.Time) *ToolCallW
- func (w *ToolCallW) Status(s ChainStatus) *ToolCallW
- func (w *ToolCallW) Summary(s string) *ToolCallW
- func (w *ToolCallW) Toggled() bool
- type TooltipW
- func (t *TooltipW) Arrow(on bool) *TooltipW
- func (t *TooltipW) Color(s string) *TooltipW
- func (t *TooltipW) Content(fn func()) *TooltipW
- func (t *TooltipW) Disabled(on bool) *TooltipW
- func (t *TooltipW) Effect(s string) *TooltipW
- func (t *TooltipW) IsOpen() bool
- func (t *TooltipW) MouseEnterDelay(d time.Duration) *TooltipW
- func (t *TooltipW) MouseLeaveDelay(d time.Duration) *TooltipW
- func (t *TooltipW) Open(v *bool) *TooltipW
- func (t *TooltipW) OpenChanged() bool
- func (t *TooltipW) Placement(s string) *TooltipW
- func (t *TooltipW) Trigger(s string) *TooltipW
- type TopNavHeaderW
- func (w *TopNavHeaderW) Actions(fn func()) *TopNavHeaderW
- func (w *TopNavHeaderW) ContentWidth(s string) *TopNavHeaderW
- func (w *TopNavHeaderW) Logo(ic *icon.Icon) *TopNavHeaderW
- func (w *TopNavHeaderW) OnMenuHeaderClick(fn func()) *TopNavHeaderW
- func (w *TopNavHeaderW) Show() *TopNavHeaderW
- func (w *TopNavHeaderW) Title(s string) *TopNavHeaderW
- func (w *TopNavHeaderW) UserName(s string) *TopNavHeaderW
- type TourActions
- type TourLocale
- type TourMask
- type TourStep
- type TourType
- type TourW
- func (t *TourW) ActionsRender(fn func(a *TourActions)) *TourW
- func (t *TourW) Changed() bool
- func (t *TourW) Closable(on bool) *TourW
- func (t *TourW) Closed() bool
- func (t *TourW) DisabledInteraction(on bool) *TourW
- func (t *TourW) Finished() bool
- func (t *TourW) Gap(px float32) *TourW
- func (t *TourW) GapRadius(px float32) *TourW
- func (t *TourW) IndicatorsRender(fn func(current, total int)) *TourW
- func (t *TourW) Keyboard(on bool) *TourW
- func (t *TourW) MaskColor(col theme.Color) *TourW
- func (t *TourW) NoArrow() *TourW
- func (t *TourW) NoMask() *TourW
- func (t *TourW) Placement(s string) *TourW
- func (t *TourW) Primary() *TourW
- func (t *TourW) ScrollIntoView(on bool) *TourW
- func (t *TourW) Show() *TourW
- type TransferItem
- type TransferLocale
- type TransferW
- func (w *TransferW) Actions(toRight, toLeft string) *TransferW
- func (w *TransferW) Changed() bool
- func (w *TransferW) Checked(side int) []string
- func (w *TransferW) DefaultChecked(keys ...string) *TransferW
- func (w *TransferW) Disabled(on bool) *TransferW
- func (w *TransferW) ListSize(wd, ht float32) *TransferW
- func (w *TransferW) OneWay() *TransferW
- func (w *TransferW) Operations(toRight, toLeft string) *TransferWdeprecated
- func (w *TransferW) Pagination(pageSize int) *TransferW
- func (w *TransferW) Render(fn func(o Option)) *TransferW
- func (w *TransferW) Searchable() *TransferW
- func (w *TransferW) ShowSelectAll(on bool) *TransferW
- func (w *TransferW) Status(s string) *TransferW
- func (w *TransferW) TargetOrder(s string) *TransferW
- func (w *TransferW) Titles(left, right string) *TransferW
- func (w *TransferW) TreeSource(nodes []TreeNode) *TransferW
- func (w *TransferW) Virtual(on bool) *TransferW
- type TreeNode
- type TreeSelectNode
- type TreeSelectW
- func (w *TreeSelectW) A11yLabel(s string) *TreeSelectW
- func (w *TreeSelectW) AllowClear() *TreeSelectW
- func (w *TreeSelectW) Changed() bool
- func (w *TreeSelectW) CheckStrictly() *TreeSelectW
- func (w *TreeSelectW) Checkable() *TreeSelectW
- func (w *TreeSelectW) Checked() []string
- func (w *TreeSelectW) DefaultExpandAll() *TreeSelectW
- func (w *TreeSelectW) Disabled(on bool) *TreeSelectW
- func (w *TreeSelectW) ExpandChanged() bool
- func (w *TreeSelectW) ExpandedKeys(keys *[]string) *TreeSelectW
- func (w *TreeSelectW) FilterTreeNode(fn func(query string, node TreeSelectNode) bool) *TreeSelectW
- func (w *TreeSelectW) IsOpen() bool
- func (w *TreeSelectW) Layout(o ...layout.Option) *TreeSelectW
- func (w *TreeSelectW) ListHeight(px float32) *TreeSelectW
- func (w *TreeSelectW) LoadData(fn func(value string) bool) *TreeSelectW
- func (w *TreeSelectW) MaxTagCount(n int) *TreeSelectW
- func (w *TreeSelectW) MaxTagPlaceholder(fn func(omitted []string) string) *TreeSelectW
- func (w *TreeSelectW) Multiple(vals *[]string) *TreeSelectW
- func (w *TreeSelectW) NotFoundContent(s string) *TreeSelectW
- func (w *TreeSelectW) Open() *TreeSelectW
- func (w *TreeSelectW) Placeholder(s string) *TreeSelectW
- func (w *TreeSelectW) Placement(p Placement) *TreeSelectW
- func (w *TreeSelectW) Searchable() *TreeSelectW
- func (w *TreeSelectW) ShowCheckedStrategy(s CheckedStrategy) *TreeSelectW
- func (w *TreeSelectW) Size(s ControlSize) *TreeSelectW
- func (w *TreeSelectW) Status(s string) *TreeSelectW
- func (w *TreeSelectW) StrategyValue(on bool) *TreeSelectW
- func (w *TreeSelectW) Variant(v FieldVariant) *TreeSelectW
- func (w *TreeSelectW) Virtual(on bool) *TreeSelectW
- func (w *TreeSelectW) Width(px float32) *TreeSelectW
- type TreeW
- func (w *TreeW) A11yLabel(s string) *TreeW
- func (w *TreeW) Accordion() *TreeW
- func (w *TreeW) AllowDrag(fn func(key string) bool) *TreeW
- func (w *TreeW) AllowDrop(fn func(drag, drop string, pos int) bool) *TreeW
- func (w *TreeW) BlockNode() *TreeW
- func (w *TreeW) Built() int
- func (w *TreeW) CheckChanged() bool
- func (w *TreeW) CheckOnClick(on bool) *TreeW
- func (w *TreeW) CheckOnClickLeaf(on bool) *TreeW
- func (w *TreeW) CheckStrictly() *TreeW
- func (w *TreeW) Checkable(checked *[]string) *TreeW
- func (w *TreeW) DataVersion(v int) *TreeW
- func (w *TreeW) DefaultExpandAll() *TreeW
- func (w *TreeW) Disabled(on bool) *TreeW
- func (w *TreeW) Draggable() *TreeW
- func (w *TreeW) Dropped() (drag, drop string, pos int, ok bool)
- func (w *TreeW) EmptyText(s string) *TreeW
- func (w *TreeW) ExpandChanged() bool
- func (w *TreeW) ExpandOnClick(on bool) *TreeW
- func (w *TreeW) Expanded(keys *[]string) *TreeW
- func (w *TreeW) Filter() *TreeW
- func (w *TreeW) FilterMethod(fn func(keyword string, n *TreeNode) bool) *TreeW
- func (w *TreeW) HalfChecked() []string
- func (w *TreeW) Height(px float32) *TreeW
- func (w *TreeW) Layout(o ...layout.Option) *TreeW
- func (w *TreeW) LoadData(fn func(key string) bool) *TreeW
- func (w *TreeW) Multiple() *TreeW
- func (w *TreeW) Search(keyword string) *TreeW
- func (w *TreeW) SelectChanged() bool
- func (w *TreeW) Selectable(on bool) *TreeW
- func (w *TreeW) Selected(keys *[]string) *TreeW
- func (w *TreeW) Show() *TreeW
- func (w *TreeW) ShowIcon() *TreeW
- func (w *TreeW) ShowLine() *TreeW
- func (w *TreeW) SwitcherIcon(ic *icon.Icon) *TreeW
- type Trigger
- type UIPoster
- type UploadFile
- type UploadListType
- type UploadLocale
- type UploadW
- func (w *UploadW) Accept(s string) *UploadW
- func (w *UploadW) Action(url string) *UploadW
- func (w *UploadW) Added() []UploadFile
- func (w *UploadW) AutoUpload(on bool) *UploadW
- func (w *UploadW) BeforeUpload(fn func(f UploadFile) error) *UploadW
- func (w *UploadW) ButtonText(s string) *UploadW
- func (w *UploadW) Changed() bool
- func (w *UploadW) Client(cl *http.Client) *UploadW
- func (w *UploadW) CustomRequest(...) *UploadW
- func (w *UploadW) Data(d map[string]string) *UploadW
- func (w *UploadW) Directory() *UploadW
- func (w *UploadW) Disabled(on bool) *UploadW
- func (w *UploadW) DragOver(on bool) *UploadW
- func (w *UploadW) DragText(title, hint string) *UploadW
- func (w *UploadW) Dragger() *UploadW
- func (w *UploadW) FieldName(s string) *UploadW
- func (w *UploadW) Headers(h map[string]string) *UploadW
- func (w *UploadW) ListType(t UploadListType) *UploadW
- func (w *UploadW) MaxCount(n int) *UploadW
- func (w *UploadW) MaxSize(n int64) *UploadW
- func (w *UploadW) Method(m string) *UploadW
- func (w *UploadW) Multiple() *UploadW
- func (w *UploadW) OnPick(fn func()) *UploadW
- func (w *UploadW) Picked() bool
- func (w *UploadW) Picker(fn func(accept string, multiple, dir bool) ([]string, error)) *UploadW
- func (w *UploadW) PictureCard() *UploadW
- func (w *UploadW) PictureList() *UploadW
- func (w *UploadW) Previewed() int
- func (w *UploadW) Rejections() []string
- func (w *UploadW) Removed() int
- func (w *UploadW) Retries(n int) *UploadW
- func (w *UploadW) ShowUploadList(on bool) *UploadW
- func (w *UploadW) Submit() int
- func (w *UploadW) Tip(s string) *UploadW
- func (w *UploadW) Width(px float32) *UploadW
- type ValueCopier
- type ValueKind
- type ValueNode
- type ValueSource
- type VirtualListW
- func (w *VirtualListW) A11yLabel(s string) *VirtualListW
- func (w *VirtualListW) Height(px float32) *VirtualListW
- func (w *VirtualListW) ID() ID
- func (w *VirtualListW) Layout(opts ...layout.Option) *VirtualListW
- func (w *VirtualListW) Offset() float64
- func (w *VirtualListW) Overscan(rows int) *VirtualListW
- func (w *VirtualListW) Range() (first, end int)
- func (w *VirtualListW) ScrollIntoView(i int) *VirtualListW
- func (w *VirtualListW) ScrollToIndex(i int) *VirtualListW
- type VirtualOptionGroup
- type VirtualOptionState
- type VirtualSelectW
- func (w *VirtualSelectW) AllowClear() *VirtualSelectW
- func (w *VirtualSelectW) AllowCreate() *VirtualSelectW
- func (w *VirtualSelectW) Changed() bool
- func (w *VirtualSelectW) Created() (string, bool)
- func (w *VirtualSelectW) DataVersion(v int) *VirtualSelectW
- func (w *VirtualSelectW) Debounce(d time.Duration) *VirtualSelectW
- func (w *VirtualSelectW) Disabled(on bool) *VirtualSelectW
- func (w *VirtualSelectW) FilterMethod(fn func(query string, o Option) bool) *VirtualSelectW
- func (w *VirtualSelectW) Filterable() *VirtualSelectW
- func (w *VirtualSelectW) Groups(groups []VirtualOptionGroup) *VirtualSelectW
- func (w *VirtualSelectW) ID() ID
- func (w *VirtualSelectW) IsOpen() bool
- func (w *VirtualSelectW) ItemHeight(px float32) *VirtualSelectW
- func (w *VirtualSelectW) Layout(o ...layout.Option) *VirtualSelectW
- func (w *VirtualSelectW) ListHeight(px float32) *VirtualSelectW
- func (w *VirtualSelectW) Loading(on bool) *VirtualSelectW
- func (w *VirtualSelectW) MaxCount(n int) *VirtualSelectW
- func (w *VirtualSelectW) MaxTagCount(n int) *VirtualSelectW
- func (w *VirtualSelectW) Multiple(vals *[]string) *VirtualSelectW
- func (w *VirtualSelectW) NotFoundContent(s string) *VirtualSelectW
- func (w *VirtualSelectW) Open() *VirtualSelectW
- func (w *VirtualSelectW) OptionRender(fn func(o Option, s VirtualOptionState)) *VirtualSelectW
- func (w *VirtualSelectW) Placeholder(s string) *VirtualSelectW
- func (w *VirtualSelectW) Placement(p Placement) *VirtualSelectW
- func (w *VirtualSelectW) Query() string
- func (w *VirtualSelectW) Remote(fn func(query string)) *VirtualSelectW
- func (w *VirtualSelectW) Size(s ControlSize) *VirtualSelectW
- func (w *VirtualSelectW) Status(s string) *VirtualSelectW
- func (w *VirtualSelectW) Width(px float32) *VirtualSelectW
- type VirtualTreeW
- func (w *VirtualTreeW) Accordion() *VirtualTreeW
- func (w *VirtualTreeW) CheckChanged() bool
- func (w *VirtualTreeW) CheckOnClick() *VirtualTreeW
- func (w *VirtualTreeW) CheckOnClickLeaf(on bool) *VirtualTreeW
- func (w *VirtualTreeW) CheckStrictly() *VirtualTreeW
- func (w *VirtualTreeW) Checkable(checked *[]string) *VirtualTreeW
- func (w *VirtualTreeW) Current(key *string) *VirtualTreeW
- func (w *VirtualTreeW) CurrentChanged() bool
- func (w *VirtualTreeW) DataVersion(v int) *VirtualTreeW
- func (w *VirtualTreeW) EmptyText(s string) *VirtualTreeW
- func (w *VirtualTreeW) ExpandChanged() bool
- func (w *VirtualTreeW) ExpandOnClick(on bool) *VirtualTreeW
- func (w *VirtualTreeW) Expanded(keys *[]string) *VirtualTreeW
- func (w *VirtualTreeW) Filter(query string) *VirtualTreeW
- func (w *VirtualTreeW) FilterMethod(fn func(query string, n *TreeNode) bool) *VirtualTreeW
- func (w *VirtualTreeW) HalfChecked() []string
- func (w *VirtualTreeW) Height(px float32) *VirtualTreeW
- func (w *VirtualTreeW) ID() ID
- func (w *VirtualTreeW) LoadData(fn func(key string) bool) *VirtualTreeW
- func (w *VirtualTreeW) NodeClicked() (string, bool)
- func (w *VirtualTreeW) NodeRender(fn func(n *TreeNode, depth int)) *VirtualTreeW
- func (w *VirtualTreeW) Range() (first, end int)
- func (w *VirtualTreeW) ScrollToKey(key string) *VirtualTreeW
- func (w *VirtualTreeW) Show() *VirtualTreeW
- func (w *VirtualTreeW) VisibleCount() int
- type WatermarkW
- func (w *WatermarkW) Body(fn func()) *WatermarkW
- func (w *WatermarkW) Color(col theme.Color) *WatermarkW
- func (w *WatermarkW) FontSize(px float32) *WatermarkW
- func (w *WatermarkW) FontStyle(s string) *WatermarkW
- func (w *WatermarkW) Gap(x, y float32) *WatermarkW
- func (w *WatermarkW) Grid() *WatermarkW
- func (w *WatermarkW) Image(img image.Image, wpx, hpx float32) *WatermarkW
- func (w *WatermarkW) ImageOpacity(a float32) *WatermarkW
- func (w *WatermarkW) Layout(o ...layout.Option) *WatermarkW
- func (w *WatermarkW) MarkSize(wpx, hpx float32) *WatermarkW
- func (w *WatermarkW) Offset(x, y float32) *WatermarkW
- func (w *WatermarkW) Rotate(deg float64) *WatermarkW
- func (w *WatermarkW) Weight(wt text.Weight) *WatermarkW
- type Window
- type WindowAction
- type WindowControlsStyle
- type WindowControlsW
- func (w *WindowControlsW) Action() WindowAction
- func (w *WindowControlsW) Frame(f WindowFrame) *WindowControlsW
- func (w *WindowControlsW) Height(px float32) *WindowControlsW
- func (w *WindowControlsW) ID() ID
- func (w *WindowControlsW) Manual() *WindowControlsW
- func (w *WindowControlsW) Style(s WindowControlsStyle) *WindowControlsW
- type WindowFrame
- type WindowFrameInfo
- type WindowOptions
- type WindowState
Constants ¶
const ( TreeDropBefore = -1 TreeDropInside = 0 TreeDropAfter = 1 )
Tree drop positions reported by Dropped and accepted by TreeMove.
const ( AlignAuto = "auto" AlignTop = "top" AlignBottom = "bottom" )
Scroll alignments of Listy.ScrollToKey / ScrollToGroup.
const ( ValuePassword = "password" ValueTextArea = "textarea" ValueSelect = "select" ValueMultiSelect = "multiSelect" ValueRadio = "radio" ValueRadioButton = "radioButton" ValueCheckbox = "checkbox" ValueSwitch = "switch" ValueRate = "rate" ValueSlider = "slider" ValueSegmented = "segmented" ValueDateRange = "dateRange" ValueCascader = "cascader" // []string path; options: ValueEnum with Children ValueTreeSelect = "treeSelect" // string; options: ValueEnum with Children ValueUpload = "upload" // []UploadFile; ProField.Pick adds files ValueTime = "time" // time.Time (time of day) ValueTimeRange = "timeRange" // [2]time.Time ValueColor = "color" // string "#RRGGBB" / "#RRGGBBAA" ValueDigitRange = "digitRange" // [2]float64; an empty end is NaN )
Value types used by ProForm fields in addition to the ProTable ones (ValueText, ValueMoney, ValueDigit, ValuePercent, ValueDate, ValueDateTime, ValueStatus, ValueTag ...): one set describes both a column's display and a field's editor.
const ( ValueDateWeek = "dateWeek" // time.Time, shown as its week ("2026-46周") ValueDateMonth = "dateMonth" // time.Time, shown as "2006-01" ValueDateQuarter = "dateQuarter" // time.Time, shown as its quarter ("2026-Q4") ValueDateYear = "dateYear" // time.Time, shown as "2006" ValueDateTimeRange = "dateTimeRange" // [2]time.Time with the times of day // ValueImage is an image.Image, []image.Image or UploadFile(s) with a // Thumb; the editor is a one-picture Upload card (ProField.Pick adds). ValueImage = "image" // ValueAvatar is an image.Image (or UploadFile) or a name string (its // first letter, edited as text); a picture is edited like image. ValueAvatar = "avatar" ValueCode = "code" // string in a monospace block ValueJSONCode = "jsonCode" // JSON text (string / []byte) or any value, shown indented; validated when edited ValueFromNow = "fromNow" // time.Time shown relative to now ("3 分钟前"); edited with a date-time picker ValueSecond = "second" // number of seconds shown as a duration ("1 小时 5 秒") ValueIndex = "index" // ProTable: the 1-based row number (the value is ignored) // ValueCaptcha is a string code with a "get code" button and its // countdown (ProField.OnCaptcha sends the code). ValueCaptcha = "captcha" // ValueFormList is a list of rows ([]ProValues) edited with Form.List; // ProField.List gives the fields of a row. ValueFormList = "formList" )
Value types of the third Pro round: date granularities, a date-time range, media (image, avatar), code, relative time, durations, row numbers, a verification code and nested lists. Like the others they describe both a field's editor and the read-only view in ProForm (readonly), ProField, ProTable and ProDescriptions.
const ( SplitVertical = "vertical" // children side by side, vertical dividers SplitHorizontal = "horizontal" // children stacked, horizontal dividers )
Split directions of ProCard.Split.
const ( SkeletonList = "list" SkeletonResult = "result" SkeletonDescriptions = "descriptions" )
ProSkeleton page types.
const ( StatisticVertical = "vertical" StatisticHorizontal = "horizontal" StatisticInline = "inline" )
Statistic layouts of StatisticCard.StatisticLayout and ProStatistic.
const ( ChartBottom = "bottom" ChartLeft = "left" ChartRight = "right" )
Chart placements of StatisticCard.ChartPlace.
const ( LoginAccount = "account" LoginMobile = "mobile" )
Login types of LoginForm (the "loginType" value).
const ( StatusSuccess = "success" StatusInfo = "info" StatusWarning = "warning" StatusError = "error" StatusProcessing = "processing" // Badge.Status and Tag.Color )
Status names accepted wherever a component takes a status string: Alert, Message, Notification, Result, Badge.Status, Tag.Color and the Status of inputs (error, warning). They are untyped constants, so the plain strings keep working; the names give completion and catch typos at compile time.
ui.Alert(c, ui.StatusSuccess, "已保存") ui.Input(c, &email).Status(ui.StatusError)
Some components accept more values than these (Result also takes "403", "404" and "500"; Tag takes preset and hex colors); see each component's documentation.
const ( FixedLeft = "left" FixedRight = "right" )
Fixed column sides (TableColumn.Fixed). They are logical, like Ant's RTL table: "left" is the start side (the right edge in an RTL scope) and "right" the end side.
const ( SelectionAll = "all" // select every selectable row (all pages of local data) SelectionPage = "page" // select the rows of the current page SelectionInvert = "invert" // invert the selection of the current page SelectionNone = "none" // clear the whole selection )
Built-in selection menu items (TableSelection.Key) of Selections.
const ( PageTopStart = "topStart" PageTopCenter = "topCenter" PageTopEnd = "topEnd" PageBottomStart = "bottomStart" PageBottomCenter = "bottomCenter" PageBottomEnd = "bottomEnd" // default PageNone = "none" )
Pagination placements (PaginationPlacement), Ant Design 6 pagination.placement.
const ( ValueText = "text" ValueMoney = "money" ValueDigit = "digit" ValuePercent = "percent" ValueDate = "date" ValueDateTime = "dateTime" ValueStatus = "status" ValueTag = "tag" ValueProgress = "progress" ValueLink = "link" ValueOption = "option" // action column: Render only, never searched )
Value types of ProColumn.ValueType.
const ( AlignLeft = AlignStart AlignRight = AlignEnd )
AlignLeft and AlignRight are transitional aliases of AlignStart and AlignEnd, kept while existing call sites are audited (RTL spec §3.2): in LTR they behave exactly as before. Use AlignStart / AlignEnd for "start / end" and AlignPhysicalLeft / AlignPhysicalRight where the physical side is required; after the audit AlignLeft / AlignRight will become the physical values.
const DragSlop = 8
DragSlop is how far (logical px) a press may travel before an enclosing container that accepts the movement direction takes the pointer over.
const FixedNone = "none"
FixedNone unpins a column in TableColumnState.Fixed.
const GridContentFixedWidth = 1152
GridContentFixedWidth is the content width of a Fixed GridContent.
TopNavHeaderWideWidth is Pro v3's Fixed top navigation content width.
Variables ¶
var ( EaseInOut = cubicBezier(0.645, 0.045, 0.355, 1) EaseOut = cubicBezier(0.215, 0.61, 0.355, 1) EaseIn = cubicBezier(0.55, 0.055, 0.675, 0.19) )
Ant Design motion curves.
var ButtonPresetColors = []ButtonColor{ ButtonColorBlue, ButtonColorPurple, ButtonColorCyan, ButtonColorGreen, ButtonColorMagenta, ButtonColorPink, ButtonColorRed, ButtonColorOrange, ButtonColorYellow, ButtonColorVolcano, ButtonColorGeekblue, ButtonColorLime, ButtonColorGold, }
ButtonPresetColors lists the Ant Design preset colors in display order.
var ContextMenuSource func(c *Context) (geom.Point, bool)
ContextMenuSource is an extra context-menu gesture for platforms without a secondary button (e.g. a two-finger tap): when set, context-menu triggers (Dropdown with TriggerContextMenu) also open when it reports a point inside them. Right-button presses always work (they are read with Context.ContextMenuFor, which respects layers). Nil by default.
var EnUS = &Locale{ Code: "en-US", Name: "English", OK: "OK", Cancel: "Cancel", Close: "Close", Confirm: "Confirm", Back: "Back", Clear: "Clear", Reset: "Reset", Search: "Search", Save: "Save", Delete: "Delete", Edit: "Edit", Copy: "Copy", Copied: "Copied", More: "More", Expand: "Expand", Collapse: "Collapse", SelectAll: "Select all", Loading: "Loading", Retry: "Retry", GotIt: "Got it", NoData: "No data", NoMore: "No more", LoadMore: "Load more", LoadFailed: "Failed to load", TotalFmt: "Total %d items", RangeTotalFmt: "%d-%d of %d items", PageSizeFmt: "%d / page", PrevPage: "Previous Page", NextPage: "Next Page", Prev5: "Previous 5 Pages", Next5: "Next 5 Pages", JumpTo: "Go to", PageSuffix: "Page", Placeholder: "Please enter", SelectPlaceholder: "Please select", Required: "This field is required", NotFound: "Not found", LabelColon: ":", SelectedFmt: "%d selected", Today: "Today", Now: "Now", SelectDate: "Select date", SelectTime: "Select time", SelectDateTime: "Select date and time", StartDate: "Start date", EndDate: "End date", PrevYear: "Previous year", NextYear: "Next year", PrevMonth: "Previous month", NextMonth: "Next month", RangeSeparator: "to", YearFmt: "%d", MonthFmt: "%[2]s", YearMonthFmt: "%[3]s %[1]d", Weekdays: [7]string{"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"}, Months: [12]string{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}, WeekStart: time.Sunday, FilterConfirm: "OK", FilterReset: "Reset", SortAsc: "Click to sort ascending", SortDesc: "Click to sort descending", CancelSort: "Click to cancel sorting", SelectionAll: "Select all data", SelectionInvert: "Invert current page", ExpandRow: "Expand row", CollapseRow: "Collapse row", ItemUnit: "item", ItemsUnit: "items", Searching: "Searching", Currency: "$", MessageBoxTitle: "Message", Info: "Info", Success: "Success", Warning: "Warning", Error: "Error", BackTop: "Back to top", CollapseMenu: "Collapse menu", ExpandMenu: "Expand menu", Fullscreen: "Fullscreen", ExitFullscreen: "Exit fullscreen", PromptPlaceholder: "Please input", PromptInvalid: "Illegal input", CloseAll: "Close all", Steps: "Steps", Calendar: CalendarLocale{Month: "Month", Year: "Year"}, Carousel: CarouselLocale{Prev: "Previous slide", Next: "Next slide"}, Image: ImageLocale{ Preview: "Preview", PreviewLabel: "Image preview", ClosePreview: "Close preview", Prev: "Previous image", Next: "Next image", ZoomIn: "Zoom in", ZoomOut: "Zoom out", RotateLeft: "Rotate left", RotateRight: "Rotate right", FlipHorizontal: "Flip horizontally", FlipVertical: "Flip vertically", }, ColorPicker: ColorPickerLocale{Presets: "Recommended", None: "None", ClearColor: "Clear color", Clear: "Clear", Saturation: "Saturation", Hue: "Hue", Alpha: "Alpha", Format: "Color format", Value: "Color value", Gradient: "Gradient stops", Angle: "Angle"}, Tour: TourLocale{Close: "Close tour", Prev: "Previous", Next: "Next", Finish: "Finish"}, Command: CommandLocale{Placeholder: "Type a command or search...", Empty: "No results found."}, QRCode: QRCodeLocale{Expired: "QR code expired", Refresh: "Refresh", Scanned: "Scanned"}, Table: TableLocale{FilterSearch: "Search in filters", FilterAll: "All", Filter: "Filter", FixedLeft: "Fixed to left", NoFixed: "Not fixed", FixedRight: "Fixed to right", PinLeft: "Pin to left", PinRight: "Pin to right", Unpin: "Unpin", SelectRowFmt: "Select row %d", Selections: "Selection options", SelectPage: "Select current page", SelectNone: "Clear all data", SumText: "Sum"}, Mobile: MobileLocale{PullToRefresh: "Pull to refresh", ReleaseToRefresh: "Release to refresh", Refreshed: "Refreshed", TapToRetry: ", tap to retry", DayFmt: "%d", HourFmt: "%02d", MinuteFmt: "%02d"}, Graph: GraphLocale{Diagram: "Diagram", ER: "ER diagram", GitGraph: "Commit graph", ZoomIn: "Zoom in", ZoomOut: "Zoom out", FitView: "Fit view", AutoLayout: "Auto layout", MiniMap: "Minimap", PrimaryKey: "Primary key", ForeignKey: "Foreign key", SummaryFmt: "%[1]d nodes, %[2]d edges", CommitsFmt: "%d commits"}, Chart: ChartLocale{Total: "Total", Conversion: "Conversion", Line: "Line chart", Area: "Area chart", Column: "Column chart", Bar: "Bar chart", Pie: "Pie chart", Donut: "Donut chart", Scatter: "Scatter chart", Radar: "Radar chart", Gauge: "Gauge", Funnel: "Funnel chart", Heatmap: "Heatmap", DualAxes: "Dual axes chart", Liquid: "Liquid gauge", Sparkline: "Sparkline", SummaryFmt: "%[1]s, %[2]d series, %[3]d data points", XRangeFmt: "; x axis from %s to %s", YRangeFmt: "; values from %s to %s", ValueFmt: "%s: %s"}, ProTable: ProTableLocale{Query: "Query", Reload: "Refresh", Density: "Density", DensityDefault: "Default", DensityMiddle: "Middle", DensityCompact: "Compact", ColumnSetting: "Column settings", ColumnDisplay: "Columns", ClearSelection: "Clear selection", LoadErrorFmt: "Failed to load data: %s"}, Transfer: TransferLocale{Source: "Source", Target: "Target", SearchPlaceholder: "Search here"}, Upload: UploadLocale{Trigger: "Upload", Uploading: "Uploading", Remove: "Remove file", Preview: "Preview file", Button: "Click to Upload", DragTitle: "Click or drag file to this area to upload", DropPrefix: "Drop file here or ", DoneFmt: "%s uploaded", FailedFmt: "%s failed to upload", TooManyFmt: "%s: the list is full", BadTypeFmt: "%s: file type not accepted", TooLargeFmt: "%s is larger than %s", IsDirFmt: "%s is a folder"}, Markdown: MarkdownLocale{ImagePrefix: "[Image] ", CopyCode: "Copy code", Copied: "Copied"}, MarkdownEditor: MarkdownEditorLocale{Placeholder: "Write Markdown here…", Heading: "Heading", Bold: "Bold", Italic: "Italic", Strike: "Strikethrough", Code: "Code", Link: "Link", Quote: "Quote", BulletList: "Bulleted list", OrderedList: "Numbered list", Task: "Task", CodeBlock: "Code block", Table: "Table", Divider: "Divider", BoldSample: "bold text", ItalicSample: "italic text", StrikeSample: "deleted text", LinkSample: "link text", TableColumnFmt: "Column %d", Edit: "Edit", Split: "Split", Preview: "Preview"}, Form: FormLocale{Validating: "Validating…", RequiredInputFmt: "Please enter %s", RequiredSelectFmt: "Please select %s", Submit: "Submit", Query: "Query", PrevStep: "Previous", NextStep: "Next", MoveUp: "Move up", MoveDown: "Move down", AddRow: "Add a row", Optional: "(optional)"}, A11y: A11yLocale{Navigation: "Navigation", Breadcrumb: "Breadcrumb", Pagination: "Pagination", Notifications: "Notifications", Toolbar: "Toolbar", Menu: "Menu", PageFmt: "Page %d", MoreActions: "More actions", OpenMenu: "Open menu", Remove: "Remove", DragHandle: "Drag to reorder", Resize: "Resize", Splitter: "Splitter", ShowPassword: "Show password", HidePassword: "Hide password", Increase: "Increase", Decrease: "Decrease", Avatar: "Avatar", Image: "Image", Chart: "Chart", Progress: "Progress", Rating: "Rating", Color: "Color", Loading: "Loading", SlideFmt: "Slide %d of %d", RateFmt: "%[1]g of %[2]d stars", DateFmt: "%[4]s %[3]d, %[1]d", DigitFmt: "Character %d of %d", RemoveFmt: "Remove %s", Day: "Day", Hour: "Hour", Minute: "Minute", Second: "Second", MoveToTarget: "Move to target", MoveToSource: "Move to source", PageSize: "Items per page"}, DatePicker: DatePickerLocale{SelectWeek: "Select week", SelectMonth: "Select month", SelectQuarter: "Select quarter", SelectYear: "Select year", StartWeek: "Start week", EndWeek: "End week", StartMonth: "Start month", EndMonth: "End month", StartQuarter: "Start quarter", EndQuarter: "End quarter", StartYear: "Start year", EndYear: "End year", PrevDecade: "Previous decade", NextDecade: "Next decade", WeekFmt: "%[1]d-%[2]d%[3]s", QuarterFmt: "%[1]d-Q%[2]d", QuarterCellFmt: "Q%d"}, TimePicker: TimePickerLocale{StartTime: "Start time", EndTime: "End time", AM: "AM", PM: "PM", Meridiem: "AM/PM"}, Tabs: TabsLocale{More: "More tabs", Add: "Add tab"}, Pagination: PaginationLocale{Jump: "Go to page", Current: "Current page", Confirm: "Confirm", Prev3: "Previous 3 Pages", Next3: "Next 3 Pages"}, Slider: SliderLocale{Min: "Minimum", Max: "Maximum"}, DropZone: DropZoneLocale{Name: "Drop zone", Release: "Release to drop the files here"}, EditableTable: EditableTableLocale{Actions: "Actions", DeleteConfirm: "Delete this row?"}, PageContainer: PageContainerLocale{FooterToolbar: "Page actions"}, ProCard: ProCardLocale{MoreInfo: "More info"}, StatisticCard: StatisticCardLocale{Up: "Up", Down: "Down"}, ProField: ProFieldLocale{On: "On", Off: "Off", StartFmt: "%s start", EndFmt: "%s end", Min: "Min", Max: "Max", RangeEndFmt: "%s: %s", JustNow: "just now", AgoFmt: "%s ago", LaterFmt: "in %s", SecondFmt: "%d s", MinuteFmt: "%d min", HourFmt: "%d h", DayFmt: "%d d", MonthFmt: "%d mo", YearFmt: "%d yr", InvalidJSON: "Invalid JSON"}, ProDescriptions: ProDescriptionsLocale{EditFmt: "Edit %s"}, LightFilter: LightFilterLocale{Name: "Filter", ClearFmt: "Clear %s", PillFmt: "%s: %s", More: "More filters", MoreFmt: "More filters (%d)"}, LoginForm: LoginFormLocale{AccountTab: "Account", MobileTab: "Mobile", Username: "Username", UsernameRequired: "Please enter your username", Password: "Password", PasswordRequired: "Please enter your password", Mobile: "Mobile number", MobileRequired: "Please enter your mobile number", MobileInvalid: "Invalid mobile number", Captcha: "Verification code", CaptchaRequired: "Please enter the code", GetCode: "Get code", ResendFmt: "Resend in %ds", CodeSentFmt: "Code sent. You can resend it in %d seconds.", CodeReady: "You can request a new code now.", Remember: "Remember me", Forgot: "Forgot password", Submit: "Log in", Others: "Other login methods"}, Chat: ChatLocale{User: "You", Assistant: "Assistant", System: "System", Messages: "Messages", ScrollToBottom: "Scroll to bottom", Thinking: "Thinking", Generating: "Generating", Placeholder: "Message… (Enter to send, Shift+Enter for a new line)", Send: "Send", Stop: "Stop generating", Attach: "Attach files", Suggestions: "Suggestions", Uploading: "Uploading", Failed: "Upload failed", EditPlaceholder: "Edit message", Pending: "Pending", Running: "Running", Done: "Done", Error: "Failed", StepsFmt: "%d/%d", SecondsFmt: "%.1fs", MinutesFmt: "%dm %ds", ToolCall: "Tool call", Arguments: "Arguments", Result: "Result", ApprovalTitle: "Approval required", AllowOnce: "Allow", AllowSession: "Allow for this chat", AllowAlways: "Always allow", Deny: "Deny", Allowed: "Allowed", Denied: "Denied", FeedbackPlaceholder: "Add a note (optional)", RiskWarning: "Needs review", RiskDanger: "High risk", Conversations: "Conversations", Rename: "Rename", Untitled: "Untitled chat", Today: "Today", Yesterday: "Yesterday", Last7Days: "Previous 7 days", Last30Days: "Previous 30 days", Earlier: "Earlier", Prompts: "Prompts"}, SettingDrawer: SettingDrawerLocale{Open: "Open page settings", Title: "Page settings", NavTheme: "Style", Light: "Light menu", Dark: "Dark menu", RealDark: "Dark mode", PrimaryColor: "Theme color", Layout: "Navigation", Side: "Side menu", Top: "Top menu", Mix: "Mixed", ContentWidth: "Content width", Fluid: "Fluid", Fixed: "Fixed", FixedHeader: "Fixed header", FixSiderbar: "Fixed side menu", ColorWeak: "Color weak mode", Other: "Other settings", Compact: "Compact", ColorFmt: "Theme color %s"}, CodeBlock: CodeBlockLocale{Code: "Code"}, JSONView: JSONViewLocale{Name: "JSON viewer", CopyValue: "Copy value", CopyPath: "Copy path", ExpandAll: "Expand all", CollapseAll: "Collapse all", ItemsFmt: "%d items", KeysFmt: "%d keys", Search: "Search keys or values", PrevMatch: "Previous match", NextMatch: "Next match", MatchFmt: "%d of %d", NoMatch: "No results", ParseErrorFmt: "Invalid JSON: %s"}, LogView: LogViewLocale{Name: "Log", Search: "Search log", PrevMatch: "Previous match", NextMatch: "Next match", MatchFmt: "%d of %d", NoMatch: "No results", Wrap: "Wrap lines", Follow: "Follow output", Level: "Level", AllLevels: "All levels", Levels: [5]string{"Trace", "Debug", "Info", "Warn", "Error"}, LinesFmt: "%d lines"}, StatusBar: StatusBarLocale{Label: "Status bar"}, TitleBar: TitleBarLocale{Minimize: "Minimize", Maximize: "Maximize", Restore: "Restore", WindowControls: "Window controls"}, NotificationCenter: NotificationCenterLocale{MarkAllRead: "Mark all as read", ClearAll: "Clear all", Dismiss: "Dismiss", Empty: "No notifications", UnreadFmt: "%d unread", JustNow: "Just now", MinutesAgoFmt: "%dm ago", HoursAgoFmt: "%dh ago", DaysAgoFmt: "%dd ago"}, HotkeyInput: HotkeyInputLocale{Placeholder: "Click to record a shortcut", Recording: "Press a key combination, Esc to cancel", ClearLabel: "Clear shortcut"}, Dock: DockLocale{Maximize: "Maximize", Restore: "Restore", Split: "Split right", Empty: "Drag a tab here", Group: "Tab group"}, Extra: map[string]string{ "diffview.a11y.change": "Difference %d of %d: ", "diffview.a11y.removed": "removed lines %s", "diffview.a11y.inserted": "added lines %s", "diffview.a11y.sep": ", ", "diffview.a11y.range": "%d–%d", "diffview.a11y.none": "No differences", "diffview.hidden": "%d hidden lines", "diffview.showAbove": "Show %d more lines above", "diffview.showBelow": "Show %d more lines below", "diffview.showAll": "Show all", "diffview.original": "Original (read-only) — %s", "diffview.originalEditable": "Original — %s", "diffview.modified": "Modified — %s", "diffview.revert": "Revert this change", "diffview.unnamed": "Untitled", }, }
EnUS is the US English locale. RegisterLocale fills the empty texts of every other locale from it.
var ErrQRTooLong = errors.New("ui: qrcode data too long")
ErrQRTooLong is returned when the data exceeds version 40 capacity.
var Ja = &Locale{ Code: "ja-JP", Name: "日本語", OK: "OK", Cancel: "キャンセル", Close: "閉じる", Confirm: "確認", Back: "戻る", Clear: "クリア", Reset: "リセット", Search: "検索", Save: "保存", Delete: "削除", Edit: "編集", Copy: "コピー", Copied: "コピーしました", More: "その他", Expand: "展開", Collapse: "折りたたむ", SelectAll: "すべて選択", Loading: "読み込み中", Retry: "再試行", GotIt: "了解", NoData: "データがありません", NoMore: "これ以上ありません", LoadMore: "さらに読み込む", LoadFailed: "読み込みに失敗しました", TotalFmt: "全 %d 件", RangeTotalFmt: "%d-%d 件 / 全 %d 件", PageSizeFmt: "%d 件/ページ", PrevPage: "前のページ", NextPage: "次のページ", Prev5: "前の 5 ページ", Next5: "次の 5 ページ", JumpTo: "移動", PageSuffix: "ページ", Placeholder: "入力してください", SelectPlaceholder: "選択してください", Required: "必須項目です", NotFound: "見つかりません", LabelColon: ":", SelectedFmt: "%d 件選択中", Today: "今日", Now: "現在", SelectDate: "日付を選択", SelectTime: "時刻を選択", SelectDateTime: "日時を選択", StartDate: "開始日", EndDate: "終了日", PrevYear: "前年", NextYear: "翌年", PrevMonth: "前月", NextMonth: "翌月", RangeSeparator: "〜", YearFmt: "%d年", MonthFmt: "%d月", YearMonthFmt: "%d年%d月", Weekdays: [7]string{"日", "月", "火", "水", "木", "金", "土"}, Months: [12]string{"1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"}, WeekStart: time.Sunday, FilterConfirm: "OK", FilterReset: "リセット", SortAsc: "クリックで昇順", SortDesc: "クリックで降順", CancelSort: "ソートを解除", SelectionAll: "すべてを選択", SelectionInvert: "このページを反転", ExpandRow: "行を展開", CollapseRow: "行を折りたたむ", ItemUnit: "件", ItemsUnit: "件", Searching: "検索中", Currency: "JPY", MessageBoxTitle: "メッセージ", Info: "情報", Success: "成功", Warning: "警告", Error: "エラー", BackTop: "トップへ戻る", CollapseMenu: "メニューを折りたたむ", ExpandMenu: "メニューを展開", Fullscreen: "全画面表示", ExitFullscreen: "全画面表示を終了", PromptPlaceholder: "入力してください", PromptInvalid: "入力が正しくありません", CloseAll: "すべて閉じる", Steps: "ステップ", Calendar: CalendarLocale{Month: "月", Year: "年"}, Carousel: CarouselLocale{Prev: "前のスライド", Next: "次のスライド"}, Image: ImageLocale{ Preview: "プレビュー", PreviewLabel: "画像プレビュー", ClosePreview: "プレビューを閉じる", Prev: "前の画像", Next: "次の画像", ZoomIn: "拡大", ZoomOut: "縮小", RotateLeft: "左に回転", RotateRight: "右に回転", FlipHorizontal: "左右反転", FlipVertical: "上下反転", }, ColorPicker: ColorPickerLocale{Presets: "おすすめ", None: "なし", ClearColor: "色をクリア", Clear: "クリア", Saturation: "彩度", Hue: "色相", Alpha: "透明度", Format: "カラー形式", Value: "カラー値", Gradient: "グラデーションの色標", Angle: "角度"}, Tour: TourLocale{Close: "ツアーを閉じる", Prev: "前へ", Next: "次へ", Finish: "完了"}, Command: CommandLocale{Placeholder: "コマンドを入力または検索…", Empty: "結果が見つかりません。"}, QRCode: QRCodeLocale{Expired: "期限切れ", Refresh: "更新", Scanned: "スキャン済み"}, Table: TableLocale{FilterSearch: "フィルターを検索", FilterAll: "すべて", Filter: "フィルター", FixedLeft: "左に固定", NoFixed: "固定なし", FixedRight: "右に固定", PinLeft: "先頭に固定", PinRight: "末尾に固定", Unpin: "固定を解除", SelectRowFmt: "%d 行目を選択", Selections: "選択オプション", SelectPage: "このページを選択", SelectNone: "選択をすべて解除", SumText: "合計"}, Mobile: MobileLocale{PullToRefresh: "引っ張って更新", ReleaseToRefresh: "離すと更新", Refreshed: "更新しました", TapToRetry: "、タップして再試行", DayFmt: "%d日", HourFmt: "%02d時", MinuteFmt: "%02d分"}, Graph: GraphLocale{Diagram: "ダイアグラム", ER: "ER 図", GitGraph: "コミットグラフ", ZoomIn: "拡大", ZoomOut: "縮小", FitView: "全体表示", AutoLayout: "自動レイアウト", MiniMap: "ミニマップ", PrimaryKey: "主キー", ForeignKey: "外部キー", SummaryFmt: "%[1]d 個のノード、%[2]d 本の接続", CommitsFmt: "%d 件のコミット"}, Chart: ChartLocale{Total: "合計", Conversion: "コンバージョン率", Line: "折れ線グラフ", Area: "面グラフ", Column: "縦棒グラフ", Bar: "横棒グラフ", Pie: "円グラフ", Donut: "ドーナツグラフ", Scatter: "散布図", Radar: "レーダーチャート", Gauge: "ゲージ", Funnel: "ファネルチャート", Heatmap: "ヒートマップ", DualAxes: "2 軸グラフ", Liquid: "リキッドゲージ", Sparkline: "スパークライン", SummaryFmt: "%[1]s、%[2]d 系列、%[3]d データポイント", XRangeFmt: "、横軸 %s ~ %s", YRangeFmt: "、値 %s ~ %s", ValueFmt: "%s:%s"}, ProTable: ProTableLocale{Query: "検索", Reload: "更新", Density: "表示密度", DensityDefault: "標準", DensityMiddle: "中", DensityCompact: "コンパクト", ColumnSetting: "列の設定", ColumnDisplay: "列の表示", ClearSelection: "選択を解除", LoadErrorFmt: "データの読み込みに失敗しました:%s"}, Transfer: TransferLocale{Source: "ソース", Target: "ターゲット", SearchPlaceholder: "ここを検索"}, Upload: UploadLocale{Trigger: "アップロード", Uploading: "アップロード中", Remove: "ファイルを削除", Preview: "ファイルをプレビュー", Button: "クリックしてアップロード", DragTitle: "クリックまたはドラッグしてアップロード", DropPrefix: "ここにファイルをドロップ、または", DoneFmt: "%s をアップロードしました", FailedFmt: "%s のアップロードに失敗しました", TooManyFmt: "%s:ファイル数が上限に達しています", BadTypeFmt: "%s:この形式のファイルは使用できません", TooLargeFmt: "%s は %s を超えています", IsDirFmt: "%s はフォルダーです"}, Markdown: MarkdownLocale{ImagePrefix: "[画像] ", CopyCode: "コードをコピー", Copied: "コピーしました"}, MarkdownEditor: MarkdownEditorLocale{Placeholder: "ここに Markdown を入力…", Heading: "見出し", Bold: "太字", Italic: "斜体", Strike: "取り消し線", Code: "コード", Link: "リンク", Quote: "引用", BulletList: "箇条書き", OrderedList: "番号付きリスト", Task: "タスク", CodeBlock: "コードブロック", Table: "表", Divider: "区切り線", BoldSample: "太字テキスト", ItalicSample: "斜体テキスト", StrikeSample: "取り消しテキスト", LinkSample: "リンクテキスト", TableColumnFmt: "列 %d", Edit: "編集", Split: "分割", Preview: "プレビュー"}, Form: FormLocale{Validating: "検証中…", RequiredInputFmt: "%sを入力してください", RequiredSelectFmt: "%sを選択してください", Submit: "送信", Query: "検索", PrevStep: "前へ", NextStep: "次へ", MoveUp: "上へ移動", MoveDown: "下へ移動", AddRow: "行を追加", Optional: "(オプション)"}, A11y: A11yLocale{Navigation: "ナビゲーション", Breadcrumb: "パンくずリスト", Pagination: "ページ送り", Notifications: "通知", Toolbar: "ツールバー", Menu: "メニュー", PageFmt: "%d ページ", MoreActions: "その他の操作", OpenMenu: "メニューを開く", Remove: "削除", DragHandle: "ドラッグして並べ替え", Resize: "サイズ変更", Splitter: "分割バー", ShowPassword: "パスワードを表示", HidePassword: "パスワードを隠す", Increase: "増やす", Decrease: "減らす", Avatar: "アバター", Image: "画像", Chart: "グラフ", Progress: "進捗", Rating: "評価", Color: "色", Loading: "読み込み中", SlideFmt: "スライド %d / %d", RateFmt: "%[2]d 点中 %[1]g 点", DateFmt: "%d年%d月%d日", DigitFmt: "%d 文字目(全 %d 文字)", RemoveFmt: "%s を削除", Day: "日", Hour: "時", Minute: "分", Second: "秒", MoveToTarget: "ターゲットへ移動", MoveToSource: "ソースへ戻す", PageSize: "1 ページあたりの件数"}, DatePicker: DatePickerLocale{SelectWeek: "週を選択", SelectMonth: "月を選択", SelectQuarter: "四半期を選択", SelectYear: "年を選択", StartWeek: "開始週", EndWeek: "終了週", StartMonth: "開始月", EndMonth: "終了月", StartQuarter: "開始四半期", EndQuarter: "終了四半期", StartYear: "開始年", EndYear: "終了年", PrevDecade: "前の10年", NextDecade: "次の10年", WeekFmt: "%[1]d-第%[2]d週", QuarterFmt: "%[1]d-Q%[2]d", QuarterCellFmt: "Q%d"}, TimePicker: TimePickerLocale{StartTime: "開始時間", EndTime: "終了時間", AM: "午前", PM: "午後", Meridiem: "午前/午後"}, Tabs: TabsLocale{More: "その他のタブ", Add: "タブを追加"}, Pagination: PaginationLocale{Jump: "ページを指定して移動", Current: "現在のページ", Confirm: "確認する", Prev3: "前の 3 ページ", Next3: "次の 3 ページ"}, Slider: SliderLocale{Min: "最小値", Max: "最大値"}, DropZone: DropZoneLocale{Name: "ドロップエリア", Release: "ここで離すとファイルをドロップします"}, EditableTable: EditableTableLocale{Actions: "操作", DeleteConfirm: "この行を削除しますか?"}, PageContainer: PageContainerLocale{FooterToolbar: "ページ操作"}, ProCard: ProCardLocale{MoreInfo: "詳細情報"}, StatisticCard: StatisticCardLocale{Up: "上昇", Down: "下降"}, ProField: ProFieldLocale{On: "オン", Off: "オフ", StartFmt: "%s(開始)", EndFmt: "%s(終了)", Min: "最小", Max: "最大", RangeEndFmt: "%s:%s", JustNow: "たった今", AgoFmt: "%s前", LaterFmt: "%s後", SecondFmt: "%d 秒", MinuteFmt: "%d 分", HourFmt: "%d 時間", DayFmt: "%d 日", MonthFmt: "%d か月", YearFmt: "%d 年", InvalidJSON: "JSON の形式が正しくありません"}, ProDescriptions: ProDescriptionsLocale{EditFmt: "%sを編集"}, LightFilter: LightFilterLocale{Name: "フィルター", ClearFmt: "%sをクリア", PillFmt: "%s:%s", More: "その他のフィルター", MoreFmt: "その他のフィルター(%d)"}, LoginForm: LoginFormLocale{AccountTab: "アカウントでログイン", MobileTab: "携帯電話番号でログイン", Username: "ユーザー名", UsernameRequired: "ユーザー名を入力してください", Password: "パスワード", PasswordRequired: "パスワードを入力してください", Mobile: "携帯電話番号", MobileRequired: "携帯電話番号を入力してください", MobileInvalid: "携帯電話番号の形式が正しくありません", Captcha: "認証コード", CaptchaRequired: "認証コードを入力してください", GetCode: "コードを取得", ResendFmt: "%d 秒後に再送信", CodeSentFmt: "認証コードを送信しました。%d 秒後に再送信できます。", CodeReady: "認証コードを再送信できるようになりました。", Remember: "ログイン状態を保持", Forgot: "パスワードをお忘れの方", Submit: "ログイン", Others: "その他のログイン方法"}, Chat: ChatLocale{User: "あなた", Assistant: "アシスタント", System: "システム", Messages: "メッセージ一覧", ScrollToBottom: "最新へ移動", Thinking: "考え中", Generating: "生成中", Placeholder: "メッセージを入力(Enter で送信、Shift+Enter で改行)", Send: "送信", Stop: "生成を停止", Attach: "ファイルを添付", Suggestions: "候補", Uploading: "アップロード中", Failed: "アップロード失敗", EditPlaceholder: "メッセージを編集", Pending: "待機中", Running: "実行中", Done: "完了", Error: "失敗", StepsFmt: "%d/%d", SecondsFmt: "%.1f 秒", MinutesFmt: "%d 分 %d 秒", ToolCall: "ツール呼び出し", Arguments: "引数", Result: "結果", ApprovalTitle: "確認が必要です", AllowOnce: "許可", AllowSession: "この会話で許可", AllowAlways: "常に許可", Deny: "拒否", Allowed: "許可済み", Denied: "拒否済み", FeedbackPlaceholder: "補足(任意)", RiskWarning: "要確認", RiskDanger: "高リスク", Conversations: "会話一覧", Rename: "名前を変更", Untitled: "無題の会話", Today: "今日", Yesterday: "昨日", Last7Days: "過去 7 日間", Last30Days: "過去 30 日間", Earlier: "それ以前", Prompts: "プロンプト"}, SettingDrawer: SettingDrawerLocale{Open: "ページ設定を開く", Title: "ページ設定", NavTheme: "テーマ", Light: "ライトメニュー", Dark: "ダークメニュー", RealDark: "ダークモード", PrimaryColor: "テーマカラー", Layout: "ナビゲーション", Side: "サイドメニュー", Top: "トップメニュー", Mix: "ミックス", ContentWidth: "コンテンツ幅", Fluid: "可変", Fixed: "固定", FixedHeader: "ヘッダーを固定", FixSiderbar: "サイドメニューを固定", ColorWeak: "色覚サポート", Other: "その他の設定", Compact: "コンパクト", ColorFmt: "テーマカラー %s"}, CodeBlock: CodeBlockLocale{Code: "コード"}, JSONView: JSONViewLocale{Name: "JSON ビューア", CopyValue: "値をコピー", CopyPath: "パスをコピー", ExpandAll: "すべて展開", CollapseAll: "すべて折りたたむ", ItemsFmt: "%d 項目", KeysFmt: "%d 個のキー", Search: "キーまたは値を検索", PrevMatch: "前の一致", NextMatch: "次の一致", MatchFmt: "%d/%d", NoMatch: "一致なし", ParseErrorFmt: "JSON を解析できません: %s"}, LogView: LogViewLocale{Name: "ログ", Search: "ログを検索", PrevMatch: "前の一致", NextMatch: "次の一致", MatchFmt: "%d/%d", NoMatch: "一致なし", Wrap: "折り返し", Follow: "最新を追跡", Level: "レベル", AllLevels: "すべてのレベル", Levels: [5]string{"Trace", "Debug", "Info", "Warn", "Error"}, LinesFmt: "%d 行"}, StatusBar: StatusBarLocale{Label: "ステータスバー"}, TitleBar: TitleBarLocale{Minimize: "最小化", Maximize: "最大化", Restore: "元に戻す", WindowControls: "ウィンドウ操作"}, NotificationCenter: NotificationCenterLocale{MarkAllRead: "すべて既読にする", ClearAll: "すべてクリア", Dismiss: "通知を削除", Empty: "通知はありません", UnreadFmt: "未読 %d 件", JustNow: "たった今", MinutesAgoFmt: "%d 分前", HoursAgoFmt: "%d 時間前", DaysAgoFmt: "%d 日前"}, HotkeyInput: HotkeyInputLocale{Placeholder: "クリックしてショートカットを記録", Recording: "キーの組み合わせを押してください(Esc で取消)", ClearLabel: "ショートカットをクリア"}, Dock: DockLocale{Maximize: "最大化", Restore: "元に戻す", Split: "右に分割", Empty: "ここにタブをドラッグ", Group: "タブグループ"}, }
Ja is the Japanese locale.
var MessageDuration = 3 * time.Second
MessageDuration is how long Message toasts stay visible by default.
var NotifyStackThreshold = 3
NotifyStackThreshold is the count above which cards collapse into a stack until hovered (Ant stack mode). 0 disables stacking.
var ProSettingsPresetColors = []theme.Color{ theme.Hex("#1677ff"), theme.Hex("#1890ff"), theme.Hex("#f5222d"), theme.Hex("#fa541c"), theme.Hex("#faad14"), theme.Hex("#13c2c2"), theme.Hex("#52c41a"), theme.Hex("#2f54eb"), theme.Hex("#722ed1"), }
ProSettingsPresetColors are the theme colors offered by SettingDrawer (Pro's daybreak, dust, volcano, sunset, cyan, green, geekblue, purple).
var ZhCN = &Locale{ Code: "zh-CN", Name: "简体中文", OK: "确定", Cancel: "取消", Close: "关闭", Confirm: "确认", Back: "返回", Clear: "清除", Reset: "重置", Search: "搜索", Save: "保存", Delete: "删除", Edit: "编辑", Copy: "复制", Copied: "复制成功", More: "更多", Expand: "展开", Collapse: "收起", SelectAll: "全选", Loading: "加载中", Retry: "重试", GotIt: "知道了", NoData: "暂无数据", NoMore: "没有更多了", LoadMore: "加载更多", LoadFailed: "加载失败", TotalFmt: "共 %d 条", RangeTotalFmt: "第 %d-%d 条/共 %d 条", PageSizeFmt: "%d 条/页", PrevPage: "上一页", NextPage: "下一页", Prev5: "向前 5 页", Next5: "向后 5 页", JumpTo: "跳至", PageSuffix: "页", Placeholder: "请输入", SelectPlaceholder: "请选择", Required: "此项为必填项", NotFound: "无匹配数据", LabelColon: ":", SelectedFmt: "已选择 %d 项", Today: "今天", Now: "此刻", SelectDate: "请选择日期", SelectTime: "请选择时间", SelectDateTime: "请选择日期时间", StartDate: "开始日期", EndDate: "结束日期", PrevYear: "上一年", NextYear: "下一年", PrevMonth: "上个月", NextMonth: "下个月", RangeSeparator: "至", YearFmt: "%d年", MonthFmt: "%d月", YearMonthFmt: "%d年%d月", Weekdays: [7]string{"日", "一", "二", "三", "四", "五", "六"}, Months: [12]string{"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"}, WeekStart: time.Sunday, FilterConfirm: "确定", FilterReset: "重置", SortAsc: "点击升序", SortDesc: "点击降序", CancelSort: "取消排序", SelectionAll: "全选所有", SelectionInvert: "反选当页", ExpandRow: "展开行", CollapseRow: "关闭行", ItemUnit: "项", ItemsUnit: "项", Searching: "搜索中", Currency: "¥", MessageBoxTitle: "提示", Info: "提示", Success: "成功", Warning: "警告", Error: "错误", BackTop: "回到顶部", CollapseMenu: "折叠菜单", ExpandMenu: "展开菜单", Fullscreen: "全屏", ExitFullscreen: "退出全屏", PromptPlaceholder: "请输入内容", PromptInvalid: "输入的数据不合法", CloseAll: "全部关闭", Steps: "步骤", Calendar: CalendarLocale{Month: "月", Year: "年"}, Carousel: CarouselLocale{Prev: "上一张", Next: "下一张"}, Image: ImageLocale{ Preview: "预览", PreviewLabel: "预览图片", ClosePreview: "关闭预览", Prev: "上一张", Next: "下一张", ZoomIn: "放大", ZoomOut: "缩小", RotateLeft: "向左旋转", RotateRight: "向右旋转", FlipHorizontal: "左右翻转", FlipVertical: "上下翻转", }, ColorPicker: ColorPickerLocale{Presets: "推荐", None: "无", ClearColor: "清除颜色", Clear: "清空", Saturation: "饱和度", Hue: "色相", Alpha: "透明度", Format: "颜色格式", Value: "颜色值", Gradient: "渐变色标", Angle: "角度"}, Tour: TourLocale{Close: "关闭引导", Prev: "上一步", Next: "下一步", Finish: "结束导览"}, Command: CommandLocale{Placeholder: "输入命令或搜索…", Empty: "没有找到结果。"}, QRCode: QRCodeLocale{Expired: "二维码过期", Refresh: "点击刷新", Scanned: "已扫描"}, Table: TableLocale{FilterSearch: "在筛选项中搜索", FilterAll: "全部", Filter: "筛选", FixedLeft: "固定在左侧", NoFixed: "不固定", FixedRight: "固定在右侧", PinLeft: "固定在列首", PinRight: "固定在列尾", Unpin: "不固定", SelectRowFmt: "选择第 %d 行", Selections: "选择选项", SelectPage: "选择当页", SelectNone: "清空所有", SumText: "合计"}, Mobile: MobileLocale{PullToRefresh: "下拉刷新", ReleaseToRefresh: "释放立即刷新", Refreshed: "刷新成功", TapToRetry: ",点击重试", DayFmt: "%d日", HourFmt: "%02d时", MinuteFmt: "%02d分"}, Graph: GraphLocale{Diagram: "关系图", ER: "ER 图", GitGraph: "提交图", ZoomIn: "放大", ZoomOut: "缩小", FitView: "适应视图", AutoLayout: "自动布局", MiniMap: "小地图", PrimaryKey: "主键", ForeignKey: "外键", SummaryFmt: "%[1]d 个节点,%[2]d 条连线", CommitsFmt: "%d 个提交"}, Chart: ChartLocale{Total: "总计", Conversion: "转化率", Line: "折线图", Area: "面积图", Column: "柱状图", Bar: "条形图", Pie: "饼图", Donut: "环形图", Scatter: "散点图", Radar: "雷达图", Gauge: "仪表盘", Funnel: "漏斗图", Heatmap: "热力图", DualAxes: "双轴图", Liquid: "水波图", Sparkline: "迷你图", SummaryFmt: "%[1]s,%[2]d 个系列,%[3]d 个数据点", XRangeFmt: ";横轴从 %s 到 %s", YRangeFmt: ";数值从 %s 到 %s", ValueFmt: "%s:%s"}, ProTable: ProTableLocale{Query: "查询", Reload: "刷新", Density: "密度", DensityDefault: "默认", DensityMiddle: "中等", DensityCompact: "紧凑", ColumnSetting: "列设置", ColumnDisplay: "列展示", ClearSelection: "取消选择", LoadErrorFmt: "数据加载失败:%s"}, Transfer: TransferLocale{Source: "源列表", Target: "目标列表", SearchPlaceholder: "请输入搜索内容"}, Upload: UploadLocale{Trigger: "上传", Uploading: "文件上传中", Remove: "删除文件", Preview: "预览文件", Button: "点击上传", DragTitle: "点击或将文件拖拽到这里上传", DropPrefix: "将文件拖到此处,或", DoneFmt: "%s 上传成功", FailedFmt: "%s 上传失败", TooManyFmt: "%s:文件数量已达上限", BadTypeFmt: "%s:不支持该文件类型", TooLargeFmt: "%s 超过 %s", IsDirFmt: "%s 是文件夹"}, Markdown: MarkdownLocale{ImagePrefix: "[图片] ", CopyCode: "复制代码", Copied: "已复制"}, MarkdownEditor: MarkdownEditorLocale{Placeholder: "在此输入 Markdown……", Heading: "标题", Bold: "粗体", Italic: "斜体", Strike: "删除线", Code: "代码", Link: "链接", Quote: "引用", BulletList: "无序列表", OrderedList: "有序列表", Task: "任务", CodeBlock: "代码块", Table: "表格", Divider: "分割线", BoldSample: "粗体文字", ItalicSample: "斜体文字", StrikeSample: "删除文字", LinkSample: "链接文字", TableColumnFmt: "列 %d", Edit: "编辑", Split: "分屏", Preview: "预览"}, Form: FormLocale{Validating: "校验中…", RequiredInputFmt: "请输入%s", RequiredSelectFmt: "请选择%s", Submit: "提交", Query: "查询", PrevStep: "上一步", NextStep: "下一步", MoveUp: "上移", MoveDown: "下移", AddRow: "添加一行数据", Optional: "(可选)"}, A11y: A11yLocale{Navigation: "导航", Breadcrumb: "面包屑", Pagination: "分页", Notifications: "通知", Toolbar: "工具栏", Menu: "菜单", PageFmt: "第 %d 页", MoreActions: "更多操作", OpenMenu: "打开菜单", Remove: "移除", DragHandle: "拖动排序", Resize: "调整大小", Splitter: "分隔条", ShowPassword: "显示密码", HidePassword: "隐藏密码", Increase: "增加", Decrease: "减少", Avatar: "头像", Image: "图片", Chart: "图表", Progress: "进度", Rating: "评分", Color: "颜色", Loading: "加载中", SlideFmt: "第 %d 张,共 %d 张", RateFmt: "%[1]g 星,共 %[2]d 星", DateFmt: "%d年%d月%d日", DigitFmt: "第 %d 位,共 %d 位", RemoveFmt: "移除 %s", Day: "日", Hour: "时", Minute: "分", Second: "秒", MoveToTarget: "移到目标列表", MoveToSource: "移回源列表", PageSize: "每页条数"}, DatePicker: DatePickerLocale{SelectWeek: "请选择周", SelectMonth: "请选择月份", SelectQuarter: "请选择季度", SelectYear: "请选择年份", StartWeek: "开始周", EndWeek: "结束周", StartMonth: "开始月份", EndMonth: "结束月份", StartQuarter: "开始季度", EndQuarter: "结束季度", StartYear: "开始年份", EndYear: "结束年份", PrevDecade: "上一年代", NextDecade: "下一年代", WeekFmt: "%[1]d-第%[2]d周", QuarterFmt: "%[1]d-Q%[2]d", QuarterCellFmt: "Q%d"}, TimePicker: TimePickerLocale{StartTime: "开始时间", EndTime: "结束时间", AM: "上午", PM: "下午", Meridiem: "上午/下午"}, Tabs: TabsLocale{More: "更多标签页", Add: "添加标签页"}, Pagination: PaginationLocale{Jump: "跳转页码", Current: "当前页", Confirm: "确定", Prev3: "向前 3 页", Next3: "向后 3 页"}, Slider: SliderLocale{Min: "最小值", Max: "最大值"}, DropZone: DropZoneLocale{Name: "拖放区域", Release: "松开即可把文件放到这里"}, EditableTable: EditableTableLocale{Actions: "操作", DeleteConfirm: "删除此行?"}, PageContainer: PageContainerLocale{FooterToolbar: "页面操作"}, ProCard: ProCardLocale{MoreInfo: "更多信息"}, StatisticCard: StatisticCardLocale{Up: "上升", Down: "下降"}, ProField: ProFieldLocale{On: "开", Off: "关", StartFmt: "%s开始", EndFmt: "%s结束", Min: "最小值", Max: "最大值", RangeEndFmt: "%s:%s", JustNow: "刚刚", AgoFmt: "%s前", LaterFmt: "%s后", SecondFmt: "%d 秒", MinuteFmt: "%d 分钟", HourFmt: "%d 小时", DayFmt: "%d 天", MonthFmt: "%d 个月", YearFmt: "%d 年", InvalidJSON: "JSON 格式错误"}, ProDescriptions: ProDescriptionsLocale{EditFmt: "编辑%s"}, LightFilter: LightFilterLocale{Name: "筛选", ClearFmt: "清除%s", PillFmt: "%s:%s", More: "更多筛选", MoreFmt: "更多筛选(%d)"}, LoginForm: LoginFormLocale{AccountTab: "账户密码登录", MobileTab: "手机号登录", Username: "用户名", UsernameRequired: "请输入用户名", Password: "密码", PasswordRequired: "请输入密码", Mobile: "手机号", MobileRequired: "请输入手机号", MobileInvalid: "手机号格式错误", Captcha: "验证码", CaptchaRequired: "请输入验证码", GetCode: "获取验证码", ResendFmt: "%d 秒后重新获取", CodeSentFmt: "验证码已发送,%d 秒后可重新获取。", CodeReady: "现在可以重新获取验证码。", Remember: "自动登录", Forgot: "忘记密码", Submit: "登录", Others: "其他登录方式"}, Chat: ChatLocale{User: "我", Assistant: "助手", System: "系统", Messages: "消息列表", ScrollToBottom: "回到底部", Thinking: "正在思考", Generating: "正在生成", Placeholder: "输入消息,Enter 发送,Shift+Enter 换行", Send: "发送", Stop: "停止生成", Attach: "添加附件", Suggestions: "建议", Uploading: "上传中", Failed: "上传失败", EditPlaceholder: "编辑消息", Pending: "等待中", Running: "进行中", Done: "已完成", Error: "失败", StepsFmt: "%d/%d", SecondsFmt: "%.1f 秒", MinutesFmt: "%d 分 %d 秒", ToolCall: "工具调用", Arguments: "参数", Result: "结果", ApprovalTitle: "需要你的确认", AllowOnce: "允许", AllowSession: "本次会话允许", AllowAlways: "总是允许", Deny: "拒绝", Allowed: "已允许", Denied: "已拒绝", FeedbackPlaceholder: "补充说明(可选)", RiskWarning: "需确认", RiskDanger: "高风险", Conversations: "会话列表", Rename: "重命名", Untitled: "未命名对话", Today: "今天", Yesterday: "昨天", Last7Days: "近 7 天", Last30Days: "近 30 天", Earlier: "更早", Prompts: "提示词"}, SettingDrawer: SettingDrawerLocale{Open: "打开页面设置", Title: "页面设置", NavTheme: "整体风格", Light: "亮色菜单", Dark: "暗色菜单", RealDark: "暗色模式", PrimaryColor: "主题色", Layout: "导航模式", Side: "侧边菜单", Top: "顶部菜单", Mix: "混合菜单", ContentWidth: "内容区域宽度", Fluid: "流式", Fixed: "定宽", FixedHeader: "固定顶栏", FixSiderbar: "固定侧边菜单", ColorWeak: "色弱模式", Other: "其他设置", Compact: "紧凑模式", ColorFmt: "主题色 %s"}, CodeBlock: CodeBlockLocale{Code: "代码"}, JSONView: JSONViewLocale{Name: "JSON 查看器", CopyValue: "复制值", CopyPath: "复制路径", ExpandAll: "全部展开", CollapseAll: "全部折叠", ItemsFmt: "%d 项", KeysFmt: "%d 个键", Search: "搜索键或值", PrevMatch: "上一个匹配", NextMatch: "下一个匹配", MatchFmt: "%d/%d", NoMatch: "无匹配", ParseErrorFmt: "JSON 解析失败:%s"}, LogView: LogViewLocale{Name: "日志", Search: "搜索日志", PrevMatch: "上一个匹配", NextMatch: "下一个匹配", MatchFmt: "%d/%d", NoMatch: "无匹配", Wrap: "自动换行", Follow: "跟随最新", Level: "级别", AllLevels: "全部级别", Levels: [5]string{"Trace", "Debug", "Info", "Warn", "Error"}, LinesFmt: "%d 行"}, StatusBar: StatusBarLocale{Label: "状态栏"}, TitleBar: TitleBarLocale{Minimize: "最小化", Maximize: "最大化", Restore: "向下还原", WindowControls: "窗口控制"}, NotificationCenter: NotificationCenterLocale{MarkAllRead: "全部标为已读", ClearAll: "清空通知", Dismiss: "移除通知", Empty: "暂无通知", UnreadFmt: "%d 条未读", JustNow: "刚刚", MinutesAgoFmt: "%d 分钟前", HoursAgoFmt: "%d 小时前", DaysAgoFmt: "%d 天前"}, HotkeyInput: HotkeyInputLocale{Placeholder: "点击录制快捷键", Recording: "请按下组合键,Esc 取消", ClearLabel: "清除快捷键"}, Dock: DockLocale{Maximize: "最大化", Restore: "还原", Split: "向右拆分", Empty: "将标签页拖到这里", Group: "标签组"}, }
ZhCN is the Simplified Chinese locale (default).
var ZhTW = &Locale{ Code: "zh-TW", Name: "繁體中文", OK: "確定", Cancel: "取消", Close: "關閉", Confirm: "確認", Back: "返回", Clear: "清除", Reset: "重設", Search: "搜尋", Save: "儲存", Delete: "刪除", Edit: "編輯", Copy: "複製", Copied: "已複製", More: "更多", Expand: "展開", Collapse: "收合", SelectAll: "全選", Loading: "載入中", Retry: "重試", GotIt: "知道了", NoData: "暫無資料", NoMore: "沒有更多了", LoadMore: "載入更多", LoadFailed: "載入失敗", TotalFmt: "共 %d 筆", RangeTotalFmt: "第 %d-%d 筆/共 %d 筆", PageSizeFmt: "%d 筆/頁", PrevPage: "上一頁", NextPage: "下一頁", Prev5: "向前 5 頁", Next5: "向後 5 頁", JumpTo: "跳至", PageSuffix: "頁", Placeholder: "請輸入", SelectPlaceholder: "請選擇", Required: "此欄位為必填", NotFound: "無符合資料", LabelColon: ":", SelectedFmt: "已選擇 %d 項", Today: "今天", Now: "此刻", SelectDate: "請選擇日期", SelectTime: "請選擇時間", SelectDateTime: "請選擇日期時間", StartDate: "開始日期", EndDate: "結束日期", PrevYear: "上一年", NextYear: "下一年", PrevMonth: "上個月", NextMonth: "下個月", RangeSeparator: "至", YearFmt: "%d年", MonthFmt: "%d月", YearMonthFmt: "%d年%d月", Weekdays: [7]string{"日", "一", "二", "三", "四", "五", "六"}, Months: [12]string{"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"}, WeekStart: time.Sunday, FilterConfirm: "確定", FilterReset: "重設", SortAsc: "點擊升序", SortDesc: "點擊降序", CancelSort: "取消排序", SelectionAll: "全部選取", SelectionInvert: "反向選取", ExpandRow: "展開列", CollapseRow: "收合列", ItemUnit: "項", ItemsUnit: "項", Searching: "搜尋中", Currency: "NT$", MessageBoxTitle: "提示", Info: "提示", Success: "成功", Warning: "警告", Error: "錯誤", BackTop: "回到頂端", CollapseMenu: "收合選單", ExpandMenu: "展開選單", Fullscreen: "全螢幕", ExitFullscreen: "離開全螢幕", PromptPlaceholder: "請輸入內容", PromptInvalid: "輸入的資料不合法", CloseAll: "全部關閉", Steps: "步驟", Calendar: CalendarLocale{Month: "月", Year: "年"}, Carousel: CarouselLocale{Prev: "上一張", Next: "下一張"}, Image: ImageLocale{ Preview: "預覽", PreviewLabel: "預覽圖片", ClosePreview: "關閉預覽", Prev: "上一張", Next: "下一張", ZoomIn: "放大", ZoomOut: "縮小", RotateLeft: "向左旋轉", RotateRight: "向右旋轉", FlipHorizontal: "左右翻轉", FlipVertical: "上下翻轉", }, ColorPicker: ColorPickerLocale{Presets: "推薦", None: "無", ClearColor: "清除顏色", Clear: "清空", Saturation: "飽和度", Hue: "色相", Alpha: "透明度", Format: "色彩格式", Value: "色彩值", Gradient: "漸層色標", Angle: "角度"}, Tour: TourLocale{Close: "關閉導覽", Prev: "上一步", Next: "下一步", Finish: "結束導覽"}, Command: CommandLocale{Placeholder: "輸入指令或搜尋…", Empty: "找不到結果。"}, QRCode: QRCodeLocale{Expired: "QR 碼已過期", Refresh: "點擊重新整理", Scanned: "已掃描"}, Table: TableLocale{FilterSearch: "在篩選項目中搜尋", FilterAll: "全部", Filter: "篩選", FixedLeft: "固定在左側", NoFixed: "不固定", FixedRight: "固定在右側", PinLeft: "固定在列首", PinRight: "固定在列尾", Unpin: "不固定", SelectRowFmt: "選擇第 %d 列", Selections: "選取選項", SelectPage: "選取本頁", SelectNone: "清除所有選取", SumText: "合計"}, Mobile: MobileLocale{PullToRefresh: "下拉重新整理", ReleaseToRefresh: "放開立即重新整理", Refreshed: "重新整理成功", TapToRetry: ",點擊重試", DayFmt: "%d日", HourFmt: "%02d時", MinuteFmt: "%02d分"}, Graph: GraphLocale{Diagram: "關係圖", ER: "ER 圖", GitGraph: "提交圖", ZoomIn: "放大", ZoomOut: "縮小", FitView: "適應視圖", AutoLayout: "自動配置", MiniMap: "小地圖", PrimaryKey: "主鍵", ForeignKey: "外鍵", SummaryFmt: "%[1]d 個節點,%[2]d 條連線", CommitsFmt: "%d 個提交"}, Chart: ChartLocale{Total: "總計", Conversion: "轉換率", Line: "折線圖", Area: "面積圖", Column: "直條圖", Bar: "橫條圖", Pie: "圓餅圖", Donut: "環形圖", Scatter: "散佈圖", Radar: "雷達圖", Gauge: "儀表板", Funnel: "漏斗圖", Heatmap: "熱度圖", DualAxes: "雙軸圖", Liquid: "水波圖", Sparkline: "迷你圖", SummaryFmt: "%[1]s,%[2]d 個數列,%[3]d 個資料點", XRangeFmt: ";橫軸從 %s 到 %s", YRangeFmt: ";數值從 %s 到 %s", ValueFmt: "%s:%s"}, ProTable: ProTableLocale{Query: "查詢", Reload: "重新整理", Density: "密度", DensityDefault: "預設", DensityMiddle: "中等", DensityCompact: "緊湊", ColumnSetting: "欄位設定", ColumnDisplay: "欄位顯示", ClearSelection: "取消選擇", LoadErrorFmt: "資料載入失敗:%s"}, Transfer: TransferLocale{Source: "來源清單", Target: "目的清單", SearchPlaceholder: "請輸入搜尋內容"}, Upload: UploadLocale{Trigger: "上傳", Uploading: "檔案上傳中", Remove: "刪除檔案", Preview: "預覽檔案", Button: "點擊上傳", DragTitle: "點擊或將檔案拖曳到此區域上傳", DropPrefix: "將檔案拖到此處,或", DoneFmt: "%s 上傳成功", FailedFmt: "%s 上傳失敗", TooManyFmt: "%s:檔案數量已達上限", BadTypeFmt: "%s:不支援此檔案類型", TooLargeFmt: "%s 超過 %s", IsDirFmt: "%s 是資料夾"}, Markdown: MarkdownLocale{ImagePrefix: "[圖片] ", CopyCode: "複製程式碼", Copied: "已複製"}, MarkdownEditor: MarkdownEditorLocale{Placeholder: "在此輸入 Markdown……", Heading: "標題", Bold: "粗體", Italic: "斜體", Strike: "刪除線", Code: "程式碼", Link: "連結", Quote: "引用", BulletList: "項目清單", OrderedList: "編號清單", Task: "待辦", CodeBlock: "程式碼區塊", Table: "表格", Divider: "分隔線", BoldSample: "粗體文字", ItalicSample: "斜體文字", StrikeSample: "刪除文字", LinkSample: "連結文字", TableColumnFmt: "欄 %d", Edit: "編輯", Split: "分割", Preview: "預覽"}, Form: FormLocale{Validating: "驗證中…", RequiredInputFmt: "請輸入%s", RequiredSelectFmt: "請選擇%s", Submit: "提交", Query: "查詢", PrevStep: "上一步", NextStep: "下一步", MoveUp: "上移", MoveDown: "下移", AddRow: "新增一列資料", Optional: "(選填)"}, A11y: A11yLocale{Navigation: "導覽", Breadcrumb: "麵包屑", Pagination: "分頁", Notifications: "通知", Toolbar: "工具列", Menu: "選單", PageFmt: "第 %d 頁", MoreActions: "更多操作", OpenMenu: "開啟選單", Remove: "移除", DragHandle: "拖曳排序", Resize: "調整大小", Splitter: "分隔線", ShowPassword: "顯示密碼", HidePassword: "隱藏密碼", Increase: "增加", Decrease: "減少", Avatar: "頭像", Image: "圖片", Chart: "圖表", Progress: "進度", Rating: "評分", Color: "顏色", Loading: "載入中", SlideFmt: "第 %d 張,共 %d 張", RateFmt: "%[1]g 顆星,共 %[2]d 顆星", DateFmt: "%d年%d月%d日", DigitFmt: "第 %d 位,共 %d 位", RemoveFmt: "移除 %s", Day: "日", Hour: "時", Minute: "分", Second: "秒", MoveToTarget: "移到目標列表", MoveToSource: "移回來源列表", PageSize: "每頁筆數"}, DatePicker: DatePickerLocale{SelectWeek: "請選擇週", SelectMonth: "請選擇月份", SelectQuarter: "請選擇季度", SelectYear: "請選擇年份", StartWeek: "開始週", EndWeek: "結束週", StartMonth: "開始月份", EndMonth: "結束月份", StartQuarter: "開始季度", EndQuarter: "結束季度", StartYear: "開始年份", EndYear: "結束年份", PrevDecade: "上一個年代", NextDecade: "下一個年代", WeekFmt: "%[1]d-第%[2]d週", QuarterFmt: "%[1]d-Q%[2]d", QuarterCellFmt: "Q%d"}, TimePicker: TimePickerLocale{StartTime: "開始時間", EndTime: "結束時間", AM: "上午", PM: "下午", Meridiem: "上午/下午"}, Tabs: TabsLocale{More: "更多分頁", Add: "新增分頁"}, Pagination: PaginationLocale{Jump: "跳至頁碼", Current: "目前頁碼", Confirm: "確定", Prev3: "向前 3 頁", Next3: "向後 3 頁"}, Slider: SliderLocale{Min: "最小值", Max: "最大值"}, DropZone: DropZoneLocale{Name: "拖放區域", Release: "放開即可將檔案放到這裡"}, EditableTable: EditableTableLocale{Actions: "操作", DeleteConfirm: "確定刪除此列?"}, PageContainer: PageContainerLocale{FooterToolbar: "頁面操作"}, ProCard: ProCardLocale{MoreInfo: "更多資訊"}, StatisticCard: StatisticCardLocale{Up: "上升", Down: "下降"}, ProField: ProFieldLocale{On: "開", Off: "關", StartFmt: "%s開始", EndFmt: "%s結束", Min: "最小值", Max: "最大值", RangeEndFmt: "%s:%s", JustNow: "剛剛", AgoFmt: "%s前", LaterFmt: "%s後", SecondFmt: "%d 秒", MinuteFmt: "%d 分鐘", HourFmt: "%d 小時", DayFmt: "%d 天", MonthFmt: "%d 個月", YearFmt: "%d 年", InvalidJSON: "JSON 格式錯誤"}, ProDescriptions: ProDescriptionsLocale{EditFmt: "編輯%s"}, LightFilter: LightFilterLocale{Name: "篩選", ClearFmt: "清除%s", PillFmt: "%s:%s", More: "更多篩選", MoreFmt: "更多篩選(%d)"}, LoginForm: LoginFormLocale{AccountTab: "帳號密碼登入", MobileTab: "手機號碼登入", Username: "帳號", UsernameRequired: "請輸入帳號", Password: "密碼", PasswordRequired: "請輸入密碼", Mobile: "手機號碼", MobileRequired: "請輸入手機號碼", MobileInvalid: "手機號碼格式錯誤", Captcha: "驗證碼", CaptchaRequired: "請輸入驗證碼", GetCode: "取得驗證碼", ResendFmt: "%d 秒後重新取得", CodeSentFmt: "驗證碼已傳送,%d 秒後可重新取得。", CodeReady: "現在可以重新取得驗證碼。", Remember: "自動登入", Forgot: "忘記密碼", Submit: "登入", Others: "其他登入方式"}, Chat: ChatLocale{User: "我", Assistant: "助理", System: "系統", Messages: "訊息列表", ScrollToBottom: "回到底部", Thinking: "正在思考", Generating: "正在產生", Placeholder: "輸入訊息,Enter 傳送,Shift+Enter 換行", Send: "傳送", Stop: "停止產生", Attach: "新增附件", Suggestions: "建議", Uploading: "上傳中", Failed: "上傳失敗", EditPlaceholder: "編輯訊息", Pending: "等待中", Running: "進行中", Done: "已完成", Error: "失敗", StepsFmt: "%d/%d", SecondsFmt: "%.1f 秒", MinutesFmt: "%d 分 %d 秒", ToolCall: "工具呼叫", Arguments: "參數", Result: "結果", ApprovalTitle: "需要你的確認", AllowOnce: "允許", AllowSession: "本次對話允許", AllowAlways: "一律允許", Deny: "拒絕", Allowed: "已允許", Denied: "已拒絕", FeedbackPlaceholder: "補充說明(選填)", RiskWarning: "需確認", RiskDanger: "高風險", Conversations: "對話列表", Rename: "重新命名", Untitled: "未命名對話", Today: "今天", Yesterday: "昨天", Last7Days: "過去 7 天", Last30Days: "過去 30 天", Earlier: "更早", Prompts: "提示詞"}, SettingDrawer: SettingDrawerLocale{Open: "開啟頁面設定", Title: "頁面設定", NavTheme: "整體風格", Light: "亮色選單", Dark: "暗色選單", RealDark: "暗色模式", PrimaryColor: "主題色", Layout: "導覽模式", Side: "側邊選單", Top: "頂部選單", Mix: "混合選單", ContentWidth: "內容區域寬度", Fluid: "流式", Fixed: "定寬", FixedHeader: "固定頂欄", FixSiderbar: "固定側邊選單", ColorWeak: "色弱模式", Other: "其他設定", Compact: "緊湊模式", ColorFmt: "主題色 %s"}, CodeBlock: CodeBlockLocale{Code: "程式碼"}, JSONView: JSONViewLocale{Name: "JSON 檢視器", CopyValue: "複製值", CopyPath: "複製路徑", ExpandAll: "全部展開", CollapseAll: "全部摺疊", ItemsFmt: "%d 項", KeysFmt: "%d 個鍵", Search: "搜尋鍵或值", PrevMatch: "上一個相符項", NextMatch: "下一個相符項", MatchFmt: "%d/%d", NoMatch: "無相符項", ParseErrorFmt: "JSON 解析失敗:%s"}, LogView: LogViewLocale{Name: "日誌", Search: "搜尋日誌", PrevMatch: "上一個相符項", NextMatch: "下一個相符項", MatchFmt: "%d/%d", NoMatch: "無相符項", Wrap: "自動換行", Follow: "跟隨最新", Level: "等級", AllLevels: "全部等級", Levels: [5]string{"Trace", "Debug", "Info", "Warn", "Error"}, LinesFmt: "%d 行"}, StatusBar: StatusBarLocale{Label: "狀態列"}, TitleBar: TitleBarLocale{Minimize: "最小化", Maximize: "最大化", Restore: "還原", WindowControls: "視窗控制"}, NotificationCenter: NotificationCenterLocale{MarkAllRead: "全部標為已讀", ClearAll: "清除所有通知", Dismiss: "移除通知", Empty: "沒有通知", UnreadFmt: "%d 則未讀", JustNow: "剛剛", MinutesAgoFmt: "%d 分鐘前", HoursAgoFmt: "%d 小時前", DaysAgoFmt: "%d 天前"}, HotkeyInput: HotkeyInputLocale{Placeholder: "按一下以錄製快速鍵", Recording: "請按下組合鍵,Esc 取消", ClearLabel: "清除快速鍵"}, Dock: DockLocale{Maximize: "最大化", Restore: "還原", Split: "向右分割", Empty: "將分頁拖曳到這裡", Group: "分頁群組"}, }
ZhTW is the Traditional Chinese locale with Taiwan usage. LocaleByCode maps zh-TW, zh-HK, zh-MO and zh-Hant to it.
Functions ¶
func AcceptPatterns ¶
AcceptPatterns turns an accept list into file-dialog patterns ("*.png"); MIME wildcards expand to common extensions. Hosts use it to build the native dialog's filter (uihost.FilePicker).
func BreakpointMins ¶
BreakpointMins returns the minimum widths of SM..XXL for the theme: Ant 576/768/992/1200/1600, Element 768/992/1200/1920 (no xxl), shadcn Tailwind's sm..2xl 640/768/1024/1280/1536.
func CloseContextMenu ¶
CloseContextMenu closes the context menu opened for owner, if any, returning focus to owner when it was inside the menu.
func ContextMenuAt ¶
func ContextMenuAt(c *Context, owner ID, pos geom.Point, items []MenuItem, onSelect func(key string))
ContextMenuAt opens a context menu of items with its top-left corner at the window point pos (top-right in right-to-left scopes); it opens upwards / towards the inline start when it does not fit below / after the point. owner is the widget the menu belongs to: keyboard focus moves to the first enabled item on open (to the panel itself with ContextMenuOptions.NoAutoSelect, see ContextMenuAtWith) and returns to owner when the menu closes (an item is chosen, Escape, or a press outside the menu). onSelect receives the key of the chosen leaf item. The menu takes the theme, locale and direction of the scope ContextMenuAt is called in.
Call it once to open the menu (not every frame):
if p, ok := c.ContextMenuFor(area.ID()); ok {
ui.ContextMenuAt(c, area.ID(), p, items, func(key string) { ... })
}
Calling it again while the menu is open at the same point for the same owner only updates items and onSelect; a new point or owner reopens it.
func ContextMenuAtWith ¶
func ContextMenuAtWith(c *Context, owner ID, pos geom.Point, items []MenuItem, onSelect func(key string), opts ContextMenuOptions)
ContextMenuAtWith is ContextMenuAt with options. Options take effect when the menu (re)opens.
func ContextMenuOpen ¶
ContextMenuOpen reports whether a context menu opened for owner is shown.
func FieldSet ¶
func FieldSet(c *Context, f *FormW, fs ProFieldSet, vals ProValues)
FieldSet builds a field set as a labelled item of form f (outside a ProForm); vals holds the values. While vals has no fs.Key entry it is filled with a copy of fs.Initial (checked every frame, like ProForm's initial values), so an existing value is never overwritten; to clear the set store nil parts (e.g. []any{nil, nil}) instead of deleting the key.
func FillLocale ¶
func FillLocale(l, base *Locale)
FillLocale copies every empty text of l (string fields, entries of the fixed arrays, fields of the component groups and missing Extra keys) from base. RegisterLocale calls it with EnUS so a partial translation never shows blank labels, and new fields added later fall back automatically. WeekStart is not copied (its zero value, Sunday, is valid).
func FormStatus ¶
FormStatus returns the status string to pass to a control for an error.
func FormatDuration ¶
FormatDuration renders d with tokens D (days), HH, mm, ss, SSS. Larger units absent from the format carry into the largest present one.
func FormatMoney ¶
FormatMoney formats amount in a currency for loc. currency is an ISO 4217 code or a symbol; "" means loc.Currency (itself a code or a symbol), else the default of the locale's region (see ProColumn.Currency). A nil loc formats like zh-CN.
func FormatNumber ¶
FormatNumber formats v with thousands separators.
func HoverDelay ¶
HoverDelay turns a raw hover signal into a debounced open state: it becomes true after hovering has held for enter and false after it has been off for leave (Ant mouseEnterDelay/mouseLeaveDelay, Element show-after/hide-after). key identifies the trigger across frames.
func Invalidate ¶
func Invalidate(w Window)
Invalidate requests a frame of the window w; it is safe to call from any goroutine. Equivalent to w.Invalidate, but tolerates a nil window.
func Key ¶
Key runs fn in an identity scope named by key, so widgets inside keep their state when siblings are inserted or removed (list rows, tabs).
func MarkdownInsertBlock ¶
MarkdownInsertBlock inserts block on its own lines at position at; the caret lands on the block's first empty line (or after it).
func MarkdownLinePrefix ¶
MarkdownLinePrefix toggles prefix on every line touched by [a,b).
func MarkdownWrap ¶
MarkdownWrap surrounds the selection [a,b) with pre/suf, or inserts pre+placeholder+suf at a when nothing is selected; the inner text stays selected. Wrapping an already wrapped selection unwraps it.
func MessageDestroy ¶
MessageDestroy closes the message with key ("" closes all).
func NotificationDestroy ¶
NotificationDestroy closes the card with key ("" closes all).
func OpenDialogs ¶
OpenDialogs returns how many Confirm/MessageBox/Prompt dialogs are open.
func ProFormItems ¶
ProFormItems builds the form items of fields inside f (for use in ProForm.Children, ProFormGroup bodies and custom form layouts).
func ProFormat ¶
ProFormat renders a value as text for a value type, formatting money like zh-CN (ProFormatLocale(nil, ...)). Code with a Context should call ProFormatLocale(c.Locale(), ...) so money follows the active Locale, as ProTable, ProDescriptions and the other Pro components do.
func ProFormatLocale ¶
ProFormatLocale is ProFormat with money in the currency and number style of loc (see FormatMoney).
func ProLayout ¶
func ProLayout(c *Context, cfg ProLayoutConfig, content func())
ProLayout builds an Ant Design Pro style admin shell: sider with logo and menu, header with collapse toggle, breadcrumb and user, page title, then content, then footer. cfg.Layout selects the top and mix layouts.
ConfigProvider.Defaults("ProLayout", ...) keys: "layout" (string), "noPadding" (bool), "siderWidth" (number), "breakpoint" (Breakpoint), "title", "footer" (string), "navTheme" ("light" | "dark"), "contentWidth" ("Fluid" | "Fixed"), "fixedHeader", "fixSiderbar" (bool).
func ProSettingsProvider ¶
func ProSettingsProvider(c *Context, s *ProSettings, fn func())
ProSettingsProvider builds fn inside a ConfigProvider following s: realDark selects the dark algorithm, PrimaryColor the brand color, Compact the compact sizes, and ColorWeak the high-contrast theme. Like ConfigProvider.Theme, the theme applies to the whole window: call it at the root.
func QRDataCapacity ¶
QRDataCapacity returns the number of data codewords of version v at level.
func QRFormatBits ¶
QRFormatBits returns the 15-bit masked format information.
func QRVersionBits ¶
QRVersionBits returns the 18-bit version information (v >= 7).
func RegisterLocale ¶
func RegisterLocale(l *Locale)
RegisterLocale adds (or replaces) a locale under l.Code. Empty texts are filled from EnUS (see FillLocale), so a partial translation works:
ko := &ui.Locale{Code: "ko-KR", Name: "한국어", OK: "확인", Cancel: "취소"}
ui.RegisterLocale(ko)
func SetCodeHighlighter ¶
func SetCodeHighlighter(h CodeHighlighter)
SetCodeHighlighter installs the highlighter CodeBlock and Markdown use when they are not given one of their own (nil: plain text).
ui.SetCodeHighlighter(codehl.New())
func SetDefaultDirection ¶
func SetDefaultDirection(d Direction)
SetDefaultDirection sets the window-level direction used where no ConfigProvider decides: pages without a provider and the global layers. DirAuto (the default) derives it from the default locale. Hosts that follow the system layout direction inject it here. It takes effect on the next frame.
func SetDefaultLocale ¶
func SetDefaultLocale(l *Locale)
SetDefaultLocale sets the locale used outside any ConfigProvider.
func SetHoverOpen ¶
SetHoverOpen forces the debounced state (used when a click closes a hover-triggered popup).
func ShortcutKeys ¶
ShortcutKeys returns the key caps of an accelerator for this platform: on macOS the modifier symbols in Apple's order ("⌃", "⌥", "⇧", "⌘") then the key, elsewhere "Ctrl", "Alt", "Shift", "Win" / "Super" then the key; nil when accel does not parse. Kbd draws one cap.
func ShortcutLabel ¶
ShortcutLabel returns an accelerator as one string for this platform: "⌘⇧K" on macOS, "Ctrl+Shift+K" elsewhere ("" when it does not parse). Use it for MenuItem.Shortcut and similar hints.
func SkeletonAvatar ¶
SkeletonAvatar adds an avatar placeholder.
func SkeletonButton ¶
func SkeletonButton(c *Context, size ControlSize, shape string, active bool)
SkeletonButton adds a button-shaped placeholder (shape: "default", "round", "circle").
func SkeletonImage ¶
SkeletonImage adds a picture placeholder with a mountain glyph.
func SkeletonInput ¶
func SkeletonInput(c *Context, size ControlSize, active bool)
SkeletonInput adds an input-shaped placeholder.
func State ¶
State returns retained per-widget state, creating it with init on first use. State that is not requested for a while is dropped.
func ToggleMarkdownTask ¶
ToggleMarkdownTask flips the index-th task checkbox ("- [ ]" / "- [x]", in document order) in src and returns the new source.
Types ¶
type A11yLocale ¶
type A11yLocale struct {
A11yLocale holds accessible names and descriptions that are read by screen readers but not shown (icon-only controls, regions, summaries).
type ANSIColor ¶
type ANSIColor struct {
Kind ANSIColorKind
Index uint8 // ANSIIndexed
R, G, B uint8 // ANSIRGB
}
ANSIColor is a foreground or background color of an SGR sequence.
type ANSIColorKind ¶
type ANSIColorKind uint8
ANSIColorKind says how an ANSIColor is given.
const ( ANSIDefault ANSIColorKind = iota ANSIIndexed ANSIRGB )
The color kinds: the default color, one of the 256 indexed colors (0–15 are the theme's ANSI colors, 16–231 the 6×6×6 cube, 232–255 grays) or a 24-bit color.
type ANSIParser ¶
type ANSIParser struct {
// contains filtered or unexported fields
}
ANSIParser strips escape sequences from lines of terminal output and turns SGR sequences ("\x1b[1;31m") into styled spans. The style carries over from one line to the next, as in a terminal. Supported: reset, bold, faint, italic, underline, inverse, strike-through and their resets; the 8 + 8 colors (30–37, 90–97, 40–47, 100–107), 256 colors (38;5;n) and 24-bit colors (38;2;r;g;b, also with ":" separators). Other CSI sequences, OSC strings and control characters are removed; a carriage return inside a line discards what came before it (progress output). The zero value is ready to use.
func (*ANSIParser) Line ¶
func (p *ANSIParser) Line(s string, dst []ANSISpan) (string, []ANSISpan)
Line parses one line (without "\n"): it returns the plain text and appends its styled spans (default-styled text has none) to dst.
func (*ANSIParser) Reset ¶
func (p *ANSIParser) Reset()
Reset returns the parser to the default style.
type AccessibilityHost ¶
type AccessibilityHost interface {
AccessibilityEnabled() bool
// AccessibilityUpdate delivers the tree of the last frame. changed
// lists added and modified nodes and then removed ones (tree.Node
// returns nil for those). tree.Focus is the focused node and
// tree.Announcements the messages to speak once.
AccessibilityUpdate(tree *a11y.Tree, changed []a11y.NodeID)
}
AccessibilityHost is an optional interface of Window. A platform backend implements it to receive the semantics tree and expose it through the native accessibility API (NSAccessibility, UI Automation, AT-SPI, UIAccessibility, AccessibilityNodeInfo); docs/accessibility.md has the role mapping and the expected update protocol.
The runner calls AccessibilityEnabled at the start of every frame (it must be cheap) and, while it returns true, AccessibilityUpdate after every frame whose tree differs from the previous one. When an assistive technology attaches, the host flips its flag and calls Runner.Invalidate so the first full tree (every node reported as changed) arrives promptly. Both methods run on the UI thread. The tree must not be modified; it stays valid after the call (the runner builds a new one each frame).
type AddonW ¶
type AddonW struct {
// contains filtered or unexported fields
}
AddonW is a static (or clickable) label attached before/after an input inside Compact (Ant addonBefore/addonAfter, Element prepend/append).
func (*AddonW) A11yLabel ¶
A11yLabel sets the accessible name (needed for an icon-only addon button).
func (*AddonW) Clicked ¶
Clicked makes the addon a button (Element append button) and reports a click.
func (*AddonW) Size ¶
func (a *AddonW) Size(s ControlSize) *AddonW
type AffixW ¶
type AffixW struct {
// contains filtered or unexported fields
}
AffixW pins its content to the viewport (or to a scroll container) once it would scroll past OffsetTop / OffsetBottom.
func Affix ¶
Affix starts a pinned block (default: offset top 0 in the window). Give it Target(scrollBox.ID()) when the page scrolls inside a container.
ConfigProvider.Defaults("Affix", ...) keys: "offsetTop", "offsetBottom" (numbers). Element's position="bottom" + offset is OffsetBottom.
func (*AffixW) Changed ¶
Changed reports a pin state change on the first build after it was detected.
func (*AffixW) OffsetBottom ¶
OffsetBottom pins the content this far above the bottom of the viewport.
type AlertEffect ¶
type AlertEffect string
AlertEffect selects how an Alert is filled (Element's effect).
const ( // AlertEffectLight tints the box with the light status background // (the default). AlertEffectLight AlertEffect = "light" // AlertEffectDark fills the box with the solid status color and // draws the text and icon on it in a contrasting color. AlertEffectDark AlertEffect = "dark" )
type AlertW ¶
type AlertW struct {
// contains filtered or unexported fields
}
AlertW is an inline status banner.
func Alert ¶
Alert adds a banner; call Show after options. status: success, info, warning, error. title is antd's title (v6; message before).
As in antd and Element Plus the icon is off unless ShowIcon(true) (or Banner, which shows it by default).
ConfigProvider.Defaults("Alert", ...) keys: "showIcon", "closable", "banner" (bool), "variant" (string: "outlined" | "filled").
Under shadcn/ui it is the bordered Alert card with an outlined (lucide-style) icon; "error" is the destructive variant.
func (*AlertW) Action ¶
Action builds an operation area at the right of the text (Ant action), e.g. a small button.
func (*AlertW) Banner ¶
Banner styles the alert as a page-top banner: no border or radius, and the icon on unless ShowIcon(false) (antd banner).
func (*AlertW) Center ¶
Center centers the icon and text horizontally (Element center); the close button stays at the end.
func (*AlertW) CloseDisabled ¶
CloseDisabled disables the close button (antd closable.disabled); ConfigProvider.ComponentDisabled disables it too.
func (*AlertW) CloseIcon ¶
CloseIcon replaces the close icon and makes the alert closable (antd closable.closeIcon).
func (*AlertW) CloseText ¶
CloseText shows text instead of the close icon and makes the alert closable (EP close-text).
func (*AlertW) Description ¶
func (*AlertW) Effect ¶
func (a *AlertW) Effect(e AlertEffect) *AlertW
Effect selects the fill: AlertEffectLight (default) or AlertEffectDark, the solid status color with contrasting text (Element effect="dark").
type AnchorItem ¶
type AnchorItem struct {
Key, Title string
Children []AnchorItem
}
AnchorItem is one link of an Anchor; Key matches an AnchorSection.
type AnchorSectionW ¶
type AnchorSectionW struct {
*Box
// contains filtered or unexported fields
}
AnchorSectionW is the section AnchorSection returns; it embeds the section's Box.
func AnchorSection ¶
func AnchorSection(c *Context, key string, fn func(), opts ...layout.Option) *AnchorSectionW
AnchorSection wraps a block of page content that an Anchor link with the same key scrolls to and highlights.
type AnchorW ¶
type AnchorW struct {
// contains filtered or unexported fields
}
AnchorW is an in-page table of contents that follows scrolling.
func Anchor ¶
func Anchor(c *Context, items []AnchorItem) *AnchorW
Anchor starts a table of contents; call Target with the scroll container holding the AnchorSections, then Show.
func (*AnchorW) Bounds ¶
Bounds sets how close (px) a section's top must come to the offset line to become active (antd bounds 5, Element bound 15; default from AnchorToken.Bounds).
func (*AnchorW) CurrentAnchor ¶
CurrentAnchor customizes the highlighted link (antd getCurrentAnchor): fn gets the key scrolling selected and returns the key to highlight.
func (*AnchorW) Direction ¶
Direction lays the links out "vertical" (default) or "horizontal" (antd direction, Element direction).
func (*AnchorW) Horizontal ¶
Horizontal lays links out in a row with a bottom ink bar.
func (*AnchorW) TargetOffset ¶
TargetOffset scrolls sections this far below the container top (fixed headers) and uses it for the active test.
type AppAPI ¶
type AppAPI struct {
// contains filtered or unexported fields
}
AppAPI opens messages, notifications and confirm boxes with the configuration of the enclosing App (Ant App.useApp()).
func UseApp ¶
UseApp returns the API of the innermost App being built (outside an App it opens plain messages with the defaults).
func (AppAPI) Confirm ¶
func (a AppAPI) Confirm(o ConfirmOptions) *ConfirmRef
Confirm opens a confirm box (see Confirm; Ant modal.confirm).
func (AppAPI) Info ¶
func (a AppAPI) Info(o ConfirmOptions) *ConfirmRef
Info opens an alert box (see MessageBox; Ant modal.info).
func (AppAPI) Message ¶
func (a AppAPI) Message(status, content string) *MessageRef
Message opens a message (see Message), closing the oldest ones beyond MaxCount.
func (AppAPI) Notification ¶
func (a AppAPI) Notification(status, title string) *NotificationRef
Notification opens a notification (see Notification), closing the oldest cards beyond MaxCount.
type AppMessageConfig ¶
type AppMessageConfig struct {
Duration time.Duration // default display time (0: MessageDuration)
MaxCount int // most messages on screen; the oldest close first (0: no limit)
// contains filtered or unexported fields
}
AppMessageConfig configures the messages opened inside an App (Ant App message prop).
type AppNotificationConfig ¶
type AppNotificationConfig struct {
Placement NotifyPlacement
PlacementSet bool // Placement given (NotifyTopEnd is the zero value)
Duration time.Duration // 0: the default
MaxCount int // most cards on screen (0: no limit)
ShowProgress bool
// contains filtered or unexported fields
}
AppNotificationConfig configures the notifications opened inside an App (Ant App notification prop).
type AppW ¶
type AppW struct {
// contains filtered or unexported fields
}
AppW builds an App.
func App ¶
App starts an application root; chain options, then Body.
ConfigProvider.Defaults("App", ...) keys: "messageMaxCount", "notificationMaxCount" (number).
func (*AppW) Message ¶
func (a *AppW) Message(cfg AppMessageConfig) *AppW
Message sets the message configuration.
func (*AppW) Notification ¶
func (a *AppW) Notification(cfg AppNotificationConfig) *AppW
Notification sets the notification configuration.
type ApprovalChoice ¶
type ApprovalChoice uint8
ApprovalChoice is a decision on an Approval.
const ( ApproveNone ApprovalChoice = iota // undecided ApproveOnce // allow this request ApproveSession // allow for the rest of the conversation ApproveAlways // allow from now on ApproveDeny )
type ApprovalW ¶
type ApprovalW struct {
// contains filtered or unexported fields
}
ApprovalW is a card asking the user to allow or deny an action (a tool call, a command, a file write) before the assistant goes on.
func Approval ¶
Approval adds a permission card; title "" uses Locale.Chat.ApprovalTitle.
a := ui.Approval(c, "").Description("运行 shell 命令").Command("rm -rf build", "sh")
if d, ok := a.Decided(); ok { resolve(d) }
func (*ApprovalW) Choices ¶
func (w *ApprovalW) Choices(ch ...ApprovalChoice) *ApprovalW
Choices sets the buttons in order (default Deny, Always, Once; the last one is the primary button).
func (*ApprovalW) Decided ¶
func (w *ApprovalW) Decided() (ApprovalChoice, bool)
Decided returns the choice clicked this frame.
func (*ApprovalW) Decision ¶
func (w *ApprovalW) Decision(d ApprovalChoice) *ApprovalW
Decision shows a decided card: the buttons give way to the outcome.
func (*ApprovalW) Description ¶
Description explains what will happen.
func (*ApprovalW) Feedback ¶
Feedback adds an optional note input bound to *note, sent with the decision.
type AspectRatioW ¶
type AspectRatioW struct {
// contains filtered or unexported fields
}
AspectRatioW is a container that keeps a fixed width-to-height ratio (shadcn/ui AspectRatio, CSS aspect-ratio): it takes the width its parent gives it and is ratio times less tall; the content fills it.
func AspectRatio ¶
func AspectRatio(c *Context, ratio float32, fn func(), opts ...layout.Option) *AspectRatioW
AspectRatio adds a ratio box (width / height, e.g. 16.0/9) and builds fn inside it, stretched over the whole box:
ui.AspectRatio(c, 16.0/9, func() { ui.Image(c, src).Fill() }).Radius(8)
In a column it spans the column's width; where nothing gives it a width (a row, a stack) it is zero wide unless MaxWidth or layout options set one. A ratio <= 0 is taken as 1.
func (*AspectRatioW) A11yLabel ¶
func (w *AspectRatioW) A11yLabel(s string) *AspectRatioW
A11yLabel exposes the box as a named group (a figure caption).
func (*AspectRatioW) MaxWidth ¶
func (w *AspectRatioW) MaxWidth(px float32) *AspectRatioW
MaxWidth limits the width (and with it the height).
func (*AspectRatioW) Radius ¶
func (w *AspectRatioW) Radius(r float32) *AspectRatioW
Radius rounds the corners and clips the content to them.
func (*AspectRatioW) Ratio ¶
func (w *AspectRatioW) Ratio() float32
Ratio returns the width-to-height ratio in effect.
func (*AspectRatioW) Rect ¶
func (w *AspectRatioW) Rect() geom.Rect
Rect returns the box rectangle of the last frame.
type AuditIssue ¶
type AuditIssue struct {
Kind AuditKind
Role a11y.Role
Name string // accessible name (empty for missing-name)
Label string // the widget's internal label (to locate it)
Rect geom.Rect
Interactive bool // the node is a control (counts toward the zero-missing-name goal)
Detail string // contrast pair, reason
}
AuditIssue is one finding of Driver.Audit.
func AuditTheme ¶
func AuditTheme(th *theme.Theme) []AuditIssue
AuditTheme reports the contrast findings of th as audit issues.
func (AuditIssue) String ¶
func (i AuditIssue) String() string
type AuditKind ¶
type AuditKind uint8
AuditKind classifies an accessibility audit finding.
Append-only: never reorder or insert; the zero value stays AuditMissingName.
const ( // AuditMissingName: an interactive (or image / dialog) node without an // accessible name. Icon-only controls need an A11yLabel / label. AuditMissingName AuditKind = iota // AuditNoRole: a pointer target that declares no role; it is exposed // as a generic button so it stays reachable, but the widget should // annotate it. AuditNoRole // AuditNotKeyboard: an interactive widget that Tab cannot reach and // that is not an item of a keyboard-operated composite (list, menu, // tree, grid, popup of a focusable trigger). AuditNotKeyboard // AuditContrast: a theme token pair below its WCAG contrast minimum. AuditContrast // AuditUnmirroredIcon (warning): a directional icon (an arrow, a // chevron, text lines) drawn without mirroring in a right-to-left // scope, so it points against the reading direction. Draw it with the // direction-aware helper (Context.paintIcon) instead of icon.Draw. AuditUnmirroredIcon )
type AuditReport ¶
type AuditReport struct {
Issues []AuditIssue
Nodes int // semantic nodes in the tree
Interactive int // interactive nodes in the tree
}
AuditReport is the result of Driver.Audit.
func (AuditReport) Count ¶
func (r AuditReport) Count(k AuditKind) int
Count returns the number of issues of kind k.
func (AuditReport) MissingInteractiveNames ¶
func (r AuditReport) MissingInteractiveNames() int
MissingInteractiveNames counts interactive nodes without a name (the gallery gate keeps it at zero).
func (AuditReport) String ¶
func (r AuditReport) String() string
String lists the issues, one per line.
type AutoCompleteW ¶
type AutoCompleteW struct {
// contains filtered or unexported fields
}
AutoCompleteW is a text input with a suggestion dropdown.
func AutoComplete ¶
func AutoComplete(c *Context, val *string, opts []Option) *AutoCompleteW
AutoComplete adds an input bound to *val that suggests opts (filtered by the typed text). Picking a suggestion writes its Value.
func (*AutoCompleteW) A11yLabel ¶
func (w *AutoCompleteW) A11yLabel(s string) *AutoCompleteW
A11yLabel sets the accessible name (inside a FormItem the item label is used; the placeholder is the last resort).
func (*AutoCompleteW) AllowClear ¶
func (w *AutoCompleteW) AllowClear() *AutoCompleteW
func (*AutoCompleteW) Changed ¶
func (w *AutoCompleteW) Changed() bool
Changed reports a typed edit or a picked suggestion this frame.
func (*AutoCompleteW) DataVersion ¶
func (w *AutoCompleteW) DataVersion(v int) *AutoCompleteW
DataVersion tells the autocomplete that the options slice was modified in place (a virtual list caches its matches and label widths by slice identity, length and this number): after editing options of the same slice without changing its length, change v (or pass a new slice) so the matches and the list's width are recomputed on the next frame.
func (*AutoCompleteW) Debounce ¶
func (w *AutoCompleteW) Debounce(d time.Duration) *AutoCompleteW
Debounce sets the delay before a Remote call.
func (*AutoCompleteW) Disabled ¶
func (w *AutoCompleteW) Disabled(on bool) *AutoCompleteW
func (*AutoCompleteW) Highlight ¶
func (w *AutoCompleteW) Highlight() *AutoCompleteW
Highlight emphasises the matched part of each suggestion.
func (*AutoCompleteW) IsOpen ¶
func (w *AutoCompleteW) IsOpen() bool
IsOpen reports whether the dropdown (suggestions or the loading row) is shown.
func (*AutoCompleteW) Layout ¶
func (w *AutoCompleteW) Layout(o ...layout.Option) *AutoCompleteW
func (*AutoCompleteW) Loading ¶
func (w *AutoCompleteW) Loading(on bool) *AutoCompleteW
Loading shows a spinner and the loading text in the dropdown (in place of the suggestions with Remote, or when there are none).
func (*AutoCompleteW) NotFoundContent ¶
func (w *AutoCompleteW) NotFoundContent(s string) *AutoCompleteW
NotFoundContent keeps the dropdown open with text s when nothing matches (Ant notFoundContent; without it an empty list closes).
func (*AutoCompleteW) Open ¶
func (w *AutoCompleteW) Open() *AutoCompleteW
Open forces the dropdown open (screenshots, tests).
func (*AutoCompleteW) Placeholder ¶
func (w *AutoCompleteW) Placeholder(s string) *AutoCompleteW
func (*AutoCompleteW) Placement ¶
func (w *AutoCompleteW) Placement(p Placement) *AutoCompleteW
Placement sets where the suggestions open: BottomStart (default), BottomEnd, TopStart or TopEnd (Ant placement, Element placement); they flip when there is no room. ConfigProvider.Defaults("AutoComplete", "placement") takes the Ant names.
func (*AutoCompleteW) Prefix ¶
func (w *AutoCompleteW) Prefix(ic *icon.Icon) *AutoCompleteW
func (*AutoCompleteW) Remote ¶
func (w *AutoCompleteW) Remote(fn func(query string)) *AutoCompleteW
Remote turns on server-side suggestions: fn receives the typed text after Debounce (300ms by default) on the UI thread. Start the request in the background, pass Loading(true) while it runs, then replace the options given to AutoComplete (they are shown as-is, not filtered by the typed text) and wake the window with Invalidate. A Source, when set, still computes the options.
ui.AutoComplete(c, &q, hits).Remote(func(s string) { go fetch(s) }).Loading(busy)
func (*AutoCompleteW) Selected ¶
func (w *AutoCompleteW) Selected() (string, bool)
Selected returns the value picked this frame and whether one was picked.
func (*AutoCompleteW) Size ¶
func (w *AutoCompleteW) Size(s ControlSize) *AutoCompleteW
func (*AutoCompleteW) Source ¶
func (w *AutoCompleteW) Source(fn func(q string) []Option) *AutoCompleteW
Source computes suggestions from the typed text (replaces filtering of the static options).
func (*AutoCompleteW) Status ¶
func (w *AutoCompleteW) Status(s string) *AutoCompleteW
func (*AutoCompleteW) TriggerOnFocus ¶
func (w *AutoCompleteW) TriggerOnFocus() *AutoCompleteW
TriggerOnFocus opens the suggestions as soon as the input gains focus (Element trigger-on-focus), before anything is typed: the options (or Source's result) for the current text, all of them when it is empty. With Remote the callback runs at once for the current text.
func (*AutoCompleteW) Variant ¶
func (w *AutoCompleteW) Variant(v FieldVariant) *AutoCompleteW
Variant sets the frame look (FieldOutlined by default; the inner Input's Variant).
func (*AutoCompleteW) Virtual ¶
func (w *AutoCompleteW) Virtual(on bool) *AutoCompleteW
Virtual forces the virtual suggestion list on or off; by default lists longer than 100 suggestions are virtual (only the visible rows and the keyboard row are built; the dropdown keeps the width, height and scroll range of the full list, but suggestions out of view are not in the accessibility tree). Labels, values and Disabled are always read live. A virtual list of static options keeps which options match while the options slice (identity and length), the typed text and the DataVersion stay the same, and measures label widths once per slice, DataVersion and theme: an option renamed in place (same slice, same length) does not join or leave the matches, nor change the list's width, until the text, the slice or the DataVersion (or the theme pointer) changes. Virtual(false) builds every row.
func (*AutoCompleteW) Width ¶
func (w *AutoCompleteW) Width(px float32) *AutoCompleteW
type AvatarGroupW ¶
type AvatarGroupW struct {
// contains filtered or unexported fields
}
AvatarGroupW stacks avatars with overlap.
func AvatarGroup ¶
func AvatarGroup(c *Context) *AvatarGroupW
AvatarGroup starts a group; call Body with the avatars.
ConfigProvider.Defaults("AvatarGroup", ...) keys: "maxCount" (int).
func (*AvatarGroupW) Max ¶
func (g *AvatarGroupW) Max(n int) *AvatarGroupW
Max folds avatars beyond n into a "+k" avatar; hovering it shows the folded avatars in a popover (antd max.count / max.popover).
func (*AvatarGroupW) MaxPopover ¶
func (g *AvatarGroupW) MaxPopover(on bool, placement, trigger string) *AvatarGroupW
MaxPopover shows (default) or hides the popover listing the folded avatars; placement and trigger as in Popover (default "top", "hover"). Element's collapse-avatars-tooltip is MaxPopover(true, "top", "hover").
func (*AvatarGroupW) MoreBg ¶
func (g *AvatarGroupW) MoreBg(col theme.Color) *AvatarGroupW
MoreBg sets the background of the "+k" avatar (antd max.style).
func (*AvatarGroupW) Size ¶
func (g *AvatarGroupW) Size(px float32) *AvatarGroupW
Size sets the size of the "+k" avatar (match your avatars; default 32).
type AvatarW ¶
type AvatarW struct {
// contains filtered or unexported fields
}
AvatarW is a round user avatar.
func Avatar ¶
Avatar shows text initials (or an icon when label is "").
ConfigProvider.Defaults("Avatar", ...) keys: "size" (float32 px or ControlSize), "shape" ("circle" | "square"), "gap" (px, default 4).
func (*AvatarW) A11yLabel ¶
A11yLabel sets the accessible name (the person's name; the default is the avatar text, or "avatar" for an icon or image avatar).
func (*AvatarW) Gap ¶
Gap sets the space kept on each side of the text; longer text is scaled down to fit (antd gap, default 4).
type BackTopW ¶
type BackTopW struct {
// contains filtered or unexported fields
}
BackTopW is the "back to top" floating button of a scroll container.
func BackTop ¶
BackTop adds the button for the scroll container target (ScrollBox.ID()); it appears once scrolled past VisibilityHeight (antd 400, Element 200: FloatButtonToken.BackTop*) and scrolls back smoothly in Duration (450ms, antd duration). Call Show. It is antd's FloatButton.BackTop: Icon, Description, Primary and Square style it like a FloatButton.
func (*BackTopW) Description ¶
Description shows a text under the icon in a square button (antd 6 content, description deprecated).
func (*BackTopW) VisibilityHeight ¶
VisibilityHeight sets the scroll distance after which it shows.
type BackWindow ¶
type BackWindow interface {
SetBackHandling(on bool)
}
BackWindow is implemented by windows on platforms with a system Back action. The runner calls SetBackHandling after a frame whenever Context.WantBack changes (never twice with the same value; the first call is SetBackHandling(true)). While on, the host delivers Back as KeyEscape down and up; while off, Back does what the platform does without the UI (go back in the page stack, leave the app). UI thread.
type BadgeRibbonW ¶
type BadgeRibbonW struct {
*Box
// contains filtered or unexported fields
}
BadgeRibbonW is the ribbon wrapper BadgeRibbon returns; it embeds the wrapper's Box.
func BadgeRibbon ¶
func BadgeRibbon(c *Context, label, color, placement string, fn func()) *BadgeRibbonW
BadgeRibbon wraps fn's content (usually a card) with a corner ribbon. placement is "end" (default) or "start" (logical: mirrored in RTL); color as in Badge.Color. With placement "", the "placement" key of ConfigProvider.Defaults("BadgeRibbon", ...) applies.
type BadgeW ¶
type BadgeW struct {
// contains filtered or unexported fields
}
BadgeW is a badge: count / dot / text bubble, overflow, show-zero, preset or custom color, offset, small size, standalone use and the status form with the "processing" ripple.
func Badge ¶
Badge adds a badge. Body(fn) wraps content and draws the bubble at its top-end corner (top-right; top-left in RTL); without Body the badge stands alone (an inline bubble, or a status dot with a label when Status is set).
ui.Badge(c).Count(5).Body(func() { ui.Avatar(c, "U") })
ui.Badge(c).Status("success", "成功")
ConfigProvider.Defaults("Badge", ...) keys: "size" ("small" / Small), "overflowCount" (int), "showZero" (bool), "color" (string), "dot" (bool).
func (*BadgeW) Color ¶
Color: status name ("success", "warning", "processing", ...), Ant preset ("pink", "green", ...) or hex.
func (*BadgeW) Count ¶
Count sets the number. Zero hides the bubble unless ShowZero; negative numbers are shown as they are (antd, Element).
func (*BadgeW) Offset ¶
Offset moves the bubble by (x, y) from the top-end corner; x points away from the content (mirrored in RTL).
func (*BadgeW) Status ¶
Status turns a standalone badge into a status dot with a label ("success", "processing" (ripples), "default", "error", "warning", or "custom" with Color).
type BeamStop ¶
BeamStop is a color stop of a BorderBeam gradient (Percent 0..100 from tail to head).
type BorderBeamW ¶
type BorderBeamW struct {
// contains filtered or unexported fields
}
BorderBeamW decorates its body with moving border beams.
func BorderBeam ¶
func BorderBeam(c *Context) *BorderBeamW
BorderBeam starts a beam decoration; add the content with Body.
ui.BorderBeam(c).Duration(3 * time.Second).Body(func() { ui.Card(c, "AI").Body(...) })
func (*BorderBeamW) Active ¶
func (w *BorderBeamW) Active(on bool) *BorderBeamW
Active shows or hides the beam (e.g. only while hovered).
func (*BorderBeamW) Body ¶
func (w *BorderBeamW) Body(fn func()) *Box
Body builds the decorated content and returns the wrapper box.
func (*BorderBeamW) Color ¶
func (w *BorderBeamW) Color(col theme.Color) *BorderBeamW
Color sets a single beam color (fading to transparent at the tail).
func (*BorderBeamW) Count ¶
func (w *BorderBeamW) Count(n int) *BorderBeamW
Count spaces n beams evenly (default 1).
func (*BorderBeamW) Duration ¶
func (w *BorderBeamW) Duration(d time.Duration) *BorderBeamW
Duration sets the time of one loop (default 6s).
func (*BorderBeamW) Gradient ¶
func (w *BorderBeamW) Gradient(stops ...BeamStop) *BorderBeamW
Gradient sets the beam colors from tail (0) to head (100).
func (*BorderBeamW) Layout ¶
func (w *BorderBeamW) Layout(o ...layout.Option) *BorderBeamW
Layout applies layout options to the wrapper.
func (*BorderBeamW) LineWidth ¶
func (w *BorderBeamW) LineWidth(px float32) *BorderBeamW
LineWidth sets the beam thickness (default 1px).
func (*BorderBeamW) Outset ¶
func (w *BorderBeamW) Outset(px float32) *BorderBeamW
Outset moves the beam outside (positive) or inside (negative) the edge.
func (*BorderBeamW) Radius ¶
func (w *BorderBeamW) Radius(px float32) *BorderBeamW
Radius sets the corner radius the beam follows (default th.RadiusLG, the Card radius).
func (*BorderBeamW) Size ¶
func (w *BorderBeamW) Size(px float32) *BorderBeamW
Size sets the beam length (default 100px).
type Box ¶
type Box struct {
// contains filtered or unexported fields
}
Box is a styled layout container.
func Custom ¶
func Custom(c *Context, measure func(maxW, maxH float32) geom.Size, p PaintFunc, opts ...layout.Option) *Box
Custom adds a leaf with a measure and paint function.
func Footer ¶
Footer is the bottom bar (Ant: 24px/50px padding on the layout background; Element: 60px high, 20px padding). Its content starts at the inline start like Ant's and Element's footers (neither centres it; pass layout.Center() for the centred footer of the Ant demos).
func Layout ¶
Layout is the page frame holding Header / Sider / Content / Footer (or nested Layouts). It fills the free space of its parent.
func Overlay ¶
func Overlay(c *Context, o OverlayOptions, fn func(), opts ...layout.Option) *Box
Overlay builds fn in a new layer above everything built so far. Layers swallow pointer input over their area (and over the whole window for ScreenFill). The overlay is placed during layout of the current frame, using its measured size, so it never needs a frame to settle.
Dismissible overlays close through Dismissed (or EscapeAt and PressedOutside) with the returned box's ID: Escape and outside presses then reach only the top-most open layer.
func (*Box) A11y ¶
A11y sets a function that completes the box's semantics node (description, value, range, relations) while the tree is built. fn runs only when accessibility is on.
func (*Box) A11yHidden ¶
A11yHidden hides the box and its subtree from the semantics tree (decoration, or content another node already describes).
func (*Box) A11yKeyboard ¶
A11yKeyboard declares that a pointer-only box has a keyboard equivalent elsewhere (arrow keys of its composite, a focusable twin), so Audit does not report it as unreachable.
func (*Box) A11yScroller ¶
A11yScroller declares that the box is a scroll container that moves its content itself (a touch scroll view with its own scroller) rather than a ui scroll container. Semantic nodes inside it get the ScrollIntoView action, and the container reads a request for it with Context.A11yScrollRequest and scrolls the widget into view. Such a container normally clips (Clip), which also marks content scrolled out of it Offscreen.
func (*Box) Cursor ¶
Cursor sets the pointer cursor for an interactive box. It can be set during custom painting when hit geometry depends on layout.
func (*Box) DashedBorder ¶
DashedBorder draws a dashed border.
func (*Box) Focusable ¶
func (b *Box) Focusable(cursor input.Cursor) Interaction
Focusable makes the box a keyboard focus stop (Tab, focus ring state, Enter / Space activate it) and returns its interaction, like Interact.
func (*Box) Interact ¶
func (b *Box) Interact(cursor input.Cursor) Interaction
Interact makes the box hoverable/clickable and returns its state.
func (*Box) Label ¶
Label gives a box (Custom, Div, Row …) a text label: Driver.Find, FindText and ClickLabel locate it by that text, and it is the box's accessible name unless Semantics set another. The widget ID is not affected (it was computed when the box was created).
func (*Box) RawTouch ¶
RawTouch stops the fingers that go down inside b from being turned into pointer events: b handles them through Touches alone (drawing surfaces, maps, custom multi-finger gestures).
func (*Box) Scale ¶
Scale scales the box and its subtree by k about its centre (enter / leave motion); 1 removes the transform.
func (*Box) ScrollShift ¶
ScrollShift is Context.ScrollShift for a widget that paints scrolled content itself (the lines of a code editor): it declares that what b paints, with b's subtree, moved by d inside r. Unlike Context.ScrollShift it may also be called from b's paint function, once the widget knows where it scrolled to; the rules are the same (the backgrounds behind r must look the same everywhere in r, nodes that do not move with b are damaged by the Runner, and an unclassifiable region is redrawn whole).
UI thread only, during the page build or b's paint.
func (*Box) Semantics ¶
Semantics sets the box's role and accessible name (an empty name is computed from the text inside for roles such as buttons and cells).
func (*Box) TakePointer ¶
TakePointer makes b take over drags that start on widgets inside it and move along axes (see the package notes above on pointer takeover). b should register a hit (Interact, Focusable) so that it can also be dragged directly. Declare it every frame, like other modifiers.
func (*Box) Touches ¶
func (b *Box) Touches() []input.TouchEvent
Touches makes b receive touch events and returns those of this frame for the fingers bound to b (see the notes on multi-touch above), in the order they happened. Call it every frame: fingers are routed by the last frame's geometry, so b receives fingers that go down inside it from the frame after its first call. Single-finger pointer emulation keeps running unless b also sets RawTouch.
func (*Box) Transform ¶
Transform draws the box and its subtree through m, given in the box's own coordinates (origin at its top-left corner), like a CSS transform with transform-origin 0 0. Layout is unaffected; hit testing and Rect use the transformed bounding box. Combine with geom.ScaleAround / RotateAround for other origins, e.g. scaling about the centre:
b.Transform(geom.ScaleAround(k, k, geom.Pt(w/2, h/2)))
type BreadcrumbItem ¶
type BreadcrumbItem struct {
Label string
Icon *icon.Icon // shown before the label (alone when Label is "")
Href string // reported by ClickedHref; the app navigates
OnClick func() // runs when the item is clicked
Menu []MenuItem // dropdown menu on the item (read MenuClicked)
// Separator replaces the separator after this item (antd items[]
// {type: "separator", separator}); "" keeps the breadcrumb's.
Separator string
}
BreadcrumbItem is a structured breadcrumb entry.
type BreadcrumbW ¶
type BreadcrumbW struct {
// contains filtered or unexported fields
}
BreadcrumbW is a breadcrumb with structured items: icons, dropdown menus, click handlers and a custom separator.
func Breadcrumb ¶
func Breadcrumb(c *Context, items ...string) *BreadcrumbW
Breadcrumb shows a path of plain labels; Clicked on the result returns the index of the item clicked this frame, or -1. BreadcrumbItems builds the structured form.
func BreadcrumbItems ¶
func BreadcrumbItems(c *Context, items []BreadcrumbItem) *BreadcrumbW
BreadcrumbItems starts a breadcrumb of structured items; chain options, then Show.
ConfigProvider.Defaults("Breadcrumb", ...) keys: "separator" (string).
func (*BreadcrumbW) Clicked ¶
func (b *BreadcrumbW) Clicked() int
Clicked returns the index of the item clicked this frame, or -1.
func (*BreadcrumbW) ClickedHref ¶
func (b *BreadcrumbW) ClickedHref() string
ClickedHref returns the Href of the item clicked this frame ("" when none was clicked or it has no Href).
func (*BreadcrumbW) DropdownIcon ¶
func (b *BreadcrumbW) DropdownIcon(ic *icon.Icon) *BreadcrumbW
DropdownIcon replaces the down arrow of items with a Menu (antd dropdownIcon).
func (*BreadcrumbW) MenuClicked ¶
func (b *BreadcrumbW) MenuClicked() string
MenuClicked returns the key chosen in an item's dropdown menu this frame.
func (*BreadcrumbW) Separator ¶
func (b *BreadcrumbW) Separator(s string) *BreadcrumbW
Separator replaces the "/" between items (Ant separator, Element separator).
func (*BreadcrumbW) SeparatorIcon ¶
func (b *BreadcrumbW) SeparatorIcon(ic *icon.Icon) *BreadcrumbW
SeparatorIcon uses an icon between items (Element separator-icon).
type Breakpoint ¶
type Breakpoint uint8
Breakpoint names a window width range.
Append-only: never reorder or insert; the zero value stays XS.
const ( XS Breakpoint = iota SM MD LG XL XXL )
func ScreenBreakpoint ¶
func ScreenBreakpoint(c *Context) Breakpoint
ScreenBreakpoint returns the breakpoint of the current window width.
type BubbleAction ¶
type BubbleAction uint8
BubbleAction is a set of built-in message actions (bit flags).
const ( BubbleCopy BubbleAction = 1 << iota // copy the content to the clipboard BubbleRetry // ask for a new answer (Retried) BubbleEdit // edit the message in place (Edited) )
type BubbleListW ¶
type BubbleListW struct {
// contains filtered or unexported fields
}
BubbleListW is a scrolling message stream that only builds the messages near the viewport (heights are measured and cached by key), keeps the bottom in view while new content streams in, and stops following when the user scrolls up, showing a "back to bottom" button instead.
func BubbleList ¶
func BubbleList(c *Context, n int, key func(i int) string, item func(i int), opts ...layout.Option) *BubbleListW
BubbleList adds a message list of n items; key(i) must be a stable, unique key of message i (heights and widget state are kept by key) and item(i) builds it (usually a Bubble). Give the list a bounded height (Grow inside a sized parent, or layout.H).
ui.BubbleList(c, len(msgs), func(i int) string { return msgs[i].ID }, func(i int) {
ui.Bubble(c, msgs[i].Role, msgs[i].Text)
}, layout.Grow(1))
func (*BubbleListW) A11yLabel ¶
func (w *BubbleListW) A11yLabel(s string) *BubbleListW
A11yLabel sets the accessible name (default Locale.Chat.Messages).
func (*BubbleListW) Following ¶
func (w *BubbleListW) Following() bool
Following reports whether the list sticks to the bottom.
func (*BubbleListW) Gap ¶
func (w *BubbleListW) Gap(px float32) *BubbleListW
Gap sets the space between messages (default 8; the action row under a message reserves its own space).
func (*BubbleListW) NoAutoScroll ¶
func (w *BubbleListW) NoAutoScroll() *BubbleListW
NoAutoScroll stops following new content at the bottom.
func (*BubbleListW) Overscan ¶
func (w *BubbleListW) Overscan(px float32) *BubbleListW
Overscan sets how far beyond the viewport messages are built, in px (default 600).
func (*BubbleListW) Padding ¶
func (w *BubbleListW) Padding(px float32) *BubbleListW
Padding sets the space around the messages (default 16).
func (*BubbleListW) Range ¶
func (w *BubbleListW) Range() (first, end int)
Range returns the half-open range of messages built this frame.
func (*BubbleListW) ScrollToBottom ¶
func (w *BubbleListW) ScrollToBottom() *BubbleListW
ScrollToBottom jumps to the end and resumes following new content.
func (*BubbleListW) TopReached ¶
func (w *BubbleListW) TopReached() bool
TopReached reports the frame the user scrolled to the very top (load earlier messages then; the view keeps its place when they are prepended).
type BubbleVariant ¶
type BubbleVariant uint8
BubbleVariant is the look of a Bubble.
const ( BubbleAuto BubbleVariant = iota // user filled, assistant borderless BubbleFilled // tinted background BubbleOutlined // border, no fill BubbleShadow // elevated card BubbleBorderless // content only (full width) )
type BubbleW ¶
type BubbleW struct {
// contains filtered or unexported fields
}
BubbleW is one chat message: avatar, optional name, content and actions.
func Bubble ¶
Bubble adds a chat message of role with content (Markdown for the assistant, plain text for the user; see Markdown/Plain).
ui.Bubble(c, ui.ChatAssistant, reply).Typing(streaming).Actions(ui.BubbleCopy | ui.BubbleRetry)
func (*BubbleW) Actions ¶
func (w *BubbleW) Actions(a BubbleAction) *BubbleW
Actions shows the built-in action buttons under the bubble. They appear while the pointer is over the message or focus is inside it (see ActionsAlways) and stay reachable with Tab.
func (*BubbleW) ActionsAlways ¶
ActionsAlways keeps the action buttons visible (the last answer).
func (*BubbleW) AvatarIcon ¶
AvatarIcon sets the icon of the default avatar.
func (*BubbleW) AvatarText ¶
AvatarText shows initials in the default avatar.
func (*BubbleW) ClickedLink ¶
ClickedLink returns the URL of a Markdown link clicked this frame.
func (*BubbleW) Copied ¶
Copied reports that the copy action put the content on the clipboard this frame.
func (*BubbleW) Extra ¶
Extra adds content under the bubble (tool cards, thought chains, attachments, custom actions).
func (*BubbleW) Plain ¶
Plain renders the content as plain text keeping line breaks (default for the user and system).
func (*BubbleW) Typing ¶
Typing marks the content as still streaming: it is revealed at TypingSpeed (catching up quickly when far behind) with a caret at the end. Turning it off shows the whole content.
func (*BubbleW) TypingSpeed ¶
TypingSpeed sets the reveal speed in characters per second (default 60).
func (*BubbleW) Variant ¶
func (w *BubbleW) Variant(v BubbleVariant) *BubbleW
Variant sets the look (default BubbleAuto).
type ButtonAppearance ¶
type ButtonAppearance string
ButtonAppearance is how a button wears its color (Ant v6 variant, plus Element's plain).
const ( ButtonSolid ButtonAppearance = "solid" // filled with the color ButtonOutlined ButtonAppearance = "outlined" // colored border and label ButtonDashed ButtonAppearance = "dashed" // outlined with a dashed border ButtonFilled ButtonAppearance = "filled" // light tint, no border ButtonText ButtonAppearance = "text" // label only, tint under the pointer ButtonLink ButtonAppearance = "link" // link-styled label ButtonPlain ButtonAppearance = "plain" // Element plain: tint + tinted border, solid on hover )
type ButtonColor ¶
type ButtonColor string
ButtonColor names a button color: a role (default, primary, danger, success, warning, info), an Ant Design preset (blue … gold) or a hex color such as "#13c2c2". The set is open; unknown names fall back to primary.
const ( ButtonColorDefault ButtonColor = "default" ButtonColorPrimary ButtonColor = "primary" ButtonColorDanger ButtonColor = "danger" ButtonColorSuccess ButtonColor = "success" // Element type="success" ButtonColorWarning ButtonColor = "warning" // Element type="warning" ButtonColorInfo ButtonColor = "info" // Element type="info" ButtonColorBlue ButtonColor = "blue" ButtonColorPurple ButtonColor = "purple" ButtonColorCyan ButtonColor = "cyan" ButtonColorGreen ButtonColor = "green" ButtonColorMagenta ButtonColor = "magenta" ButtonColorPink ButtonColor = "pink" ButtonColorRed ButtonColor = "red" ButtonColorOrange ButtonColor = "orange" ButtonColorYellow ButtonColor = "yellow" ButtonColorVolcano ButtonColor = "volcano" ButtonColorGeekblue ButtonColor = "geekblue" ButtonColorLime ButtonColor = "lime" ButtonColorGold ButtonColor = "gold" )
type ButtonGroupW ¶
type ButtonGroupW struct {
// contains filtered or unexported fields
}
ButtonGroupW joins buttons into one group (Ant Button.Group, Element el-button-group, shadcn ButtonGroup): neighbours share a one-pixel border, only the outer corners stay rounded, and size, color, appearance or variant can be set once for every button. Buttons keep their own modifiers, which win over the group's.
ui.ButtonGroup(c).Variant(ui.VariantPrimary).Body(func() {
ui.Button(c, "上一页").Icon(icon.Left)
ui.Button(c, "下一页").IconRight(icon.Right)
})
Buttons that are direct children join, and so does a button that is the whole trigger of a Dropdown placed directly in the group (Element split-button: a main button and a menu caret sharing one seam). Each button stays its own Tab stop.
func ButtonGroup ¶
func ButtonGroup(c *Context) *ButtonGroupW
ButtonGroup starts a button group; chain options, then Body.
ConfigProvider.Defaults("ButtonGroup", ...) keys: "size", "type" (a Button type / variant name such as "primary").
func (*ButtonGroupW) A11yLabel ¶
func (g *ButtonGroupW) A11yLabel(s string) *ButtonGroupW
A11yLabel names the group for screen readers.
func (*ButtonGroupW) Appearance ¶
func (g *ButtonGroupW) Appearance(a ButtonAppearance) *ButtonGroupW
Appearance sets the appearance of every button (see ButtonW.Appearance).
func (*ButtonGroupW) Body ¶
func (g *ButtonGroupW) Body(fn func()) *ButtonGroupW
Body adds the buttons.
func (*ButtonGroupW) Color ¶
func (g *ButtonGroupW) Color(col ButtonColor) *ButtonGroupW
Color sets the color of every button (see ButtonW.Color).
func (*ButtonGroupW) ID ¶
func (g *ButtonGroupW) ID() ID
ID returns the group's widget ID (valid after Body).
func (*ButtonGroupW) Layout ¶
func (g *ButtonGroupW) Layout(o ...layout.Option) *ButtonGroupW
Layout applies layout options to the group.
func (*ButtonGroupW) Size ¶
func (g *ButtonGroupW) Size(s ControlSize) *ButtonGroupW
Size sets the size of every button.
func (*ButtonGroupW) Variant ¶
func (g *ButtonGroupW) Variant(v ButtonVariant) *ButtonGroupW
Variant sets the variant of every button (Element group type="primary" is Variant(ui.VariantPrimary)).
func (*ButtonGroupW) Vertical ¶
func (g *ButtonGroupW) Vertical() *ButtonGroupW
Vertical stacks the buttons (joined top / bottom edges).
type ButtonVariant ¶
type ButtonVariant uint8
ButtonVariant is the visual type of a button.
Append-only: never reorder or insert; the zero value stays VariantDefault.
const ( VariantDefault ButtonVariant = iota VariantPrimary VariantDashed VariantText VariantLink // VariantSecondary is a neutral filled button (shadcn "secondary", Ant // variant="filled", Element type="info" plain). VariantSecondary )
type ButtonW ¶
type ButtonW struct {
// contains filtered or unexported fields
}
ButtonW is a button under construction; chain modifiers then query.
func (*ButtonW) A11yLabel ¶
A11yLabel sets the accessible name read by screen readers. Icon-only buttons (no label) must set one, from the Locale: Button(c, "").Icon(ic).A11yLabel(loc.Search).
func (*ButtonW) Appearance ¶
func (b *ButtonW) Appearance(a ButtonAppearance) *ButtonW
Appearance sets how the button wears its color (Ant v6 variant, plus Element's plain).
func (*ButtonW) AutoInsertSpace ¶
AutoInsertSpace sets whether a label of exactly two Chinese characters is drawn with a space between them ("确定" shows as "确 定"; Ant / Element ConfigProvider button.autoInsertSpace). It applies only to buttons without an icon whose appearance is not text or link; the accessible name keeps the label as given. The default follows the design system (ButtonToken.AutoInsertSpace: on for Ant, off for Element and shadcn); Defaults("Button", Props{"autoInsertSpace": …}) overrides it for a scope and this method for one button.
func (*ButtonW) Color ¶
func (b *ButtonW) Color(col ButtonColor) *ButtonW
Color sets the button color (Ant v6 color): a role, an Ant preset or a hex color ("#13c2c2"). Combine it with Appearance, or with the variant modifiers: Primary is solid, Dashed dashed, Text text, Link link, Secondary filled. With neither, the success / warning / info colors are solid (Element type="success") and the other colors outlined.
ui.Button(c, "紫色").Color(ui.ButtonColorPurple).Appearance(ui.ButtonFilled)
func (*ButtonW) IconPlacement ¶
IconPlacement places the icon at the inline "start" of the label (default) or at its "end" (Ant v6 iconPlacement, which replaces iconPosition). Both are logical: "end" is on the left in a right-to-left scope. Other values are ignored.
ui.Button(c, "下一步").Icon(icon.Right).IconPlacement("end")
func (*ButtonW) IconRight ¶
IconRight puts the icon after the label (Icon(ic).IconPlacement("end")).
func (*ButtonW) LoadingDelay ¶
LoadingDelay postpones the loading state (Ant loading.delay): after Loading(true) the button stays clickable and shows no spinner until d has passed; a loading that ends sooner never shows.
func (*ButtonW) LoadingIcon ¶
LoadingIcon replaces the loading spinner with ic, drawn spinning (Ant loading.icon, Element loading-icon).
func (*ButtonW) Plain ¶
Plain uses Element's plain style: a light tint of the color with a tinted border, filled with the color under the pointer. It combines with every color: Plain() alone, Primary().Plain(), Success().Plain(), Danger().Plain(), Color(ui.ButtonColorPurple).Plain() …
func (*ButtonW) Success ¶
Success makes a solid success button (Element type="success"); add Plain for the plain style.
func (*ButtonW) Variant ¶
func (b *ButtonW) Variant(v ButtonVariant) *ButtonW
Variant sets the variant explicitly.
type CalendarLocale ¶
type CalendarLocale struct {
Month, Year string
// contains filtered or unexported fields
}
CalendarLocale holds the Calendar mode switch.
type CalendarW ¶
type CalendarW struct {
// contains filtered or unexported fields
}
CalendarW is a calendar.
func Calendar ¶
Calendar adds a calendar bound to *val (zero means today, nothing selected). Modifiers apply until the end of the build; the content is built then (or at Changed/PanelChanged).
ui.Calendar(c, &day).CellRender(func(d time.Time) { ... })
ui.Calendar(c, &day).Card().DisabledDate(isWeekend)
func (*CalendarW) CellHeight ¶
CellHeight overrides the fullscreen cell height.
func (*CalendarW) CellRender ¶
CellRender adds content below the date in month view.
func (*CalendarW) ControllerType ¶
ControllerType sets the Element header's month navigation: "button" (previous / today / next, default) or "select" (year and month selects; Element controller-type). The Ant header always uses selects.
func (*CalendarW) DisabledDate ¶
DisabledDate greys out and blocks dates.
func (*CalendarW) Formatter ¶
Formatter formats the labels of the header's year and month selects: fn(v, kind) gets the year or the month number (1-12) and kind "year" or "month" (Element formatter); empty results fall back to the default.
func (*CalendarW) MonthCellRender ¶
MonthCellRender adds content below the month in year view.
func (*CalendarW) PanelChanged ¶
PanelChanged reports a month/year/mode navigation.
func (*CalendarW) Range ¶
Range shows only the weeks from start to end (Element range): the grid starts with start's week and ends with end's week, the header shows the range instead of the month navigation, days outside [start, end] are greyed out and cannot be picked, and the year view is off. Element asks for a start on the first day of a week and an end on the last day, at most two months apart; other ranges are padded to whole weeks.
type CardActionW ¶
type CardActionW struct {
// contains filtered or unexported fields
}
CardActionW is the action slot CardAction returns.
func CardAction ¶
func CardAction(c *Context, ic *icon.Icon, label string) *CardActionW
CardAction is a convenience action slot: a clickable icon (e.g. icon.Setting, icon.Edit, icon.More, icon.Like) in the secondary text color that turns primary on hover. Clicked on the result reports an activation.
func (*CardActionW) Clicked ¶
func (a *CardActionW) Clicked() bool
Clicked reports whether the action was activated this frame.
type CardMetaW ¶
type CardMetaW struct {
*Box
// contains filtered or unexported fields
}
CardMetaW is the Card.Meta block CardMeta returns; it embeds the row's Box.
type CardW ¶
type CardW struct {
// contains filtered or unexported fields
}
CardW is a bordered container: cover, header with extra, body, action bar, footer, loading skeleton, inner type, hover/always/never shadow.
func Card ¶
Card starts a card ("" title = no header); set options then call Body.
ConfigProvider.Defaults("Card", ...) keys: "size" ("small" / Small), "variant" ("outlined" | "borderless"; the deprecated "bordered" bool is still read), "hoverable" (bool), "shadow" (Element: "always" | "hover" | "never"), "type" ("inner").
func (*CardW) Borderless
deprecated
func (*CardW) Shadow ¶
Shadow sets the shadow mode: "always", "hover" or "never" (Element's el-card shadow prop). The default comes from the theme (CardToken.ShadowAlways: never for Ant, except a borderless card, which keeps a soft shadow; always for Element and shadcn).
func (*CardW) TabBarExtra ¶
TabBarExtra builds content at the end of the card's tab bar (Ant tabBarExtraContent).
func (*CardW) TabChanged ¶
TabChanged reports that the user switched tabs this frame (Ant onTabChange). Call it after Body.
type CarouselLocale ¶
type CarouselLocale struct {
Prev, Next string
// contains filtered or unexported fields
}
CarouselLocale holds the accessible names of the Carousel arrows.
type CarouselW ¶
type CarouselW struct {
// contains filtered or unexported fields
}
CarouselW is a slideshow: scroll or fade transitions, autoplay with pause on hover, indicator dots/lines and arrows.
func Carousel ¶
Carousel adds a slideshow of n slides; slide(i) builds slide i.
ConfigProvider.Defaults("Carousel", ...) keys: "autoplay" (time.Duration), "dots" (bool), "arrows" (string), "dotPlacement" ("top" | "bottom" | "start" | "end"; the deprecated "dotPosition" also takes "left" | "right" | "outside"), "type" ("card"), "effect" ("fade"), "height" (float32), "trigger" ("click" | "hover"), "pauseOnHover" (bool).
The index bound with Current is clamped to [0, n): an index past the ends shows the first or last slide.
func (*CarouselW) Arrows ¶
Arrows: "always", "hover" or "never". The arrows sit ArrowOffset px inside the frame (theme token CarouselToken.ArrowOffset); a negative offset (shadcn's -left-12 is -48) puts them outside, which needs that much free room beside the carousel or they are clipped by the parent.
func (*CarouselW) Card ¶
Card shows three slides at once: the current one in the middle and its neighbours scaled down and dimmed at the sides (Element type="card"); clicking a side card moves to it.
func (*CarouselW) CardScale ¶
CardScale sets the scale of the side cards of Card mode (Element cards-scale, default 0.83).
func (*CarouselW) DotDuration ¶
DotDuration fills the active indicator over the autoplay interval, as a progress bar (Ant autoplay.dotDuration).
func (*CarouselW) DotOutside ¶
DotOutside puts the indicators under the frame, on the page (Element indicator-position="outside").
func (*CarouselW) DotPlacement ¶
DotPlacement puts the indicators at the "bottom" (default), "top", "start" or "end" (Ant v6 dotPlacement; logical sides, mirrored in RTL). "start" and "end" also make the slides move vertically, as in Ant.
func (*CarouselW) DotPosition
deprecated
func (*CarouselW) Draggable ¶
Draggable lets a pointer drag or a finger swipe move the slides: the slides follow the pointer, and on release a travel past the swipe threshold (or a quick flick) turns the page, otherwise they spring back. Drags that start on a control inside a slide are taken over once they move sideways.
func (*CarouselW) Loop ¶
Loop(false) stops at the ends: the first slide has no previous one and the last no next one (arrows and keys do nothing there, the arrows look disabled, autoplay stops at the last slide). Default true.
func (*CarouselW) PauseOnHover ¶
PauseOnHover(false) keeps autoplay running while the pointer is over the carousel (default true; Ant / Element pause-on-hover). Keyboard focus inside still pauses it (WAI-ARIA).
func (*CarouselW) SwipeThreshold ¶
SwipeThreshold sets the fraction of the slide size a drag must travel to turn the page (default 0.2).
type CascaderOption ¶
type CascaderOption struct {
Label, Value string
Disabled bool
Children []CascaderOption
IsLeaf bool // never has children (relevant with LoadData)
}
CascaderOption is a node of a Cascader tree. With LoadData, a node without Children that is not IsLeaf loads its children when expanded.
type CascaderPanelW ¶
type CascaderPanelW struct {
// contains filtered or unexported fields
}
CascaderPanelW is an inline cascader; chain options, read Changed.
func CascaderPanel ¶
func CascaderPanel(c *Context, val *[]string, opts []CascaderOption) *CascaderPanelW
CascaderPanel adds the column menus of a Cascader inline, bound to *val (the selected value path). Clicking a leaf selects it (the menus stay); the panel is one Tab stop whose arrow keys move through the columns (Right / Enter opens the next column, Left goes back; mirrored in RTL), Enter / Space on a leaf selects it.
ui.CascaderPanel(c, &path, options).ChangeOnSelect()
func (*CascaderPanelW) A11yLabel ¶
func (p *CascaderPanelW) A11yLabel(s string) *CascaderPanelW
A11yLabel names the panel and its first column (default: the generic "please select").
func (*CascaderPanelW) Border ¶
func (p *CascaderPanelW) Border(on bool) *CascaderPanelW
Border toggles the panel frame (default on).
func (*CascaderPanelW) ChangeOnSelect ¶
func (p *CascaderPanelW) ChangeOnSelect() *CascaderPanelW
ChangeOnSelect selects parents too (clicking a parent selects it and opens its column).
func (*CascaderPanelW) Changed ¶
func (p *CascaderPanelW) Changed() bool
Changed reports a new selection this frame.
func (*CascaderPanelW) CheckedPaths ¶
func (p *CascaderPanelW) CheckedPaths() [][]string
CheckedPaths returns the checked paths of multiple mode by the checked strategy.
func (*CascaderPanelW) DataVersion ¶
func (p *CascaderPanelW) DataVersion(v int) *CascaderPanelW
DataVersion tells the panel that the options were modified in place (see CascaderW.DataVersion): change v after editing options of the same slice without changing its length.
func (*CascaderPanelW) Disabled ¶
func (p *CascaderPanelW) Disabled(on bool) *CascaderPanelW
Disabled turns the panel off.
func (*CascaderPanelW) Expand ¶
func (p *CascaderPanelW) Expand(path ...string) *CascaderPanelW
Expand sets the expanded path (by default it follows the value).
func (*CascaderPanelW) ExpandOnHover ¶
func (p *CascaderPanelW) ExpandOnHover() *CascaderPanelW
ExpandOnHover opens a parent's column on hover.
func (*CascaderPanelW) Height ¶
func (p *CascaderPanelW) Height(px float32) *CascaderPanelW
Height sets the column height (default: the Cascader token's DropdownHeight).
func (*CascaderPanelW) LoadData ¶
func (p *CascaderPanelW) LoadData(fn func(path []string, done func([]CascaderOption))) *CascaderPanelW
LoadData loads children lazily (see CascaderW.LoadData).
func (*CascaderPanelW) Multiple ¶
func (p *CascaderPanelW) Multiple(vals *[][]string) *CascaderPanelW
Multiple switches to checkboxes bound to *vals (the checked leaf paths; see ShowCheckedStrategy and StrategyValue).
func (*CascaderPanelW) ShowCheckedStrategy ¶
func (p *CascaderPanelW) ShowCheckedStrategy(s CheckedStrategy) *CascaderPanelW
ShowCheckedStrategy sets the checked strategy of multiple mode (see CascaderW.ShowCheckedStrategy); CheckedPaths returns its paths.
func (*CascaderPanelW) StrategyValue ¶
func (p *CascaderPanelW) StrategyValue(on bool) *CascaderPanelW
StrategyValue makes the bound value of multiple mode follow the checked strategy (see CascaderW.StrategyValue).
func (*CascaderPanelW) Virtual ¶
func (p *CascaderPanelW) Virtual(on bool) *CascaderPanelW
Virtual forces virtual columns on or off (see CascaderW.Virtual; by default columns longer than 100 options are virtual).
type CascaderW ¶
type CascaderW struct {
// contains filtered or unexported fields
}
CascaderW selects a path in a tree through cascading menus.
func Cascader ¶
func Cascader(c *Context, val *[]string, opts []CascaderOption) *CascaderW
Cascader adds a cascading select bound to *val (the selected value path).
func (*CascaderW) A11yLabel ¶
A11yLabel sets the accessible name (inside a FormItem the item label is used; the placeholder is the last resort).
func (*CascaderW) AllowClear ¶
func (*CascaderW) ChangeOnSelect ¶
func (*CascaderW) CheckedPaths ¶
CheckedPaths returns the checked paths of multiple mode by the checked strategy (the paths shown as tags).
func (*CascaderW) DataVersion ¶
DataVersion tells the cascader that the options were modified in place (a virtual column caches its width by slice identity, length and this number): after editing options of the same slice without changing its length, change v (or pass a new slice) so the widths are recomputed on the next frame.
func (*CascaderW) DisplayRender ¶
func (w *CascaderW) DisplayRender(fn func(labels []string, path []CascaderOption) string) *CascaderW
DisplayRender sets the text shown for the selected path (single selection; default the labels joined by " / "): fn receives the labels and the options of the path, root first (Ant displayRender, Element show-all-levels / separator). A value no longer in the tree shows as an option whose Label and Value are the stored value.
ui.Cascader(c, &v, opts).DisplayRender(func(ls []string, _ []ui.CascaderOption) string { return ls[len(ls)-1] })
func (*CascaderW) ExpandOnHover ¶
func (*CascaderW) FilterMethod ¶
func (w *CascaderW) FilterMethod(fn func(query string, path []CascaderOption) bool) *CascaderW
FilterMethod replaces the search match (by default the "a / b / c" label path containing the typed text, case-insensitively) with fn: it receives the typed text and the options along a candidate path, root first (Ant showSearch.filter, Element filter-method). Implies Searchable.
ui.Cascader(c, &v, opts).FilterMethod(func(q string, p []ui.CascaderOption) bool {
return strings.HasPrefix(p[len(p)-1].Value, q)
})
func (*CascaderW) LoadData ¶
func (w *CascaderW) LoadData(fn func(path []string, done func([]CascaderOption))) *CascaderW
LoadData enables lazy loading: expanding an option that has no Children and is not IsLeaf calls fn with its value path; fn (now or later, on any goroutine) calls done with the children. A spinner replaces the arrow meanwhile; done(nil) marks the option as a leaf.
ui.Cascader(c, &v, roots).LoadData(func(path []string, done func([]ui.CascaderOption)) {
go func() { done(fetchChildren(path)) }()
})
func (*CascaderW) MaxTagCount ¶
func (*CascaderW) MaxTagPlaceholder ¶
MaxTagPlaceholder builds the text of the collapsed tag of multiple mode from the hidden labels (Ant maxTagPlaceholder; default "+ N ...").
func (*CascaderW) NotFoundContent ¶
NotFoundContent sets the text shown when a search finds nothing (Ant notFoundContent, Element empty slot).
func (*CascaderW) Placeholder ¶
func (*CascaderW) Placement ¶
Placement sets where the menus open: BottomStart (default), BottomEnd, TopStart or TopEnd (Ant placement, Element placement); they flip when there is no room. ConfigProvider.Defaults("Cascader", "placement") takes the Ant names.
func (*CascaderW) Searchable ¶
func (*CascaderW) Separator ¶
Separator sets the text between path labels in the selected value, tags and search results (Element separator; default " / " as Ant's displayRender). "" joins the labels directly.
func (*CascaderW) ShowCheckedStrategy ¶
func (w *CascaderW) ShowCheckedStrategy(s CheckedStrategy) *CascaderW
ShowCheckedStrategy chooses the tags of multiple mode (default ShowParent: a fully checked parent replaces its children; ShowChild: every checked leaf; ShowAll: every checked node). By default the bound value holds the checked leaf paths and CheckedPaths returns the strategy's paths; with StrategyValue(true) the bound value itself follows the strategy (Ant).
func (*CascaderW) Size ¶
func (w *CascaderW) Size(s ControlSize) *CascaderW
func (*CascaderW) StrategyValue ¶
StrategyValue makes the bound value of multiple mode follow the checked strategy, as Ant's value does (ShowParent, the default, stores a fully checked parent path instead of its leaf paths). Paths written by the application are read the same way: a parent path checks its subtree. Default false: the value holds the checked leaf paths (what earlier versions stored).
func (*CascaderW) Variant ¶
func (w *CascaderW) Variant(v FieldVariant) *CascaderW
Variant sets the frame look (FieldOutlined by default).
func (*CascaderW) Virtual ¶
Virtual forces virtual columns on or off; by default a column (or a search result list) longer than 100 options is virtual: only its visible rows and the row on the expanded path are built. The column keeps the width, height and scroll range of the full list (its width is measured once while the column's options slice, identity and length, and the DataVersion stay the same: an option renamed in place does not change the column's width until one of them changes), but options out of view are not in the accessibility tree. Search results are matched and measured every frame. Virtual(false) builds every row.
type CellEditorTableW ¶
type CellEditorTableW[T any] struct { // contains filtered or unexported fields }
CellEditorTableW is an editable table that edits one cell at a time (Pro Components v3 CellEditorTable): double-click a cell of a column with an Editor (or press Enter on the keyboard-active cell) to edit it; Enter or moving focus away validates that cell and saves the row, Escape cancels and drops the draft. Only the edited column is validated. It is an EditableProTable preset (same editors, validation and OnSave flow), bordered and without pagination by default.
func CellEditorTable ¶
func CellEditorTable[T any](c *Context, cols []ProColumn[T], rows *[]T) *CellEditorTableW[T]
CellEditorTable starts a cell-editing table over *rows; chain options, then Show.
ConfigProvider.Defaults("CellEditorTable", ...) keys: "bordered" (bool, default true), "size", "pagination" (page size or Props{"pageSize": n}; default none).
func (*CellEditorTableW[T]) Bordered ¶
func (w *CellEditorTableW[T]) Bordered(on bool) *CellEditorTableW[T]
Bordered turns the cell borders on or off (default on).
func (*CellEditorTableW[T]) Cancel ¶
func (w *CellEditorTableW[T]) Cancel()
Cancel leaves the edited cell without saving (as Escape does).
func (*CellEditorTableW[T]) Changed ¶
func (w *CellEditorTableW[T]) Changed() bool
Changed reports a change of *rows in the last Show.
func (*CellEditorTableW[T]) Edit ¶
func (w *CellEditorTableW[T]) Edit(k, col string)
Edit starts editing the cell of row key k in column col (valid after Show; ignored for a column without an Editor).
func (*CellEditorTableW[T]) EditingCell ¶
func (w *CellEditorTableW[T]) EditingCell() (key, col string)
EditingCell returns the row key and column key of the edited cell ("" when none).
func (*CellEditorTableW[T]) Errors ¶
func (w *CellEditorTableW[T]) Errors(k string) map[string]string
Errors returns the validation messages of row k by column key.
func (*CellEditorTableW[T]) ID ¶
func (w *CellEditorTableW[T]) ID() ID
ID returns the widget ID (valid after Show).
func (*CellEditorTableW[T]) OnSave ¶
func (w *CellEditorTableW[T]) OnSave(fn func(row T, index int, done func(error))) *CellEditorTableW[T]
OnSave receives the row with the validated cell applied before it is written back (see EditableProTableW.OnSave).
func (*CellEditorTableW[T]) Pagination ¶
func (w *CellEditorTableW[T]) Pagination(n int) *CellEditorTableW[T]
Pagination pages the rows locally, n per page (default: no pagination).
func (*CellEditorTableW[T]) RowEditable ¶
func (w *CellEditorTableW[T]) RowEditable(fn func(row T) bool) *CellEditorTableW[T]
RowEditable limits which rows can be edited.
func (*CellEditorTableW[T]) RowKey ¶
func (w *CellEditorTableW[T]) RowKey(f func(T) string) *CellEditorTableW[T]
RowKey gives rows stable keys (default: the row index).
func (*CellEditorTableW[T]) Save ¶
func (w *CellEditorTableW[T]) Save()
Save validates the edited cell and saves its row (as Enter does).
func (*CellEditorTableW[T]) Saved ¶
func (w *CellEditorTableW[T]) Saved() bool
Saved reports a row written back in the last Show.
func (*CellEditorTableW[T]) ScrollX ¶
func (w *CellEditorTableW[T]) ScrollX(px float32) *CellEditorTableW[T]
ScrollX sets the table's scroll width.
func (*CellEditorTableW[T]) ScrollY ¶
func (w *CellEditorTableW[T]) ScrollY(maxH float32) *CellEditorTableW[T]
ScrollY bounds the table body to maxH (EditableProTableW.ScrollY): only the visible rows are built. The edited cell's row is always built, even scrolled out of view, so its draft and focus survive; starting to edit it (Edit), focus moving into it (Tab), typing in it and a failed validation scroll it into view. Default 0: unbounded, every row is built.
func (*CellEditorTableW[T]) Show ¶
func (w *CellEditorTableW[T]) Show() *CellEditorTableW[T]
Show builds the table.
func (*CellEditorTableW[T]) Size ¶
func (w *CellEditorTableW[T]) Size(s ControlSize) *CellEditorTableW[T]
Size sets the density.
func (*CellEditorTableW[T]) Table ¶
func (w *CellEditorTableW[T]) Table() *TableW
Table returns the inner table of the last Show.
func (*CellEditorTableW[T]) Title ¶
func (w *CellEditorTableW[T]) Title(s string) *CellEditorTableW[T]
Title sets the toolbar title.
func (*CellEditorTableW[T]) ToolBar ¶
func (w *CellEditorTableW[T]) ToolBar(fn func()) *CellEditorTableW[T]
ToolBar adds actions at the right of the toolbar.
func (*CellEditorTableW[T]) Validating ¶
func (w *CellEditorTableW[T]) Validating(k string) bool
Validating reports async validation or a save in flight for row k.
func (*CellEditorTableW[T]) Virtual ¶
func (w *CellEditorTableW[T]) Virtual() *CellEditorTableW[T]
Virtual is TableW.Virtual for the inner table (see EditableProTableW.Virtual): with ScrollY the body is windowed either way; rows keep the height of the density (Size) unless the theme has a Table V2 row height (Element Plus).
type ChainItem ¶
type ChainItem struct {
Key string // stable key (default: the index)
Title string
Description string // secondary line under the title
Status ChainStatus //
Duration time.Duration // shown at the end (0: hidden)
Started time.Time // a running step shows the time elapsed since then
Detail string // collapsible Markdown detail
Content func() // collapsible custom detail (instead of Detail)
// contains filtered or unexported fields
}
ChainItem is one step of a ThoughtChain.
type ChainStatus ¶
type ChainStatus uint8
ChainStatus is the state of a step or tool call.
const ( ChainPending ChainStatus = iota // not started ChainRunning // in progress (spinner, live duration) ChainSuccess ChainError )
type ChartLocale ¶
type ChartLocale struct {
Line, Area, Column, Bar, Pie, Donut, Scatter, Radar, Gauge, Funnel, Heatmap, DualAxes, Liquid, Sparkline string
SummaryFmt string // args: kind, series count, point count ("%[1]s,%[2]d 个系列,%[3]d 个数据点")
XRangeFmt string // appended to the summary, args: first, last x (";横轴从 %s 到 %s")
YRangeFmt string // appended to the summary, args: min, max value (";数值从 %s 到 %s")
ValueFmt string // single-value charts, args: kind, value ("%s:%s")
Total string // pie / donut centre title ("总计")
Conversion string // funnel conversion-rate label ("转化率")
// contains filtered or unexported fields
}
ChartLocale holds the accessible names and summaries of ui/chart charts: the chart kinds (default names) and the summary read as the description.
type ChatAttachment ¶
type ChatAttachment struct {
Name string
Size int64 // bytes (0: not shown)
Image image.Image // thumbnail of an image (nil: file icon)
Status string // "" ready, "uploading" or "error"
Percent float32 // upload progress 0..100 while uploading
// contains filtered or unexported fields
}
ChatAttachment is a file attached to a message being composed.
type ChatLocale ¶
type ChatLocale struct {
User, Assistant, System string // role names (accessible names of bubbles)
Messages string // accessible name of a BubbleList
ScrollToBottom string // BubbleList "back to bottom" button
Thinking string // loading bubble (accessible name)
Generating string // streaming bubble (accessible description)
Placeholder string // Sender placeholder
Send, Stop, Attach string // Sender buttons
Suggestions string // accessible name of the @ / command popup
Uploading, Failed string // attachment states
EditPlaceholder string // inline edit of a user message
Pending, Running string // step states
Done, Error string
StepsFmt string // chain progress, args: done, total ("%d/%d")
SecondsFmt string // duration under a minute, arg: seconds as float ("%.1fs")
MinutesFmt string // longer duration, args: minutes, seconds ("%dm %ds")
ToolCall string // accessible name prefix of a tool card
Arguments, Result string // tool card sections
ApprovalTitle string // default Approval title
AllowOnce string
AllowSession string
AllowAlways string
Deny string
Allowed, Denied string // decided Approval
FeedbackPlaceholder string // optional note sent with a decision
RiskWarning string // risk tag of a warning-level request
RiskDanger string // risk tag of a dangerous request
Conversations string // accessible name of the list
Rename string
Untitled string // conversation without a title
Today, Yesterday string // time groups
Last7Days string
Last30Days string
Earlier string
Prompts string // accessible name of a Prompts group
// contains filtered or unexported fields
}
ChatLocale holds the texts of the AI chat components (Bubble, BubbleList, Sender, ThoughtChain, ToolCall, Approval, Conversations, Prompts). Copy, Copied, Retry, Edit, Save and Cancel come from the common Locale fields.
type CheckAllW ¶
type CheckAllW struct {
// contains filtered or unexported fields
}
CheckAllW is the select-all group CheckAll returns.
type CheckCardGroupW ¶
type CheckCardGroupW struct {
// contains filtered or unexported fields
}
CheckCardGroupW builds a single- or multiple-choice card group.
func CheckCardGroup ¶
func CheckCardGroup(c *Context, opts []CheckCardOption) *CheckCardGroupW
CheckCardGroup starts a group. Value / Values bind application state; without a binding the group owns its state, initialized by DefaultValue or DefaultValues. Values also selects multiple-choice mode.
func (*CheckCardGroupW) Body ¶
func (g *CheckCardGroupW) Body(fn func()) *CheckCardGroupW
Body builds custom CheckCards linked to this group by Value.
func (*CheckCardGroupW) Borderless ¶
func (g *CheckCardGroupW) Borderless() *CheckCardGroupW
Borderless removes option card borders.
func (*CheckCardGroupW) Changed ¶
func (g *CheckCardGroupW) Changed() bool
Changed reports a user selection change this frame.
func (*CheckCardGroupW) DefaultValue ¶
func (g *CheckCardGroupW) DefaultValue(v string) *CheckCardGroupW
DefaultValue sets the initial single selection, ignored when bound.
func (*CheckCardGroupW) DefaultValues ¶
func (g *CheckCardGroupW) DefaultValues(v ...string) *CheckCardGroupW
DefaultValues sets initial multiple selections, ignored when bound.
func (*CheckCardGroupW) Disabled ¶
func (g *CheckCardGroupW) Disabled(on bool) *CheckCardGroupW
Disabled disables every card.
func (*CheckCardGroupW) Layout ¶
func (g *CheckCardGroupW) Layout(opts ...layout.Option) *CheckCardGroupW
Layout sets wrapping-row layout options.
func (*CheckCardGroupW) Loading ¶
func (g *CheckCardGroupW) Loading(on bool) *CheckCardGroupW
Loading shows noninteractive, unchecked loading placeholders.
func (*CheckCardGroupW) Multiple ¶
func (g *CheckCardGroupW) Multiple() *CheckCardGroupW
Multiple enables multiple choices with internally owned state.
func (*CheckCardGroupW) Selected ¶
func (g *CheckCardGroupW) Selected() string
Selected reports the single selection after Show / Body.
func (*CheckCardGroupW) SelectedValues ¶
func (g *CheckCardGroupW) SelectedValues() []string
SelectedValues reports a copy of the multiple selections after Show / Body.
func (*CheckCardGroupW) Show ¶
func (g *CheckCardGroupW) Show() *CheckCardGroupW
Show renders the configured options.
func (*CheckCardGroupW) Size ¶
func (g *CheckCardGroupW) Size(s ControlSize) *CheckCardGroupW
Size sets the group size.
func (*CheckCardGroupW) Value ¶
func (g *CheckCardGroupW) Value(v *string) *CheckCardGroupW
Value binds the single choice. Re-clicking a selected card clears it.
func (*CheckCardGroupW) Values ¶
func (g *CheckCardGroupW) Values(v *[]string) *CheckCardGroupW
Values binds multiple choices, maintained in option order.
func (*CheckCardGroupW) Width ¶
func (g *CheckCardGroupW) Width(px float32) *CheckCardGroupW
Width overrides every option card's width.
type CheckCardOption ¶
type CheckCardOption struct {
Value string
Title string
Description string
Avatar string // text avatar (first character)
Icon *icon.Icon // icon avatar
Disabled bool
Size ControlSize // zero without SizeSet: inherit group size
SizeSet bool // allows explicit Middle to override the group size
Cover func()
Children []CheckCardOption
// contains filtered or unexported fields
}
CheckCardOption is one card of a CheckCardGroup.
type CheckCardW ¶
type CheckCardW struct {
// contains filtered or unexported fields
}
CheckCardW builds a checkable card.
func CheckCard ¶
func CheckCard(c *Context, title string, checked *bool) *CheckCardW
CheckCard starts a checkable card bound to checked; chain options, then Show.
func (*CheckCardW) Actions ¶
func (w *CheckCardW) Actions(fns ...func()) *CheckCardW
Actions builds the bottom action bar.
func (*CheckCardW) Avatar ¶
func (w *CheckCardW) Avatar(s string) *CheckCardW
Avatar shows a text avatar (first character) left of the title.
func (*CheckCardW) AvatarIcon ¶
func (w *CheckCardW) AvatarIcon(ic *icon.Icon) *CheckCardW
AvatarIcon shows an icon avatar left of the title.
func (*CheckCardW) Borderless ¶
func (w *CheckCardW) Borderless() *CheckCardW
Borderless removes the border (the checked state still colors it).
func (*CheckCardW) Changed ¶
func (w *CheckCardW) Changed() bool
Changed reports a toggle by the user this frame (after Show).
func (*CheckCardW) Clicked ¶
func (w *CheckCardW) Clicked() bool
Clicked reports a click this frame (after Show).
func (*CheckCardW) Content ¶
func (w *CheckCardW) Content(fn func()) *CheckCardW
Content builds body content below the card's metadata.
func (*CheckCardW) Cover ¶
func (w *CheckCardW) Cover(fn func()) *CheckCardW
Cover replaces the content with fn (an image or any block).
func (*CheckCardW) DefaultChecked ¶
func (w *CheckCardW) DefaultChecked(on bool) *CheckCardW
DefaultChecked sets the initial checked state when checked is nil.
func (*CheckCardW) Description ¶
func (w *CheckCardW) Description(s string) *CheckCardW
Description sets the secondary text under the title.
func (*CheckCardW) Disabled ¶
func (w *CheckCardW) Disabled(on bool) *CheckCardW
Disabled disables the card.
func (*CheckCardW) Extra ¶
func (w *CheckCardW) Extra(fn func()) *CheckCardW
Extra builds content at the top right.
func (*CheckCardW) IsChecked ¶
func (w *CheckCardW) IsChecked() bool
IsChecked reports the current selection after Show.
func (*CheckCardW) Loading ¶
func (w *CheckCardW) Loading(on bool) *CheckCardW
Loading shows a skeleton instead of the content.
func (*CheckCardW) Show ¶
func (w *CheckCardW) Show() *CheckCardW
Show builds the card and toggles it on click / Enter / Space.
func (*CheckCardW) Size ¶
func (w *CheckCardW) Size(s ControlSize) *CheckCardW
Size sets the size: Small (212px), Middle (320px) or Large (440px).
func (*CheckCardW) SubTitle ¶
func (w *CheckCardW) SubTitle(s string) *CheckCardW
SubTitle sets text beside the title.
func (*CheckCardW) Value ¶
func (w *CheckCardW) Value(s string) *CheckCardW
Value sets this card's key when built in CheckCardGroup.Body.
func (*CheckCardW) Width ¶
func (w *CheckCardW) Width(px float32) *CheckCardW
Width overrides the width of the size.
type CheckableTagGroupW ¶
type CheckableTagGroupW struct {
// contains filtered or unexported fields
}
CheckableTagGroupW is a row of checkable tags bound to the selected values.
func CheckableTagGroup ¶
func CheckableTagGroup(c *Context, selected *[]string, opts []Option) *CheckableTagGroupW
CheckableTagGroup renders one CheckableTag per option bound to *selected. Single selection by default: checking a tag replaces the value, unchecking it clears the value (antd value null); Multiple toggles each value. Tags wrap with a gap of 8 (antd paddingXS). A nil selected shows nothing checked and ignores clicks.
ConfigProvider.Defaults("CheckableTagGroup", ...) keys: "multiple" (bool).
func (*CheckableTagGroupW) A11yLabel ¶
func (g *CheckableTagGroupW) A11yLabel(s string) *CheckableTagGroupW
A11yLabel names the group for screen readers.
func (*CheckableTagGroupW) Changed ¶
func (g *CheckableTagGroupW) Changed() bool
Changed reports a selection change this frame.
func (*CheckableTagGroupW) Disabled ¶
func (g *CheckableTagGroupW) Disabled(on bool) *CheckableTagGroupW
Disabled disables every tag of the group.
func (*CheckableTagGroupW) Multiple ¶
func (g *CheckableTagGroupW) Multiple(on bool) *CheckableTagGroupW
Multiple allows several checked tags.
type CheckableTagW ¶
type CheckableTagW struct {
// contains filtered or unexported fields
}
CheckableTagW is a tag that toggles between checked and unchecked.
func CheckableTag ¶
func CheckableTag(c *Context, label string, checked *bool) *CheckableTagW
CheckableTag adds a tag bound to *checked; clicking (or Enter/Space when focused) toggles it.
func (*CheckableTagW) A11yLabel ¶
func (w *CheckableTagW) A11yLabel(s string) *CheckableTagW
A11yLabel sets the accessible name (needed for an icon-only tag).
func (*CheckableTagW) Changed ¶
func (w *CheckableTagW) Changed() bool
Changed reports a toggle this frame.
func (*CheckableTagW) Checked ¶
func (w *CheckableTagW) Checked() bool
Checked reports the current value.
func (*CheckableTagW) Disabled ¶
func (w *CheckableTagW) Disabled(on bool) *CheckableTagW
Disabled blocks toggling when on.
func (*CheckableTagW) Icon ¶
func (w *CheckableTagW) Icon(ic *icon.Icon) *CheckableTagW
Icon puts an icon before the label.
func (*CheckableTagW) Type ¶
func (w *CheckableTagW) Type(status string) *CheckableTagW
Type tints the checked state with a status palette ("primary" default, "success", "warning", "error", "info"). Element Plus also tints the unchecked state.
type CheckboxGroupW ¶
type CheckboxGroupW struct {
// contains filtered or unexported fields
}
CheckboxGroupW is the checkbox group CheckboxGroup returns.
func CheckboxGroup ¶
func CheckboxGroup(c *Context, selected *[]string, opts []Option) *CheckboxGroupW
CheckboxGroup renders one checkbox per option bound to the selected values. Changed on the result reports a selection change; the builder also takes Disabled, Min/Max, Border, Buttons and Size.
func (*CheckboxGroupW) A11yLabel ¶
func (g *CheckboxGroupW) A11yLabel(s string) *CheckboxGroupW
A11yLabel names the group for screen readers.
func (*CheckboxGroupW) Border ¶
func (g *CheckboxGroupW) Border() *CheckboxGroupW
Border draws every checkbox with a frame (see CheckboxW.Border).
func (*CheckboxGroupW) Buttons ¶
func (g *CheckboxGroupW) Buttons() *CheckboxGroupW
Buttons renders the options as a row of joined toggle buttons (Element el-checkbox-button).
func (*CheckboxGroupW) Changed ¶
func (g *CheckboxGroupW) Changed() bool
Changed reports a selection change this frame.
func (*CheckboxGroupW) Disabled ¶
func (g *CheckboxGroupW) Disabled(on bool) *CheckboxGroupW
Disabled disables every checkbox of the group.
func (*CheckboxGroupW) Max ¶
func (g *CheckboxGroupW) Max(n int) *CheckboxGroupW
Max allows at most n selected values: once n are checked the others are disabled (0 = no maximum).
func (*CheckboxGroupW) Min ¶
func (g *CheckboxGroupW) Min(n int) *CheckboxGroupW
Min keeps at least n values selected: while only n are checked they cannot be unchecked (0 = no minimum).
func (*CheckboxGroupW) Size ¶
func (g *CheckboxGroupW) Size(s ControlSize) *CheckboxGroupW
Size sets the size of the checkboxes.
type CheckboxW ¶
type CheckboxW struct {
// contains filtered or unexported fields
}
CheckboxW is a checkbox with a label.
func (*CheckboxW) A11yLabel ¶
A11yLabel sets the accessible name of a checkbox without a visible label.
func (*CheckboxW) Border ¶
Border draws a frame around the box and the label (Element el-checkbox border); a checked one gets a brand-colored frame.
func (*CheckboxW) Button ¶
Button renders the checkbox as a toggle button without a box (Element el-checkbox-button); checked buttons take the brand color. Inside CheckboxGroup(...).Buttons() the buttons join into a segmented row.
func (*CheckboxW) Indeterminate ¶
func (*CheckboxW) Size ¶
func (w *CheckboxW) Size(s ControlSize) *CheckboxW
Size sets the checkbox size: the label font, the box (Element shrinks it when small) and the height of the Border / Button styles.
type CheckedStrategy ¶
type CheckedStrategy int
CheckedStrategy chooses which checked nodes of a tree-shaped multiple selection (Cascader, TreeSelect) are shown as tags and returned by Checked (Ant showCheckedStrategy).
Append-only: never reorder or insert; the zero value stays ShowChild.
const ( // ShowChild shows every checked leaf. ShowChild CheckedStrategy = iota // ShowParent shows a fully checked parent instead of its children. ShowParent // ShowAll shows every checked node, parents and children. ShowAll )
type CodeBlockLocale ¶
type CodeBlockLocale struct {
Code string // accessible name of a block without title or language
// contains filtered or unexported fields
}
CodeBlockLocale holds the CodeBlock texts (the copy button uses Markdown.CopyCode and Markdown.Copied).
type CodeBlockMatch ¶
type CodeBlockMatch struct {
Start, End int
}
CodeBlockMatch is a half-open UTF-8 byte range in the code after CRLF and CR line endings have been normalized to LF.
type CodeBlockW ¶
type CodeBlockW struct {
// contains filtered or unexported fields
}
CodeBlockW is a read-only code viewer. Long lines scroll sideways; a block taller than its Height / MaxHeight scrolls and only the visible lines are shaped, so it stays fast for files of hundreds of thousands of lines. The text is selectable (drag, double click a word, triple click or click the line number for a line, Cmd/Ctrl+A) and copies with Cmd/Ctrl+C; the copy button copies everything.
func CodeBlock ¶
func CodeBlock(c *Context, code string, opts ...layout.Option) *CodeBlockW
CodeBlock adds a read-only code block for code (lines separated by "\n"; "\r\n" is accepted).
ui.CodeBlock(c, src).Lang("go").LineNumbers(true).MaxHeight(400)
func (*CodeBlockW) A11yLabel ¶
func (w *CodeBlockW) A11yLabel(s string) *CodeBlockW
A11yLabel sets the accessible name of the code area (default: the title or language).
func (*CodeBlockW) ActiveMatch ¶
func (w *CodeBlockW) ActiveMatch(index int) *CodeBlockW
ActiveMatch marks and reveals the zero-based search result at index when the index or result set changes. Pass -1 to clear the active highlight.
func (*CodeBlockW) Copied ¶
func (w *CodeBlockW) Copied() bool
Copied reports a click on the copy button this frame.
func (*CodeBlockW) HeaderStyle ¶
func (w *CodeBlockW) HeaderStyle(style CodeHeaderStyle) *CodeBlockW
HeaderStyle styles the header. An untitled block with a copy button also gets a header when this option is set.
func (*CodeBlockW) Height ¶
func (w *CodeBlockW) Height(px float32) *CodeBlockW
Height fixes the height of the code area (it scrolls).
func (*CodeBlockW) HighlightLines ¶
func (w *CodeBlockW) HighlightLines(lines ...int) *CodeBlockW
HighlightLines tints lines (numbers as shown, see StartLine).
func (*CodeBlockW) Highlighter ¶
func (w *CodeBlockW) Highlighter(h CodeHighlighter) *CodeBlockW
Highlighter sets the highlighter (default DefaultCodeHighlighter; nil: plain text).
func (*CodeBlockW) Lang ¶
func (w *CodeBlockW) Lang(lang string) *CodeBlockW
Lang sets the language for highlighting: an id, alias or file extension ("go", "ts", "python" …).
func (*CodeBlockW) Layout ¶
func (w *CodeBlockW) Layout(opts ...layout.Option) *CodeBlockW
Layout applies layout options to the block.
func (*CodeBlockW) LineNumbers ¶
func (w *CodeBlockW) LineNumbers(on bool) *CodeBlockW
LineNumbers shows the line-number gutter.
func (*CodeBlockW) MaxHeight ¶
func (w *CodeBlockW) MaxHeight(px float32) *CodeBlockW
MaxHeight lets the code area grow with its lines up to px, then scroll. Without Height or MaxHeight the block is as tall as its code.
func (*CodeBlockW) Reveal ¶
func (w *CodeBlockW) Reveal(offset int) *CodeBlockW
Reveal scrolls to a UTF-8 byte offset in the normalized code. Call this modifier in response to a navigation action. Offsets outside the document are clamped; offsets inside a rune move to its start.
func (*CodeBlockW) Search ¶
func (w *CodeBlockW) Search(query string, caseSensitive bool) *CodeBlockW
Search highlights non-overlapping literal matches throughout the code. An empty query clears the highlights. Use SearchMatches to read the ranges.
func (*CodeBlockW) SearchLimit ¶
func (w *CodeBlockW) SearchLimit(limit int) *CodeBlockW
SearchLimit caps the number of retained results in document order. Zero keeps all results, as in Search without this option.
func (*CodeBlockW) SearchMatchCount ¶
func (w *CodeBlockW) SearchMatchCount() (count int, capped bool)
SearchMatchCount returns the number of retained matches without copying their ranges. Capped is true if additional matches were found.
func (*CodeBlockW) SearchMatches ¶
func (w *CodeBlockW) SearchMatches() []CodeBlockMatch
SearchMatches returns a copy of the matches in document order.
func (*CodeBlockW) Selection ¶
func (w *CodeBlockW) Selection() string
Selection returns the selected text ("" if none).
func (*CodeBlockW) StartLine ¶
func (w *CodeBlockW) StartLine(n int) *CodeBlockW
StartLine sets the number of the first line (default 1).
func (*CodeBlockW) TextID ¶
func (w *CodeBlockW) TextID() ID
TextID returns the keyboard focus target for the selectable, read-only text. Call it after configuring the block, then pass the ID to Context.SetFocus to restore focus when a related control, such as a find panel, closes.
func (*CodeBlockW) Title ¶
func (w *CodeBlockW) Title(s string) *CodeBlockW
Title shows a header row with title (a file name, the language …) and the copy button.
func (*CodeBlockW) VisibleStartByte ¶
func (w *CodeBlockW) VisibleStartByte() (offset int, ok bool)
VisibleStartByte returns the normalized source byte offset of the first visible visual row from the last painted frame. CRLF and CR count as one LF byte. The result is unavailable until the current source and wrap setting have been painted.
func (*CodeBlockW) Wrap ¶
func (w *CodeBlockW) Wrap(on bool) *CodeBlockW
Wrap wraps long lines instead of scrolling sideways.
type CodeDocument ¶
type CodeDocument interface {
// Line appends the spans of line i (0-based) to dst[:0]: in order,
// not overlapping, gaps are plain text. It reports whether they are
// final; spans that are not final are a guess made while the lines
// above are still being tokenized, and the viewer asks again in a
// later frame.
Line(i int, dst []CodeSpan) ([]CodeSpan, bool)
}
CodeDocument is the highlighting of one immutable piece of code.
type CodeHeaderStyle ¶
type CodeHeaderStyle struct {
Padding geom.Insets // logical pixels around the header contents
Divider theme.Color // 1px separator, omitted when transparent
Mono bool // use monospace for the title or language
TextCopy bool // show the localized Copy label instead of an icon
}
CodeHeaderStyle styles the header shared by CodeBlock and Markdown fences.
type CodeHighlighter ¶
type CodeHighlighter interface {
// Document prepares the highlighting of code (lines separated by
// "\n") in language lang: a language id, alias or file extension
// ("go", "ts", "python", "sh" …). It returns nil when the language is
// unknown, and the code is shown as plain text.
Document(lang, code string) CodeDocument
}
CodeHighlighter splits code into highlighted spans by language. Implementations must be safe for use from the UI thread of several windows.
func DefaultCodeHighlighter ¶
func DefaultCodeHighlighter() CodeHighlighter
DefaultCodeHighlighter returns the highlighter installed with SetCodeHighlighter (nil if none).
type CodeSpan ¶
type CodeSpan struct {
Start, End int
Kind CodeTokenKind
}
CodeSpan is a highlighted piece of one line: bytes [Start, End) of the line (without its "\n").
type CodeTokenKind ¶
type CodeTokenKind uint8
CodeTokenKind classifies a span of highlighted code.
Append-only: new kinds go at the end.
const ( CodePlain CodeTokenKind = iota CodeKeyword CodeString CodeNumber CodeComment CodeType CodeFunction CodeVariable CodeConstant CodeOperator CodePunctuation CodeTag CodeAttribute CodeProperty CodeRegexp CodeInvalid )
The token kinds; CodePlain is unhighlighted text.
type CollapseItem ¶
type CollapseItem struct {
Key string
Label string
Extra func() // content at the inline end of the header
Body func()
Disabled bool
NoArrow bool
// Collapsible overrides the group's Collapsible for this panel:
// "header" (only the title and the arrow toggle), "icon" (only the
// arrow toggles) or "disabled"; "" uses the group's mode.
Collapsible string
}
CollapseItem is one panel of a Collapse.
type CollapseW ¶
type CollapseW struct {
// contains filtered or unexported fields
}
CollapseW is an accordion / collapse panel group.
func Collapse ¶
func Collapse(c *Context, active *[]string, items []CollapseItem) *CollapseW
Collapse starts a collapse group bound to the app's open panel keys. Configure with chained modifiers and finish with Show.
func (*CollapseW) BeforeCollapse ¶
BeforeCollapse is asked before a panel opens or closes (Element before-collapse); returning false keeps the panel as it is.
func (*CollapseW) Borderless ¶
Borderless removes the outer border (Ant bordered={false}).
func (*CollapseW) Collapsible ¶
Collapsible sets which part of every header toggles its panel (antd collapsible): "" the whole header, "header" only the title and the arrow, "icon" only the arrow, "disabled" nothing. CollapseItem.Collapsible overrides it per panel.
func (*CollapseW) ExpandIcon ¶
ExpandIcon replaces the expand arrow (antd expandIcon, Element icon). It points to the inline end when closed and turns 90° when open.
func (*CollapseW) ExpandIconPlacement ¶
ExpandIconPlacement places the expand arrow: "start" (before the label, Ant's default) or "end" (Element and shadcn's default); antd expandIconPlacement, Element expand-icon-position ("left" / "right" are accepted too). Other values keep the theme's default.
func (*CollapseW) IsOpen ¶
IsOpen reports whether key is open. In accordion mode only the first active key counts (rc-collapse useItems: activeKey[0]).
func (*CollapseW) Size ¶
func (w *CollapseW) Size(s ControlSize) *CollapseW
Size sets header padding (Small / Middle / Large).
type ColorPickerLocale ¶
type ColorPickerLocale struct {
Presets, None, ClearColor, Clear, Saturation, Hue, Alpha string
Format string // accessible name of the HEX / RGB format select
Value string // accessible name of the value input of ColorPickerPanel ("颜色值")
Gradient string // the gradient stop bar of ColorPickerGradient ("渐变色标")
Angle string // the gradient angle input ("角度")
// contains filtered or unexported fields
}
ColorPickerLocale holds the ColorPicker panel texts.
type ColorPickerPanelW ¶
type ColorPickerPanelW struct {
// contains filtered or unexported fields
}
ColorPickerPanelW is an inline color panel bound to a color.
func ColorPickerPanel ¶
func ColorPickerPanel(c *Context, val *theme.Color) *ColorPickerPanelW
ColorPickerPanel adds an inline color panel bound to *val; changes apply immediately in every design system (there is no confirm step).
ui.ColorPickerPanel(c, &col).Presets(theme.Hex("#409eff"), theme.Hex("#67c23a"))
func ColorPickerPanelGradient ¶
func ColorPickerPanelGradient(c *Context, val *theme.Gradient) *ColorPickerPanelW
ColorPickerPanelGradient adds an inline panel bound to a linear gradient: the stop bar and angle input of ColorPickerGradient above the editors of the selected stop's color. ColorPickerPanel (single color) is unchanged.
ui.ColorPickerPanelGradient(c, &g).NoAlpha()
func (*ColorPickerPanelW) AllowClear ¶
func (w *ColorPickerPanelW) AllowClear() *ColorPickerPanelW
AllowClear adds the "no color" control (Ant).
func (*ColorPickerPanelW) Border ¶
func (w *ColorPickerPanelW) Border(on bool) *ColorPickerPanelW
Border toggles the panel border (default on).
func (*ColorPickerPanelW) Changed ¶
func (w *ColorPickerPanelW) Changed() bool
Changed reports a new color this frame.
func (*ColorPickerPanelW) Disabled ¶
func (w *ColorPickerPanelW) Disabled(on bool) *ColorPickerPanelW
Disabled turns the panel off.
func (*ColorPickerPanelW) DisabledFormat ¶
func (w *ColorPickerPanelW) DisabledFormat(on bool) *ColorPickerPanelW
DisabledFormat leaves the format select out (Ant disabledFormat).
func (*ColorPickerPanelW) Format ¶
func (w *ColorPickerPanelW) Format(f string) *ColorPickerPanelW
Format sets the value text format: "hex" (default), "rgb", "hsb" or "hsv".
func (*ColorPickerPanelW) NoAlpha ¶
func (w *ColorPickerPanelW) NoAlpha() *ColorPickerPanelW
NoAlpha hides the alpha bar and input.
func (*ColorPickerPanelW) PresetGroups ¶
func (w *ColorPickerPanelW) PresetGroups(groups ...ColorPresetGroup) *ColorPickerPanelW
PresetGroups shows several titled preset groups (see ColorPickerW.PresetGroups).
func (*ColorPickerPanelW) PresetLabel ¶
func (w *ColorPickerPanelW) PresetLabel(s string) *ColorPickerPanelW
PresetLabel names the preset group (Ant).
func (*ColorPickerPanelW) Presets ¶
func (w *ColorPickerPanelW) Presets(cols ...theme.Color) *ColorPickerPanelW
Presets adds preset swatches (Element predefine, Ant presets).
type ColorPickerW ¶
type ColorPickerW struct {
// contains filtered or unexported fields
}
ColorPickerW is a color input with a picker panel.
func ColorPicker ¶
func ColorPicker(c *Context, val *theme.Color) *ColorPickerW
ColorPicker adds a color picker bound to *val. The zero Color means "no color" (cleared).
func ColorPickerGradient ¶
func ColorPickerGradient(c *Context, val *theme.Gradient) *ColorPickerW
ColorPickerGradient adds a color picker bound to a linear gradient (Ant mode="gradient"): the trigger shows the gradient, and the panel adds a stop bar and an angle input above the usual editors, which edit the color of the selected stop. On the stop bar a press on empty rail adds a stop (with the gradient's color there), dragging a handle moves it and dragging it away from the bar removes it (at least two stops stay); from the keyboard Left / Right move the selected stop, Up / Down select the previous / next one, Enter or Insert adds one after it and Delete / Backspace removes it. Changes apply at once in every design system. The zero Gradient means "no color"; editing a color then creates two stops of that color. The single-color ColorPicker is unchanged.
g := theme.Gradient{Angle: 90, Stops: []theme.GradientStop{{0, theme.Hex("#1677ff")}, {1, theme.Hex("#722ed1")}}}
ui.ColorPickerGradient(c, &g).ShowText()
func (*ColorPickerW) A11yLabel ¶
func (w *ColorPickerW) A11yLabel(s string) *ColorPickerW
A11yLabel sets the accessible name (default: the Locale's A11y.Color; inside a FormItem the item label).
func (*ColorPickerW) AllowClear ¶
func (w *ColorPickerW) AllowClear() *ColorPickerW
AllowClear adds a clear control (Element always has one).
func (*ColorPickerW) Changed ¶
func (w *ColorPickerW) Changed() bool
Changed reports a new color this frame (Element: on confirm or clear).
func (*ColorPickerW) Cleared ¶
func (w *ColorPickerW) Cleared() bool
Cleared reports that the value was cleared this frame.
func (*ColorPickerW) Disabled ¶
func (w *ColorPickerW) Disabled(on bool) *ColorPickerW
func (*ColorPickerW) DisabledFormat ¶
func (w *ColorPickerW) DisabledFormat(on bool) *ColorPickerW
DisabledFormat leaves the format select out of the panel (Ant disabledFormat): the value is edited in the current Format only.
func (*ColorPickerW) Format ¶
func (w *ColorPickerW) Format(f string) *ColorPickerW
Format sets the value text and input format: "hex", "rgb", or "hsb" / "hsv" (the same color space, written "hsb(220, 75%, 80%)" / "hsv(...)"; Ant's panel then edits hue, saturation and brightness). Typed text is accepted in any of these forms.
func (*ColorPickerW) IsOpen ¶
func (w *ColorPickerW) IsOpen() bool
IsOpen reports whether the panel is shown.
func (*ColorPickerW) NoAlpha ¶
func (w *ColorPickerW) NoAlpha() *ColorPickerW
NoAlpha hides the alpha slider and input.
func (*ColorPickerW) Open ¶
func (w *ColorPickerW) Open() *ColorPickerW
Open forces the panel open (screenshots, tests).
func (*ColorPickerW) Placement ¶
func (w *ColorPickerW) Placement(p Placement) *ColorPickerW
Placement sets where the panel opens: BottomStart (default), BottomEnd, TopStart or TopEnd (Ant placement "bottomLeft" …); it flips when there is no room.
func (*ColorPickerW) PresetGroups ¶
func (w *ColorPickerW) PresetGroups(groups ...ColorPresetGroup) *ColorPickerW
PresetGroups shows several titled preset groups instead of Presets. In Ant / shadcn the titles are buttons that collapse / expand their group (Closed starts collapsed); Element shows each title above its swatches.
func (*ColorPickerW) PresetLabel ¶
func (w *ColorPickerW) PresetLabel(s string) *ColorPickerW
PresetLabel names the preset group (Ant; default "推荐").
func (*ColorPickerW) Presets ¶
func (w *ColorPickerW) Presets(cols ...theme.Color) *ColorPickerW
Presets adds preset swatches (Ant presets, Element predefine).
func (*ColorPickerW) ShowText ¶
func (w *ColorPickerW) ShowText() *ColorPickerW
ShowText shows the color value next to the swatch.
func (*ColorPickerW) Size ¶
func (w *ColorPickerW) Size(s ControlSize) *ColorPickerW
func (*ColorPickerW) Status ¶
func (w *ColorPickerW) Status(s string) *ColorPickerW
func (*ColorPickerW) Trigger ¶
func (w *ColorPickerW) Trigger(t Trigger) *ColorPickerW
Trigger chooses what opens the panel: TriggerClick (default) or TriggerHover (Ant trigger="hover"): the panel opens when the pointer rests on the swatch and closes shortly after it leaves both; a click (or Enter / Space) pins it open until an outside press or Escape. TriggerContextMenu is treated as TriggerClick.
type ColorPresetGroup ¶
type ColorPresetGroup struct {
Label string
Colors []theme.Color
Closed bool // Ant / shadcn: the group starts collapsed
}
ColorPresetGroup is a titled group of preset swatches (PresetGroups).
type ColumnsStateFuncs ¶
type ColumnsStateFuncs struct {
Load func(key string) (TableColumnState, bool)
Save func(key string, s TableColumnState)
}
ColumnsStateFuncs adapts two functions to ColumnsStateStore.
func (ColumnsStateFuncs) LoadColumnsState ¶
func (f ColumnsStateFuncs) LoadColumnsState(key string) (TableColumnState, bool)
LoadColumnsState calls Load (nil: nothing stored).
func (ColumnsStateFuncs) SaveColumnsState ¶
func (f ColumnsStateFuncs) SaveColumnsState(key string, s TableColumnState)
SaveColumnsState calls Save (nil: dropped).
type ColumnsStateStore ¶
type ColumnsStateStore interface {
LoadColumnsState(key string) (TableColumnState, bool)
SaveColumnsState(key string, s TableColumnState)
}
ColumnsStateStore keeps ProTable column states where the application wants them (memory, a settings file, a database): ProTable loads the state once by key and saves it on every change. It never touches the disk itself.
type CommandItem ¶
type CommandItem struct {
Value string
Label string
Group string // heading the item is listed under ("" = none)
Icon *icon.Icon // optional leading icon
Shortcut string // right-aligned hint such as "⌘P"
Keywords []string // extra search terms
Disabled bool
}
CommandItem is one entry of a Command palette.
type CommandLocale ¶
type CommandLocale struct {
Placeholder, Empty string
// contains filtered or unexported fields
}
CommandLocale holds the Command palette texts.
type CommandW ¶
type CommandW struct {
// contains filtered or unexported fields
}
CommandW is a command palette under construction (shadcn/ui Command): a search field over a filtered, grouped list navigated with the arrow keys. It renders in every design system with the active theme's tokens.
func Command ¶
func Command(c *Context, items []CommandItem) *CommandW
Command adds a command palette over items. Typing filters and ranks the list like cmdk: an item matches when the search letters appear in order in its label, value or keywords (case-insensitive); whole-word and prefix matches rank first and groups follow their best item. Up/Down (and Ctrl+N/J, Ctrl+P/K) move the active row, Home/End jump to the first / last, Enter or a click picks it (Selected).
ConfigProvider.Defaults("Command", ...) keys: "placeholder", "emptyText" (string), "loop" (bool, default false), "shouldFilter" (bool, default true), "vimBindings" (bool, default true).
func (*CommandW) DataVersion ¶
DataVersion tells the palette that the items slice was modified in place (a virtual list caches its matches, layout and width by slice identity, length and this number): after editing items of the same slice without changing its length, change v (or pass a new slice) so they are recomputed on the next frame.
func (*CommandW) DisablePointerSelection ¶
DisablePointerSelection stops hovering from moving the active item (cmdk disablePointerSelection); clicks still pick.
func (*CommandW) Filter ¶
Filter replaces the matching and ranking (cmdk filter): fn returns 0 to hide an item, else its rank (higher first) for the item's value (Label when Value is empty), the trimmed search and its keywords.
func (*CommandW) Loop ¶
Loop lets the arrow keys wrap from the last item to the first and back (cmdk loop; default false).
func (*CommandW) Placeholder ¶
Placeholder replaces the search placeholder.
func (*CommandW) Selected ¶
func (w *CommandW) Selected() (CommandItem, bool)
Selected returns the item picked this frame.
func (*CommandW) ShouldFilter ¶
ShouldFilter(false) lists every item whatever the search (cmdk shouldFilter): the app filters items itself, for example from a server, reading Query.
func (*CommandW) Value ¶
Value binds the value of the active item (cmdk value / onValueChange): the palette highlights the item whose Value (Label when empty) equals *v and writes the active item's value back as it moves. A value that is not listed leaves the first item active.
func (*CommandW) ValueChanged ¶
ValueChanged reports that the active item changed this frame.
func (*CommandW) VimBindings ¶
VimBindings(false) turns off Ctrl+N/J (next) and Ctrl+P/K (previous) (cmdk vimBindings; default true).
func (*CommandW) Virtual ¶
Virtual forces the virtual list on or off; by default lists showing more than 100 items are virtual: only the rows in view and the active item are built (groups only for their visible part), the list keeps the width, height and scroll range of the full list and follows the active item when it moves with the keyboard, but items out of view are not in the accessibility tree. Without a Filter function the matches, their order and the width are reused while the items slice (identity and length), the search and the DataVersion stay the same: an item edited in place (same slice, same length) does not join or leave the matches, nor change the list's width, until one of them changes. Virtual(false) builds every row.
type CompactW ¶
type CompactW struct {
// contains filtered or unexported fields
}
CompactW joins its direct child controls (Input, Select, Button, InputNumber, DatePicker, Addon, ...) into one group: neighbours overlap by one pixel and only the outer corners stay rounded (Ant Space.Compact / Input.Group, Element input prepend/append and button groups).
The children are drawn by their own painters; Compact squares the joined corners by repainting the joined edge columns with a widened rectangle, so it works with any control without changing it.
func Compact ¶
Compact starts a compact group; chain options, then Body.
ui.Compact(c).Body(func() { ui.Input(c, &v); ui.Button(c, "提交").Primary() })
ConfigProvider.Defaults("Compact", ...) keys: "block" (bool).
func (*CompactW) Orientation ¶
Orientation sets the direction: "horizontal" (default) or "vertical" (antd 6 orientation; Vertical is the shorthand). Other values are ignored.
func (*CompactW) Size ¶
func (w *CompactW) Size(s ControlSize) *CompactW
Size sets the size of the controls in the group that do not set their own (antd Space.Compact size): it scopes the component size like ConfigProvider.Size.
type ConfigProviderW ¶
type ConfigProviderW struct {
// contains filtered or unexported fields
}
ConfigProviderW configures every component built inside its Body: size, locale, component default properties, disabled state and theme.
func ConfigProvider ¶
func ConfigProvider(c *Context) *ConfigProviderW
ConfigProvider starts a configuration scope; chain options, then Body.
func (*ConfigProviderW) Body ¶
func (p *ConfigProviderW) Body(fn func())
Body builds fn inside the configuration scope.
func (*ConfigProviderW) Compact ¶
func (p *ConfigProviderW) Compact(on bool) *ConfigProviderW
Compact selects the compact size algorithm.
func (*ConfigProviderW) ComponentDisabled ¶
func (p *ConfigProviderW) ComponentDisabled(on bool) *ConfigProviderW
ComponentDisabled disables every widget inside.
func (*ConfigProviderW) Components ¶
func (p *ConfigProviderW) Components(cs theme.Components) *ConfigProviderW
Components layers component token overrides (theme.Components; zero fields inherit) over the scope's theme. Repeated calls merge. Like Theme, it themes the window from the root provider and only the scope from a nested one.
func (*ConfigProviderW) Dark ¶
func (p *ConfigProviderW) Dark(on bool) *ConfigProviderW
Dark switches between the light and dark algorithm.
func (*ConfigProviderW) Defaults ¶
func (p *ConfigProviderW) Defaults(component string, props Props) *ConfigProviderW
Defaults sets default properties of a component; keys merge with outer providers.
func (*ConfigProviderW) Direction ¶
func (p *ConfigProviderW) Direction(d Direction) *ConfigProviderW
Direction sets the inline direction of the scope: LTR, RTL, or DirAuto to derive it from the scope's Locale again (overriding an explicit direction of an outer provider). Without a provider that sets one, the direction follows the Locale, then SetDefaultDirection.
func (*ConfigProviderW) Flavor ¶
func (p *ConfigProviderW) Flavor(f theme.Flavor) *ConfigProviderW
Flavor switches the design language (theme.Ant / theme.Element / theme.StyleShadcn) keeping dark mode and primary color settings of this provider.
func (*ConfigProviderW) HighContrast ¶
func (p *ConfigProviderW) HighContrast(on bool) *ConfigProviderW
HighContrast fixes the contrast of the scope: true draws theme.HighContrast of the scope's theme (WCAG AA for every required pair, docs/accessibility.md), false the standard variant. Without it the scope inherits: a theme rebuilt by Flavor, Dark, PrimaryColor or Compact stays high-contrast when the outer theme is (for example while uihost follows the system preference). Like Theme, the root provider applies it to the window; uihost then stops following the system theme for that window.
HighContrast(false) inside a high-contrast scope regenerates the theme from its flavor, dark mode and component overrides, as Dark does: token customizations of the outer theme that the generator cannot reproduce are lost.
func (*ConfigProviderW) Locale ¶
func (p *ConfigProviderW) Locale(l *Locale) *ConfigProviderW
Locale sets the language.
func (*ConfigProviderW) LocaleCode ¶
func (p *ConfigProviderW) LocaleCode(code string) *ConfigProviderW
LocaleCode sets the language by registered code ("en-US").
func (*ConfigProviderW) PrimaryColor ¶
func (p *ConfigProviderW) PrimaryColor(col theme.Color) *ConfigProviderW
PrimaryColor overrides the brand color (derived shades follow).
func (*ConfigProviderW) Size ¶
func (p *ConfigProviderW) Size(s ControlSize) *ConfigProviderW
Size sets the default control size (small / middle / large).
func (*ConfigProviderW) Theme ¶
func (p *ConfigProviderW) Theme(th *theme.Theme) *ConfigProviderW
Theme sets the theme of the scope. A provider called directly by the page function outside any other provider (the root provider) switches the window theme: background, global layers (Message, Notification) and everything built before it. A nested provider only themes the widgets built inside its Body, including their paint. The same applies to Flavor, Dark, PrimaryColor and Compact.
type ConfirmAction ¶
type ConfirmAction string
ConfirmAction is how a Confirm / MessageBox / Prompt dialog was closed.
const ( // ConfirmActionConfirm: the OK button (or Enter in a Prompt). ConfirmActionConfirm ConfirmAction = "confirm" // ConfirmActionCancel: the Cancel button, or with // DistinguishCancelAndClose unset also the close button, Escape and // a mask click. ConfirmActionCancel ConfirmAction = "cancel" // ConfirmActionClose: the close button, Escape or a mask click when // DistinguishCancelAndClose is set. ConfirmActionClose ConfirmAction = "close" )
type ConfirmOptions ¶
type ConfirmOptions struct {
Title string
Content string
// Status picks the leading icon: "info", "success", "warning", "error"
// or "none". Confirm/Prompt default to "warning"/"none", MessageBox to
// "info".
Status string
OkText string // default "确定" ("知道了" for Ant MessageBox)
CancelText string // default "取消"
Danger bool // red OK button (destructive actions)
Width float32
// MaskClosable closes the dialog (as a cancel) on a mask click.
MaskClosable bool
// OnOk runs on the UI thread when OK is activated. The dialog closes
// after it returns unless it called d.Loading(true); then it stays open
// with a spinning OK button until d.Close().
OnOk func(d *ConfirmRef)
// OnCancel runs on Cancel, the close button, Escape or a mask click.
OnCancel func()
// DistinguishCancelAndClose tells the close button, Escape and a
// mask click apart from Cancel: they run OnClose (not OnCancel) and
// ConfirmRef.Action reports ConfirmActionClose.
DistinguishCancelAndClose bool
// OnClose runs when the dialog is closed without Cancel or OK
// (close button, Escape, mask) and DistinguishCancelAndClose is set.
OnClose func()
// Center centers the icon, title, content and buttons.
Center bool
// Draggable lets the user move the dialog by dragging its title.
Draggable bool
// Icon replaces the status icon; it is drawn in the status color
// (the primary color for Status "none").
Icon *icon.Icon
// AutoFocusButton picks the button focused when the dialog opens:
// "" or "ok" (default), "cancel", or "none" (antd autoFocusButton,
// null for none). A Prompt focuses its input.
AutoFocusButton string
// NoKeyboard keeps Escape from closing the dialog (antd keyboard
// false, Element close-on-press-escape false).
NoKeyboard bool
// Prompt only.
InputValue string
InputPlaceholder string
// Validate returns an error message ("" = valid); OK is refused while
// it fails.
Validate func(v string) string
}
ConfirmOptions configure Confirm, MessageBox and Prompt.
type ConfirmRef ¶
type ConfirmRef struct {
// contains filtered or unexported fields
}
ConfirmRef is a handle to an open dialog.
func Confirm ¶
func Confirm(c *Context, o ConfirmOptions) *ConfirmRef
Confirm opens a confirmation dialog with Cancel and OK buttons.
func MessageBox ¶
func MessageBox(c *Context, o ConfirmOptions) *ConfirmRef
MessageBox opens an information dialog with a single OK button (Ant Modal.info/success/warning/error, Element ElMessageBox.alert). Set o.Status to pick the icon.
func Prompt ¶
func Prompt(c *Context, o ConfirmOptions) *ConfirmRef
Prompt opens a dialog with a text input; read the value in OnOk with d.Value().
func (*ConfirmRef) Action ¶
func (d *ConfirmRef) Action() ConfirmAction
Action reports how the dialog was closed by the user ("" while open or after Close).
func (*ConfirmRef) Close ¶
func (d *ConfirmRef) Close()
Close closes the dialog without calling any callback. It is safe to call from any goroutine (e.g. when async work started in OnOk finishes): the state is atomic and a frame is requested through Window.Invalidate, which the Window contract makes thread-safe.
func (*ConfirmRef) IsOpen ¶
func (d *ConfirmRef) IsOpen() bool
IsOpen reports whether the dialog is still shown.
func (*ConfirmRef) Loading ¶
func (d *ConfirmRef) Loading(on bool)
Loading shows (or clears) the spinner on the OK button. While loading, OK is inert and the dialog stays open after OnOk returns. Safe to call from another goroutine.
type ContentKind ¶
type ContentKind int
ContentKind says what a window mostly shows (RunnerOptions.Content). The window host uses it to decide when a window leaves its default renderer: on Apple Silicon macOS, uihost starts every window, of any size and any ContentKind, on native Core Animation layers, whose memory footprint is well below Metal's, and switches a window to Metal at most once. TANGO_RENDERER and RunnerOptions.Renderer still take precedence, and hosts without such a choice ignore it.
const ( // ContentGeneral is the default. On Apple Silicon macOS the window // switches itself to Metal on the frame after its first keyboard input // (a non-modifier key press, committed text or an IME composition), // because Metal shows input about two frames sooner, or after six // consecutive frames over 8 ms or six consecutive frames of full-window // software fallback. Scrolling and pointer input alone keep it on native // layers. Intel Macs default to Metal. ContentGeneral ContentKind = iota // ContentData is for windows that mostly display data changing on its // own: tables, grids, quote boards, lists and dashboards. On Apple // Silicon macOS they ignore keyboard input, so browsing with arrow or // page keys keeps their memory footprint low (list and quote windows: // 39-54 vs 135-147 MB on Metal; an 800x600 grid redrawing 600 cells // every frame: about 69 MB), and switch to Metal only under the same // frame-cost rules as ContentGeneral. Their input // reaches the screen about two frames later than on Metal, so editors, // terminals and drawing canvases should stay ContentGeneral. ContentData )
type Context ¶
Context is passed to page functions; it builds the frame's widget tree and answers interaction queries. It is only valid on the UI goroutine during a frame.
func (*Context) A11yAction ¶
A11yAction returns an accessibility action requested for id this frame (Runner.PerformAction): widgets whose activation does not go through Interact (gesture areas, custom hit testing) read it to react to Press, Expand, SetValue … Press is also delivered as a click to Interact.
func (*Context) A11yEnabled ¶
A11yEnabled reports whether the semantics tree is built this frame (a host or the Driver asked for it). Widgets may skip work that only feeds the tree (formatting descriptions, closures) when it is false.
func (*Context) A11yScrollRequest ¶
A11yScrollRequest returns the widget a screen reader asked to scroll into view this frame (the ScrollIntoView action) when container is the nearest scroll container around it that is not a ui scroll container (Box.A11yScroller); the container scrolls the minimum amount that shows the widget's rectangle of the last frame (Context.RectOf) inside its visible part. ui scroll containers further out are scrolled by the runner itself.
func (*Context) Anim ¶
Anim returns a value that eases towards target over dur, retained per (id, slot). The first call returns target immediately. While moving it keeps frames coming; when settled no frames are requested.
func (*Context) Announce ¶
Announce asks the screen reader to speak text once (a polite or assertive announcement not tied to a node, e.g. "3 results"). It is ignored when accessibility is off.
func (*Context) CaptureTab ¶
CaptureTab makes Tab and Shift+Tab reach widget id (in KeysFor) instead of moving focus, while id has keyboard focus. Call it during the build of every frame in which id wants Tab. Ctrl+Tab, or Esc then Tab, still moves focus out of it.
func (*Context) ClaimBack ¶
func (c *Context) ClaimBack()
ClaimBack asks for the system Back action in this frame: while some frame calls it, Back arrives as an Escape key press, read with Context.Escape (on the page it is not consumed by overlays, which are above it and take Escape first). Call it every frame the page has something Back should undo, typically an in-page navigation stack that is not at its root.
func (*Context) ClaimEscape ¶
ClaimEscape makes keyboard Esc reach widget id (in KeysFor and EventsFor) instead of closing overlays, while id has keyboard focus. Call it during the build of every frame in which id wants Esc. Android's system Back (Esc with Code input.KeyBack) is not claimed and still closes overlays.
func (*Context) ClaimKeyboardReveal ¶
func (c *Context) ClaimKeyboardReveal()
ClaimKeyboardReveal marks the pending keyboard avoidance request as handled (see PendingKeyboardReveal). The frame is redrawn completely.
func (*Context) ComponentSize ¶
func (c *Context) ComponentSize() (ControlSize, bool)
ComponentSize returns the size set by the innermost ConfigProvider and whether one was set; components use it when the caller gave no size.
func (*Context) CompositionFor ¶
CompositionFor returns the current IME pre-edit string for focused id.
func (*Context) ConfigProp ¶
ConfigProp returns a default property for component (nil, false when unset). Nested providers inherit and override per key.
func (*Context) ContextMenu ¶
ContextMenu reports a secondary-button (right) press this frame and its position.
func (*Context) ContextMenuFor ¶
ContextMenuFor reports a secondary-button press this frame inside id's last-frame rectangle that did not land on a layer above id.
func (*Context) Damage ¶
Damage tells the renderer that the pixels inside r (window logical pixels, the space of RectOf and Box.Rect) change this frame. Once any widget declares damage (or a ScrollShift) in a frame, the renderer may redraw only the declared regions plus what the Runner detects itself: running Anim/AnimFrom transitions (old and new rect of the animation's widget ID), overlays opening, closing or moving, the focus ring and the hovered/pressed widget. Everything else that looks different must be covered by a declaration. Frames without declarations are redrawn completely, and so are frames in which time-driven drawing may have changed (the clock passed a WakeAt timer of the last frame, such as a text caret's blink, or the last frame was animating; WakeAtDamaged timers excepted).
UI thread only, during the page build or a paint function (before the Runner collects the hints at the end of the frame).
func (*Context) Direction ¶
Direction reports the resolved direction of the current scope: LTR or RTL, never DirAuto.
func (*Context) Dismissed ¶
Dismissed reports whether an open overlay panel should close this frame: Escape routed to it (EscapeAt) or a press outside it and the extra widgets, typically its anchor (PressedOutside). Call it every frame the panel is open.
func (*Context) Escape ¶
Escape reports (and consumes) an Escape press not handled by a focused widget, routed like EscapeAt using the layer the caller is being built in. Overlays that check Escape outside their own content (after building the panel) must use EscapeAt with the panel ID instead.
func (*Context) EscapeAt ¶
EscapeAt reports (and consumes) an Escape press meant for the overlay panel: it is true only when panel is the top-most layer that listened for Escape in the last frame, so Escape closes stacked popups one at a time. Call it every frame the panel is open (calling it is what registers the panel as a listener). panel is the overlay's box ID (Overlay(...).ID()); before the panel was first painted the caller's own layer is used.
func (*Context) EventsFor ¶
EventsFor returns, in arrival order, the keyboard input of this frame for widget id while it has focus: input.KeyEvent (Key folded with Key.Base, Code the physical key), input.TextInput and input.Composition, interleaved as they happened. Use it when order matters (a text editor: Backspace then "a" is not "a" then Backspace); KeysFor and TextFor give the same events split by kind.
It also carries Esc (which overlays consume through Escape) and Tab when id declared CaptureTab. Like KeysFor it hands the events over once: later calls in the same frame return nil.
func (*Context) FileDrag ¶
FileDrag reports a file drag over the window and its position in UI logical pixels. It is read-only: use DropZone for hit testing and highlighting.
func (*Context) Inline ¶
func (c *Context) Inline(r geom.Rect) InlineSpan
Inline returns the inline span of r in the current scope's direction. Call it during build, or during paint (the node's own scope is current).
func (*Context) InlineKey ¶
InlineKey reports whether k means "previous" or "next" along the inline axis: Left/Right swap in RTL scopes.
func (*Context) Invalidate ¶
func (c *Context) Invalidate()
Invalidate requests another build pass of the current frame (e.g. after changing state that widgets built earlier in this frame read). It must be called on the UI goroutine during a frame; from other goroutines use the function returned by Invalidator.
func (*Context) InvalidateImage ¶
InvalidateImage drops the renderer's cached copies of img. Call it on the UI goroutine during building or painting, before rendering, after changing image pixels or discarding a private derived image. A later draw of the same image value prepares it again. Renderers without image caches may ignore this hint.
This does not declare redraw damage. In-place pixel changes also need Damage (or a full redraw); replacing a drawn image value changes its paint fingerprint normally. Recorded image pixels remain caller-owned.
func (*Context) Invalidator ¶
func (c *Context) Invalidator() func()
Invalidator returns a function that requests a new frame. Unlike Invalidate it is safe to call from any goroutine (background loaders, network callbacks) and after the frame that obtained it has ended.
func (*Context) IsRTL ¶
IsRTL reports whether the current scope lays out right to left. During paint and measure callbacks it reports the direction of the node being painted or measured.
func (*Context) KeepPointer ¶
KeepPointer stops enclosing containers from taking the pointer over from id while it holds it (CSS touch-action: none). Call it during the build of each frame in which id drags by itself.
func (*Context) KeyboardCover ¶
KeyboardCover returns how much of the bottom of r (window logical pixels) the soft keyboard hides; 0 while it is hidden.
func (*Context) KeyboardInset ¶
KeyboardInset returns the part of the window covered by the soft keyboard, in logical pixels: usually only Bottom, zero while the keyboard is hidden and on desktops. Views that must stay visible pad or lift themselves by it (with SafeArea, take the larger bottom of the two). A change redraws the whole frame.
func (*Context) KeysFor ¶
KeysFor returns the key events delivered to id this frame when it has focus, and marks them consumed.
func (*Context) Locale ¶
Locale returns the active locale (innermost ConfigProvider, else the default set by SetDefaultLocale, zh-CN out of the box). In paint and measure callbacks it is the locale of the scope the node was built in.
func (*Context) MiddlePressed ¶
MiddlePressed reports a middle-button press on the visible hit region of id. The topmost overlay wins and clipped content does not receive presses.
func (*Context) PaintIcon ¶
func (c *Context) PaintIcon(l *paint.List, ic *icon.Icon, r geom.Rect, col theme.Color, angle float64)
PaintIcon draws ic in r, mirroring directional icons in RTL scopes (rotation first, then the mirror).
func (*Context) PendingKeyboardReveal ¶
func (c *Context) PendingKeyboardReveal() (KeyboardReveal, bool)
PendingKeyboardReveal returns the keyboard avoidance request of this frame, if any. A scroll container that moves its content itself (not a ui scroll container) checks that Field lies in its content, scrolls so that Target ends above Limit and calls ClaimKeyboardReveal. Unclaimed requests go to the innermost ui scroll container around the field after the build.
func (*Context) PixelScale ¶
PixelScale returns device pixels per UI logical pixel in the current frame, including both UI scale and the host window's device-pixel ratio.
func (*Context) PointerCancelled ¶
PointerCancelled reports whether id lost the pointer this frame without a release: an enclosing container took the drag over, or the system cancelled the gesture (input.Cancel, a cancelled touch, the window lost focus). The widget should drop any drag in progress without committing it.
func (*Context) PointerDownOutside ¶
PointerDownOutside reports whether a press happened this frame outside all of the given rectangles. It ignores layering; popups should use PressedOutside or Dismissed with widget IDs instead.
func (*Context) PointerEvents ¶
PointerEvents returns every pointer event of the frame (Move, Press, Release, Leave), in arrival order, in the same coordinates as Pointer. Pointer reports only where the frame ended; apps that forward the pointer elsewhere, such as a remote desktop, read the whole path here. Like keys, the events reach the first build of the frame only; a rebuild of the same frame sees none. The slice is valid until the next build.
func (*Context) PointerMods ¶
PointerMods returns the modifiers held at the latest pointer event (move, press, release, wheel) or key event, whichever came last. Unlike PressMods it follows modifier changes during a drag, so a drag source can switch between move and copy (Alt/Option) while the pointer moves or when only the modifier key changes.
func (*Context) PointerTaken ¶
PointerTaken reports whether id took the pointer over from a widget inside it this frame, and where that press started (id is now the holder: Dragging(id) is true).
func (*Context) PressCount ¶
PressCount returns the click count of the current (or last) primary press: 1 single, 2 double, 3 triple... It follows the host's count when the platform reports one (system double-click settings), otherwise the UI's own 400 ms rule. Read it while handling a press or a drag that started with one (word / line selection by double / triple click).
func (*Context) PressMods ¶
PressMods returns the modifier keys held at the last primary press (Shift+click to extend a selection, Alt+click for a column cursor).
func (*Context) PressPos ¶
PressPos returns the position of the latest primary press, even if more pointer events followed it in the same frame.
func (*Context) PressedOutside ¶
PressedOutside reports whether the primary button went down this frame outside the last-frame rectangles of all ids and not on a layer above them: a press inside a popup stacked over the panel (a Select list opened from a Modal) is not "outside" the panel. The highest layer among ids (usually the panel; anchors on the page do not raise it) is the panel's.
func (*Context) RectOf ¶
RectOf returns the absolute rectangle id had in the last painted frame, in UI logical pixels.
func (*Context) ReduceMotion ¶
ReduceMotion reports whether the user asked for reduced motion (RunnerOptions.ReduceMotion). Anim and AnimFrom already jump to their targets; widgets check it for motion they drive themselves (shimmer, pulsing dots, marquees, autoplay).
func (*Context) ReleasePos ¶
ReleasePos returns where the primary button was released over the press that id held, this frame. Unlike Pointer (the last pointer event of the frame) it is the release event's own position, so a move that arrives in the same frame after the release does not shift it. ok is false when id was not released this frame.
func (*Context) SafeArea ¶
SafeArea returns the safe-area insets of the window in logical pixels (zero on desktops). Edge-to-edge widgets (navigation and tab bars, bottom sheets, full-screen pages) pad themselves by it. A change redraws the whole frame.
func (*Context) ScrollIntoView ¶
ScrollIntoView scrolls container scrollID (a ScrollBox or another scroll container's ID) the minimum amount that makes widget id fully visible, using both widgets' rectangles from the last painted frame. It returns false when either was not painted yet (call it again next frame).
func (*Context) ScrollIntoViewInset ¶
ScrollIntoViewInset is ScrollIntoView for a window partly covered by system UI: inset (window logical pixels, such as KeyboardInset or SafeArea) is removed from the window before it clips the container's viewport, so the widget ends up in the part of the container that is still visible. A widget taller than that part is aligned to its top. While the soft keyboard covers the container it may scroll past its content's end by the covered height. Like ScrollIntoView it returns false when either widget was not painted yet.
func (*Context) ScrollShift ¶
ScrollShift declares that the content being built moved by d inside r (window logical pixels; a pixel at p is now at p+d) since the last frame, so the renderer may copy those pixels instead of redrawing them. Call it inside the Body of the scrolled content: the current parent node is recorded as the scrolled content (for a Scroll container, its children). The Runner damages, inside r, the strip the copy uncovers and every node that does not move with the content (sticky headers, summary rows, Affix, overlays, fixed-column shadows), at its new place and where the copy carried its old pixels. The backgrounds of the content's ancestors must look the same everywhere in r. When the nodes in r cannot be classified (the content was not laid out, a node straddles r's edge, an ancestor paints over r or is transformed) the shift is withdrawn and r is redrawn as a whole.
UI thread only, during the page build.
func (*Context) Semantics ¶
Semantics annotates the widget id (built this frame) with a role, an accessible name and states, overriding what the widget declared; use it for custom widgets built from Div/Custom or to rename a control:
b := ui.Custom(c, measure, paint) c.Semantics(b.ID(), a11y.RoleImage, loc.Logo)
An empty name keeps the widget's own name. It costs nothing when accessibility is off.
func (*Context) TerminalEvents ¶
TerminalEvents declares an experimental fast input path for a focused terminal-like control. The handler runs when Runner.HandleEvent receives an event, before the event is queued for the next frame. Returning true claims the event; returning false leaves it for ordinary frame processing.
The handler must not mutate retained UI state from another goroutine. It may enqueue work into a thread-safe application queue such as a terminal's input writer.
func (*Context) TerminalFocus ¶
TerminalFocus declares an end-of-frame focus callback for a terminal-like control. Register it during each build. The callback receives true after a frame in which the control and its window have focus. It receives false once when that focus ends, including when the control disappears. A newly focused control is notified before the previous control loses focus, so shared terminal views can transfer ownership.
Experimental: this API may change.
func (*Context) TextEditsFor ¶
TextEditsFor returns, in arrival order, the input.TextEdit and input.SelectionChange events of this frame for widget id while it has focus, and records that id applies them itself: from the next frame on they reach it unconverted. Like KeysFor it hands them over once.
func (*Context) TextOpts ¶
TextOpts sets the paragraph base direction of interface text (labels, titles) from the scope: RTL scopes get text.DirRTL, LTR scopes keep the options unchanged. User content should keep text.DirAuto instead.
func (*Context) TextStyle ¶
TextStyle returns a style using the current theme's family and line height. Custom widgets can use it for both measuring and painting text.
func (*Context) ThemeFor ¶
ThemeFor returns the theme component k reads: the current theme with k's Alias overrides applied (theme.Components.X.Alias), or c.Theme itself when k has none. Components capture it when they are built and paint from it.
func (*Context) Token ¶
func (c *Context) Token() *theme.Components
Token returns the resolved component tokens of the current theme.
func (*Context) TouchCount ¶
TouchCount returns how many fingers are on the screen.
func (*Context) TrapFocus ¶
TrapFocus makes the overlay panel (Overlay(...).ID()) a modal focus scope for this frame: Tab and Shift+Tab cycle inside it and the layers above it, keyboard focus moves into it when it opens and returns to the previously focused widget when it closes, and the semantics tree hides the layers below. Call it every frame the panel is open; Modal, Drawer and the confirm boxes do so already.
func (*Context) WakeAtDamaged ¶
WakeAtDamaged asks for a frame at t like WakeAt, for a time-driven change the widget declares itself, with Damage, in the frame it wakes (a text caret's blink): reaching t does not make that frame a full redraw, as reaching a WakeAt timer does (see Damage). The widget must declare everything the clock changed in its drawing.
UI thread only, during the page build or paint.
func (*Context) WantBack ¶
WantBack reports whether the system Back action has something to close in the last frame: a dismissible overlay above the page (anything that listened for Escape on a layer above the page) or a ClaimBack call.
func (*Context) WantImagePaste ¶
func (c *Context) WantImagePaste()
WantImagePaste tells the host that the focused text field can handle image-only Paste. Call alongside WantTextInput on each active frame. The host still delivers the regular Paste shortcut.
func (*Context) WantTextInput ¶
WantTextInput tells the host that a text field has focus and where its caret is (for IME candidate windows). Called while painting, caret is in the space being painted; it is mapped to window coordinates.
func (*Context) WantTextInputState ¶
func (c *Context) WantTextInputState(caret geom.Rect, st input.TextInputState)
WantTextInputState is WantTextInput for a field that describes its text to the input method: st carries the text around the selection (rune offsets, see input.TextInputState) and the field's hints. Call it every frame the field has focus, like WantTextInput.
func (*Context) WheelFor ¶
WheelFor returns the wheel delta that landed on widget id this frame and was not consumed by a scroll container inside it (or by a nested WheelFor listener). Use it for wheel-driven widgets that do not scroll: zoom in an image preview, a carousel, stepping a number. id must be registered for hit testing (any interact/Hovered call); delivery starts the frame after the first call. Wheel over a widget that never asks keeps scrolling the containers around it.
func (*Context) WindowFocused ¶
WindowFocused reports whether the window has key focus (false after the host reported input.WindowFocus{Focused: false}). Stop caret blinking and other focus-only animations while it is false.
type ContextMenuOptions ¶
type ContextMenuOptions struct {
// NoAutoSelect opens the menu with no item highlighted, like the
// context menus of code editors: keyboard focus moves to the menu
// panel itself (role menu, not a Tab stop), Down/Home highlight the
// first enabled item, Up/End the last, a letter or digit the first
// item starting with it, and Enter/Space do nothing until an item is
// highlighted. Pointer hover, Escape and closing work as usual.
NoAutoSelect bool
// Width specifies the root panel width in logical pixels. It is
// capped to the window width minus the edge margins. A non-positive
// value uses the content width. Submenus still size to their content.
Width float32
// contains filtered or unexported fields
}
ContextMenuOptions configure ContextMenuAtWith.
type ControlSize ¶
type ControlSize uint8
ControlSize is the size variant of form controls.
Append-only: never reorder or insert; the zero value stays Middle.
const ( Middle ControlSize = iota Small Large )
type Conversation ¶
type Conversation struct {
Key string
Title string // "" shows Locale.Chat.Untitled
Time time.Time // last activity: groups the list by day unless Group is set
Group string // explicit group label
Icon *icon.Icon // leading icon (nil: none)
Running bool // a reply is being generated (spinner)
Disabled bool
// contains filtered or unexported fields
}
Conversation is one entry of a Conversations list.
type ConversationsW ¶
type ConversationsW struct {
// contains filtered or unexported fields
}
ConversationsW is a list of conversations grouped by time (today, yesterday, previous 7 / 30 days, earlier) with selection and hover actions to rename (F2) and delete (Delete).
func Conversations ¶
func Conversations(c *Context, items []Conversation, active *string) *ConversationsW
Conversations adds a conversation list; *active holds the selected key. Put it in a Scroll for long lists, or give it Height (and Virtual for thousands of conversations).
cv := ui.Conversations(c, convs, &cur)
if k, t, ok := cv.Renamed(); ok { rename(k, t) }
if k, ok := cv.Deleted(); ok { remove(k) }
func (*ConversationsW) A11yLabel ¶
func (w *ConversationsW) A11yLabel(s string) *ConversationsW
A11yLabel sets the accessible name (default Locale.Chat.Conversations).
func (*ConversationsW) Deleted ¶
func (w *ConversationsW) Deleted() (string, bool)
Deleted returns the key whose delete action was used this frame.
func (*ConversationsW) Height ¶
func (w *ConversationsW) Height(px float32) *ConversationsW
Height fixes the list's height; longer lists scroll inside it. Default 0: the list grows with its rows (put it in a Scroll), as before. Call it, Virtual and ScrollToKey before Selected, Renamed and Deleted.
func (*ConversationsW) Layout ¶
func (w *ConversationsW) Layout(opts ...layout.Option) *ConversationsW
Layout applies layout options to the list.
func (*ConversationsW) NoDelete ¶
func (w *ConversationsW) NoDelete() *ConversationsW
NoDelete hides the delete action.
func (*ConversationsW) NoGroups ¶
func (w *ConversationsW) NoGroups() *ConversationsW
NoGroups lists the conversations without group headers.
func (*ConversationsW) NoRename ¶
func (w *ConversationsW) NoRename() *ConversationsW
NoRename hides the rename action.
func (*ConversationsW) Renamed ¶
func (w *ConversationsW) Renamed() (key, title string, ok bool)
Renamed returns the key and new title of a rename committed this frame.
func (*ConversationsW) ScrollToKey ¶
func (w *ConversationsW) ScrollToKey(key string, align string, offset float64) *ConversationsW
ScrollToKey scrolls the list (needs Height) to the conversation with key using align (AlignTop, AlignBottom or AlignAuto) plus offset pixels.
func (*ConversationsW) Selected ¶
func (w *ConversationsW) Selected() (string, bool)
Selected returns the key selected this frame.
func (*ConversationsW) Virtual ¶
func (w *ConversationsW) Virtual() *ConversationsW
Virtual builds only the rows in view (and a few past each edge) instead of every conversation; it needs Height and is ignored without it. The selected row and the row being renamed are always built, and the focused row is built on the frame it leaves the view, but focus inside a row clipped out of view is lost, as in the non-virtual Height form; Up / Down / Home / End move over every conversation and scroll the target into view. Rows out of view are missing from the accessibility tree (each option reports its position in the whole list) and FindText. The group layout is cached by the list's length, its first element and the day, and checked against the conversations in view every frame, so Time or Group edited in place (a conversation moved to today, the slice sorted in place) shows right as it comes into view. When the selected key is not in the list (a filtered list without the current conversation), every frame scans the list once for it.
type CountdownW ¶
type CountdownW struct {
// contains filtered or unexported fields
}
CountdownW counts down to a deadline (Statistic.Countdown / el-countdown) or, made by StatisticTimer with TimerCountup, counts up from a start time (Ant Statistic.Timer).
func Countdown ¶
func Countdown(c *Context, title string, deadline time.Time) *CountdownW
Countdown adds a countdown to deadline. Format tokens: D, HH, mm, ss, SSS (default "HH:mm:ss"); text in [brackets] is literal.
func StatisticTimer ¶
StatisticTimer adds a timer statistic (Ant Statistic.Timer): with TimerCountdown it counts down to at like Countdown; with TimerCountup it shows the time elapsed since at (zero before at) and never finishes. Format, Prefix, Suffix, Color and OnChange apply to both.
func (*CountdownW) Color ¶
func (w *CountdownW) Color(col theme.Color) *CountdownW
Color sets the value color.
func (*CountdownW) Finished ¶
func (w *CountdownW) Finished() bool
Finished reports (once) that the deadline passed this frame.
func (*CountdownW) Format ¶
func (w *CountdownW) Format(f string) *CountdownW
Format sets the display format (see Countdown).
func (*CountdownW) OnChange ¶
func (w *CountdownW) OnChange(fn func(d time.Duration)) *CountdownW
OnChange runs fn with the time left (counting up: the time elapsed) whenever the displayed value changes, e.g. every second with the default format. It does not run on the first frame.
func (*CountdownW) Prefix ¶
func (w *CountdownW) Prefix(s string) *CountdownW
Prefix / Suffix add text around the value.
func (*CountdownW) Suffix ¶
func (w *CountdownW) Suffix(s string) *CountdownW
type DamagePresenter ¶
DamagePresenter is implemented by windows that can present only the changed parts of a CPU frame. Runner calls it instead of Present when the frame carries damage and the renderer is the CPU renderer.
img is the complete frame (the CPU renderer still rasterizes every pixel); dirty lists the device-pixel rectangles, within img.Bounds(), that differ from the previous frame presented through this window, so a host that keeps its own copy of the last frame may copy only those. Ownership of img is the same as for Present. Frames without damage hints (the first frame, resizes, scale/theme/reduced-motion changes, frames whose widgets declared nothing) still go through Present.
type DatePickerLocale ¶
type DatePickerLocale struct {
SelectWeek, SelectMonth, SelectQuarter, SelectYear string // placeholders by granularity
// RangePicker placeholders by granularity (date ranges use the
// top-level StartDate / EndDate).
StartWeek, EndWeek string
StartMonth, EndMonth string
StartQuarter, EndQuarter string
StartYear, EndYear string
PrevDecade, NextDecade string // year panel arrows
WeekFmt string // week value, args: week-based year, week number, English ordinal suffix ("%[1]d-第%[2]d周")
QuarterFmt string // quarter value, args: year, quarter ("%[1]d-Q%[2]d")
QuarterCellFmt string // quarter cell of the panel, arg: quarter ("Q%d")
// contains filtered or unexported fields
}
DatePickerLocale holds the texts of the week / month / quarter / year pickers and DatePickerPanel.
type DatePickerPanelW ¶
type DatePickerPanelW struct {
// contains filtered or unexported fields
}
DatePickerPanelW is an inline date panel.
func DatePickerPanel ¶
func DatePickerPanel(c *Context, val *time.Time) *DatePickerPanelW
DatePickerPanel adds an inline date panel bound to *val. Picked values are UTC midnights normalized to the start of their period (week start per Locale.WeekStart, first day of the month, quarter or year).
ui.DatePickerPanel(c, &day) ui.DatePickerPanel(c, &from).Range(&to).Picker(ui.PickerMonth)
func (*DatePickerPanelW) Border ¶
func (w *DatePickerPanelW) Border(on bool) *DatePickerPanelW
Border toggles the panel border (default on).
func (*DatePickerPanelW) Changed ¶
func (w *DatePickerPanelW) Changed() bool
Changed reports a new value (both ends in range mode) this frame.
func (*DatePickerPanelW) Disabled ¶
func (w *DatePickerPanelW) Disabled(on bool) *DatePickerPanelW
Disabled turns the whole panel off.
func (*DatePickerPanelW) DisabledDate ¶
func (w *DatePickerPanelW) DisabledDate(fn func(time.Time) bool) *DatePickerPanelW
DisabledDate marks periods that cannot be picked (called with the first day of the period).
func (*DatePickerPanelW) MaxDate ¶
func (w *DatePickerPanelW) MaxDate(t time.Time) *DatePickerPanelW
MaxDate limits the pickable dates (Ant maxDate): periods wholly after t are disabled and the header arrows stop at t's page. Zero = no limit.
func (*DatePickerPanelW) MinDate ¶
func (w *DatePickerPanelW) MinDate(t time.Time) *DatePickerPanelW
MinDate limits the pickable dates (Ant minDate): periods wholly before t are disabled and the header arrows stop at t's page. Zero = no limit.
func (*DatePickerPanelW) Picker ¶
func (w *DatePickerPanelW) Picker(t PickerType) *DatePickerPanelW
Picker sets the granularity: PickerDate (default), PickerWeek, PickerMonth, PickerQuarter or PickerYear.
func (*DatePickerPanelW) Range ¶
func (w *DatePickerPanelW) Range(end *time.Time) *DatePickerPanelW
Range turns on range selection: *val holds the start and *end the end (both set by the second click; two panels side by side).
func (*DatePickerPanelW) ShowWeek ¶
func (w *DatePickerPanelW) ShowWeek(on bool) *DatePickerPanelW
ShowWeek adds the ISO week-number column to the day grid (Ant showWeek; the week picker always shows it).
func (*DatePickerPanelW) View ¶
func (w *DatePickerPanelW) View() PickerType
View returns the view level shown (PickerDate means the day grid).
type DatePickerW ¶
type DatePickerW struct {
// contains filtered or unexported fields
}
DatePickerW is an input that opens a date panel (days, or weeks, months, quarters or years with Picker).
func DatePicker ¶
func DatePicker(c *Context, val *time.Time) *DatePickerW
DatePicker adds a date input bound to *val. Picked values are UTC midnights (with Picker: the first day of the week, month, quarter or year).
The value can also be typed: printable keys edit the text in place and open the panel, which follows a valid date; Enter (or leaving the field) commits it, invalid or disabled text is dropped.
ConfigProvider.Defaults("DatePicker", ...) keys: "format", "placeholder", "picker" (PickerType), "allowClear", "width", "size", "variant", "placement", "showNow", "showWeek", "needConfirm".
func (*DatePickerW) A11yLabel ¶
func (w *DatePickerW) A11yLabel(s string) *DatePickerW
A11yLabel sets the accessible name (inside a FormItem the item label is used; the placeholder is the last resort).
func (*DatePickerW) AllowClear ¶
func (w *DatePickerW) AllowClear(on bool) *DatePickerW
AllowClear toggles the clear button shown on hover (on by default).
func (*DatePickerW) Changed ¶
func (w *DatePickerW) Changed() bool
func (*DatePickerW) Disabled ¶
func (w *DatePickerW) Disabled(on bool) *DatePickerW
func (*DatePickerW) DisabledDate ¶
func (w *DatePickerW) DisabledDate(fn func(time.Time) bool) *DatePickerW
DisabledDate marks dates that cannot be picked (with Picker: called with the first day of the period).
func (*DatePickerW) Format ¶
func (w *DatePickerW) Format(f string) *DatePickerW
Format sets the Go layout of the value (date, month and year pickers; week and quarter values use the Locale labels "2026-46th" / "2026-Q4").
func (*DatePickerW) IsOpen ¶
func (w *DatePickerW) IsOpen() bool
IsOpen reports whether the panel is shown.
func (*DatePickerW) Layout ¶
func (w *DatePickerW) Layout(o ...layout.Option) *DatePickerW
Layout applies layout options to the input.
func (*DatePickerW) MaxDate ¶
func (w *DatePickerW) MaxDate(t time.Time) *DatePickerW
MaxDate limits the pickable dates (Ant maxDate), like MinDate.
func (*DatePickerW) MinDate ¶
func (w *DatePickerW) MinDate(t time.Time) *DatePickerW
MinDate limits the pickable dates (Ant minDate): periods wholly before t cannot be picked or typed, and the panel arrows stop at t's page. Zero = no limit.
func (*DatePickerW) NeedConfirm ¶
func (w *DatePickerW) NeedConfirm(on bool) *DatePickerW
NeedConfirm keeps a picked date as a draft until the footer's OK button (or Enter on the picked cell, or Enter after typing) commits it (Ant needConfirm); closing the panel otherwise drops the draft. Presets still commit immediately.
func (*DatePickerW) Open ¶
func (w *DatePickerW) Open() *DatePickerW
Open forces the panel open (screenshots, tests).
func (*DatePickerW) Picker ¶
func (w *DatePickerW) Picker(p PickerType) *DatePickerW
Picker sets the granularity: PickerDate (default), PickerWeek, PickerMonth, PickerQuarter or PickerYear (Ant picker, Element type). Clicking the panel titles switches between the year, month and day views.
func (*DatePickerW) Placeholder ¶
func (w *DatePickerW) Placeholder(s string) *DatePickerW
func (*DatePickerW) Placement ¶
func (w *DatePickerW) Placement(p Placement) *DatePickerW
Placement sets where the panel opens: BottomStart (default), BottomEnd, TopStart or TopEnd (Ant placement "bottomLeft" / "bottomRight" / "topLeft" / "topRight"); it flips when there is no room.
func (*DatePickerW) Presets ¶
func (w *DatePickerW) Presets(p ...DatePreset) *DatePickerW
Presets adds a side list of named dates (DatePreset.Value) that pick immediately.
func (*DatePickerW) ShowNow ¶
func (w *DatePickerW) ShowNow(on bool) *DatePickerW
ShowNow toggles the Today link in the panel footer (Ant showNow, on by default for the date picker).
func (*DatePickerW) ShowWeek ¶
func (w *DatePickerW) ShowWeek(on bool) *DatePickerW
ShowWeek adds the ISO week-number column to the day grid (Ant showWeek; the week picker always shows it).
func (*DatePickerW) Size ¶
func (w *DatePickerW) Size(s ControlSize) *DatePickerW
func (*DatePickerW) Status ¶
func (w *DatePickerW) Status(s string) *DatePickerW
Status sets the validation look: "error" or "warning".
func (*DatePickerW) Variant ¶
func (w *DatePickerW) Variant(v string) *DatePickerW
Variant sets the frame look: "outlined" (default), "filled", "borderless" or "underlined" (Ant variant).
func (*DatePickerW) Width ¶
func (w *DatePickerW) Width(px float32) *DatePickerW
Width sets the input width in pixels (default 180).
type DatePreset ¶
type DatePreset struct {
Label string
Range [2]time.Time
Value time.Time
// contains filtered or unexported fields
}
DatePreset is a named value shown beside the picker panels: Range for RangePicker, Value for DatePicker (Range[0] when Value is zero).
type DateTimePickerW ¶
type DateTimePickerW struct {
// contains filtered or unexported fields
}
DateTimePickerW is an input whose dropdown combines a month calendar with time columns; the value is committed with "确定" or Enter.
func DateTimePicker ¶
func DateTimePicker(c *Context, val *time.Time) *DateTimePickerW
DateTimePicker adds a date-time input bound to *val (zero = empty).
func (*DateTimePickerW) A11yLabel ¶
func (w *DateTimePickerW) A11yLabel(s string) *DateTimePickerW
A11yLabel sets the accessible name (inside a FormItem the item label is used; the placeholder is the last resort).
func (*DateTimePickerW) AllowClear ¶
func (w *DateTimePickerW) AllowClear(on bool) *DateTimePickerW
func (*DateTimePickerW) Changed ¶
func (w *DateTimePickerW) Changed() bool
Changed reports a committed value this frame.
func (*DateTimePickerW) DefaultTime ¶
func (w *DateTimePickerW) DefaultTime(t time.Time) *DateTimePickerW
DefaultTime is the clock given to a day picked while no time is set (Element default-time, Ant showTime.defaultValue; default 00:00:00). Only its hour, minute and second are used.
func (*DateTimePickerW) Disabled ¶
func (w *DateTimePickerW) Disabled(on bool) *DateTimePickerW
Disabled disables the picker.
func (*DateTimePickerW) DisabledDate ¶
func (w *DateTimePickerW) DisabledDate(fn func(time.Time) bool) *DateTimePickerW
DisabledDate marks days that cannot be picked (called with UTC midnights); typed or preset values on such a day are not committed.
func (*DateTimePickerW) DisabledTime ¶
func (w *DateTimePickerW) DisabledTime(fn func(day time.Time) DisabledTimes) *DateTimePickerW
DisabledTime disables hours, minutes and seconds per day (Ant disabledTime): fn receives the drafted day (UTC midnight) and returns the options to grey out in the time columns. A value whose clock is disabled cannot be confirmed.
func (*DateTimePickerW) Format ¶
func (w *DateTimePickerW) Format(f string) *DateTimePickerW
Format sets the Go layout (default "2006-01-02 15:04:05"); omitting the seconds hides the second column.
func (*DateTimePickerW) IsOpen ¶
func (w *DateTimePickerW) IsOpen() bool
IsOpen reports whether the dropdown is shown.
func (*DateTimePickerW) Layout ¶
func (w *DateTimePickerW) Layout(o ...layout.Option) *DateTimePickerW
func (*DateTimePickerW) MaxDate ¶
func (w *DateTimePickerW) MaxDate(t time.Time) *DateTimePickerW
MaxDate limits the pickable days (Ant maxDate), like MinDate.
func (*DateTimePickerW) MinDate ¶
func (w *DateTimePickerW) MinDate(t time.Time) *DateTimePickerW
MinDate limits the pickable days (Ant minDate): earlier days cannot be picked, typed or confirmed and the month arrows stop at t's month.
func (*DateTimePickerW) Open ¶
func (w *DateTimePickerW) Open() *DateTimePickerW
Open forces the dropdown open (screenshots, tests).
func (*DateTimePickerW) Placeholder ¶
func (w *DateTimePickerW) Placeholder(s string) *DateTimePickerW
func (*DateTimePickerW) Placement ¶
func (w *DateTimePickerW) Placement(p Placement) *DateTimePickerW
Placement sets where the dropdown opens: BottomStart (default), BottomEnd, TopStart or TopEnd (Ant placement); it flips when there is no room.
func (*DateTimePickerW) Presets ¶
func (w *DateTimePickerW) Presets(p ...DatePreset) *DateTimePickerW
Presets adds a side list of named date-times (DatePreset.Value, else Range[0]) that commit immediately.
func (*DateTimePickerW) ShowNow ¶
func (w *DateTimePickerW) ShowNow(on bool) *DateTimePickerW
ShowNow toggles the Now action in the footer (Ant showNow, on by default).
func (*DateTimePickerW) Size ¶
func (w *DateTimePickerW) Size(s ControlSize) *DateTimePickerW
func (*DateTimePickerW) Status ¶
func (w *DateTimePickerW) Status(s string) *DateTimePickerW
func (*DateTimePickerW) Steps ¶
func (w *DateTimePickerW) Steps(h, m, s int) *DateTimePickerW
func (*DateTimePickerW) Variant ¶
func (w *DateTimePickerW) Variant(v string) *DateTimePickerW
Variant sets the frame look: "outlined" (default), "filled", "borderless" or "underlined".
func (*DateTimePickerW) Width ¶
func (w *DateTimePickerW) Width(px float32) *DateTimePickerW
type DefaultFooterW ¶
type DefaultFooterW struct {
// contains filtered or unexported fields
}
DefaultFooterW is the Pro page footer: a row of links above a copyright line, centred (Ant Design Pro DefaultFooter).
ui.DefaultFooter(c).Links(links).Copyright("© 2026 Tango").Show()
func DefaultFooter ¶
func DefaultFooter(c *Context) *DefaultFooterW
DefaultFooter starts a footer; chain options, then Show.
func (*DefaultFooterW) Clicked ¶
func (f *DefaultFooterW) Clicked() string
Clicked returns the Key of the link clicked in the last Show ("" if none).
func (*DefaultFooterW) Copyright ¶
func (f *DefaultFooterW) Copyright(s string) *DefaultFooterW
Copyright sets the line under the links (shown as given, so include the © sign yourself).
func (*DefaultFooterW) Links ¶
func (f *DefaultFooterW) Links(links []FooterLink) *DefaultFooterW
Links sets the link row.
func (*DefaultFooterW) Show ¶
func (f *DefaultFooterW) Show() *DefaultFooterW
Show builds the footer.
type DescItem ¶
type DescItem struct {
Label, Value string
Span int
Render func()
// Spans sets the span from a breakpoint upwards (antd span={{ xs: 1,
// md: 2 }}); the largest set breakpoint not above the window width
// wins, Span is the fallback.
Spans map[Breakpoint]int
// Filled makes the item take the rest of its row and ends the row
// (antd span: 'filled').
Filled bool
}
DescItem is one label/value pair; Render replaces Value with custom content, Span takes several columns.
type DescriptionsW ¶
type DescriptionsW struct {
// contains filtered or unexported fields
}
DescriptionsW is a description list: title, extra, columns, bordered, sizes, vertical layout, label width, per-item span and custom render.
func Descriptions ¶
func Descriptions(c *Context, items []DescItem) *DescriptionsW
Descriptions adds a description list (no border). Without Column or a "column" default the column count follows antd's DEFAULT_COLUMN_MAP: 1 on xs, 2 on sm, 3 from md up. Modifiers apply until the end of the build; the content is built then.
ConfigProvider.Defaults("Descriptions", ...) keys: "column" (int or map[Breakpoint]int), "bordered", "size", "layout" ("vertical"), "colon" (bool).
func (*DescriptionsW) Bordered ¶
func (d *DescriptionsW) Bordered() *DescriptionsW
func (*DescriptionsW) Column ¶
func (d *DescriptionsW) Column(n int) *DescriptionsW
func (*DescriptionsW) ColumnAt ¶
func (d *DescriptionsW) ColumnAt(bp Breakpoint, n int) *DescriptionsW
ColumnAt sets the column count from breakpoint bp upwards (Ant column={{ xs: 1, sm: 2, md: 3 }}); the largest set breakpoint not above the window width wins, Column (default DEFAULT_COLUMN_MAP) is the fallback.
func (*DescriptionsW) Columns ¶
func (d *DescriptionsW) Columns(m map[Breakpoint]int) *DescriptionsW
Columns sets several breakpoint column counts at once.
func (*DescriptionsW) Extra ¶
func (d *DescriptionsW) Extra(fn func()) *DescriptionsW
func (*DescriptionsW) LabelBg ¶
func (d *DescriptionsW) LabelBg(col theme.Color) *DescriptionsW
LabelBg overrides the bordered label background.
func (*DescriptionsW) LabelWidth ¶
func (d *DescriptionsW) LabelWidth(px float32) *DescriptionsW
func (*DescriptionsW) Layout ¶
func (d *DescriptionsW) Layout(o ...layout.Option) *DescriptionsW
Layout applies layout options to the list.
func (*DescriptionsW) NoColon ¶
func (d *DescriptionsW) NoColon() *DescriptionsW
func (*DescriptionsW) Size ¶
func (d *DescriptionsW) Size(s ControlSize) *DescriptionsW
func (*DescriptionsW) Title ¶
func (d *DescriptionsW) Title(s string) *DescriptionsW
func (*DescriptionsW) Vertical ¶
func (d *DescriptionsW) Vertical() *DescriptionsW
type Direction ¶
type Direction uint8
Direction is the inline (horizontal) layout direction of a scope: left-to-right or right-to-left. It is unrelated to layout.Direction (Row / Column) and text.Direction (paragraph base direction).
Append-only: never reorder or insert; the zero value stays DirAuto.
func DefaultDirection ¶
func DefaultDirection() Direction
DefaultDirection returns the value set by SetDefaultDirection.
type DisabledTimes ¶
type DisabledTimes struct {
Hours func(h int) bool
Minutes func(h, m int) bool
Seconds func(h, m, s int) bool
// contains filtered or unexported fields
}
DisabledTimes lists the clock options that cannot be picked on one day (the result of a DisabledTime callback: Ant disabledTime). Nil fields disable nothing; values are 24-hour.
type DividerW ¶
type DividerW struct {
*Box
// contains filtered or unexported fields
}
DividerW is the Box of a Divider with its line options; it embeds the *Box, so code using the returned box keeps working.
ConfigProvider.Defaults("Divider", ...) keys: "dashed" (bool), "variant" ("solid" | "dashed" | "dotted"), "orientation" ("horizontal" | "vertical"; a title placement is still accepted), "vertical" (bool), "titlePlacement" ("start" | "end" | "left" | "right" | "center"), "plain" (bool), "size" (ControlSize).
func (*DividerW) Orientation ¶
Orientation sets the direction: "horizontal" (default) or "vertical" (Ant v6 orientation). A title placement ("left", "right", "center", "start", "end") is still accepted here and sets TitlePlacement, as Ant does for the pre-v6 meaning; new code sets the title placement with TitlePlacement.
func (*DividerW) Size ¶
func (d *DividerW) Size(s ControlSize) *DividerW
Size sets the block margin of a horizontal divider (Ant size): Small 8px, Middle 16px; Large keeps the default.
func (*DividerW) TitlePlacement ¶
TitlePlacement places the title: "start", "end" (logical), "left", "right" (physical) or "center" (default; Ant titlePlacement, Element content-position). Other values are ignored.
type DockAxis ¶
type DockAxis string
DockAxis is the direction of a DockNode split: DockRow lays its children side by side (in the reading direction), DockColumn stacks them.
type DockLayout ¶
type DockLayout struct {
Root *DockNode `json:"root"`
Focus string `json:"focus,omitempty"` // ID of the focused group (new tabs go there)
Maximized string `json:"maximized,omitempty"` // ID of the group filling the dock ("" when none)
// contains filtered or unexported fields
}
DockLayout is the state of a Dock: a tree of splits whose leaves are tab groups, the focused group and the maximized one. The application owns it; Dock edits it in place as the user drags, closes, splits or resizes. It marshals to JSON with encoding/json (save it when DockW.Changed reports) and loads back with ParseDockLayout.
Methods keep the invariants (call Normalize after editing the tree by hand): every tab key appears once, splits have at least two children and never a child split of the same axis, sizes are positive fractions, group IDs are unique and only the root may be an empty group.
func NewDockLayout ¶
func NewDockLayout(tabs ...string) *DockLayout
NewDockLayout returns a layout with one group holding tabs (the first one active).
func ParseDockLayout ¶
func ParseDockLayout(data []byte) (*DockLayout, error)
ParseDockLayout decodes a layout saved with json.Marshal and repairs whatever breaks the invariants (unknown axes, missing IDs, repeated keys, wrong sizes), so a hand-edited or older file still loads.
func (*DockLayout) Activate ¶
func (l *DockLayout) Activate(key string) bool
Activate makes key the active tab of its group and focuses the group. It reports whether the layout holds key.
func (*DockLayout) AddTab ¶
func (l *DockLayout) AddTab(key, group string)
AddTab adds key to the group with ID group ("" for the focused group), after its active tab, and activates it. A key already in the layout is only activated.
func (*DockLayout) FocusGroup ¶
func (l *DockLayout) FocusGroup() *DockNode
FocusGroup returns the focused group (the first one when Focus names none).
func (*DockLayout) Group ¶
func (l *DockLayout) Group(id string) *DockNode
Group returns the group with the given ID (nil when none).
func (*DockLayout) GroupOf ¶
func (l *DockLayout) GroupOf(key string) *DockNode
GroupOf returns the group holding the tab key (nil when none).
func (*DockLayout) Groups ¶
func (l *DockLayout) Groups() []*DockNode
Groups returns the tab groups in reading order (depth first).
func (*DockLayout) MoveTab ¶
func (l *DockLayout) MoveTab(key, group string, index int) bool
MoveTab moves key into the group with ID group at index (clamped; < 0 appends) and activates it there. Moving within a group reorders it. It reports whether anything moved.
func (*DockLayout) Normalize ¶
func (l *DockLayout) Normalize()
Normalize restores the invariants after the tree was edited by hand: it drops nil children, repeated tab keys and empty groups (keeping one group), collapses splits with a single child, merges a split into a parent of the same axis, fixes sizes, unknown axes, missing or repeated group IDs and active tabs, and clears Focus / Maximized when they name no group.
func (*DockLayout) RemoveTab ¶
func (l *DockLayout) RemoveTab(key string) bool
RemoveTab removes key. A group left empty is removed (unless it is the last one) and its neighbours take its space; the group's next tab (or previous) becomes active. It reports whether the layout held key.
func (*DockLayout) SplitTab ¶
func (l *DockLayout) SplitTab(key, group string, side DockSide) (string, bool)
SplitTab moves key into a new group on side of the group with ID group (DockCenter appends it to that group instead) and returns the new group's ID. Splitting a group's only tab off itself does nothing.
type DockLocale ¶
type DockLocale struct {
Maximize, Restore, Split string // header buttons (accessible names, tooltips)
Empty string // hint shown in a group without tabs
Group string // accessible name of a tab group
// contains filtered or unexported fields
}
DockLocale holds the Dock texts: the group header buttons, the hint of an empty group and the accessible name of a group.
type DockNode ¶
type DockNode struct {
// Group (leaf).
ID string `json:"id,omitempty"`
Tabs []string `json:"tabs,omitempty"`
Active string `json:"active,omitempty"`
// Split.
Axis DockAxis `json:"axis,omitempty"`
Children []*DockNode `json:"children,omitempty"`
Sizes []float64 `json:"sizes,omitempty"` // fractions of the split, one per child, summing to 1
// contains filtered or unexported fields
}
DockNode is a node of a dock layout: a split (Axis set, Children with their Sizes) or a tab group (a leaf: ID, Tabs and the Active tab). Tabs holds application keys; Dock asks the application for each key's title and content.
type DockSide ¶
type DockSide uint8
DockSide is where a tab lands relative to a group: in it (DockCenter) or in a new group beside it. DockLeft and DockRight are logical: in a right-to-left scope DockLeft is the right (start) side.
Append-only: never reorder or insert; existing values never change.
type DockW ¶
type DockW struct {
// contains filtered or unexported fields
}
DockW is a docking layout (IDE workbench): nested horizontal / vertical splits whose leaves are tab groups, edited by the user and kept in a DockLayout the application owns.
func Dock ¶
func Dock(c *Context, l *DockLayout) *DockW
Dock adds a docking layout editing l: tab groups in nested splits. Drag a tab onto another group's tab bar to move it there, onto the left, right, top or bottom part of a group's content to split that group, or onto its middle to merge; a preview shows where it lands. Drag the bars between groups to resize them; the header buttons split the active tab to the right and maximize / restore the group. Tabs close with their x (or Delete), and a group left empty disappears.
Tab supplies each key's label and icon (TabItem.NoClose keeps a tab open), Content builds the active tab of each group. Call Show after the options, then read Changed (save l) and Closed. The layout is edited in place; the content of a tab keeps its widget state when the tab moves to another group.
Experimental: the API may change in any 0.x release.
func (*DockW) BeforeClose ¶
BeforeClose is asked before a tab closes; returning false keeps it (an unsaved document).
func (*DockW) Changed ¶
Changed reports an edit of the layout this frame (a move, split, close, resize, maximize, focus or active tab change): the moment to save it.
func (*DockW) Content ¶
Content sets the function that builds the content of a group's active tab. It runs once per visible group.
func (*DockW) OnTearOff ¶
OnTearOff lets a tab be dragged out of the window: released outside, the tab leaves the layout and fn runs with its key and the release point (window coordinates; see TabsW.OnTearOff). The application opens it in a new window.
func (*DockW) Style ¶
Style applies layout options to the dock (give it a size: layout.Grow(1), layout.H(480) ...).
type DrawerPlacement ¶
type DrawerPlacement uint8
DrawerPlacement selects the edge a Drawer slides from. DrawerEnd (the zero value and default) and DrawerStart are logical: in RTL the end is the left edge. DrawerRight and DrawerLeft always mean that physical edge.
Append-only: never reorder or insert; the zero value stays DrawerEnd.
const ( DrawerEnd DrawerPlacement = iota DrawerRight DrawerLeft DrawerTop DrawerBottom DrawerStart )
type DrawerW ¶
type DrawerW struct {
// contains filtered or unexported fields
}
DrawerW is a panel sliding from a window edge: four placements, nested drawers push their parent aside, header extra, footer, sizes.
func Drawer ¶
Drawer starts a drawer shown while *open; chain options, then Body. A Drawer opened inside another one's Body pushes the parent aside.
Besides the keys read in shad2c_defaults.go, ConfigProvider.Defaults( "Drawer", ...) reads "keyboard" (bool) and "closablePlacement" ("start" / "end").
func (*DrawerW) AfterOpenChanged ¶
AfterOpenChanged reports, after Body, that the open or close slide finished this frame (antd afterOpenChange; read *open for the state).
func (*DrawerW) BindSize ¶
BindSize binds the size to *px: a positive value overrides Size, and a resize writes the new size back.
func (*DrawerW) ClosablePlacement ¶
ClosablePlacement puts the close button "start" (before the title) or "end" (after the title and extra); default from the theme (Ant start, Element and shadcn end; antd closable.placement).
func (*DrawerW) CurrentSize ¶
CurrentSize returns the width / height used this frame (after Body).
func (*DrawerW) Keyboard ¶
Keyboard sets whether Escape closes the drawer (default true; antd keyboard, Element close-on-press-escape).
func (*DrawerW) MaskBlur ¶
MaskBlur sets the Gaussian blur radius of the canvas behind the mask, in logical pixels. A zero radius draws the mask without blur.
func (*DrawerW) MaskClosable ¶
func (*DrawerW) Placement ¶
func (d *DrawerW) Placement(p DrawerPlacement) *DrawerW
Placement selects the edge (DrawerEnd default: right, left in RTL).
func (*DrawerW) Push ¶
Push sets how far a nested drawer pushes this one aside (default 180; 0 turns it off; antd push.distance).
func (*DrawerW) Resizable ¶
Resizable lets the user drag the edge facing the page to change the width (left / right) or height (top / bottom). The edge is also a focusable separator: arrow keys step 10px (Shift: 50px), Home / End go to the limits. The chosen size is kept while the drawer exists; use BindSize to own it.
func (*DrawerW) Size ¶
Size sets the width (left/right) or height (top/bottom); default from theme.DrawerToken: 378 (Ant), 30% of the window (Element), 384 but at most 75% (shadcn Sheet).
func (*DrawerW) SizeLimits ¶
SizeLimits bounds a resizable drawer (px). Zero min means 100; zero max means the window width / height.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver runs a page without a native window: inject events, run frames and read back the rendered *image.RGBA. It is used by tests, screenshot tools and the ui-gallery example. Time is simulated: it only advances through Advance / Settle, so output is deterministic.
func NewDriver ¶
func NewDriver(page func(*Context), o DriverOptions) *Driver
NewDriver creates a headless driver for page.
func (*Driver) A11yFind ¶
A11yFind returns the first node with role and name in the last tree (a11y.RoleNone matches any role, "" any name).
func (*Driver) A11yFindAll ¶
A11yFindAll returns every node with role and name in the last tree.
func (*Driver) A11yFocused ¶
A11yFocused returns the node with keyboard focus (nil if none).
func (*Driver) A11yPerform ¶
A11yPerform finds the node with role and name and performs act on it.
func (*Driver) A11yUpdates ¶
A11yUpdates returns how many times the host was notified and the changed IDs of the last notification.
func (*Driver) AccessibilityTree ¶
AccessibilityTree returns the semantics tree of the last frame (nil until EnableAccessibility).
func (*Driver) Audit ¶
func (d *Driver) Audit() AuditReport
Audit enables accessibility, settles and checks the current frame: interactive nodes without an accessible name, pointer targets without a role, controls the keyboard cannot reach, and contrast problems of the current theme (see theme.CheckContrast), and in right-to-left scopes directional icons drawn without mirroring. Drive the page into the state to check (open popups with Click / Key) before calling it.
func (*Driver) AuditNoContrast ¶
func (d *Driver) AuditNoContrast() AuditReport
AuditNoContrast is Audit without the theme contrast checks (when several pages share one theme and contrast is reported once).
func (*Driver) BackHandling ¶
BackHandling reports what the runner last told the window through BackWindow: whether the system Back action has something to close.
func (*Driver) ClickLabel ¶
ClickLabel clicks the center of the first widget whose label is text.
func (*Driver) ContentSize ¶
ContentSize returns the extent of the page's top-level widgets in the last frame (useful to size screenshots to their content).
func (*Driver) Drag ¶
Drag presses at from, moves to to in a few steps (one frame each) and releases there, then settles.
func (*Driver) DropFiles ¶
DropFiles simulates dropping files at p (after FileDragLeave, as hosts do) and runs a frame.
func (*Driver) EnableAccessibility ¶
EnableAccessibility turns the semantics tree on (the fake window acts as an AccessibilityHost that asked for it), settles and returns the tree.
func (*Driver) FileDragLeave ¶
func (d *Driver) FileDragLeave()
FileDragLeave simulates the file drag leaving the window.
func (*Driver) FileDragOver ¶
FileDragOver simulates files dragged over the window at p and runs a frame (tests).
func (*Driver) FindText ¶
FindText returns the rect of a node labelled text in the last frame, including non-interactive ones (Text, Title, Paragraph, labels inside widgets) that Find does not see. Layers are searched top-most first. An exact label match wins; otherwise the first label containing text is used.
func (*Driver) MirrorCheck ¶
func (d *Driver) MirrorCheck(page func(*Context), setup ...func(*Driver)) MirrorReport
MirrorCheck renders page left to right and right to left (wrapped in ConfigProvider(c).Direction(...)) at d's size, scale and theme, settles each frame (after the optional setup, e.g. opening a popup) and compares every node drawn in both frames.
Each node is checked relative to its parent: with p the parent's rectangle, the RTL node must sit at x' = p'.X + p.W - (x - p.X) - w, with the same y offset and size (±1px). Checking against the parent instead of the window (|X_rtl − (W − X_ltr − W_n)|) reports only the node at fault, not its whole subtree; for a chain of correctly mirrored parents the two are the same. Nodes without a parent drawn in both frames (overlay roots) are checked against the window.
Skipped: nodes with layout.Physical() (NoMirror) and children of boxes that lay out left to right in the RTL frame (an LTR scope such as a code editor or chart, or the window root outside the page's provider).
Icon check: every icon drawn in the RTL frame is recorded (see paint.List.IconNote); a directional icon drawn unmirrored while its node was painted in a right-to-left scope is reported in Icons, located at the deepest node containing it. Icons in LTR scopes are not reported; icons inside a NoMirror node or subtree are counted in IconsSkipped.
func (*Driver) NeedsFrame ¶
NeedsFrame reports whether the UI asked for another frame.
func (*Driver) PerformAction ¶
PerformAction runs an accessibility action like a screen reader would (Runner.PerformAction) and settles.
func (*Driver) Pinch ¶
Pinch puts two fingers down on a horizontal line through center, from apart, moves them symmetrically until they are to apart (to > from zooms in) and lifts them, then settles.
func (*Driver) RightClick ¶
RightClick presses and releases the secondary button at p (context menus), then settles.
func (*Driver) SetClipboard ¶
SetClipboard sets the fake clipboard.
func (*Driver) SetKeyboardInset ¶
SetKeyboardInset sets the keyboard inset the page sees (Runner.SetKeyboardInset); the next frame picks it up.
func (*Driver) SetSafeArea ¶
SetSafeArea sets the safe-area insets the page sees (Runner.SetSafeArea); the next frame picks them up.
func (*Driver) Settle ¶
Settle runs frames, advancing simulated time 16ms per frame, until nothing animates (at most 2 simulated seconds).
func (*Driver) TextInputActive ¶
TextInputActive reports whether the UI requested IME input and the caret.
func (*Driver) TextInputState ¶
func (d *Driver) TextInputState() (input.TextInputState, bool)
TextInputState returns the text-input state the Runner last reported and whether one is in effect (tests).
func (*Driver) TouchDrag ¶
TouchDrag puts one finger down at from, moves it to to in a few steps (one frame and touchStep of simulated time each) and lifts it, then settles.
func (*Driver) Touches ¶
func (d *Driver) Touches(evs ...input.TouchEvent)
Touches injects several finger changes delivered in the same frame and runs it.
func (*Driver) TwoFingerPan ¶
TwoFingerPan puts two fingers down around from (spread px apart), moves both to to without changing their distance and lifts them, then settles.
type DriverOptions ¶
type DriverOptions struct {
Width, Height float32 // logical size, default 1024×768
Scale float32 // default 1
Theme *theme.Theme
Animations bool // run transitions (default: jump to end state)
ReduceMotion bool // RunnerOptions.ReduceMotion (use with Animations)
Accessibility bool // build the semantics tree from the first frame
// contains filtered or unexported fields
}
DriverOptions configure a Driver.
type DropZoneLocale ¶
type DropZoneLocale struct {
Name, Release string
// contains filtered or unexported fields
}
DropZoneLocale holds the DropZone accessible name and drag-over announcement.
type DropZoneW ¶
type DropZoneW struct {
// contains filtered or unexported fields
}
DropZoneW is an area that reacts to files dragged over the window (Ant Design Upload.Dragger's hover state, as a standalone wrapper):
z := ui.DropZone(c, func(over bool) {
ui.Upload(c, &files).Dragger().DragOver(over)
}).Highlight(false)
if paths := z.Dropped(); paths != nil { ... }
Nested zones: the innermost (last built) zone under the drag wins.
func DropZone ¶
DropZone builds body in a zone; body receives whether files are dragged over the zone (from the previous build pass, so it is stable within a frame).
func (*DropZoneW) Dropped ¶
Dropped returns the paths of files dropped on the zone (Runner.DropFiles) once, or nil.
func (*DropZoneW) Highlight ¶
Highlight toggles the built-in highlight (a tinted, dashed overlay; default on). Turn it off when the content shows its own (Upload's Dragger with DragOver).
type DropdownW ¶
type DropdownW struct {
// contains filtered or unexported fields
}
DropdownW is a menu attached to a trigger: hover / click / context-menu triggers, nested submenus, placements, arrow, selected key, keyboard navigation, and the split-button form (Button).
func Dropdown ¶
Dropdown starts a dropdown menu; chain options, then Body with the trigger content, or Button for a split button (Ant Dropdown.Button, Element split-button):
if k := ui.Dropdown(c, items).Trigger(ui.TriggerClick).Body(func() { ui.Button(c, "更多") }).Clicked(); k != "" { ... }
dd := ui.Dropdown(c, items).Primary().Button("提交")
ConfigProvider.Defaults("Dropdown", ...) keys: "trigger", "placement", "arrow", "disabled", "mouseEnterDelay" / "mouseLeaveDelay" (time.Duration; default the Dropdown token: Ant 150 / 100 ms, Element 150 / 150 ms), "autoFocus", "hideOnClick" (bool, default true).
func (*DropdownW) ArrowPointAtCenter ¶
ArrowPointAtCenter draws the arrow (Arrow) at the centre of the trigger instead of near its aligned edge (antd arrow.pointAtCenter).
func (*DropdownW) AutoFocus ¶
AutoFocus moves keyboard focus to the first enabled item whenever the menu opens, also by pointer (antd autoFocus; the keyboard always does).
func (*DropdownW) Button
deprecated
Button builds the split-button form: a main button labelled label joined with a menu button (Ant Dropdown.Button, Element split-button). Check ButtonClicked for the main part and Clicked for the chosen item.
Deprecated: use Compact + Button + Dropdown (antd 6 deprecates Dropdown.Button):
ui.Compact(c).Body(func() {
ui.Button(c, "提交")
ui.Dropdown(c, items).Placement(ui.BottomEnd).Body(func() { ui.Button(c, "").Icon(icon.More) })
})
func (*DropdownW) ButtonClicked ¶
ButtonClicked reports a click on the main part of the Button form.
func (*DropdownW) Check ¶
Check makes the item keyed key a checkbox item bound to on (shadcn DropdownMenuCheckboxItem): a check mark shows its state and choosing it toggles *on (Clicked still reports the key). The panel reserves an indicator column for it.
func (*DropdownW) HideOnClick ¶
HideOnClick(false) keeps the menu open after an item is chosen (Element hide-on-click; default true).
func (*DropdownW) MaxHeight ¶
MaxHeight limits the menu panels' height (default: the window height); longer menus scroll and keyboard moves keep the active item visible.
func (*DropdownW) MouseEnterDelay ¶
MouseEnterDelay waits d before a hover dropdown opens (antd mouseEnterDelay 0.15 s, Element show-timeout).
func (*DropdownW) MouseLeaveDelay ¶
MouseLeaveDelay waits d before a hover dropdown closes once the pointer left the trigger and the menu (antd mouseLeaveDelay 0.1 s, Element hide-timeout).
func (*DropdownW) OpenChanged ¶
OpenChanged reports that the menu opened or closed this frame.
func (*DropdownW) OpenSource ¶
OpenSource reports what opened or closed the menu this frame (when OpenChanged): "menu" when choosing an item closed it, else "trigger" (antd onOpenChange info.source).
func (*DropdownW) Placement ¶
Placement positions the menu (BottomStart, Bottom, BottomEnd, TopStart, Top, TopEnd).
func (*DropdownW) PopupRender ¶
PopupRender builds the panel content around the menu (antd popupRender, v6 name of dropdownRender): call menu() where the items go, add other content before or after it.
func (*DropdownW) Radio ¶
Radio makes the items keyed keys a radio group bound to value (shadcn DropdownMenuRadioGroup): the item whose key equals *value shows a dot and choosing an item stores its key.
func (*DropdownW) Size ¶
func (d *DropdownW) Size(s ControlSize) *DropdownW
Size sets the control size of the Button form.
type EditableProTableW ¶
type EditableProTableW[T any] struct { // contains filtered or unexported fields }
EditableProTableW is a table over app-owned rows edited in place (Ant Design Pro EditableProTable): columns with an Editor show the ProField control of their value type while a row is edited; an action column offers edit / save / cancel / delete; "add a row" creates a draft row that joins the data when saved. Rows are validated (Required, Rules, Validate, AsyncValidate of every editor) before they are written back.
ui.EditableProTable(c, cols, &rows).RowKey(func(r Row) string { return r.ID }).
NewRow(func() Row { return Row{ID: newID()} }).
OnSave(func(r Row, i int, done func(error)) { go save(r, done) }).
Show()
func EditableProTable ¶
func EditableProTable[T any](c *Context, cols []ProColumn[T], rows *[]T) *EditableProTableW[T]
EditableProTable starts an editable table over *rows; chain options, then Show.
func (*EditableProTableW[T]) AddAtTop ¶
func (e *EditableProTableW[T]) AddAtTop() *EditableProTableW[T]
AddAtTop puts new rows (and the add button) above the data.
func (*EditableProTableW[T]) AddRow ¶
func (e *EditableProTableW[T]) AddRow() string
AddRow adds a new draft row in edit mode (as the add button does) and returns its key ("" when NewRow is not set or another row is being edited in single mode).
func (*EditableProTableW[T]) Bordered ¶
func (e *EditableProTableW[T]) Bordered() *EditableProTableW[T]
Bordered draws cell borders.
func (*EditableProTableW[T]) Cancel ¶
func (e *EditableProTableW[T]) Cancel(k string)
Cancel leaves edit mode of row k without saving (a new row is dropped).
func (*EditableProTableW[T]) Changed ¶
func (e *EditableProTableW[T]) Changed() bool
Changed reports any change of *rows in the last Show.
func (*EditableProTableW[T]) Deleted ¶
func (e *EditableProTableW[T]) Deleted() bool
Deleted reports a deleted row in the last Show.
func (*EditableProTableW[T]) DragSort ¶
func (e *EditableProTableW[T]) DragSort(fn func(from, to int)) *EditableProTableW[T]
DragSort adds a drag handle column that reorders *rows; fn (may be nil) is told the move (indices into *rows) after it happened.
func (*EditableProTableW[T]) Edit ¶
func (e *EditableProTableW[T]) Edit(k string)
Edit puts the row with key k into edit mode (valid after Show).
func (*EditableProTableW[T]) EditableKeys ¶
func (e *EditableProTableW[T]) EditableKeys(keys *[]string) *EditableProTableW[T]
EditableKeys binds the keys of the rows being edited (controlled).
func (*EditableProTableW[T]) Editing ¶
func (e *EditableProTableW[T]) Editing(k string) bool
Editing reports whether the row with key k is in edit mode.
func (*EditableProTableW[T]) Errors ¶
func (e *EditableProTableW[T]) Errors(k string) map[string]string
Errors returns the validation messages of the row with key k by column key (nil when valid).
func (*EditableProTableW[T]) ID ¶
func (e *EditableProTableW[T]) ID() ID
ID returns the widget ID (valid after Show).
func (*EditableProTableW[T]) MaxLength ¶
func (e *EditableProTableW[T]) MaxLength(n int) *EditableProTableW[T]
MaxLength hides the add button once there are n rows.
func (*EditableProTableW[T]) Moved ¶
func (e *EditableProTableW[T]) Moved() bool
Moved reports a drag-sort move in the last Show.
func (*EditableProTableW[T]) Multiple ¶
func (e *EditableProTableW[T]) Multiple() *EditableProTableW[T]
Multiple lets several rows be edited at once (default: one; the other rows' edit actions are disabled meanwhile).
func (*EditableProTableW[T]) NewRow ¶
func (e *EditableProTableW[T]) NewRow(fn func() T) *EditableProTableW[T]
NewRow shows the "add a row" button; fn creates the draft row (set its key there). The new row opens in edit mode and joins *rows when saved.
func (*EditableProTableW[T]) NoDelete ¶
func (e *EditableProTableW[T]) NoDelete() *EditableProTableW[T]
NoDelete hides the delete action.
func (*EditableProTableW[T]) OnDelete ¶
func (e *EditableProTableW[T]) OnDelete(fn func(row T, index int)) *EditableProTableW[T]
OnDelete is called after a confirmed delete instead of removing the row from *rows (the app removes it, e.g. after a server call).
func (*EditableProTableW[T]) OnSave ¶
func (e *EditableProTableW[T]) OnSave(fn func(row T, index int, done func(error))) *EditableProTableW[T]
OnSave receives a validated row (index -1 for a new row) before it is written back; call done from any goroutine. A nil error writes the row into *rows, an error keeps the row in edit mode and shows the message.
func (*EditableProTableW[T]) Pagination ¶
func (e *EditableProTableW[T]) Pagination(n int) *EditableProTableW[T]
Pagination pages the rows locally, n per page.
func (*EditableProTableW[T]) RowEditable ¶
func (e *EditableProTableW[T]) RowEditable(fn func(row T) bool) *EditableProTableW[T]
RowEditable limits which rows can be edited.
func (*EditableProTableW[T]) RowKey ¶
func (e *EditableProTableW[T]) RowKey(f func(T) string) *EditableProTableW[T]
RowKey gives rows stable keys (needed when rows are inserted, deleted or reordered while one is edited; default: the row index).
func (*EditableProTableW[T]) Save ¶
func (e *EditableProTableW[T]) Save(k string)
Save validates the edited row k and writes it back (as its save action does; valid after Show).
func (*EditableProTableW[T]) Saved ¶
func (e *EditableProTableW[T]) Saved() bool
Saved reports a row written back in the last Show.
func (*EditableProTableW[T]) ScrollX ¶
func (e *EditableProTableW[T]) ScrollX(w float32) *EditableProTableW[T]
ScrollX sets the table's scroll width.
func (*EditableProTableW[T]) ScrollY ¶
func (e *EditableProTableW[T]) ScrollY(maxH float32) *EditableProTableW[T]
ScrollY bounds the table body to maxH (TableW.ScrollY): the header stays in place and only the visible rows are built, so many thousand rows stay fast. Rows being edited are always built, even scrolled out of view, so their drafts and focus survive; starting to edit a row (Edit, AddRow), focus moving into an edited row (Tab), typing in one and a failed validation scroll it into view. An edited key not found among the rows is not looked up again every frame: a key that reappears in place (a row re-keyed at the same row count) is picked up once the row count changes or a new rows slice is passed. The toolbar and the add button stay outside the scrolling body. Default 0: unbounded, every row is built.
func (*EditableProTableW[T]) Show ¶
func (e *EditableProTableW[T]) Show() *EditableProTableW[T]
Show builds the table.
func (*EditableProTableW[T]) Size ¶
func (e *EditableProTableW[T]) Size(s ControlSize) *EditableProTableW[T]
Size sets the density.
func (*EditableProTableW[T]) Table ¶
func (e *EditableProTableW[T]) Table() *TableW
Table returns the inner table of the last Show.
func (*EditableProTableW[T]) Title ¶
func (e *EditableProTableW[T]) Title(s string) *EditableProTableW[T]
Title sets the toolbar title.
func (*EditableProTableW[T]) ToolBar ¶
func (e *EditableProTableW[T]) ToolBar(fn func()) *EditableProTableW[T]
ToolBar adds actions at the right of the toolbar.
func (*EditableProTableW[T]) Validating ¶
func (e *EditableProTableW[T]) Validating(k string) bool
Validating reports async validations or a save in flight for row k.
func (*EditableProTableW[T]) Virtual ¶
func (e *EditableProTableW[T]) Virtual() *EditableProTableW[T]
Virtual is TableW.Virtual for the inner table: with ScrollY the body is windowed either way, Virtual states the intent (and takes the theme's Table V2 row height where it has one, as TableW.Virtual). Otherwise rows keep the height of the density (Size).
type EditableTableLocale ¶
type EditableTableLocale struct {
Actions string // title of the action column
DeleteConfirm string // Popconfirm of the delete action
// contains filtered or unexported fields
}
EditableTableLocale holds the EditableProTable texts.
type EmptyW ¶
type EmptyW struct {
// contains filtered or unexported fields
}
EmptyW is an empty state: Ant's default/simple pictures or Element's illustration, custom image, size, description and actions.
func Empty ¶
Empty adds the "no data" placeholder. Modifiers apply until the end of the build (or Body); the content is built then.
ui.Empty(c)
ui.Empty(c).Simple().Description("暂无订单")
ui.Empty(c).Body(func() { ui.Button(c, "立即创建").Primary() })
func (*EmptyW) Description ¶
Description sets the text ("" hides it).
func (*EmptyW) ImageSize ¶
ImageSize sets the picture height (Ant default 100, simple 40, Element 160).
type FieldVariant ¶
type FieldVariant string
FieldVariant is the frame look of an input-like selector (Ant variant): AutoComplete, Mentions, Select, MultiSelect, Cascader and TreeSelect take it. The values are the strings Input.Variant and the date pickers accept, so FieldVariant(s) converts a string default.
const ( // FieldOutlined is the default bordered frame. FieldOutlined FieldVariant = "outlined" // FieldFilled is a tinted fill whose border shows on focus. FieldFilled FieldVariant = "filled" // FieldBorderless draws no frame (the padding stays). FieldBorderless FieldVariant = "borderless" // FieldUnderlined draws only the bottom line. FieldUnderlined FieldVariant = "underlined" )
type FileDrop ¶
FileDrop describes a file drop. Position uses the same UI logical coordinates as Context.Pointer and Context.RectOf.
type FlexW ¶
type FlexW struct {
// contains filtered or unexported fields
}
FlexW is a flex container with design-token gaps (Ant Flex).
func (*FlexW) Gap ¶
func (f *FlexW) Gap(s ControlSize) *FlexW
Gap sets the gap with a size token (Small 8, Middle 16, Large 24).
func (*FlexW) Orientation ¶
Orientation sets the direction: "horizontal" (default) or "vertical" (Ant v6 orientation). Other values are ignored.
type FloatButtonGroupW ¶
type FloatButtonGroupW struct {
// contains filtered or unexported fields
}
FloatButtonGroupW stacks float buttons; with a trigger it collapses them behind a menu button.
func FloatButtonGroup ¶
func FloatButtonGroup(c *Context) *FloatButtonGroupW
FloatButtonGroup starts a group; chain options, then Body with FloatButton calls.
func (*FloatButtonGroupW) Body ¶
func (g *FloatButtonGroupW) Body(fn func()) *FloatButtonGroupW
Body builds the members.
func (*FloatButtonGroupW) Icon ¶
func (g *FloatButtonGroupW) Icon(ic *icon.Icon) *FloatButtonGroupW
Icon sets the menu button icon (default: a plus that turns into a cross).
func (*FloatButtonGroupW) IsOpen ¶
func (g *FloatButtonGroupW) IsOpen() bool
IsOpen reports whether the members are shown.
func (*FloatButtonGroupW) Open ¶
func (g *FloatButtonGroupW) Open(open *bool) *FloatButtonGroupW
Open binds the open state of a triggered group.
func (*FloatButtonGroupW) Position ¶
func (g *FloatButtonGroupW) Position(right, bottom float32) *FloatButtonGroupW
Position sets the distance from the right and bottom window edges.
func (*FloatButtonGroupW) Primary ¶
func (g *FloatButtonGroupW) Primary() *FloatButtonGroupW
Primary colors the menu button.
func (*FloatButtonGroupW) Square ¶
func (g *FloatButtonGroupW) Square() *FloatButtonGroupW
Square joins the buttons in one rounded card with separators.
func (*FloatButtonGroupW) Trigger ¶
func (g *FloatButtonGroupW) Trigger(t string) *FloatButtonGroupW
Trigger collapses the group behind a menu button opened by "click" or "hover".
type FloatButtonW ¶
type FloatButtonW struct {
// contains filtered or unexported fields
}
FloatButtonW is a button floating above the page at a window corner.
func FloatButton ¶
func FloatButton(c *Context) *FloatButtonW
FloatButton adds a floating action button (default bottom-right, 24px from the right and 48px from the bottom). Inside a FloatButtonGroup it becomes a member of the group.
func (*FloatButtonW) A11yLabel ¶
func (f *FloatButtonW) A11yLabel(s string) *FloatButtonW
A11yLabel sets the accessible name of an icon-only button without a tooltip.
func (*FloatButtonW) Badge ¶
func (f *FloatButtonW) Badge(n int) *FloatButtonW
Badge shows a count (dot when n < 0).
func (*FloatButtonW) Bottom ¶
func (f *FloatButtonW) Bottom(px float32) *FloatButtonW
Bottom sets the distance from the bottom window edge.
func (*FloatButtonW) Description ¶
func (f *FloatButtonW) Description(s string) *FloatButtonW
Description shows a short caption below the icon (square shape).
func (*FloatButtonW) Icon ¶
func (f *FloatButtonW) Icon(ic *icon.Icon) *FloatButtonW
Icon sets the icon.
func (*FloatButtonW) Primary ¶
func (f *FloatButtonW) Primary() *FloatButtonW
Primary uses the brand color.
func (*FloatButtonW) Right ¶
func (f *FloatButtonW) Right(px float32) *FloatButtonW
Right sets the distance from the right window edge (the end edge: the left one in a right-to-left scope).
func (*FloatButtonW) Square ¶
func (f *FloatButtonW) Square() *FloatButtonW
Square uses a rounded square instead of a circle.
func (*FloatButtonW) Tooltip ¶
func (f *FloatButtonW) Tooltip(s string) *FloatButtonW
Tooltip shows a tip on hover, towards the page (left; right in RTL).
type FooterLink ¶
type FooterLink struct {
// contains filtered or unexported fields
}
FooterLink is one link of DefaultFooter.
type FooterToolbarW ¶
type FooterToolbarW struct {
// contains filtered or unexported fields
}
FooterToolbarW builds a FooterToolbar.
func FooterToolbar ¶
func FooterToolbar(c *Context) *FooterToolbarW
FooterToolbar starts a bottom action bar; chain options, then Body with the right-hand buttons.
ConfigProvider.Defaults("FooterToolbar", ...) keys: "fixed" (bool, default true), "sticky" (legacy bool).
func (*FooterToolbarW) Body ¶
func (f *FooterToolbarW) Body(fn func()) *FooterToolbarW
Body builds the bar with fn as the right-hand actions.
func (*FooterToolbarW) Extra ¶
func (f *FooterToolbarW) Extra(fn func()) *FooterToolbarW
Extra builds content at the left of the bar.
func (*FooterToolbarW) Fixed ¶
func (f *FooterToolbarW) Fixed(on bool) *FooterToolbarW
Fixed controls whether the bar is pinned to the bottom (default true). Fixed(false) places it in normal flow. Sticky remains an alias for enabling it.
func (*FooterToolbarW) ID ¶
func (f *FooterToolbarW) ID() ID
ID returns the bar's widget ID (after Body).
func (*FooterToolbarW) Layout ¶
func (f *FooterToolbarW) Layout(o ...layout.Option) *FooterToolbarW
Layout applies layout options to the bar.
func (*FooterToolbarW) Sticky ¶
func (f *FooterToolbarW) Sticky() *FooterToolbarW
Sticky pins the bar to the bottom of the viewport while the content above scrolls (Affix with offset bottom 0).
func (*FooterToolbarW) Target ¶
func (f *FooterToolbarW) Target(id ID) *FooterToolbarW
Target makes Sticky pin to the bottom of a scroll box (ScrollBox.ID()) instead of the window.
type FormItemW ¶
type FormItemW struct {
// contains filtered or unexported fields
}
FormItemW is one labelled form row.
func RulesOf ¶
RulesOf attaches typed rules to *val (numbers, booleans, slices …) and binds the value for ResetFields; it is Rules for any type. The item's Value (FormW.Value, Dependencies) is the value formatted with fmt.
ui.RulesOf(form.Item("年龄"), &age, ui.RangeValue(18.0, 60.0, "18–60"))
func (*FormItemW) Body ¶
func (it *FormItemW) Body(fn func())
Body builds the control(s) of the item.
func (*FormItemW) Dependencies ¶
Dependencies names fields this item depends on: when one of their values changes the item re-validates (if it has a value or was validated) and OnDepsChange runs (reset a dependent value, refresh options).
func (*FormItemW) Extra ¶
Extra shows a description line under the control and its message (Ant Form.Item extra).
func (*FormItemW) Name ¶
Name sets the field name that keys the item's validation state (default: the label). Items with the same label (Form.List rows) need distinct names.
func (*FormItemW) NoLabel ¶
NoLabel aligns the control with labelled items but shows no label (submit row).
func (*FormItemW) OnDepsChange ¶
OnDepsChange runs fn when a dependency's value changed.
func (*FormItemW) OnReset ¶
OnReset makes ResetFields call fn for this item: items bound with RulesFunc have no pointer the form could restore, so the application resets its own value (Rules and RulesOf restore automatically).
f.Item("生日").RulesFunc(func() string { return d.Format(ui.DateLayout) }, ...).OnReset(func() { d = time.Time{} })
func (*FormItemW) Rules ¶
Rules attaches validation rules to a string value. The item validates live once the value changed (see ValidateTrigger), and on FormW.Validate. The value is restored by FormW.ResetFields.
func (*FormItemW) Tooltip ¶
Tooltip shows a question-mark icon after the label with a tooltip (Ant Form.Item tooltip).
func (*FormItemW) ValidateStatus ¶
ValidateStatus sets the status by hand: "success" | "warning" | "error" | "validating" (Ant validateStatus). The Help text takes the status color; a failing rule still shows its error.
func (*FormItemW) ValidateTrigger ¶
func (it *FormItemW) ValidateTrigger(t FormTrigger) *FormItemW
ValidateTrigger sets when this item validates (see FormTrigger).
type FormLayout ¶
type FormLayout uint8
FormLayout arranges labels and controls.
Append-only: never reorder or insert; the zero value stays FormHorizontal.
const ( FormHorizontal FormLayout = iota // label left of the control FormVertical // label above FormInline // items in a wrapping row )
type FormListRow ¶
type FormListRow[T any] struct { Index int Value *T // the row's element (valid during the callback) Key string // stable key of the row // contains filtered or unexported fields }
FormListRow is one row passed to FormListW.Body.
func (*FormListRow[T]) MoveDown ¶
func (r *FormListRow[T]) MoveDown()
MoveDown swaps the row with the one below.
func (*FormListRow[T]) MoveUp ¶
func (r *FormListRow[T]) MoveUp()
MoveUp swaps the row with the one above.
func (*FormListRow[T]) Name ¶
func (r *FormListRow[T]) Name(field string) string
Name returns a field name unique to this row ("label.key.field").
func (*FormListRow[T]) Remove ¶
func (r *FormListRow[T]) Remove()
Remove deletes the row (after the rows are built).
type FormListW ¶
type FormListW[T any] struct { // contains filtered or unexported fields }
FormListW is a dynamic list of form rows bound to a slice (Ant Design Form.List / ProFormList): rows can be added, removed and moved; every row's items validate on their own (give them row.Name(field)).
ui.FormList(f, "联系人", &contacts).Min(1).Max(5).
Creator(func() Contact { return Contact{} }).
Body(func(row *ui.FormListRow[Contact]) {
f.Item("姓名").Name(row.Name("name")).Rules(&row.Value.Name, ui.Required("请输入姓名")).
Body(func() { ui.Input(c, &row.Value.Name) })
})
func (*FormListW[T]) Body ¶
func (l *FormListW[T]) Body(fn func(row *FormListRow[T])) *FormListW[T]
Body builds the rows with fn (items inside a row are laid out inline), the row actions and the add button.
func (*FormListW[T]) Creator ¶
Creator returns the element added by the add button (default: zero value).
type FormLocale ¶
type FormLocale struct {
Validating string // help text while an async rule runs
RequiredInputFmt, RequiredSelectFmt string // default required message, arg: field label
Submit, Query, PrevStep, NextStep string
MoveUp, MoveDown, AddRow string // FormList actions
Optional string // label suffix of optional items (Form.RequiredMarkOptional)
// contains filtered or unexported fields
}
FormLocale holds the Form / ProForm texts.
type FormTrigger ¶
type FormTrigger uint8
FormTrigger says when a form item validates its value.
Append-only: never reorder or insert; the zero value stays ValidateInherit.
const ( // ValidateInherit uses the form's trigger (items) or onChange (forms). ValidateInherit FormTrigger = iota // ValidateOnChange validates live once the value changed (default). ValidateOnChange // ValidateOnBlur validates when focus leaves the item's control. ValidateOnBlur // ValidateOnSubmit validates only in Validate / Submit. ValidateOnSubmit )
type FormW ¶
type FormW struct {
// contains filtered or unexported fields
}
FormW groups FormItems with shared label settings.
func (*FormW) ClearValidate ¶
ClearValidate removes the validation result of the named items (all items without names) without touching their values (Ant setFields / Element clearValidate). They validate again live after the next edit, or on Validate.
func (*FormW) Disabled ¶
Disabled disables every control in the form (Ant Form disabled, Element el-form disabled); it passes down like ui.Disabled.
func (*FormW) LabelAlign ¶
func (*FormW) LabelWidth ¶
func (*FormW) RequiredMark ¶
RequiredMark shows (default) or hides the asterisk of required items (Ant requiredMark, Element hide-required-asterisk). Required rules still apply.
func (*FormW) RequiredMarkOptional ¶
RequiredMarkOptional marks the optional items instead of the required ones (antd requiredMark="optional"): no asterisk, and the labels of items that are not Required end with Locale().Form.Optional in the secondary text color. ConfigProvider Defaults("Form", {"requiredMark": "optional"}) sets it too.
func (*FormW) ResetFields ¶
ResetFields restores every item bound with Rules(*string) or RulesOf to the value it had when the item was first built, calls the OnReset callback of RulesFunc items, and clears validation (Ant resetFields, Element resetFields). With names only those items are reset.
func (*FormW) ResetValidation ¶
func (f *FormW) ResetValidation()
ResetValidation clears errors and touched flags. Values changed from code in the same frame (a submit handler clearing the fields) are not edits: they are not validated on the next build, as antd does not validate setFieldsValue.
func (*FormW) ScrollToFirstError ¶
ScrollToFirstError scrolls the first failing item into view (in its nearest scroll container) when Validate or Submit fails.
func (*FormW) Size ¶
func (f *FormW) Size(s ControlSize) *FormW
Size sets the size of every control in the form (Ant Form size, Element el-form size); a control's own Size still wins.
func (*FormW) Submit ¶
func (f *FormW) Submit()
Submit validates every item (waiting for asynchronous rules) and makes Finished report true once all pass. It scrolls to the first error when validation fails (ScrollToFirstError).
func (*FormW) Submitting ¶
Submitting reports a Submit waiting for asynchronous validation.
func (*FormW) Validate ¶
Validate checks every item with rules built so far in this frame, shows their errors and reports whether all passed. Items whose asynchronous rules are still running count as not passed (see Validating, Submit).
func (*FormW) ValidateFields ¶
ValidateFields validates only the named items (Name, or the label) and reports whether they all passed (Ant validateFields(names), Element validateField). Without names it is Validate.
func (*FormW) ValidateTrigger ¶
func (f *FormW) ValidateTrigger(t FormTrigger) *FormW
ValidateTrigger sets when items validate (default ValidateOnChange); FormItemW.ValidateTrigger overrides it per item.
func (*FormW) Validating ¶
Validating reports an asynchronous rule still running.
type GraphLocale ¶
type GraphLocale struct {
Diagram, ER, GitGraph string // accessible names of the canvases / list
ZoomIn, ZoomOut, FitView, AutoLayout, MiniMap string // toolbar buttons and the minimap
PrimaryKey, ForeignKey string // ER column marks
SummaryFmt string // diagram description, args: node count, edge count ("%[1]d 个节点,%[2]d 条连线")
CommitsFmt string // commit list description, arg: commit count ("%d 个提交")
// contains filtered or unexported fields
}
GraphLocale holds the texts of ui/graph widgets (Diagram, ER, GitGraph).
type GridColW ¶
type GridColW struct {
// contains filtered or unexported fields
}
GridColW is a column of a GridRow.
func (*GridColW) Offset ¶
Offset shifts the column towards the end (right; left in RTL) by n columns.
func (*GridColW) Order ¶
Order sets the flex order of the column within the row (lower first; equal orders keep the call order).
func (*GridColW) Push ¶
Push moves the column towards the end by n columns without moving its neighbours (Ant push; for reordering columns visually).
type GridContentW ¶
type GridContentW struct {
// contains filtered or unexported fields
}
GridContentW builds a GridContent.
func GridContent ¶
func GridContent(c *Context) *GridContentW
GridContent starts a content container; chain options, then Body.
ConfigProvider.Defaults("GridContent", ...) keys: "contentWidth" ("Fluid" | "Fixed"). Without either, the enclosing ProLayout's content width is used.
func (*GridContentW) Body ¶
func (g *GridContentW) Body(fn func()) *Box
Body builds fn inside the container and returns the inner column.
func (*GridContentW) ContentWidth ¶
func (g *GridContentW) ContentWidth(w string) *GridContentW
ContentWidth sets "Fluid" (fill) or "Fixed" (centred, MaxWidth).
func (*GridContentW) Fixed ¶
func (g *GridContentW) Fixed() bool
Fixed reports whether the container centres its content.
func (*GridContentW) Layout ¶
func (g *GridContentW) Layout(o ...layout.Option) *GridContentW
Layout applies layout options to the inner column.
func (*GridContentW) MaxWidth ¶
func (g *GridContentW) MaxWidth(px float32) *GridContentW
MaxWidth sets the width of a Fixed container (default 1152).
type GridRowW ¶
type GridRowW struct {
// contains filtered or unexported fields
}
GridRowW is a 24-column grid row (Ant Row / Element el-row).
func (*GridRowW) Align ¶
Align sets vertical alignment of columns (AlignStart, AlignCenter, AlignEnd).
func (*GridRowW) GutterAt ¶
func (g *GridRowW) GutterAt(bp Breakpoint, px float32) *GridRowW
GutterAt sets a responsive horizontal gutter per breakpoint.
func (*GridRowW) Justify ¶
Justify distributes free columns: JustifyStart, JustifyEnd, JustifyCenter, JustifySpaceBetween, JustifySpaceAround, JustifySpaceEvenly.
type Host ¶
type Host interface {
OpenWindow(opts WindowOptions, r *Runner) (Window, error)
}
Host is implemented by a platform backend that can open windows whose content is drawn by the Tango UI. The host owns the event loop and must:
- forward input as input.Event values to Runner.HandleEvent (logical coordinates relative to the content area; positive Scroll.DY reveals content below; Pointer.Clicks if the OS tracks double clicks);
- call Runner.Frame on the UI thread after Window.Invalidate / InvalidateAt, after a resize or scale change, and when the window is first shown;
- map input.Cursor to native cursors in Window.SetCursor;
- route IME through Window.SetTextInput (NSTextInputClient, IMM32/TSF, GTK IM context) and deliver input.Composition + input.TextInput;
- display the image passed to Window.Present (e.g. CGImage into a CALayer, StretchDIBits / D2D bitmap, cairo surface);
- call Runner.Close when the window is destroyed.
type HotkeyInputLocale ¶
type HotkeyInputLocale struct {
Placeholder string // empty, not recording ("点击录制快捷键")
Recording string // waiting for a key ("请按下组合键,Esc 取消")
ClearLabel string // clear button ("清除快捷键")
// contains filtered or unexported fields
}
HotkeyInputLocale holds the HotkeyInput texts.
type HotkeyInputW ¶
type HotkeyInputW struct {
// contains filtered or unexported fields
}
HotkeyInputW is the shortcut recorder HotkeyInput returns.
func HotkeyInput ¶
func HotkeyInput(c *Context, accel *string) *HotkeyInputW
HotkeyInput adds a shortcut recorder bound to *accel, an accelerator in the syntax of package sys/hotkey and uihost shortcuts ("CmdOrCtrl+Shift+K", "Alt+F4", "F5"):
ui.HotkeyInput(c, &keys.Palette).Conflict(func(a string) string {
if owner := bindings.Owner(a); owner != "" { return "已被“" + owner + "”使用" }
return ""
})
Focusing it (a click, or Tab and then Enter / Space) starts recording: the held modifiers show as key caps until a main key completes the combination, which becomes the value. The platform shortcut modifier is stored as CmdOrCtrl (Literal stores Cmd / Ctrl as pressed). A main key needs a modifier other than Shift, except F1–F12 (AllowBare lifts that). Bare Backspace / Delete clear the value, as the clear button does.
Esc while recording cancels it and keeps the old value; the Esc is not passed on, so an enclosing Modal or Drawer stays open, and a second Esc (not recording) reaches it. (Popovers and dropdowns check Esc before building their content, so inside one Esc closes the panel.) Tab is not recorded: it moves focus as everywhere else.
Hosts implementing ShortcutCaptureWindow (including uihost) yield window shortcuts and menu accelerators while recording, without enabling IME. Capture ends on completion, cancel, blur, disable or removal. System shortcuts and global OS hotkeys cannot be overridden by this widget.
func (*HotkeyInputW) A11yLabel ¶
func (w *HotkeyInputW) A11yLabel(s string) *HotkeyInputW
A11yLabel sets the accessible name (a FormItem label names it too).
func (*HotkeyInputW) AllowBare ¶
func (w *HotkeyInputW) AllowBare(on bool) *HotkeyInputW
AllowBare accepts main keys without a modifier (letters, digits, Enter).
func (*HotkeyInputW) Changed ¶
func (w *HotkeyInputW) Changed() bool
Changed reports that the value was recorded or cleared this frame.
func (*HotkeyInputW) Conflict ¶
func (w *HotkeyInputW) Conflict(fn func(accel string) string) *HotkeyInputW
Conflict checks the value: fn returns a message when the shortcut is taken or reserved ("" when it is free). The message shows under the field, which turns to the warning status; the value is kept, the app decides whether to save it.
func (*HotkeyInputW) ConflictText ¶
func (w *HotkeyInputW) ConflictText() string
ConflictText returns the message of the Conflict check ("" for none).
func (*HotkeyInputW) Disabled ¶
func (w *HotkeyInputW) Disabled(on bool) *HotkeyInputW
Disabled stops recording and clearing.
func (*HotkeyInputW) ID ¶
func (w *HotkeyInputW) ID() ID
ID returns the field's ID (the focusable frame).
func (*HotkeyInputW) Literal ¶
func (w *HotkeyInputW) Literal() *HotkeyInputW
Literal stores Cmd (macOS) and Ctrl as pressed instead of CmdOrCtrl.
func (*HotkeyInputW) Placeholder ¶
func (w *HotkeyInputW) Placeholder(s string) *HotkeyInputW
Placeholder replaces the empty-field text (Locale.HotkeyInput.Placeholder).
func (*HotkeyInputW) Recording ¶
func (w *HotkeyInputW) Recording() bool
Recording reports whether the field is waiting for a key.
func (*HotkeyInputW) Size ¶
func (w *HotkeyInputW) Size(s ControlSize) *HotkeyInputW
Size sets the control size.
func (*HotkeyInputW) Status ¶
func (w *HotkeyInputW) Status(s string) *HotkeyInputW
Status sets the validation status: "error" or "warning" (a conflict shows as "warning" unless a status is set).
func (*HotkeyInputW) Width ¶
func (w *HotkeyInputW) Width(px float32) *HotkeyInputW
Width sets the field width (the token's MinWidth by default).
type ID ¶
type ID uint64
ID identifies a widget across frames. IDs derive from the parent scope, the widget kind, its label and its occurrence count; wrap dynamic lists in Key to make identity independent of position.
type IconButtonW ¶
type IconButtonW struct {
// contains filtered or unexported fields
}
IconButtonW is a borderless square icon button (close buttons, toolbar toggles, calendar navigation).
func IconButton ¶
func IconButton(c *Context, ic *icon.Icon, label string) *IconButtonW
IconButton adds an icon button; label is used for tests and accessibility.
func (*IconButtonW) A11yLabel ¶
func (b *IconButtonW) A11yLabel(s string) *IconButtonW
A11yLabel replaces the accessible name (by default the label argument).
func (*IconButtonW) Color ¶
func (b *IconButtonW) Color(col theme.Color) *IconButtonW
Color fixes the icon color.
func (*IconButtonW) NoHoverBg ¶
func (b *IconButtonW) NoHoverBg() *IconButtonW
NoHoverBg disables the hover background.
func (*IconButtonW) Size ¶
func (b *IconButtonW) Size(box, iconSize float32) *IconButtonW
Size sets the square box size and the icon size.
type IconViolation ¶
type IconViolation struct {
Icon string // icon name
Label string // label of the deepest labelled node containing the icon
Under string // label of the nearest labelled ancestor of that node
Rect geom.Rect // where the icon was drawn
}
IconViolation is a directional icon (icon.Icon.IsDirectional) drawn without mirroring while its node was painted in a right-to-left scope: the widget used icon.Draw instead of the direction-aware paint helper.
func (IconViolation) String ¶
func (v IconViolation) String() string
type IconW ¶
type IconW struct {
// contains filtered or unexported fields
}
IconW is an icon leaf.
func (*IconW) A11yLabel ¶
A11yLabel exposes a meaningful icon (a status, not decoration) as an image with this accessible name. Icons are decorative by default.
type ImageLocale ¶
type ImageLocale struct {
Preview, PreviewLabel, ClosePreview, Prev, Next string
ZoomIn, ZoomOut, RotateLeft, RotateRight, FlipHorizontal, FlipVertical string
// contains filtered or unexported fields
}
ImageLocale holds the Image placeholder and preview toolbar texts.
type ImageW ¶
type ImageW struct {
// contains filtered or unexported fields
}
ImageW displays a bitmap with loading placeholder, error fallback and an optional full-screen preview (Ant Design Image / Element Plus el-image).
func Image ¶
Image adds an image; img may be nil (shows the placeholder). The default size is the image's pixel size (200×200 when unknown); use Width/Height.
func (*ImageW) A11yLabel ¶
A11yLabel sets the accessible name (like Alt, without changing the Driver.Find label).
func (*ImageW) CloseOnEscape ¶
CloseOnEscape(false) keeps the preview open on Escape (Element close-on-press-escape, default true).
func (*ImageW) Infinite ¶
Infinite sets whether the group preview wraps from the last image to the first (Element infinite, default true; Ant stops at the ends).
func (*ImageW) MaskClosable ¶
MaskClosable sets whether a click on the preview backdrop closes it (Ant mask.closable, default true; Element hide-on-click-modal, default false; the theme picks the default).
func (*ImageW) MinScale ¶
MinScale and MaxScale bound the preview zoom (Ant minScale 1 / maxScale 50; Element min-scale 0.2 / max-scale 7; the theme picks the default).
func (*ImageW) Movable ¶
Movable(false) stops dragging the preview image around (Ant preview.movable, default true).
func (*ImageW) OpenPreview ¶
OpenPreview opens the preview now (Ant preview.open); call it once per action, like Rotate. PreviewOpen reports the state.
func (*ImageW) PreviewAngle ¶
PreviewAngle returns the preview rotation in degrees (clockwise).
func (*ImageW) PreviewGroup ¶
PreviewGroup previews imgs (this image is imgs[index]) with prev/next navigation and a counter. An index out of range is clamped.
func (*ImageW) PreviewOpen ¶
PreviewOpen reports whether the preview overlay is open.
func (*ImageW) PreviewScale ¶
PreviewScale returns the preview zoom factor (1 = fitted size).
func (*ImageW) PreviewSrc ¶
PreviewSrc shows img in the preview instead of the image itself (Ant preview.src: a larger original behind a thumbnail).
func (*ImageW) Rotate ¶
Rotate turns the open preview by deg degrees (clockwise, any angle; relative to its current rotation). Call it once per action, e.g. from a button's Clicked branch. The toolbar's rotate buttons step by 90°, and Shift-dragging the preview image rotates it freely.
func (*ImageW) ScaleStep ¶
ScaleStep sets the zoom step of the preview buttons: each step scales by 1+step (Ant scaleStep 0.5; Element zoom-rate 1.2 = step 0.2).
func (*ImageW) ShowProgress ¶
ShowProgress shows the "2 / 5" counter of a group preview (Ant always, Element show-progress, default false; the theme picks the default).
type InfiniteScrollW ¶
type InfiniteScrollW struct {
// contains filtered or unexported fields
}
InfiniteScrollW is a scrolling column that asks for more content when the user nears its bottom.
func InfiniteScroll ¶
func InfiniteScroll(c *Context, fn func(), opts ...layout.Option) *InfiniteScrollW
InfiniteScroll builds fn (the items) inside a vertical scroll area. Give it a bounded height with Height or opts (layout.H / MaxH / Grow), then poll NeedMore:
inf := ui.InfiniteScroll(c, func() { for _, it := range items { ... } }).
Height(400).Loading(loading).Done(len(items) >= total)
if inf.NeedMore() { loading = true; go fetch() }
func (*InfiniteScrollW) Disabled ¶
func (w *InfiniteScrollW) Disabled(on bool) *InfiniteScrollW
Disabled stops NeedMore without showing a footer.
func (*InfiniteScrollW) Distance ¶
func (w *InfiniteScrollW) Distance(px float32) *InfiniteScrollW
Distance is how close (px) to the bottom NeedMore starts firing (Element infinite-scroll-distance; default 0).
func (*InfiniteScrollW) Done ¶
func (w *InfiniteScrollW) Done(on bool) *InfiniteScrollW
Done shows the "no more" footer and stops NeedMore.
func (*InfiniteScrollW) DoneText ¶
func (w *InfiniteScrollW) DoneText(s string) *InfiniteScrollW
func (*InfiniteScrollW) Height ¶
func (w *InfiniteScrollW) Height(px float32) *InfiniteScrollW
Height fixes the viewport height.
func (*InfiniteScrollW) ID ¶
func (w *InfiniteScrollW) ID() ID
ID returns the scroll container's ID.
func (*InfiniteScrollW) Layout ¶
func (w *InfiniteScrollW) Layout(opts ...layout.Option) *InfiniteScrollW
Layout applies layout options to the viewport.
func (*InfiniteScrollW) Loading ¶
func (w *InfiniteScrollW) Loading(on bool) *InfiniteScrollW
Loading shows the loading footer and suppresses NeedMore.
func (*InfiniteScrollW) LoadingText ¶
func (w *InfiniteScrollW) LoadingText(s string) *InfiniteScrollW
LoadingText / DoneText replace the footer texts ("" hides the text).
func (*InfiniteScrollW) NeedMore ¶
func (w *InfiniteScrollW) NeedMore() bool
NeedMore reports, once per content height, that the viewport is within Distance of the bottom (or not yet filled) and more items should load.
func (*InfiniteScrollW) Offset ¶
func (w *InfiniteScrollW) Offset() float64
Offset returns the vertical scroll offset.
func (*InfiniteScrollW) ScrollTo ¶
func (w *InfiniteScrollW) ScrollTo(y float64) *InfiniteScrollW
ScrollTo sets the vertical scroll offset.
type InlineSpan ¶
type InlineSpan = inlineSpan
InlineSpan places things along a rectangle's inline axis by start/end offsets: in RTL scopes offsets run from the right edge.
type InputNumberW ¶
type InputNumberW struct {
// contains filtered or unexported fields
}
InputNumberW is a numeric input with step controls.
func InputNumber ¶
func InputNumber(c *Context, val *float64) *InputNumberW
InputNumber adds a numeric input bound to *val (val may be nil with StringMode).
func (*InputNumberW) A11yLabel ¶
func (w *InputNumberW) A11yLabel(s string) *InputNumberW
A11yLabel sets the accessible name of the numeric input.
func (*InputNumberW) Changed ¶
func (w *InputNumberW) Changed() bool
func (*InputNumberW) Controls ¶
func (w *InputNumberW) Controls(on bool) *InputNumberW
Controls shows (true, the default) or hides the step buttons (antd controls, Element controls). Without them the arrow keys and the wheel still step the value.
func (*InputNumberW) ControlsPosition ¶
func (w *InputNumberW) ControlsPosition(pos string) *InputNumberW
ControlsPosition places the step buttons: "right" (stacked at the right, Ant's look and Element's controls-position="right") or "sides" (− before and + after the value). The default follows the design system: "sides" under Element (el-input-number's default), "right" otherwise.
func (*InputNumberW) Disabled ¶
func (w *InputNumberW) Disabled(on bool) *InputNumberW
func (*InputNumberW) DownDisabled ¶
func (w *InputNumberW) DownDisabled() bool
DownDisabled reports whether the − / down button is disabled.
func (*InputNumberW) Empty ¶
func (w *InputNumberW) Empty(empty *bool) *InputNumberW
Empty lets the field hold no value, like a nullable number: *empty reports whether it is empty. An empty field shows the placeholder and ignores *val; typing a number clears *empty, clearing the text sets it. The step buttons start an empty field from 0 (clamped to Min/Max). Without Empty, clearing the text and leaving keeps the previous value.
func (*InputNumberW) Formatter ¶
func (w *InputNumberW) Formatter(fn func(value string) string) *InputNumberW
Formatter formats the value for display ("$ 1,000"); the text being edited keeps the formatted form. Pair it with Parser.
func (*InputNumberW) Keyboard ¶
func (w *InputNumberW) Keyboard(on bool) *InputNumberW
Keyboard turns the Up / Down arrow keys stepping on (the default) or off (antd keyboard).
func (*InputNumberW) Max ¶
func (w *InputNumberW) Max(v float64) *InputNumberW
func (*InputNumberW) Min ¶
func (w *InputNumberW) Min(v float64) *InputNumberW
func (*InputNumberW) Mode ¶
func (w *InputNumberW) Mode(m string) *InputNumberW
Mode chooses where the step buttons go (antd 6 mode): "input" (stacked at the inline end, the default) or "spinner" (− before and + after the value, which is centred). It is the antd name of ControlsPosition: "spinner" equals ControlsPosition("sides") and "input" equals ControlsPosition("right").
func (*InputNumberW) Parser ¶
func (w *InputNumberW) Parser(fn func(display string) string) *InputNumberW
Parser turns the displayed text back into a plain number ("1000"). Without one, a formatted field keeps only digits, '.', '-' and 'e'.
func (*InputNumberW) Placeholder ¶
func (w *InputNumberW) Placeholder(s string) *InputNumberW
Placeholder is shown while the field is empty (see Empty).
func (*InputNumberW) Precision ¶
func (w *InputNumberW) Precision(n int) *InputNumberW
func (*InputNumberW) Prefix ¶
func (w *InputNumberW) Prefix(ic *icon.Icon) *InputNumberW
Prefix shows an icon before the value.
func (*InputNumberW) PrefixText ¶
func (w *InputNumberW) PrefixText(s string) *InputNumberW
PrefixText shows short static text before the value ("¥").
func (*InputNumberW) ReadOnly ¶
func (w *InputNumberW) ReadOnly() *InputNumberW
ReadOnly shows the value without letting it change: the text can be selected and copied, the step buttons are hidden and the arrow keys and the wheel do nothing (antd readOnly, Element readonly).
func (*InputNumberW) Size ¶
func (w *InputNumberW) Size(s ControlSize) *InputNumberW
func (*InputNumberW) Status ¶
func (w *InputNumberW) Status(s string) *InputNumberW
Status overrides the validation status ("error" | "warning"); inside a form item it defaults to the item's status.
func (*InputNumberW) Step ¶
func (w *InputNumberW) Step(v float64) *InputNumberW
func (*InputNumberW) StepStrictly ¶
func (w *InputNumberW) StepStrictly() *InputNumberW
StepStrictly only accepts multiples of Step (Element step-strictly): a typed value is rounded to the nearest multiple when it is committed. It applies to float64 values (not to StringMode).
func (*InputNumberW) StringMode ¶
func (w *InputNumberW) StringMode(s *string) *InputNumberW
StringMode binds the value as a decimal string instead of a float64, so it keeps every digit ("0.1" + "0.2" = "0.3", 20-digit amounts; Ant stringMode). "" is an empty field. *val (if any) receives the nearest float64.
func (*InputNumberW) Submitted ¶
func (w *InputNumberW) Submitted() bool
Submitted reports Enter after committing the numeric value. It may be true when the committed value is unchanged.
func (*InputNumberW) UpDisabled ¶
func (w *InputNumberW) UpDisabled() bool
UpDisabled reports whether the + / up button is disabled (a value at Max, a disabled or read-only field, or no step buttons).
func (*InputNumberW) Variant ¶
func (w *InputNumberW) Variant(v string) *InputNumberW
Variant sets the frame look (see InputW.Variant).
func (*InputNumberW) Wheel ¶
func (w *InputNumberW) Wheel() *InputNumberW
Wheel lets the mouse wheel step the value while the field has focus (Ant changeOnWheel).
func (*InputNumberW) Width ¶
func (w *InputNumberW) Width(px float32) *InputNumberW
type InputTagW ¶
type InputTagW struct {
// contains filtered or unexported fields
}
InputTagW is a text field that turns entries into tags (Enter or a separator, by default a comma).
func (*InputTagW) A11yLabel ¶
A11yLabel sets the accessible name of the text field (inside a FormItem the item label is used; the placeholder is the last resort).
func (*InputTagW) AllowClear ¶
func (*InputTagW) Draggable ¶
Draggable lets the user reorder the tags by dragging them; a drop reports Changed.
func (*InputTagW) MaxTagCount ¶
func (*InputTagW) Placeholder ¶
func (*InputTagW) SaveOnBlur ¶
SaveOnBlur turns the typed text into a tag when the field loses focus (by default the text stays in the field).
func (*InputTagW) Separators ¶
Separators sets the strings that end a tag while typing or pasting (Element delimiter), e.g. Separators(";", " "); the default is the ASCII and the full-width comma. Separators() with no argument leaves only Enter. Empty strings are ignored.
func (*InputTagW) Size ¶
func (w *InputTagW) Size(s ControlSize) *InputTagW
type InputW ¶
type InputW struct {
// contains filtered or unexported fields
}
InputW is a single-line text input.
func (*InputW) A11yLabel ¶
A11yLabel sets the accessible name. Inside a FormItem the item label is used; otherwise the placeholder is the last resort.
func (*InputW) AllowClear ¶
AllowClear shows a clear button when the input has a value.
func (*InputW) Bg ¶
Bg replaces the background color of the frame (a grey search field on a white bar). It keeps hover / focus borders unless NoBorder is set.
func (*InputW) Borderless ¶
Borderless drops the frame (background, border and focus halo), for inputs embedded in another surface such as the Command search row.
func (*InputW) EnterKey ¶
EnterKey labels the soft keyboard's return key (input.EnterSearch, input.EnterNext, …). Pressing it still submits (Submitted).
func (*InputW) Kind ¶
Kind tells soft keyboards what the field holds (input.TextEmail, input.TextNumber, …): the keyboard layout and whether it suggests words. It does not filter what can be typed. Password sets input.TextPassword.
func (*InputW) NoBorder ¶
NoBorder drops the border and the focus halo but keeps the background (Bg or the variant's), e.g. a filled search bar.
func (*InputW) Placeholder ¶
func (*InputW) PrefixText ¶
PrefixText / SuffixText show short static text (units, currency).
func (*InputW) SelectAll ¶
SelectAll selects the full text of the input. It can be used after Focus when presenting a prefilled field and does not move focus itself.
func (*InputW) ShowCount ¶
ShowCount shows the character count ("3 / 20" with MaxLength) at the end of the field (Ant showCount, Element show-word-limit).
func (*InputW) SuffixText ¶
func (*InputW) Variant ¶
Variant sets the look of the frame (Ant Input variant): "outlined" (default), "filled" (grey fill, border on focus), "borderless" (no frame) or "underlined" (bottom line only).
func (*InputW) VisibilityToggle ¶
VisibilityToggle shows (true, the default) or hides the eye button of a Password field (antd Input.Password visibilityToggle; Element type="password" without show-password).
type Interaction ¶
type Interaction struct {
ID ID
Hovered bool // pointer over it and not covered by a higher layer
Pressed bool // pointer went down on it and is still held
Clicked bool // activated this frame (pointer or Enter/Space)
Clicks int // click count of the activation (2 = double click)
PressedNow bool // pointer went down on it this frame
Focused bool
FocusVisible bool // focused via keyboard: draw the focus ring
}
Interaction is the per-frame pointer/keyboard state of a widget.
type ItemGroupW ¶
type ItemGroupW struct {
// contains filtered or unexported fields
}
ItemGroupW stacks Items as a list (shadcn/ui ItemGroup), optionally with rules between them (ItemSeparator) and an outline around them.
func ItemGroup ¶
func ItemGroup(c *Context) *ItemGroupW
ItemGroup starts a list of Items; chain options, then Body:
ui.ItemGroup(c).Separated().Bordered().Body(func() {
ui.Item(c, "通知").Description("…")
ui.Item(c, "隐私").Description("…")
})
func (*ItemGroupW) A11yLabel ¶
func (g *ItemGroupW) A11yLabel(s string) *ItemGroupW
A11yLabel names the list.
func (*ItemGroupW) Bordered ¶
func (g *ItemGroupW) Bordered() *ItemGroupW
Bordered outlines the group with rounded corners.
func (*ItemGroupW) Gap ¶
func (g *ItemGroupW) Gap(px float32) *ItemGroupW
Gap sets the space between items (with Separated, the rule sits in its middle).
func (*ItemGroupW) Separated ¶
func (g *ItemGroupW) Separated() *ItemGroupW
Separated draws a rule between consecutive items.
type ItemVariant ¶
type ItemVariant string
ItemVariant is the surface of an Item. Open set: new variants are added as new constants.
const ( ItemVariantDefault ItemVariant = "default" // no surface ItemVariantOutline ItemVariant = "outline" // bordered ItemVariantMuted ItemVariant = "muted" // muted fill )
type ItemW ¶
type ItemW struct {
// contains filtered or unexported fields
}
ItemW is a general list row (shadcn/ui Item): media (an icon tile, an avatar, an image), a title with a description, and actions at the end.
func Item ¶
Item adds a list row titled title; chain the parts and options:
ui.Item(c, "安全设置").Description("双重验证已开启").Icon(icon.Lock).Outline().
Actions(func() { ui.Button(c, "管理").Small() })
if ui.Item(c, "个人资料").Icon(icon.User).Link().Clicked() { ... }
The row is built at the end of the chain (Clicked, or the end of the build).
func (*ItemW) Clickable ¶
Clickable makes the whole row a button: focusable, hover highlight, Enter / Space or a click report Clicked.
func (*ItemW) Description ¶
Description adds the secondary text under the title (two lines at most).
func (*ItemW) Link ¶
Link makes the whole row a link (as Clickable, announced as a link; the app navigates on Clicked).
func (*ItemW) Media ¶
Media builds custom media at the start (an Avatar, an Image) in place of the icon tile.
func (*ItemW) Variant ¶
func (w *ItemW) Variant(v ItemVariant) *ItemW
Variant selects the surface (default, outline, muted).
type JSONViewLocale ¶
type JSONViewLocale struct {
Name string // accessible name of the tree
CopyValue, CopyPath string
ExpandAll, CollapseAll string
ItemsFmt string // array size, arg: n ("%d 项")
KeysFmt string // object size, arg: n ("%d 个键")
Search string // search box placeholder
PrevMatch, NextMatch string
MatchFmt string // current match and count, args: i, n
NoMatch string
ParseErrorFmt string // arg: the parser's message
// contains filtered or unexported fields
}
JSONViewLocale holds the JSONView texts.
func (*JSONViewLocale) Items ¶
func (l *JSONViewLocale) Items(n int) string
Items formats an array size.
func (*JSONViewLocale) Keys ¶
func (l *JSONViewLocale) Keys(n int) string
Keys formats an object size.
func (*JSONViewLocale) Match ¶
func (l *JSONViewLocale) Match(i, n int) string
Match formats the match position.
func (*JSONViewLocale) ParseError ¶
func (l *JSONViewLocale) ParseError(msg string) string
ParseError formats a parse error.
type JSONViewW ¶
type JSONViewW struct {
// contains filtered or unexported fields
}
JSONViewW shows a value tree: a JSON document (JSONView), a Go value (JSONViewValue) or any ValueSource such as a debugger's variables (JSONViewSource). Nodes load when expanded, large arrays and objects open in groups of 100, and only the visible rows are built. Values are colored by type; containers show their size. A row's context menu (or Cmd/Ctrl+C, Cmd/Ctrl+Shift+C on the current row) copies its value or its path ($.a.b[0]); the toolbar searches keys and values and expands or collapses everything.
Keyboard (the tree is one Tab stop): Up/Down/Page Up/Page Down/Home/End move the current row, Right expands or enters, Left collapses or goes to the parent, Enter toggles.
func JSONView ¶
JSONView adds a viewer of the JSON document data (shown with an error message when it is not valid JSON). The same data slice (by address and length) keeps the tree's state; replace the slice to show new data.
ui.JSONView(c, body).Height(400)
func JSONViewSource ¶
func JSONViewSource(c *Context, src ValueSource, opts ...layout.Option) *JSONViewW
JSONViewSource adds a viewer of a value tree source (a debugger's variables, a remote document …). The same source value keeps the tree's state; bump DataVersion to reload it.
func JSONViewValue ¶
JSONViewValue adds a viewer of a Go value (see GoValueSource). Pass a pointer, map or slice to keep the tree's state across frames, and bump DataVersion when its contents change.
func (*JSONViewW) DataVersion ¶
DataVersion reloads the tree when v changes (keeping what is expanded).
func (*JSONViewW) ExpandDepth ¶
ExpandDepth sets how many levels open when data is first shown (default 1: the roots).
func (*JSONViewW) Height ¶
Height fixes the viewer's height (toolbar included); without it the viewer grows in its parent.
type KbdW ¶
type KbdW struct {
*Box
// contains filtered or unexported fields
}
KbdW is the key cap Kbd returns; it embeds the widget's Box.
type KeyboardInsetWindow ¶
KeyboardInsetWindow is implemented by windows that know the part of their content area covered by the soft keyboard (usually only Bottom; zero while it is hidden). It is polled every frame like SafeAreaWindow, so it must return a cached value.
type KeyboardReveal ¶
type KeyboardReveal struct {
Field ID // the focused widget
Rect geom.Rect // its rectangle
Caret geom.Rect // its caret (Context.WantTextInput)
// Limit is the window y the revealed part must end above: the top of
// the keyboard minus a margin.
Limit float32
}
KeyboardReveal is a request to scroll the focused text field above the soft keyboard. Rectangles are window logical pixels from the last painted frame.
type Label ¶
type Label struct {
// contains filtered or unexported fields
}
Label is a run of text (Typography.Text).
func (*Label) Copyable ¶
Copyable adds a copy icon after the text; clicking it writes the text to the clipboard and shows a check mark for three seconds.
func (*Label) Editable ¶
Editable adds an edit icon; clicking it swaps the text for an input. Enter or losing focus commits into *val, Escape cancels.
func (*Label) Expandable ¶
Expandable adds an "展开" link when the text is cut by Lines(n); open is toggled by the link ("收起" collapses when open).
func (*Label) LineHeight ¶
LineHeight overrides the line height in px.
func (*Label) TextDir ¶
TextDir sets the paragraph base direction explicitly. By default label text follows the scope: RTL in an RTL scope, else taken from the first strong character (text.DirAuto).
type LightFilterLocale ¶
type LightFilterLocale struct {
Name string // accessible name of the toolbar
ClearFmt string // clear button of a field, arg: field label ("清除%s")
PillFmt string // accessible name of a field pill, args: label, value ("%s:%s")
More string // collapsed fields button
MoreFmt string // collapsed fields button with values set, arg: count ("更多筛选(%d)")
// contains filtered or unexported fields
}
LightFilterLocale holds the LightFilter texts.
type LightFilterW ¶
type LightFilterW struct {
// contains filtered or unexported fields
}
LightFilterW is a compact filter bar (Ant Design Pro LightFilter): each field is a "label: value" pill; clicking it opens a popup with the field's editor and clear / confirm buttons. It takes the same field definitions as QueryFilter and ProForm.
lf := ui.LightFilter(c, fields).Values(&filter).Show()
if lf.Changed() { reload(lf.Params()) }
func LightFilter ¶
func LightFilter(c *Context, fields []ProField) *LightFilterW
LightFilter starts a filter bar over fields; chain options, then Show.
ConfigProvider.Defaults("LightFilter", ...) keys: "size", "bordered", "collapse" (number of pills before "more filters").
func (*LightFilterW) Bordered ¶
func (f *LightFilterW) Bordered() *LightFilterW
Bordered draws an outline around every pill.
func (*LightFilterW) Changed ¶
func (f *LightFilterW) Changed() bool
Changed reports a value confirmed or cleared in the last Show.
func (*LightFilterW) Collapse ¶
func (f *LightFilterW) Collapse(n int) *LightFilterW
Collapse shows at most n fields as pills; the others are edited together in a "more filters" popup (n <= 0: every field is a pill).
func (*LightFilterW) ID ¶
func (f *LightFilterW) ID() ID
ID returns the widget ID (valid after Show).
func (*LightFilterW) OpenKey ¶
func (f *LightFilterW) OpenKey() string
OpenKey returns the key of the field whose popup is open ("" if none).
func (*LightFilterW) Params ¶
func (f *LightFilterW) Params() map[string]string
Params returns the non-empty values as text (dates as 2006-01-02).
func (*LightFilterW) Size ¶
func (f *LightFilterW) Size(s ControlSize) *LightFilterW
Size sets the pill size (default: the global size).
func (*LightFilterW) Values ¶
func (f *LightFilterW) Values(v *ProValues) *LightFilterW
Values binds the values (otherwise the filter keeps its own).
type LinkW ¶
type LinkW struct {
*Label
// contains filtered or unexported fields
}
LinkW is a clickable text link.
func Link ¶
Link adds a hyperlink-styled text button.
ConfigProvider.Defaults("Link", ...) keys: "underline" ("always" | "hover" | "never"; Element underline).
func (*LinkW) Type ¶
Type colors the link by status: "success", "warning", "danger" / "error", "info" use that palette (hover and pressed shades follow); "secondary" (or Element's "default") starts in the secondary text color and turns link-colored on hover; "primary" is the primary palette. "" restores the link colors.
func (*LinkW) UnderlineMode ¶
UnderlineMode sets when the link is underlined: "always", "hover" or "never" (Element underline; the default follows the theme: never for Ant, on hover for Element, always for shadcn). Other values restore the theme's.
type ListActionsW ¶
type ListActionsW struct {
*Box
// contains filtered or unexported fields
}
ListActionsW is the action row ListActions returns; it embeds the row's Box.
func ListActions ¶
func ListActions(c *Context, fn func()) *ListActionsW
ListActions lays out item actions at the end of a list row, separated by short vertical bars (Ant's actions). In a vertical list they sit under the content, wider apart.
type ListItemMetaW ¶
type ListItemMetaW struct {
*Box
// contains filtered or unexported fields
}
ListItemMetaW is the block ListItemMeta returns; it embeds the row's Box.
func ListItemMeta ¶
func ListItemMeta(c *Context, avatar func(), title, desc string) *ListItemMetaW
ListItemMeta is the avatar + title + description block of a list item. avatar may be nil. It grows to take the row's free space.
In a vertical list (List.ItemLayout("vertical")) the title is large with a 12px gap under it and the block keeps 16px below.
type ListToolBarW ¶
type ListToolBarW struct {
// contains filtered or unexported fields
}
ListToolBarW composes the title, subtitle, tooltip, search, actions, settings, filter, tabs and header menu of a list. ProTable uses this same public component for its toolbar, passing its existing settings.
func ListToolBar ¶
func ListToolBar(c *Context) *ListToolBarW
ListToolBar starts a list toolbar; chain options, then Show. ConfigProvider.Defaults keys: "title", "subTitle", "tooltip" (strings), "search" (bool, default false), "multipleLine" (bool, default false).
func (*ListToolBarW) Actions ¶
func (w *ListToolBarW) Actions(fn func()) *ListToolBarW
Actions builds the right-hand actions.
func (*ListToolBarW) Filter ¶
func (w *ListToolBarW) Filter(fn func()) *ListToolBarW
Filter builds the filter area (for example LightFilter).
func (*ListToolBarW) Menu ¶
func (w *ListToolBarW) Menu(kind string, active *string, items []TabItem) *ListToolBarW
Menu sets the header menu, replacing the heading; kind is "inline" (default), "tab" or "dropdown". A nil active pointer is uncontrolled.
func (*ListToolBarW) MultipleLine ¶
func (w *ListToolBarW) MultipleLine(on bool) *ListToolBarW
MultipleLine places filters and tabs on a separate line.
func (*ListToolBarW) OnSearch ¶
func (w *ListToolBarW) OnSearch(fn func(string)) *ListToolBarW
OnSearch receives a submitted keyword (Enter or search button).
func (*ListToolBarW) Search ¶
func (w *ListToolBarW) Search(s *string) *ListToolBarW
Search binds the search input; nil hides it.
func (*ListToolBarW) Settings ¶
func (w *ListToolBarW) Settings(fn func()) *ListToolBarW
Settings builds the right-hand settings (use named IconButtons).
func (*ListToolBarW) SubTitle ¶
func (w *ListToolBarW) SubTitle(s string) *ListToolBarW
SubTitle sets the secondary text next to the heading.
func (*ListToolBarW) Tabs ¶
func (w *ListToolBarW) Tabs(active *string, items []TabItem) *ListToolBarW
Tabs sets the second-line tabs, shown only with MultipleLine(true). A nil active pointer keeps the active key internally.
func (*ListToolBarW) Title ¶
func (w *ListToolBarW) Title(s string) *ListToolBarW
Title sets the heading.
func (*ListToolBarW) Tooltip ¶
func (w *ListToolBarW) Tooltip(s string) *ListToolBarW
Tooltip sets the heading information tooltip.
type ListW ¶
type ListW struct {
// contains filtered or unexported fields
}
ListW renders a list of n items (Ant Design List).
func List ¶
List starts a list of n items; render each with Item.
ConfigProvider.Defaults("List", ...) keys: "size", "bordered", "split", "itemLayout" ("horizontal" | "vertical").
func (*ListW) EstimatedItemHeight ¶
EstimatedItemHeight is the height Virtual assumes for an item not measured yet. Default: one line of text plus the item padding (46 at the middle size, as Listy).
func (*ListW) Grid ¶
Grid lays the items out in columns separated by gap px (antd grid gutter); every grid row keeps GridItemMarginBottom below it.
func (*ListW) GridAt ¶
func (w *ListW) GridAt(bp Breakpoint, columns int) *ListW
GridAt sets the grid column count from breakpoint bp upwards (Ant grid={{ xs: 1, sm: 2, md: 4 }}); the largest set breakpoint not above the window width wins, Grid's count is the fallback. Without Grid the list becomes a grid with a 16px gap.
func (*ListW) Height ¶
Height fixes the height of the items' viewport (antd height); longer content scrolls inside it. Header, Footer, LoadMore and the pager stay outside it. Default 0: the list grows with its items.
func (*ListW) ItemExtra ¶
ItemExtra builds extra content of item i (antd List.Item extra): at the inline end of the row, or in its own column beside the content and actions with the vertical layout.
func (*ListW) ItemHeight ¶
ItemHeight fixes every item's height, padding included (the fast path of Virtual: nothing is measured). Default 0: items size to their content.
func (*ListW) ItemLayout ¶
ItemLayout sets the item layout (antd itemLayout): "horizontal" (the default: content and actions on one line) or "vertical" (actions under the content, ItemExtra in a column at the inline end; ListItemMeta gets the large title and ListActions moves under the content).
func (*ListW) LoadMore ¶
LoadMore shows a centered "load more" button under the items; query the click with LoadMoreClicked. busy shows the button in its loading state.
func (*ListW) LoadMoreClicked ¶
LoadMoreClicked reports a click on the load-more button in the last Item call.
func (*ListW) PageChanged ¶
PageChanged reports a page change in the last Item call.
func (*ListW) Pagination ¶
Pagination shows a pager under the list and only renders the current page's items; *page is 1-based and owned by the app (out-of-range pages show the nearest page).
func (*ListW) PaginationAlign ¶
PaginationAlign aligns the pager (antd pagination.align): "start", "center" or "end" (default).
func (*ListW) PaginationPosition ¶
PaginationPosition places the pager (antd pagination.position): "bottom" (default), "top" or "both".
func (*ListW) Range ¶
Range returns the item indexes [first, end) built by the last Item call: the current page, or under Virtual the window (the focused item aside, which is built even outside it).
func (*ListW) RowKey ¶
RowKey gives items stable identities for the heights Virtual measures (default: the index; the measured heights are kept for every key seen, as Listy does). It does not change how items are keyed; wrap the item content in Key for state that follows the data.
func (*ListW) ScrollToKey ¶
ScrollToKey scrolls the viewport (Height) to the item with key (RowKey; the index without one) using align (AlignTop, AlignBottom or AlignAuto) plus offset pixels. An item of the current page only; under Virtual an item not measured yet is placed by its estimate first and corrected over the next frames, as Listy.
func (*ListW) Size ¶
func (w *ListW) Size(s ControlSize) *ListW
func (*ListW) Virtual ¶
Virtual builds only the items in the viewport (and a few past each edge) instead of every item; it needs Height and is ignored without it. With Pagination it windows the current page; with Grid it windows rows of columns items (a row is as high as its tallest item). The item that holds the keyboard focus is built on the frame it leaves the viewport, but once its focused control is clipped out of view the focus is lost, exactly as in the non-virtual Height form. Items scrolled out of view are not built, so state kept inside them (State, an input's text) is dropped after a while and they are missing from the accessibility tree, FindText and the Tab order, as with Listy and VirtualList. Heights are measured as items come into view and cached by RowKey; an item never measured counts EstimatedItemHeight, so the scroll bar can adjust the first time a taller item appears.
type ListyW ¶
type ListyW struct {
// contains filtered or unexported fields
}
ListyW is a Listy list. Configure it and call Show.
func Listy ¶
Listy starts a list of n items; item(i) builds the content of row i (padded 12/16 with a divider and hover background).
ui.Listy(c, len(users), func(i int) { ui.Text(c, users[i].Name) }).
Virtual().Height(400).Group(byLetter, letterHeader).Sticky().Show()
func (*ListyW) DataVersion ¶
DataVersion tells the list that the data behind n, RowKey or Group changed without n changing (grouping and offsets are cached by n and this number).
func (*ListyW) EndReached ¶
EndReached reports that the viewport is within 100px of the end while more data can be loaded (after Show).
func (*ListyW) EstimatedItemHeight ¶
EstimatedItemHeight is assumed for items not measured yet (default 46).
func (*ListyW) Group ¶
Group groups items by key(i) (items with equal keys are gathered in order of first appearance) under headers built by title(key, count).
func (*ListyW) ItemHeight ¶
ItemHeight fixes every item's height (fast path; default: measured).
func (*ListyW) LoadMore ¶
LoadMore adds a footer: a spinner while loading, "no more" when hasMore is false. EndReached reports when the user scrolled near it.
func (*ListyW) RowHoverable ¶
RowHoverable toggles the row hover background (default on).
func (*ListyW) ScrollToGroup ¶
ScrollToGroup scrolls to a group header.
func (*ListyW) ScrollToKey ¶
ScrollToKey scrolls to the item with key (RowKey) using align (AlignTop, AlignBottom or AlignAuto) plus offset pixels.
type LoadingW ¶
type LoadingW struct {
// contains filtered or unexported fields
}
LoadingW covers a region or the window while loading.
func Loading ¶
Loading starts a loading mask shown while on; chain options, then Body (cover a region) or Fullscreen (cover the window):
ui.Loading(c, busy).Text("加载中").Body(func() { ... })
ui.Loading(c, busy).Fullscreen()
ConfigProvider.Defaults("Spin", ...) "size" and "tip" apply.
func (*LoadingW) Background ¶
Background overrides the mask color.
func (*LoadingW) Fullscreen ¶
Fullscreen covers the whole window while loading.
func (*LoadingW) Size ¶
func (m *LoadingW) Size(s ControlSize) *LoadingW
Size sets the spinner size.
func (*LoadingW) Spinner ¶
Spinner replaces the indicator with a spinning icon (EP element-loading-spinner, antd indicator).
type Locale ¶
type Locale struct {
Code string // BCP 47 tag, e.g. "zh-CN"
Name string // native display name, e.g. "简体中文"
// Dir is the layout direction of the language; the zero value DirAuto
// infers it from Code (ar, he, fa ... and Arab / Hebr script tags are
// RTL). Not copied by FillLocale.
Dir Direction
// Common actions.
OK, Cancel, Close, Confirm, Back, Clear, Reset, Search, Save, Delete, Edit, Copy, Copied, More string
Expand, Collapse, SelectAll, Loading, Retry string
GotIt string // acknowledge-only button of an alert box ("知道了")
// Empty & lists.
NoData, NoMore, LoadMore, LoadFailed string
// Pagination.
TotalFmt, RangeTotalFmt, PageSizeFmt, PrevPage, NextPage, Prev5, Next5, JumpTo, PageSuffix string
// Form controls.
Placeholder, SelectPlaceholder, Required, NotFound string
LabelColon string // appended to form / description labels (":", ":")
SelectedFmt string // selection count, arg: n ("已选择 %d 项")
// Date & time.
Today, Now, SelectDate, SelectTime, SelectDateTime, StartDate, EndDate string
PrevYear, NextYear, PrevMonth, NextMonth string
RangeSeparator string // between the two ends of a range input ("至")
YearFmt string // year label, arg: year ("%d年")
MonthFmt string // month label, args: month number, Months entry ("%d月", "%[2]s")
YearMonthFmt string // panel title, args: year, month number, Months entry ("%d年%d月", "%[3]s %[1]d")
Weekdays [7]string // short names, Sunday first
Months [12]string // short names, January first
WeekStart time.Weekday // first column of month grids (zero value: Sunday)
// Table.
FilterConfirm, FilterReset, SortAsc, SortDesc, CancelSort, SelectionAll, SelectionInvert, ExpandRow, CollapseRow string
// Counts & search.
ItemUnit, ItemsUnit, Searching string
// Currency is the symbol or ISO 4217 code of money values (ProField /
// ProColumn money type) unless the field sets its own ("¥", "$", "NT$",
// "EUR"). See FormatMoney.
Currency string
// Feedback & navigation.
MessageBoxTitle, Info, Success, Warning, Error, BackTop, CollapseMenu, ExpandMenu, Fullscreen, ExitFullscreen string
PromptPlaceholder, PromptInvalid, CloseAll, Steps string
// Component groups.
Calendar CalendarLocale
Carousel CarouselLocale
Image ImageLocale
ColorPicker ColorPickerLocale
Tour TourLocale
QRCode QRCodeLocale
Table TableLocale
ProTable ProTableLocale
Transfer TransferLocale
Upload UploadLocale
Markdown MarkdownLocale
Form FormLocale
MarkdownEditor MarkdownEditorLocale
Command CommandLocale
A11y A11yLocale
Chart ChartLocale
Mobile MobileLocale
Graph GraphLocale
// Groups of the Pro / entry components added later.
DatePicker DatePickerLocale
TimePicker TimePickerLocale
Tabs TabsLocale
Pagination PaginationLocale
Slider SliderLocale
DropZone DropZoneLocale
EditableTable EditableTableLocale
PageContainer PageContainerLocale
ProCard ProCardLocale
StatisticCard StatisticCardLocale
ProField ProFieldLocale
ProDescriptions ProDescriptionsLocale
LightFilter LightFilterLocale
LoginForm LoginFormLocale
SettingDrawer SettingDrawerLocale
Dock DockLocale
// Groups of the data viewers (types in codeblock.go, jsonview.go,
// logview.go).
CodeBlock CodeBlockLocale
JSONView JSONViewLocale
LogView LogViewLocale
// Workbench shell (locale_shell.go).
StatusBar StatusBarLocale
TitleBar TitleBarLocale
NotificationCenter NotificationCenterLocale
HotkeyInput HotkeyInputLocale
Chat ChatLocale // AI chat components (chat_locale.go)
// Extra holds texts of other components by key ("MyWidget.title", ...).
Extra map[string]string
// contains filtered or unexported fields
}
Locale holds the built-in texts of every component. Components read it with c.Locale() while building, so wrapping a page in ConfigProvider(c).Locale(ui.EnUS) switches all of them at once.
Component code never writes interface text literally: every label, placeholder, tooltip and accessible name comes from here (see AUTHORING.md section 15). The built-in packs are ZhCN (default), EnUS, ZhTW and Ja (locale_packs.go).
Texts with a number use fmt verbs (TotalFmt "共 %d 条"); call the helper methods (Total, PageSizeLabel, YearMonth ...) instead of formatting by hand. A format may ignore trailing arguments or pick them with explicit indexes ("%[3]s %[1]d"), the helpers tolerate both. Texts of a single component are grouped in a nested struct (l.Image.ZoomIn, l.Tour.Next); texts of third-party components go to Extra and are read with Locale.T(key, fallback).
func LocaleByCode ¶
LocaleByCode looks up a registered locale ("zh-CN", "en_us", "en", "zh_TW.UTF-8"). Chinese is matched by script: zh-Hant, zh-TW, zh-HK and zh-MO find zh-TW (ZhTW), other zh tags find zh-CN; the two never stand in for each other. Otherwise a tag matches the same language without regard to region ("ja" → ja-JP, "en-GB" → en-US); the language-only entry wins, then the first registered region in code order.
func (*Locale) Date ¶
Date formats the full date of a calendar cell ("2026年11月12日" / "Nov 12, 2026").
func (*Locale) IsRTL ¶
IsRTL reports whether the locale lays out right to left: Dir when set, else inferred from Code.
func (*Locale) PageSizeLabel ¶
PageSizeLabel formats the page size option ("10 条/页").
func (*Locale) RangeTotal ¶
RangeTotal formats "第 1-10 条/共 85 条".
func (*Locale) RemoveItem ¶
RemoveItem names the remove button of a tag or file ("移除 标签").
func (*Locale) WeekdayNames ¶
WeekdayNames returns the short weekday names starting at WeekStart, in the column order of month grids.
type LogBuffer ¶
type LogBuffer struct {
// contains filtered or unexported fields
}
LogBuffer holds log lines for LogView: escape sequences are parsed and levels detected once, when a line is added. It is safe for concurrent use: a goroutine reading a process's output can Write to it while the UI thread shows it (call the OnChange function to wake the UI).
With a line limit the oldest lines are dropped as new ones arrive.
func NewLogBuffer ¶
NewLogBuffer returns a buffer keeping at most maxLines lines (<= 0: no limit).
func (*LogBuffer) AppendLevel ¶
AppendLevel adds lines with a known level (LogNone: detect it).
func (*LogBuffer) Flush ¶
func (b *LogBuffer) Flush()
Flush adds the unterminated tail of the written output as a line.
func (*LogBuffer) Level ¶
Level returns the level of line i (inherited from the line above when the line has none of its own).
func (*LogBuffer) OnChange ¶
func (b *LogBuffer) OnChange(fn func())
OnChange sets a function called (outside the buffer's lock, from the goroutine that added lines) after lines are added or the buffer is cleared; pass a Context.Invalidator to repaint the view.
func (*LogBuffer) SetDetector ¶
SetDetector replaces the level detector (default DetectLogLevel). It applies to lines added afterwards.
type LogLevel ¶
type LogLevel uint8
LogLevel is the severity of a log line. LogView filters by a minimum level; lines whose level is unknown (LogNone) always pass.
The levels, lowest first.
func DetectLogLevel ¶
DetectLogLevel finds a level word near the start of a line, within the first 120 bytes and not part of a longer word: TRACE, DEBUG, INFO, WARN, WARNING, ERROR, FATAL, PANIC, CRITICAL, SEVERE in any case, and the upper-case abbreviations TRC, DBG, INF, WRN, ERR, CRIT.
type LogViewLocale ¶
type LogViewLocale struct {
Name string // accessible name of the log area
Search string // search box placeholder
PrevMatch, NextMatch string
MatchFmt string // current match and count, args: i, n ("%d/%d")
NoMatch string
Wrap string
Follow string // keep showing the newest lines
Level string // level filter
AllLevels string
Levels [5]string // Trace, Debug, Info, Warn, Error
LinesFmt string // line count, arg: n ("%d 行")
// contains filtered or unexported fields
}
LogViewLocale holds the LogView toolbar texts.
func (*LogViewLocale) Lines ¶
func (l *LogViewLocale) Lines(n int) string
Lines formats a line count.
func (*LogViewLocale) Match ¶
func (l *LogViewLocale) Match(i, n int) string
Match formats the match position ("3/120").
type LogViewW ¶
type LogViewW struct {
// contains filtered or unexported fields
}
LogViewW shows a LogBuffer: millions of lines scroll smoothly (only the visible rows are shaped), ANSI colors and attributes are drawn, new lines keep the view at the bottom until the user scrolls up (scrolling back to the bottom follows again), and the toolbar searches (Enter / Shift+Enter or the arrows move between matches), filters by minimum level, toggles soft wrapping and following, and clears the buffer. Text is selectable and copies with Cmd/Ctrl+C.
func LogView ¶
LogView adds a log viewer over buf.
logs := ui.NewLogBuffer(1_000_000) // keep the newest million lines go cmd.Stdout.CopyTo(logs) // Write is goroutine-safe ui.LogView(c, logs).Height(400)
func (*LogViewW) Height ¶
Height fixes the viewer's height (toolbar included). Without it the viewer grows in its parent (give the parent a height).
func (*LogViewW) LineNumbers ¶
LineNumbers shows line numbers (counting dropped lines, so a line keeps its number).
func (*LogViewW) MinLevel ¶
MinLevel binds the level filter to *lv: lines below it are hidden (LogNone shows everything; lines without a level always show).
func (*LogViewW) NoLevelColors ¶
NoLevelColors draws warn / error / debug lines in the plain text color.
func (*LogViewW) NoToolbar ¶
NoToolbar hides the toolbar (bind Query / MinLevel / Wrap / Follow to drive the view from elsewhere).
type LoginFormLocale ¶
type LoginFormLocale struct {
AccountTab, MobileTab string
Username, UsernameRequired string
Password, PasswordRequired string
Mobile, MobileRequired string
MobileInvalid string
Captcha, CaptchaRequired string
GetCode string
ResendFmt string // code button while counting down, arg: seconds ("%d 秒后重新获取")
CodeSentFmt string // announcement after sending, arg: seconds
CodeReady string // announcement when the countdown ends
Remember, Forgot string
Submit string
Others string // title of the other-methods row
// contains filtered or unexported fields
}
LoginFormLocale holds the LoginForm / LoginFormPage texts.
type LoginFormW ¶
type LoginFormW struct {
// contains filtered or unexported fields
}
LoginFormW is a login form (Ant Design Pro LoginForm): logo, title and subtitle, account / mobile tabs, a verification code button with a countdown, "remember me", a forgot-password link, a slot for other login methods and a submit button with a loading state.
OnFinish receives ProValues with the keys loginType ("account" or "mobile"), username, password, mobile, captcha and autoLogin (bool).
ui.LoginForm(c).Title("Tango").SubTitle("...").
OnSendCode(func(mobile string, done func(error)) { go sms(mobile, done) }).
OnFinish(func(v ui.ProValues, done func(error)) { go login(v, done) }).
Show()
func LoginForm ¶
func LoginForm(c *Context) *LoginFormW
LoginForm starts a login form; chain options, then Show.
func LoginFormPage ¶
func LoginFormPage(c *Context) *LoginFormW
LoginFormPage is LoginForm on a full page with a background color or image and an optional side area (Ant Design Pro LoginFormPage).
func (*LoginFormW) AccountOnly ¶
func (w *LoginFormW) AccountOnly() *LoginFormW
AccountOnly hides the tabs and the mobile login.
func (*LoginFormW) Actions ¶
func (w *LoginFormW) Actions(fn func()) *LoginFormW
Actions builds the other login methods (icons) under the form, in a group named "Other login methods". Icon-only buttons have no visible text: give each one an accessible name, e.g. ui.Button(c, "").Icon(icon.Wechat).Circle().A11yLabel("WeChat").
func (*LoginFormW) Background ¶
func (w *LoginFormW) Background(col theme.Color) *LoginFormW
Background sets the page background color (LoginFormPage).
func (*LoginFormW) BackgroundImage ¶
func (w *LoginFormW) BackgroundImage(img image.Image) *LoginFormW
BackgroundImage sets the page background image, scaled to cover (LoginFormPage).
func (*LoginFormW) CodeInterval ¶
func (w *LoginFormW) CodeInterval(sec int) *LoginFormW
CodeInterval sets the countdown in seconds (default 60).
func (*LoginFormW) CodeSent ¶
func (w *LoginFormW) CodeSent() bool
CodeSent reports that a verification code was sent in the last Show.
func (*LoginFormW) Countdown ¶
func (w *LoginFormW) Countdown() int
Countdown returns the seconds left before a new code can be sent.
func (*LoginFormW) Err ¶
func (w *LoginFormW) Err() error
Err returns the last OnFinish or OnSendCode error.
func (*LoginFormW) Finished ¶
func (w *LoginFormW) Finished() bool
Finished reports a completed login (OnFinish called done(nil)), once.
func (*LoginFormW) ForgotClicked ¶
func (w *LoginFormW) ForgotClicked() bool
ForgotClicked reports a click on the forgot-password link.
func (*LoginFormW) LoginType ¶
func (w *LoginFormW) LoginType() string
LoginType returns the active tab (LoginAccount or LoginMobile).
func (*LoginFormW) Logo ¶
func (w *LoginFormW) Logo(fn func()) *LoginFormW
Logo builds the logo left of the title.
func (*LoginFormW) MobileOnly ¶
func (w *LoginFormW) MobileOnly() *LoginFormW
MobileOnly hides the tabs and the account login.
func (*LoginFormW) MobilePattern ¶
func (w *LoginFormW) MobilePattern(re string) *LoginFormW
MobilePattern replaces the mobile number pattern (default: 11 digits starting with 1).
func (*LoginFormW) OnFinish ¶
func (w *LoginFormW) OnFinish(fn func(v ProValues, done func(error))) *LoginFormW
OnFinish receives the values after validation; call done from any goroutine. The submit button spins meanwhile and an error is shown above the form.
func (*LoginFormW) OnForgot ¶
func (w *LoginFormW) OnForgot(fn func()) *LoginFormW
OnForgot shows the forgot-password link and calls fn on click.
func (*LoginFormW) OnSendCode ¶
func (w *LoginFormW) OnSendCode(fn func(mobile string, done func(error))) *LoginFormW
OnSendCode is called by the "get code" button with a valid mobile number; call done from any goroutine. A nil error starts the countdown.
func (*LoginFormW) Placement ¶
func (w *LoginFormW) Placement(s string) *LoginFormW
Placement puts the form card "left", "center" or "right" (default) of the page (LoginFormPage).
func (*LoginFormW) Show ¶
func (w *LoginFormW) Show() *LoginFormW
Show builds the form (or the page).
func (*LoginFormW) Side ¶
func (w *LoginFormW) Side(fn func()) *LoginFormW
Side builds content beside the form card (LoginFormPage), such as an activity banner.
func (*LoginFormW) SubTitle ¶
func (w *LoginFormW) SubTitle(s string) *LoginFormW
SubTitle sets the line under the title.
func (*LoginFormW) SubmitText ¶
func (w *LoginFormW) SubmitText(s string) *LoginFormW
SubmitText sets the submit button's text.
func (*LoginFormW) Submitting ¶
func (w *LoginFormW) Submitting() bool
Submitting reports validation or OnFinish in progress.
func (*LoginFormW) Values ¶
func (w *LoginFormW) Values() ProValues
Values returns the form values (see OnFinish).
func (*LoginFormW) Width ¶
func (w *LoginFormW) Width(px float32) *LoginFormW
Width sets the form width (default 328).
type MarkdownEditorLocale ¶
type MarkdownEditorLocale struct {
Placeholder string
Heading, Bold, Italic, Strike, Code, Link, Quote string
BulletList, OrderedList, Task, CodeBlock, Table, Divider string
BoldSample, ItalicSample, StrikeSample, LinkSample, TableColumnFmt string // TableColumnFmt arg: column number
Edit, Split, Preview string
// contains filtered or unexported fields
}
MarkdownEditorLocale holds the MarkdownEditor toolbar, samples inserted by the toolbar and the view mode switch.
type MarkdownEditorW ¶
type MarkdownEditorW struct {
// contains filtered or unexported fields
}
MarkdownEditorW is a Markdown editor bound to *src.
func MarkdownEditor ¶
func MarkdownEditor(c *Context, src *string) *MarkdownEditorW
MarkdownEditor adds an editor for *src (default 400px high, split view).
ui.MarkdownEditor(c, &doc).Height(480)
func (*MarkdownEditorW) Changed ¶
func (w *MarkdownEditorW) Changed() bool
Changed reports an edit this frame (typing, toolbar, task toggles).
func (*MarkdownEditorW) ClickedLink ¶
func (w *MarkdownEditorW) ClickedLink() string
ClickedLink returns a link clicked in the preview this frame.
func (*MarkdownEditorW) CurrentMode ¶
func (w *MarkdownEditorW) CurrentMode() string
CurrentMode returns the active view.
func (*MarkdownEditorW) Height ¶
func (w *MarkdownEditorW) Height(px float32) *MarkdownEditorW
Height sets the total height (toolbar included).
func (*MarkdownEditorW) Layout ¶
func (w *MarkdownEditorW) Layout(opts ...layout.Option) *MarkdownEditorW
Layout applies layout options to the outer frame.
func (*MarkdownEditorW) Mode ¶
func (w *MarkdownEditorW) Mode(m string) *MarkdownEditorW
Mode sets the initial view: "edit", "split" or "preview". The toolbar switches it afterwards.
func (*MarkdownEditorW) Placeholder ¶
func (w *MarkdownEditorW) Placeholder(s string) *MarkdownEditorW
Placeholder sets the empty-editor hint.
type MarkdownImage ¶
MarkdownImage describes a Markdown or HTML image. Width and Height are positive HTML pixel dimensions, or zero when unspecified.
type MarkdownListStyle ¶
type MarkdownListStyle struct {
Indent float32 // logical pixels before item text, including the marker
ItemGap float32 // logical pixels between items at the same depth
Bullet string // optional marker text, reused at each depth
}
MarkdownListStyle controls Markdown list spacing and unordered markers.
type MarkdownLocale ¶
type MarkdownLocale struct {
ImagePrefix string // shown before the alt text of an image ("[图片] ")
CopyCode string
Copied string
// contains filtered or unexported fields
}
MarkdownLocale holds the Markdown viewer texts.
type MarkdownW ¶
type MarkdownW struct {
// contains filtered or unexported fields
}
MarkdownW renders a Markdown document.
func Markdown ¶
Markdown adds a rendered Markdown document; it grows to its content (put it in a Scroll for long documents).
md := ui.Markdown(c, src)
if u := md.ClickedLink(); u != "" { openURL(u) }
func (*MarkdownW) BodyLineHeight ¶
BodyLineHeight sets the line height in logical pixels for prose, list items and table cells. Zero uses the theme line height.
func (*MarkdownW) ClickedLink ¶
ClickedLink returns the URL of a link clicked this frame ("" if none).
func (*MarkdownW) CodeBackground ¶
CodeBackground overrides the theme's code block background. A transparent color makes the block background transparent.
func (*MarkdownW) CodeBorder ¶
CodeBorder overrides the code block's border color. A transparent color hides the border.
func (*MarkdownW) CodeHeader ¶
func (m *MarkdownW) CodeHeader(style CodeHeaderStyle) *MarkdownW
CodeHeader styles the header of fenced code blocks. CodeLanguage and CopyCode still control whether the language and copy button are shown.
func (*MarkdownW) CodeLanguage ¶
CodeLanguage controls whether fenced code blocks display their language label (default true). Syntax highlighting and copy controls are independent.
func (*MarkdownW) CodeLineHeight ¶
CodeLineHeight sets the line height of fenced code in logical pixels. Zero uses the theme line height for the code font size.
func (*MarkdownW) CodeSize ¶
CodeSize sets the code block font size in logical pixels. Use 0 for the default (body size minus one).
func (*MarkdownW) Color ¶
Color sets the color of body text and headings (default theme Text and TextHeading), for documents on a colored background such as a chat bubble.
func (*MarkdownW) ContentWidth ¶
ContentWidth caps the width of the document box, including its layout padding, in logical pixels. Use a positive maximum.
func (*MarkdownW) CopyCode ¶
CopyCode controls whether fenced code blocks show a copy button (default true).
func (*MarkdownW) HeadingBlock ¶
HeadingBlock returns the zero-based top-level block containing a heading. It accepts a heading ID or a URL fragment with a leading #. IDs are based on the heading's inline text: lowercase letters, marks, numbers, hyphens and underscores are kept, spaces become hyphens and other characters are removed. Duplicate IDs receive numeric suffixes in document order.
func (*MarkdownW) HeadingRules ¶
HeadingRules draws a bottom rule under the specified heading levels (1–6). With no levels, it removes the theme's heading rules.
func (*MarkdownW) HeadingSize ¶
HeadingSize sets a heading level's font size in logical pixels. Use 0 for the theme default.
func (*MarkdownW) Highlighter ¶
func (m *MarkdownW) Highlighter(h CodeHighlighter) *MarkdownW
Highlighter sets the code highlighter of fenced code blocks with a language (default DefaultCodeHighlighter; nil: plain text).
func (*MarkdownW) ImageMaxSize ¶
ImageMaxSize caps both standalone and inline images, keeping their aspect ratio. A non-positive dimension leaves that axis unconstrained.
func (*MarkdownW) Images ¶
Images supplies decoded images by source. Return nil to show the image fallback. Use ResolveImage to receive the alt text and size as well.
func (*MarkdownW) ListStyle ¶
func (m *MarkdownW) ListStyle(style MarkdownListStyle) *MarkdownW
ListStyle overrides the default list spacing and unordered markers.
func (*MarkdownW) NoSelect ¶
NoSelect makes the text non-selectable (selection and Cmd/Ctrl+C copy are on by default).
func (*MarkdownW) QuoteBorder ¶
QuoteBorder overrides the quote's leading border color. A transparent color hides the border while preserving the quote's inset.
func (*MarkdownW) ReadOnlyTasks ¶
ReadOnlyTasks disables task toggling while retaining the checkboxes and their checked state in the accessibility tree.
func (*MarkdownW) ResolveImage ¶
func (m *MarkdownW) ResolveImage(load func(MarkdownImage) image.Image) *MarkdownW
ResolveImage supplies decoded images for inline and reference-style Markdown images and HTML img tags. It takes precedence over Images. Return nil to show the image fallback.
func (*MarkdownW) ScrollToBlock ¶
ScrollToBlock queues a jump to the zero-based top-level block in a Virtual Markdown viewport. It aligns the block near the top, within the scroll bounds. It returns false for a non-virtual document or an invalid index.
func (*MarkdownW) ScrollToHeading ¶
ScrollToHeading queues a jump to the heading's containing block in a Virtual Markdown viewport and reports whether the fragment was found. It returns false for a non-virtual document or an unknown heading.
func (*MarkdownW) TaskToggled ¶
TaskToggled reports a click on a task-list checkbox: its index in document order. Apply it with src = ui.ToggleMarkdownTask(src, i).
type MasonryW ¶
type MasonryW struct {
// contains filtered or unexported fields
}
MasonryW is a masonry (waterfall) layout. Configure it and call Show.
func Masonry ¶
Masonry lays out n items built by render(i) in columns, each item going to the shortest column so far.
ui.Masonry(c, len(cards), func(i int) { card(i) }).Columns(4).Gutter(16).Show()
func (*MasonryW) Assignment ¶
Assignment returns the column of every item (after Show).
func (*MasonryW) Built ¶
Built returns how many items were built by Show (virtual mode builds only the visible ones).
func (*MasonryW) ColumnsAt ¶
func (w *MasonryW) ColumnsAt(bp Breakpoint, n int) *MasonryW
ColumnsAt sets the column count from breakpoint bp upwards (Ant columns={{ xs: 1, sm: 2, md: 3 }}); the largest set breakpoint not above the window width wins, Columns is the fallback.
func (*MasonryW) EstimatedHeight ¶
EstimatedHeight is the height assumed for items not measured yet.
func (*MasonryW) ItemColumn ¶
ItemColumn pins items to a column (0-based; return -1 for automatic), so existing items keep their column when more are added.
func (*MasonryW) ItemHeight ¶
ItemHeight gives known item heights (Ant item.height); items then get that fixed height. Without it heights are measured after the first paint (EstimatedHeight is used until then).
func (*MasonryW) LayoutChanged ¶
LayoutChanged reports that Show placed some item in another column than the previous Show, or the item count changed (Ant onLayoutChange; read the columns with Assignment).
type MentionsW ¶
type MentionsW struct {
// contains filtered or unexported fields
}
MentionsW is a multi-line input that suggests options after a trigger character such as '@'.
func (*MentionsW) A11yLabel ¶
A11yLabel sets the accessible name (inside a FormItem the item label is used; the placeholder is the last resort).
func (*MentionsW) AllowClear ¶
AllowClear shows a clear button at the inline end of the first line while the input has text (Ant allowClear).
func (*MentionsW) DataVersion ¶
DataVersion tells the mentions input that the options slice was modified in place (a virtual list caches its matches and label widths by slice identity, length and this number): after editing options of the same slice without changing its length, change v (or pass a new slice) so the matches and the list's width are recomputed on the next frame.
func (*MentionsW) Loading ¶
Loading shows a spinner and the loading text in the suggestions (in place of the options with Remote, or when there are none).
func (*MentionsW) Open ¶
Open forces the suggestions open when a trigger is at the caret (tests, screenshots).
func (*MentionsW) Placeholder ¶
func (*MentionsW) Placement ¶
Placement opens the suggestions below (BottomStart, default) or above (TopStart) the input (Ant placement "bottom" / "top", Element placement); ConfigProvider.Defaults("Mentions", "placement") takes "top" / "bottom".
func (*MentionsW) Query ¶
Query returns the mention being typed at the caret: its trigger prefix and the text after it; ok is false when the caret is not in a mention. Read it after the build (or from a Remote callback) to drive suggestions yourself.
func (*MentionsW) Remote ¶
Remote turns on server-side suggestions: after an edit at an active mention, fn receives its trigger prefix and the text typed after it once Debounce (300ms by default) has passed, on the UI thread. Start the request in the background, pass Loading(true) while it runs, then replace the options given to Mentions (shown as-is, not filtered by the query) and wake the window with Invalidate.
ui.Mentions(c, &msg, users).Remote(func(p, q string) { go lookup(p, q) }).Loading(busy)
func (*MentionsW) Size ¶
func (w *MentionsW) Size(s ControlSize) *MentionsW
func (*MentionsW) Split ¶
Split sets the text inserted after a picked mention (Ant split, default " "; Element split). "" inserts nothing.
func (*MentionsW) Variant ¶
func (w *MentionsW) Variant(v FieldVariant) *MentionsW
Variant sets the frame look (FieldOutlined by default).
func (*MentionsW) Virtual ¶
Virtual forces the virtual suggestion list on or off; by default lists longer than 100 suggestions are virtual (only the visible rows and the keyboard row are built; the list keeps the width, height and scroll range of the full list, but suggestions out of view are not in the accessibility tree). Labels, values and Disabled are always read live. A virtual list keeps which options match while the options slice (identity and length), the query and the DataVersion stay the same, and measures label widths once per slice, DataVersion and theme: an option renamed in place (same slice, same length) does not join or leave the matches, nor change the list's width, until the query, the slice or the DataVersion (or the theme pointer) changes. Virtual(false) builds every row.
func (*MentionsW) Whole ¶
Whole makes Backspace delete a mention as one unit (Element whole): with the caret right after a mention ("@name", or "@name " as inserted by a pick), one Backspace removes the whole mention. A mention is a trigger prefix at the start of a word followed by non-space text; see WholeCheck to restrict which ones count.
func (*MentionsW) WholeCheck ¶
WholeCheck decides which mentions Whole deletes as a unit (Element check-is-whole): fn receives the trigger prefix and the text after it. Implies Whole.
ui.Mentions(c, &msg, users).WholeCheck(func(p, v string) bool { return known[v] })
type MenuItem ¶
type MenuItem struct {
Key string
Label string
Icon *icon.Icon
Children []MenuItem
Disabled bool
Danger bool
Divider bool // render a separator instead of an item
// Group makes the entry a titled group of Children (Ant type="group",
// Element el-menu-item-group): Label is a non-clickable title and the
// children follow at the same level. Dropdowns and pop-out submenus
// show it as a titled section (shadcn: a DropdownMenuLabel set apart
// by separators); keyboard navigation skips the title.
Group bool
// Shortcut is the item's keyboard shortcut text ("Ctrl+C", "⌘K"),
// shown in a dimmer column at the item's inline end of Dropdown panels,
// Menu pop-out submenus and ContextMenuAt. It is display only (the app
// handles the key itself); the label stays the accessible name and the
// shortcut is exposed as the node's keyboard shortcut.
Shortcut string
// Radio marks a point context-menu leaf as a single-choice item. The
// caller owns the checked value and updates it when the item is chosen.
Radio *bool
}
MenuItem is an entry of Menu / Dropdown.
type MenuMode ¶
type MenuMode uint8
MenuMode selects how Menu shows submenus.
Append-only: never reorder or insert; the zero value stays MenuInline.
type MenuW ¶
type MenuW struct {
// contains filtered or unexported fields
}
MenuW is a navigation menu: inline, vertical and horizontal modes, collapsed icon mode with pop-out submenus and tooltips, dark theme, accordion behavior and keyboard navigation.
Keyboard (the menu items are in the Tab order): Up/Down move between visible items; in inline mode Right opens a submenu (again: enters it) and Left closes it or returns to the parent; in vertical / collapsed mode Right or Enter opens the pop-out submenu and moves into it; in horizontal mode Left/Right move along the bar and Down or Enter opens the dropdown. Enter/Space choose a leaf and Escape closes a pop-out submenu.
func Menu ¶
Menu starts a menu bound to the selected key; chain options, then Show.
ConfigProvider.Defaults("Menu", ...) keys: "mode" (MenuMode), "theme" ("dark" | "light"), "accordion", "inlineCollapsed", "selectable", "tooltip", "ellipsis" (bool), "inlineIndent" (float32 px), "subMenuOpenDelay" / "subMenuCloseDelay" (time.Duration; default the Menu token: Ant 100 / 100 ms, Element 300 / 300 ms, shadcn 200 / 150 ms), "triggerSubMenuAction" ("hover" | "click").
func (*MenuW) Accordion ¶
Accordion keeps only one branch of inline submenus open (Element unique-opened).
func (*MenuW) Dark ¶
Dark uses the dark sider colors (Ant theme="dark", Element's dark el-menu). Under shadcn/ui it is ignored by design: shadcn has a single Sidebar look built from the --sidebar-* variables, which already follow the light / dark theme (theme.Shadcn(theme.Dark()) gives the dark sidebar); a dark sidebar on a light shadcn page is not offered.
func (*MenuW) DefaultOpen ¶
DefaultOpen opens inline submenus initially.
func (*MenuW) Ellipsis ¶
Ellipsis(false) keeps every root item of a horizontal bar instead of folding the overflow into "…" (Element ellipsis).
func (*MenuW) ExpandIcon ¶
ExpandIcon replaces the submenu chevron (antd expandIcon).
func (*MenuW) InlineIndent ¶
InlineIndent sets the indent per inline level (antd inlineIndent 24, Element --el-menu-level-padding 20; default the Menu token).
func (*MenuW) ItemPanel ¶
ItemPanel shows fn in the drop-down panel of the root item keyed key of a horizontal menu instead of its children (shadcn NavigationMenuContent): hovering or focusing the item opens the panel, Escape or leaving it closes it. The item gets a chevron like a submenu.
func (*MenuW) OpenChanged ¶
OpenChanged reports that the user opened or closed an inline submenu this frame.
func (*MenuW) OpenKeys ¶
OpenKeys binds the keys of the open inline submenus (antd openKeys / onOpenChange, Element default-openeds): the menu reads and writes *keys; OpenChanged reports a change. Keys that are not submenus of the menu are ignored.
func (*MenuW) OverflowedIndicator ¶
OverflowedIndicator replaces the icon of the "…" item that collects the items a horizontal bar cannot fit (antd overflowedIndicator, Element ellipsis-icon).
func (*MenuW) Selectable ¶
Selectable(false) leaves the selected key alone when a leaf is clicked (antd selectable; Clicked still reports it).
func (*MenuW) SubMenuCloseDelay ¶
SubMenuCloseDelay waits d before a pop-out submenu closes once the pointer left it (antd subMenuCloseDelay, Element hide-timeout).
func (*MenuW) SubMenuOpenDelay ¶
SubMenuOpenDelay waits d before a hovered pop-out submenu opens (antd subMenuOpenDelay, Element show-timeout).
func (*MenuW) Tooltip ¶
Tooltip(false) turns off the tooltip of a collapsed menu's root items (antd tooltip={false}).
func (*MenuW) TriggerSubMenuAction ¶
TriggerSubMenuAction selects how pop-out submenus open: TriggerHover (default) or TriggerClick (antd triggerSubMenuAction, Element menu-trigger); a click popup stays until a choice, Escape or a press outside.
type MenubarItem ¶
type MenubarItem struct {
Key string
Label string
Icon *icon.Icon
Shortcut string // display only, like MenuItem.Shortcut
Disabled bool
Danger bool
Divider bool // a separator instead of an item
// Group makes the entry a titled group of Children shown inline (a
// radio group under a label, for example), like MenuItem.Group.
Group bool
Kind MenubarItemKind
// Checked is the value a checkbox item shows and toggles.
Checked *bool
// Radio is the value of the radio group the item belongs to: the item
// is checked when *Radio equals Value (Key when Value is empty) and
// choosing it stores that value.
Radio *string
Value string
// Children open as a submenu (or, with Group, form the group).
Children []MenubarItem
}
MenubarItem is an entry of a Menubar menu. Key identifies the item (Label is used when Key is empty) and must be unique within its menu.
type MenubarItemKind ¶
type MenubarItemKind string
MenubarItemKind is the behaviour of a Menubar item. Open set: new kinds are added as new constants.
const ( MenubarItemNormal MenubarItemKind = "" // runs a command MenubarItemCheckbox MenubarItemKind = "checkbox" // toggles *Checked MenubarItemRadio MenubarItemKind = "radio" // sets *Radio to its value )
type MenubarMenu ¶
type MenubarMenu struct {
Key string // identifies the menu (Label when empty)
Label string
Disabled bool
Items []MenubarItem
}
MenubarMenu is a top-level menu of a Menubar ("File", "Edit" …).
type MenubarW ¶
type MenubarW struct {
// contains filtered or unexported fields
}
MenubarW is an application menu bar inside the window (shadcn/ui Menubar; the menu bar of desktop applications): a row of top-level menus that open drop-down panels (the Dropdown panels) on click, or with Alt / F10 and the arrow keys.
func Menubar ¶
func Menubar(c *Context, menus []MenubarMenu) *MenubarW
Menubar adds a menu bar with the given top-level menus:
mb := ui.Menubar(c, []ui.MenubarMenu{
{Label: "文件", Items: []ui.MenubarItem{{Key: "new", Label: "新建", Shortcut: "Ctrl+N"}}},
{Label: "视图", Items: []ui.MenubarItem{{Label: "状态栏", Kind: ui.MenubarItemCheckbox, Checked: &status}}},
})
switch mb.Clicked() { case "new": ... }
A click on a trigger opens its menu; while a menu is open, moving the pointer onto another trigger switches to it. Alt (pressed and released alone) or F10 moves focus to the bar and back. Keyboard: Left/Right move between the menus (mirrored in RTL), Down/Enter/Space open one, Up/Down move in it, Right/Left open and close submenus, or at the edge switch to the neighbouring menu, Enter chooses, Escape closes, a letter jumps to the next item starting with it.
func (*MenubarW) Changed ¶
Changed reports that a checkbox or radio item changed its value this frame.
type MessagePlacement ¶
type MessagePlacement string
MessagePlacement is where Message toasts appear. The start / end placements are logical: in RTL the end is the left side. The zero value is the design system's default (top center; shadcn/ui: the bottom end corner, as Sonner).
const ( MessageTop MessagePlacement = "top" MessageTopStart MessagePlacement = "top-start" MessageTopEnd MessagePlacement = "top-end" MessageBottom MessagePlacement = "bottom" MessageBottomStart MessagePlacement = "bottom-start" MessageBottomEnd MessagePlacement = "bottom-end" )
type MessageRef ¶
type MessageRef struct {
// contains filtered or unexported fields
}
MessageRef configures a message opened by Message. Use it in the same call chain; it does not need to be kept.
func Message ¶
func Message(c *Context, status, content string) *MessageRef
Message shows a global toast at the top of the window and returns a reference for further options. status: success, info, warning, error, loading.
ui.Message(c, "loading", "保存中…").Key("save").Duration(0)
ui.Message(c, "success", "已保存").Key("save") // replaces the loading one
func (*MessageRef) Duration ¶
func (r *MessageRef) Duration(d time.Duration) *MessageRef
Duration sets how long the message stays; d <= 0 keeps it until MessageDestroy or an update with a positive duration.
func (*MessageRef) Grouping ¶
func (r *MessageRef) Grouping() *MessageRef
Grouping merges this message into a visible one with the same content and placement: that one restarts its timer, takes the new options and shows a repeat counter (EP grouping / repeatNum). The merge happens when the message is first shown, so the options chained after Grouping apply.
func (*MessageRef) Icon ¶
func (r *MessageRef) Icon(ic *icon.Icon) *MessageRef
Icon replaces the status icon (antd icon).
func (*MessageRef) Key ¶
func (r *MessageRef) Key(key string) *MessageRef
Key names the message; a message with the same key already on screen is updated in place (content, status and a restarted timer) instead of stacking a new one.
func (*MessageRef) Offset ¶
func (r *MessageRef) Offset(px float32) *MessageRef
Offset sets the distance in px from the window's top (or bottom) edge to the stack (default MessageToken.Top). The newest message of a placement decides it. shadcn/ui's Sonner stack keeps its own inset.
func (*MessageRef) OnClick ¶
func (r *MessageRef) OnClick(fn func()) *MessageRef
OnClick runs fn when the message is clicked (antd onClick).
func (*MessageRef) OnClose ¶
func (r *MessageRef) OnClose(fn func()) *MessageRef
OnClose runs fn once when the message has closed (timed out, closed or destroyed), as antd onClose / EP onClose.
func (*MessageRef) PauseOnHover ¶
func (r *MessageRef) PauseOnHover(on bool) *MessageRef
PauseOnHover pauses the countdown while the pointer is over the message (antd pauseOnHover, default true; Defaults key "pauseOnHover").
func (*MessageRef) Placement ¶
func (r *MessageRef) Placement(p MessagePlacement) *MessageRef
Placement selects where the message appears (MessageTop by default; shadcn/ui: the bottom end corner). Messages of each placement stack separately; bottom placements stack upwards.
func (*MessageRef) Plain ¶
func (r *MessageRef) Plain() *MessageRef
Plain draws the message on the neutral popup background with only the icon in the status color (Element plain); Ant's message already looks this way.
func (*MessageRef) ShowClose ¶
func (r *MessageRef) ShowClose() *MessageRef
ShowClose adds a close button that dismisses the message.
type MirrorReport ¶
type MirrorReport struct {
Width float32 // frame width both passes ran at
Checked int // nodes compared
Skipped int // nodes present in both frames but exempt (NoMirror, LTR parent)
Violations []MirrorViolation
// Icons lists directional icons drawn unmirrored in the RTL frame
// (icon check); IconsSkipped counts those exempt inside a NoMirror
// node or subtree.
Icons []IconViolation
IconsSkipped int
}
MirrorReport is the result of Driver.MirrorCheck.
func (MirrorReport) OK ¶
func (r MirrorReport) OK() bool
OK reports whether no violation (layout or icon) was found.
func (MirrorReport) String ¶
func (r MirrorReport) String() string
String summarizes the report, one violation per line.
type MirrorViolation ¶
type MirrorViolation struct {
ID ID
Label string // the node's internal label (to locate it)
Under string // label of the nearest labelled ancestor ("" if none)
LTR geom.Rect // absolute rectangle in the LTR frame
RTL geom.Rect // absolute rectangle in the RTL frame
Want geom.Rect // where the RTL rectangle was expected
}
MirrorViolation is a node whose RTL position is not the mirror of its LTR position inside its parent.
func (MirrorViolation) String ¶
func (v MirrorViolation) String() string
type MobileLocale ¶
type MobileLocale struct {
PullToRefresh, ReleaseToRefresh, Refreshed string // pull-to-refresh states (the loading state uses Loading)
TapToRetry string // appended to LoadFailed in infinite lists (",点击重试")
DayFmt, HourFmt, MinuteFmt string // date-time picker columns, arg: number ("%d日", "%02d时", "%02d分")
// contains filtered or unexported fields
}
MobileLocale holds the texts of ui/mobile components.
type ModalFormW ¶
type ModalFormW struct {
// contains filtered or unexported fields
}
ModalFormW is a ProForm inside a Modal (Ant Design Pro ModalForm): the dialog's OK button submits (spinning while OnFinish runs) and the dialog closes once the values are saved.
func DrawerForm ¶
func DrawerForm(c *Context, open *bool, title string, fields []ProField) *ModalFormW
DrawerForm is ModalForm in a right-side drawer (Ant Design Pro DrawerForm).
func ModalForm ¶
func ModalForm(c *Context, open *bool, title string, fields []ProField) *ModalFormW
ModalForm starts a dialog form bound to open; chain options, then Show.
ConfigProvider.Defaults("ModalForm" / "DrawerForm", ...) keys: "width", "columns" (number).
func (*ModalFormW) Columns ¶
func (m *ModalFormW) Columns(n int) *ModalFormW
Columns lays the fields out in n grid columns.
func (*ModalFormW) DestroyOnHidden ¶
func (m *ModalFormW) DestroyOnHidden(on bool) *ModalFormW
DestroyOnHidden resets the field values when the form is opened again (Pro modalProps/drawerProps.destroyOnHidden). By default values survive.
func (*ModalFormW) Finished ¶
func (m *ModalFormW) Finished() bool
Finished reports a completed submit (the dialog just closed), once.
func (*ModalFormW) KeepValues ¶
func (m *ModalFormW) KeepValues() *ModalFormW
KeepValues keeps the values after closing (the default, as in Pro v3).
func (*ModalFormW) OnFinish ¶
func (m *ModalFormW) OnFinish(fn func(vals ProValues, done func(error))) *ModalFormW
OnFinish receives the validated values; call done (from any goroutine) when saved. A nil error closes the dialog.
func (*ModalFormW) Readonly ¶
func (m *ModalFormW) Readonly(on bool) *ModalFormW
Readonly shows the values read-only (a details dialog): the drawer drops its OK button and the modal's OK just closes it.
func (*ModalFormW) Show ¶
func (m *ModalFormW) Show() *ModalFormW
Show builds the dialog (nothing while closed).
func (*ModalFormW) Values ¶
func (m *ModalFormW) Values(v *ProValues) *ModalFormW
Values binds the values.
func (*ModalFormW) Width ¶
func (m *ModalFormW) Width(px float32) *ModalFormW
Width sets the dialog width (drawer: its size).
type ModalW ¶
type ModalW struct {
// contains filtered or unexported fields
}
ModalW is a dialog over a mask: centered or top placement, draggable, fullscreen, custom footer and close options.
func Modal ¶
Modal starts a dialog shown while *open; chain options, then Body.
The default width, top and centering come from theme.ModalToken (Ant 520 / 100, Element 50% / 15%, shadcn 512 centered). Besides the keys read in shad2c_defaults.go, ConfigProvider.Defaults("Modal", ...) reads "keyboard" (bool).
func (*ModalW) AfterOpenChanged ¶
AfterOpenChanged reports, after Body, that the open or close transition finished this frame (antd afterOpenChange; read *open for the new state, false is antd afterClose).
func (*ModalW) CancelText ¶
func (*ModalW) ConfirmLoading ¶
func (*ModalW) Fullscreen ¶
Fullscreen binds the fullscreen state.
func (*ModalW) FullscreenToggle ¶
FullscreenToggle shows a maximize button in the header.
func (*ModalW) Header ¶
Header replaces the visible title with custom content. The title passed to Modal remains the accessible dialog name. The built-in fullscreen and close buttons, drag handle and focus management remain available.
func (*ModalW) Keyboard ¶
Keyboard sets whether Escape closes the dialog (default true; antd keyboard, Element close-on-press-escape).
func (*ModalW) Loading ¶
Loading shows an active Skeleton instead of the content and hides the footer (antd loading).
func (*ModalW) MaskBlur ¶
MaskBlur sets the Gaussian blur radius of the canvas behind the mask, in logical pixels. A zero radius draws the mask without blur.
func (*ModalW) MaskClosable ¶
type MultiDatePickerW ¶
type MultiDatePickerW struct {
// contains filtered or unexported fields
}
MultiDatePickerW is a date input with several values shown as tags.
func MultiDatePicker ¶
func MultiDatePicker(c *Context, vals *[]time.Time) *MultiDatePickerW
MultiDatePicker adds a multiple date input bound to *vals (Ant DatePicker multiple; with Picker(PickerMonth / PickerYear) Element's type="months" / "years"). Each click in the panel toggles a date (with Picker: a period start, UTC midnight); the panel stays open, the values are kept sorted and shown as closable tags. Backspace removes the last tag; arrow keys move the panel cursor and Enter / Space toggle it.
func (*MultiDatePickerW) A11yLabel ¶
func (w *MultiDatePickerW) A11yLabel(s string) *MultiDatePickerW
A11yLabel sets the accessible name (inside a FormItem the item label is used; the placeholder is the last resort).
func (*MultiDatePickerW) AllowClear ¶
func (w *MultiDatePickerW) AllowClear(on bool) *MultiDatePickerW
AllowClear toggles the clear-all button shown on hover (on by default).
func (*MultiDatePickerW) Changed ¶
func (w *MultiDatePickerW) Changed() bool
Changed reports a committed change of the dates this frame.
func (*MultiDatePickerW) Disabled ¶
func (w *MultiDatePickerW) Disabled(on bool) *MultiDatePickerW
Disabled disables the picker.
func (*MultiDatePickerW) DisabledDate ¶
func (w *MultiDatePickerW) DisabledDate(fn func(time.Time) bool) *MultiDatePickerW
DisabledDate marks dates (period starts) that cannot be picked.
func (*MultiDatePickerW) Format ¶
func (w *MultiDatePickerW) Format(f string) *MultiDatePickerW
Format sets the Go layout of the tags (see DatePickerW.Format).
func (*MultiDatePickerW) IsOpen ¶
func (w *MultiDatePickerW) IsOpen() bool
IsOpen reports whether the panel is shown.
func (*MultiDatePickerW) MaxDate ¶
func (w *MultiDatePickerW) MaxDate(t time.Time) *MultiDatePickerW
MaxDate limits the pickable dates (Ant maxDate), like MinDate.
func (*MultiDatePickerW) MaxTagCount ¶
func (w *MultiDatePickerW) MaxTagCount(n int) *MultiDatePickerW
MaxTagCount folds the tags after the first n into "+ N ..." (0 = all).
func (*MultiDatePickerW) MinDate ¶
func (w *MultiDatePickerW) MinDate(t time.Time) *MultiDatePickerW
MinDate limits the pickable dates (Ant minDate): periods wholly before t cannot be toggled and the panel arrows stop at t's page.
func (*MultiDatePickerW) NeedConfirm ¶
func (w *MultiDatePickerW) NeedConfirm(on bool) *MultiDatePickerW
NeedConfirm keeps the toggled dates as a draft until the footer's OK button commits them; closing the panel otherwise drops the changes.
func (*MultiDatePickerW) Open ¶
func (w *MultiDatePickerW) Open() *MultiDatePickerW
Open forces the panel open (screenshots, tests).
func (*MultiDatePickerW) Picker ¶
func (w *MultiDatePickerW) Picker(p PickerType) *MultiDatePickerW
Picker sets the granularity: PickerDate (default), PickerWeek, PickerMonth, PickerQuarter or PickerYear.
func (*MultiDatePickerW) Placeholder ¶
func (w *MultiDatePickerW) Placeholder(s string) *MultiDatePickerW
func (*MultiDatePickerW) Placement ¶
func (w *MultiDatePickerW) Placement(p Placement) *MultiDatePickerW
Placement sets where the panel opens: BottomStart (default), BottomEnd, TopStart or TopEnd (Ant placement); it flips when there is no room.
func (*MultiDatePickerW) Size ¶
func (w *MultiDatePickerW) Size(s ControlSize) *MultiDatePickerW
func (*MultiDatePickerW) Status ¶
func (w *MultiDatePickerW) Status(s string) *MultiDatePickerW
Status sets the validation look: "error" or "warning".
func (*MultiDatePickerW) Width ¶
func (w *MultiDatePickerW) Width(px float32) *MultiDatePickerW
Width sets the input width in pixels (default 260; tags wrap).
type MultiSelectW ¶
type MultiSelectW struct {
// contains filtered or unexported fields
}
MultiSelectW is a select with multiple values shown as closable tags.
func MultiSelect ¶
func MultiSelect(c *Context, val *[]string, opts []Option) *MultiSelectW
MultiSelect adds a multiple-choice select bound to *val (selected values).
func (*MultiSelectW) A11yLabel ¶
func (w *MultiSelectW) A11yLabel(s string) *MultiSelectW
A11yLabel sets the accessible name (inside a FormItem the item label is used; the placeholder is the last resort).
func (*MultiSelectW) AllowClear ¶
func (w *MultiSelectW) AllowClear() *MultiSelectW
AllowClear shows a clear-all button on hover.
func (*MultiSelectW) AllowCreate ¶
func (w *MultiSelectW) AllowCreate() *MultiSelectW
AllowCreate offers the typed text as a new option (Ant mode="tags", Element allow-create); read it with Created. Implies Searchable.
func (*MultiSelectW) Changed ¶
func (w *MultiSelectW) Changed() bool
Changed reports a selection change this frame.
func (*MultiSelectW) Created ¶
func (w *MultiSelectW) Created() (string, bool)
Created returns the value of an entry created with AllowCreate this frame.
func (*MultiSelectW) DataVersion ¶
func (w *MultiSelectW) DataVersion(v int) *MultiSelectW
DataVersion tells the select that the option slice was modified in place.
func (*MultiSelectW) Debounce ¶
func (w *MultiSelectW) Debounce(d time.Duration) *MultiSelectW
Debounce sets the delay before a Remote call.
func (*MultiSelectW) Disabled ¶
func (w *MultiSelectW) Disabled(on bool) *MultiSelectW
func (*MultiSelectW) FilterMethod ¶
func (w *MultiSelectW) FilterMethod(fn func(query string, o Option) bool) *MultiSelectW
FilterMethod replaces the label match of the search text with fn (see SelectW.FilterMethod). Implies Searchable.
func (*MultiSelectW) Groups ¶
func (w *MultiSelectW) Groups(groups []OptionGroup) *MultiSelectW
Groups shows the options under titled groups; the opts passed to MultiSelect are ignored. Options can also be grouped with Option.Group.
func (*MultiSelectW) IsOpen ¶
func (w *MultiSelectW) IsOpen() bool
IsOpen reports whether the dropdown is shown.
func (*MultiSelectW) Layout ¶
func (w *MultiSelectW) Layout(o ...layout.Option) *MultiSelectW
func (*MultiSelectW) ListHeight ¶
func (w *MultiSelectW) ListHeight(px float32) *MultiSelectW
ListHeight sets the maximum dropdown height.
func (*MultiSelectW) Loading ¶
func (w *MultiSelectW) Loading(on bool) *MultiSelectW
Loading shows a spinner and the loading text in the dropdown.
func (*MultiSelectW) MaxCount ¶
func (w *MultiSelectW) MaxCount(n int) *MultiSelectW
MaxCount limits how many values may be selected (Ant maxCount, Element multiple-limit); the other options turn disabled at the limit.
func (*MultiSelectW) MaxTagCount ¶
func (w *MultiSelectW) MaxTagCount(n int) *MultiSelectW
MaxTagCount collapses tags after n into a "+ N ..." tag.
func (*MultiSelectW) MaxTagPlaceholder ¶
func (w *MultiSelectW) MaxTagPlaceholder(fn func(omitted []string) string) *MultiSelectW
MaxTagPlaceholder builds the text of the collapsed tag from the labels MaxTagCount hides (Ant maxTagPlaceholder; default "+ N ...").
func (*MultiSelectW) MaxTagTextLength ¶
func (w *MultiSelectW) MaxTagTextLength(n int) *MultiSelectW
MaxTagTextLength cuts tag labels longer than n runes to n runes plus "..." (Ant maxTagTextLength); the accessible names keep the full label.
func (*MultiSelectW) NotFoundContent ¶
func (w *MultiSelectW) NotFoundContent(s string) *MultiSelectW
NotFoundContent sets the text of an empty dropdown (Ant notFoundContent, Element no-data-text).
func (*MultiSelectW) Open ¶
func (w *MultiSelectW) Open() *MultiSelectW
Open forces the dropdown open (screenshots, tests).
func (*MultiSelectW) OpenChanged ¶
func (w *MultiSelectW) OpenChanged() bool
OpenChanged reports that the dropdown opened or closed this frame (Ant onOpenChange, Element visible-change).
func (*MultiSelectW) OptionRender ¶
func (w *MultiSelectW) OptionRender(fn func(o Option, s OptionState)) *MultiSelectW
OptionRender builds each option row's content with fn.
func (*MultiSelectW) Placeholder ¶
func (w *MultiSelectW) Placeholder(s string) *MultiSelectW
func (*MultiSelectW) Placement ¶
func (w *MultiSelectW) Placement(p Placement) *MultiSelectW
Placement sets where the dropdown opens: BottomStart (default), BottomEnd, TopStart or TopEnd (Ant placement, Element placement); it flips when there is no room.
func (*MultiSelectW) Prefix ¶
func (w *MultiSelectW) Prefix(ic *icon.Icon) *MultiSelectW
Prefix shows ic before the tags (Ant prefix).
func (*MultiSelectW) PrefixText ¶
func (w *MultiSelectW) PrefixText(s string) *MultiSelectW
PrefixText shows s before the tags (Ant prefix, Element prefix slot).
func (*MultiSelectW) Remote ¶
func (w *MultiSelectW) Remote(fn func(query string)) *MultiSelectW
Remote turns on server-side search (see SelectW.Remote). Implies Searchable.
func (*MultiSelectW) Searchable ¶
func (w *MultiSelectW) Searchable() *MultiSelectW
Searchable filters options by typing into the selector.
func (*MultiSelectW) Size ¶
func (w *MultiSelectW) Size(s ControlSize) *MultiSelectW
func (*MultiSelectW) Status ¶
func (w *MultiSelectW) Status(s string) *MultiSelectW
func (*MultiSelectW) SuffixIcon ¶
func (w *MultiSelectW) SuffixIcon(ic *icon.Icon) *MultiSelectW
SuffixIcon replaces the dropdown arrow with ic (Ant suffixIcon); the clear button still takes its place on hover with AllowClear.
func (*MultiSelectW) Variant ¶
func (w *MultiSelectW) Variant(v FieldVariant) *MultiSelectW
Variant sets the frame look (FieldOutlined by default).
func (*MultiSelectW) Virtual ¶
func (w *MultiSelectW) Virtual(on bool) *MultiSelectW
Virtual forces the virtual dropdown on or off (default: lists longer than 100 options). With false, the dropdown builds every row.
func (*MultiSelectW) Width ¶
func (w *MultiSelectW) Width(px float32) *MultiSelectW
type NativeRegion ¶
type NativeRegion struct {
ID ID
// Rect is the whole box.
Rect geom.Rect
// Visible is the part of Rect that ancestors (scroll containers,
// clipping boxes, the window) leave visible; empty when the box is
// scrolled or clipped out of view, or culled.
Visible geom.Rect
// Covered reports that a layer above the box (an Overlay: dropdown,
// tooltip, popover, dialog, message), including a margin for its
// shadow, overlaps Visible.
Covered bool
// Focused reports the UI's keyboard focus on the box.
Focused bool
}
NativeRegion is where a native view sits in the frame just painted. Rectangles are host window logical pixels, after UI scaling.
type NativeViewW ¶
type NativeViewW struct {
*Box
// contains filtered or unexported fields
}
NativeViewW is the builder of NativeView. Box modifiers (Bg, Border, Radius, Paint, ...) style what the canvas draws under the native view, which shows wherever the native view is hidden (before it exists, while it is frozen as a snapshot, when the platform has none).
func NativeView ¶
func NativeView(c *Context, key string, opts ...layout.Option) *NativeViewW
NativeView reserves a box for a platform view. key identifies the view among its siblings (it is part of the ID: views with the same key in the same scope share an ID). The box is a Tab stop like a focusable control (Focusable(false) removes it from the Tab order); Enter and Space are left to the native view.
func (*NativeViewW) A11yLabel ¶
func (w *NativeViewW) A11yLabel(s string) *NativeViewW
A11yLabel names the region for assistive technologies.
func (*NativeViewW) Clicked ¶
func (w *NativeViewW) Clicked() bool
Clicked reports a click on the box itself (the canvas only sees clicks where the native view is hidden).
func (*NativeViewW) Focusable ¶
func (w *NativeViewW) Focusable(on bool) *NativeViewW
Focusable puts the box in the Tab order (the default) or takes it out.
func (*NativeViewW) Focused ¶
func (w *NativeViewW) Focused() bool
Focused reports whether the box has the UI's keyboard focus.
type NotificationAction ¶
NotificationAction is a button under a NotificationItem.
type NotificationCenterLocale ¶
type NotificationCenterLocale struct {
MarkAllRead, ClearAll, Dismiss string
Empty string // empty panel ("暂无通知")
UnreadFmt string // unread count, arg: n ("%d 条未读")
JustNow string // under a minute ago
MinutesAgoFmt, HoursAgoFmt, DaysAgoFmt string // arg: n ("%d 分钟前")
// contains filtered or unexported fields
}
NotificationCenterLocale holds the NotificationCenter texts. The trigger and panel are named by Locale.A11y.Notifications.
func (*NotificationCenterLocale) Unread ¶
func (l *NotificationCenterLocale) Unread(n int) string
Unread formats the unread count of a NotificationCenter ("3 条未读").
type NotificationCenterW ¶
type NotificationCenterW struct {
// contains filtered or unexported fields
}
NotificationCenterW is the bell button with its notification panel.
func NotificationCenter ¶
func NotificationCenter(c *Context, items *[]NotificationItem) *NotificationCenterW
NotificationCenter adds a bell button whose badge counts the unread entries of *items; it opens a panel listing them, grouped, newest first as the app orders them:
nc := ui.NotificationCenter(c, ¬es)
if key, ok := nc.Clicked(); ok { open(key) }
if key, act, ok := nc.Action(); ok { run(key, act) }
Activating an entry or one of its actions marks it read and closes the panel. The header marks everything read or clears the list; each entry can be dismissed on its own. Changed reports any such edit of *items. The panel is a Popover: Esc or a click outside closes it.
func (*NotificationCenterW) Action ¶
func (w *NotificationCenterW) Action() (key, action string, ok bool)
Action reports the entry and action keys of an action button activated this frame.
func (*NotificationCenterW) Changed ¶
func (w *NotificationCenterW) Changed() bool
Changed reports that the center edited *items this frame (marked read, dismissed, cleared).
func (*NotificationCenterW) Clicked ¶
func (w *NotificationCenterW) Clicked() (string, bool)
Clicked reports the key of the entry activated this frame.
func (*NotificationCenterW) IsOpen ¶
func (w *NotificationCenterW) IsOpen() bool
IsOpen reports whether the panel is shown.
func (*NotificationCenterW) Open ¶
func (w *NotificationCenterW) Open(v *bool) *NotificationCenterW
Open binds the panel's open state (controlled mode).
func (*NotificationCenterW) Placement ¶
func (w *NotificationCenterW) Placement(s string) *NotificationCenterW
Placement places the panel like Popover.Placement ("bottomRight" by default; "topRight" for a trigger in a status bar).
func (*NotificationCenterW) Title ¶
func (w *NotificationCenterW) Title(s string) *NotificationCenterW
Title replaces the panel heading (Locale.A11y.Notifications).
func (*NotificationCenterW) Unread ¶
func (w *NotificationCenterW) Unread() int
Unread returns the number of unread entries.
func (*NotificationCenterW) Width ¶
func (w *NotificationCenterW) Width(px float32) *NotificationCenterW
Width sets the panel width.
type NotificationItem ¶
type NotificationItem struct {
Key string // stable identity (required for the list to keep state)
Title string
Body string
// Level picks the leading status icon: "info", "success", "warning",
// "error" ("" for none).
Level string
// Group is the section the entry is listed under. Sections appear in
// the order their first entry has in the slice ("" = no heading).
Group string
Time time.Time // shown relative to now ("3 分钟前"); zero hides it
Read bool
Actions []NotificationAction
}
NotificationItem is one entry of a NotificationCenter. The app owns the slice; the center marks entries read and removes them.
type NotificationRef ¶
type NotificationRef struct {
// contains filtered or unexported fields
}
NotificationRef configures a notification opened by Notification. Use it in the same call chain; it does not need to be kept.
func Notification ¶
func Notification(c *Context, status, title string) *NotificationRef
Notification opens a notification card in a window corner (top end by default: top right, top left in RTL) and returns a reference for further options:
ui.Notification(c, "success", "已发布").Description("版本 1.2 已上线").Placement(ui.NotifyBottomRight)
status is success, info, warning, error or "" (no icon). Cards close after 4.5s (paused while hovered), collapse into a stack when more than NotifyStackThreshold share a corner, and can be updated in place by key.
func (*NotificationRef) Actions ¶
func (r *NotificationRef) Actions(fn func()) *NotificationRef
Actions adds buttons under the description.
func (*NotificationRef) Closable ¶
func (r *NotificationRef) Closable(on bool) *NotificationRef
Closable shows (default) or hides the close button (antd closable, EP showClose).
func (*NotificationRef) CloseIcon ¶
func (r *NotificationRef) CloseIcon(ic *icon.Icon) *NotificationRef
CloseIcon replaces the close icon (antd closeIcon, EP closeIcon).
func (*NotificationRef) Description ¶
func (r *NotificationRef) Description(s string) *NotificationRef
Description sets the text under the title.
func (*NotificationRef) Duration ¶
func (r *NotificationRef) Duration(d time.Duration) *NotificationRef
Duration sets how long the card stays; d <= 0 keeps it until closed.
func (*NotificationRef) Icon ¶
func (r *NotificationRef) Icon(ic *icon.Icon) *NotificationRef
Icon replaces the status icon (antd icon, EP icon).
func (*NotificationRef) Key ¶
func (r *NotificationRef) Key(key string) *NotificationRef
Key names the card; opening another card with the same key replaces the existing one in place (its timer restarts).
func (*NotificationRef) NoPause ¶
func (r *NotificationRef) NoPause() *NotificationRef
NoPause keeps counting down while the card is hovered.
func (*NotificationRef) OnClick ¶
func (r *NotificationRef) OnClick(fn func()) *NotificationRef
OnClick runs fn when the card is clicked.
func (*NotificationRef) OnClose ¶
func (r *NotificationRef) OnClose(fn func()) *NotificationRef
OnClose runs fn once when the card has closed (timed out, closed or destroyed), as antd onClose / EP onClose.
func (*NotificationRef) Placement ¶
func (r *NotificationRef) Placement(p NotifyPlacement) *NotificationRef
Placement selects the corner (NotifyTopEnd default).
func (*NotificationRef) Role ¶
func (r *NotificationRef) Role(role string) *NotificationRef
Role sets the live-region role: "alert" (assertive) or "status" (polite). By default errors and warnings are alerts (antd role).
func (*NotificationRef) ShowProgress ¶
func (r *NotificationRef) ShowProgress() *NotificationRef
ShowProgress draws a countdown bar at the bottom.
type NotifyPlacement ¶
type NotifyPlacement uint8
NotifyPlacement is the corner a notification appears in. NotifyTopEnd (the zero value and default), NotifyTopStart, NotifyBottomEnd and NotifyBottomStart are logical: in RTL the end is the left side. The Right / Left placements are always that physical side.
Append-only: never reorder or insert; the zero value stays NotifyTopEnd.
const ( NotifyTopEnd NotifyPlacement = iota NotifyTopStart NotifyBottomEnd NotifyBottomStart NotifyTop NotifyBottom NotifyTopRight NotifyTopLeft NotifyBottomRight NotifyBottomLeft )
type OTPW ¶
type OTPW struct {
// contains filtered or unexported fields
}
OTPW is a one-time-password input: one box per character.
func (*OTPW) A11yLabel ¶
A11yLabel names the group of boxes (inside a FormItem use the item label); each box is announced as "character n of total".
func (*OTPW) ReadOnly ¶
ReadOnly shows the code without letting it change; the boxes can still be focused and walked with the arrow keys (Element readonly).
func (*OTPW) Separator ¶
Separator shows s between every two boxes (antd / Element separator, shadcn InputOTPSeparator); "" shows none.
func (*OTPW) SeparatorFunc ¶
SeparatorFunc shows fn(i) between box i and box i+1 (antd separator as a function of the index); "" leaves that gap empty, e.g. a "-" only after the third box of six.
func (*OTPW) Size ¶
func (w *OTPW) Size(s ControlSize) *OTPW
type Option ¶
type Option struct {
Label, Value string
Disabled bool
Group string
// contains filtered or unexported fields
}
Option is an item of a Select / RadioGroup / CheckboxGroup. Group puts the option under a titled group in Select / MultiSelect / VirtualSelect dropdowns (Ant OptGroup, Element el-option-group); options of one group are listed together in order of the group's first appearance.
type OptionGroup ¶
type OptionGroup = VirtualOptionGroup
OptionGroup is a titled group of options for Select / MultiSelect Groups (the same type as VirtualOptionGroup).
type OptionState ¶
type OptionState = VirtualOptionState
OptionState tells an OptionRender function how the row is shown.
type OverlayOptions ¶
type OverlayOptions struct {
Anchor ID // widget to attach to (anchored placements)
// AnchorRect supplies a non-empty anchor in UI logical coordinates
// for placement, such as an editor caret. Anchor still owns focus.
AnchorRect geom.Rect
Place Placement
Offset float32 // gap between anchor and overlay
MatchWidth bool // at least as wide as the anchor
Margin float32 // distance from window edges for Screen* placements
Flip bool // flip to the opposite side when it does not fit (currently always on for anchored placements)
ShiftX float32 // translation applied after placement (enter/leave motion)
ShiftY float32
// contains filtered or unexported fields
}
OverlayOptions configure an overlay layer.
type PageContainerLocale ¶
type PageContainerLocale struct {
// contains filtered or unexported fields
}
PageContainerLocale holds the PageContainer / FooterToolbar texts.
type PageContainerW ¶
type PageContainerW struct {
// contains filtered or unexported fields
}
PageContainerW builds a PageContainer.
func PageContainer ¶
func PageContainer(c *Context, title string) *PageContainerW
PageContainer starts a page container titled title; chain options, then Body with the page content.
ConfigProvider.Defaults("PageContainer", ...) keys: "ghost", "fill", "tabsCard" (bool).
func (*PageContainerW) Back ¶
func (p *PageContainerW) Back() *PageContainerW
Back shows the back button (query BackClicked).
func (*PageContainerW) BackClicked ¶
func (p *PageContainerW) BackClicked() bool
BackClicked reports a click on the back button.
func (*PageContainerW) Body ¶
func (p *PageContainerW) Body(fn func()) *PageContainerW
Body builds the container with fn as the page content.
func (*PageContainerW) Breadcrumb ¶
func (p *PageContainerW) Breadcrumb(items ...string) *PageContainerW
Breadcrumb shows a breadcrumb above the title.
func (*PageContainerW) Content ¶
func (p *PageContainerW) Content(fn func()) *PageContainerW
Content builds the description area under the title.
func (*PageContainerW) CrumbClicked ¶
func (p *PageContainerW) CrumbClicked() int
CrumbClicked returns the index of a clicked breadcrumb item or -1.
func (*PageContainerW) Extra ¶
func (p *PageContainerW) Extra(fn func()) *PageContainerW
Extra builds the actions at the right of the title.
func (*PageContainerW) ExtraContent ¶
func (p *PageContainerW) ExtraContent(fn func()) *PageContainerW
ExtraContent builds a block at the right of Content.
func (*PageContainerW) Fill ¶
func (p *PageContainerW) Fill() *PageContainerW
Fill makes the container take its parent's free height: header and body scroll inside it and the footer toolbar stays at the bottom.
func (*PageContainerW) Footer ¶
func (p *PageContainerW) Footer(fn func()) *PageContainerW
Footer builds the right-hand buttons of a FooterToolbar.
func (*PageContainerW) FooterExtra ¶
func (p *PageContainerW) FooterExtra(fn func()) *PageContainerW
FooterExtra builds the left side of the FooterToolbar.
func (*PageContainerW) Ghost ¶
func (p *PageContainerW) Ghost() *PageContainerW
Ghost drops the header background and the content padding (for use inside a padded content area). Inside ProLayout a non-ghost PageContainer switches the content area to NoPadding, so the header spans it.
func (*PageContainerW) Layout ¶
func (p *PageContainerW) Layout(o ...layout.Option) *PageContainerW
Layout applies layout options to the container.
func (*PageContainerW) Loading ¶
func (p *PageContainerW) Loading(on bool) *PageContainerW
Loading shows a centred spinner instead of the body.
func (*PageContainerW) NoHeader ¶
func (p *PageContainerW) NoHeader() *PageContainerW
NoHeader hides the page header (body and footer only).
func (*PageContainerW) ScrollID ¶
func (p *PageContainerW) ScrollID() ID
ScrollID returns the scroll box of a Fill container (0 otherwise).
func (*PageContainerW) SubTitle ¶
func (p *PageContainerW) SubTitle(s string) *PageContainerW
SubTitle sets the secondary title.
func (*PageContainerW) TabChanged ¶
func (p *PageContainerW) TabChanged() bool
TabChanged reports a tab switch this frame.
func (*PageContainerW) TabExtra ¶
func (p *PageContainerW) TabExtra(fn func()) *PageContainerW
TabExtra builds content at the right of the tab list.
func (*PageContainerW) Tabs ¶
func (p *PageContainerW) Tabs(active *string, items []TabItem) *PageContainerW
Tabs shows a tab list at the bottom of the header bound to active.
func (*PageContainerW) TabsCard ¶
func (p *PageContainerW) TabsCard() *PageContainerW
TabsCard uses card-style tabs.
func (*PageContainerW) Tags ¶
func (p *PageContainerW) Tags(fn func()) *PageContainerW
Tags builds tags after the title.
type PageHeaderW ¶
type PageHeaderW struct {
// contains filtered or unexported fields
}
PageHeaderW is the page title bar: back action, breadcrumb, title, subtitle, tags, extra actions, content and footer (tabs).
func PageHeader ¶
func PageHeader(c *Context, title string) *PageHeaderW
PageHeader starts a page header; chain options, then Show. Sizes and colors come from theme.PageHeaderToken (Pro Components v3 PageHeader, Element el-page-header); a Bordered header is the container color, as Pro's non-ghost header.
func (*PageHeaderW) Avatar ¶
func (p *PageHeaderW) Avatar(fn func()) *PageHeaderW
Avatar builds an avatar before the title (Pro avatar), e.g. func() { ui.Avatar(c, "U") }.
func (*PageHeaderW) BackClicked ¶
func (p *PageHeaderW) BackClicked() bool
BackClicked reports a click on the back button.
func (*PageHeaderW) BackIcon ¶
func (p *PageHeaderW) BackIcon(ic *icon.Icon) *PageHeaderW
BackIcon replaces the back arrow and shows the back button (Pro backIcon, Element icon).
func (*PageHeaderW) BackText ¶
func (p *PageHeaderW) BackText(s string) *PageHeaderW
BackText overrides the Element back label (default Locale().Back).
func (*PageHeaderW) Bordered ¶
func (p *PageHeaderW) Bordered() *PageHeaderW
Bordered draws the container background (Pro ghost=false; a bottom line only when PageHeaderToken.BorderColor is set).
func (*PageHeaderW) Breadcrumb ¶
func (p *PageHeaderW) Breadcrumb(items ...string) *PageHeaderW
Breadcrumb shows a breadcrumb above the title.
func (*PageHeaderW) BreadcrumbItems ¶
func (p *PageHeaderW) BreadcrumbItems(items []BreadcrumbItem) *PageHeaderW
BreadcrumbItems shows a structured breadcrumb above the title (Pro breadcrumb {items}); CrumbClicked reports clicks on it.
func (*PageHeaderW) Content ¶
func (p *PageHeaderW) Content(fn func()) *PageHeaderW
Content adds the description area below the title.
func (*PageHeaderW) CrumbClicked ¶
func (p *PageHeaderW) CrumbClicked() int
CrumbClicked returns the clicked breadcrumb index or -1.
func (*PageHeaderW) Extra ¶
func (p *PageHeaderW) Extra(fn func()) *PageHeaderW
Extra adds actions at the right.
func (*PageHeaderW) Footer ¶
func (p *PageHeaderW) Footer(fn func()) *PageHeaderW
Footer adds a footer (usually Tabs).
func (*PageHeaderW) Ghost ¶
func (p *PageHeaderW) Ghost(on bool) *PageHeaderW
Ghost toggles the transparent background (Pro ghost, default true).
func (*PageHeaderW) Padding ¶
func (p *PageHeaderW) Padding(in geom.Insets) *PageHeaderW
Padding overrides the header padding (Ant 16px 24px, Element none), e.g. to align it with a surrounding container.
func (*PageHeaderW) SubTitle ¶
func (p *PageHeaderW) SubTitle(s string) *PageHeaderW
SubTitle sets the secondary title.
func (*PageHeaderW) Tags ¶
func (p *PageHeaderW) Tags(fn func()) *PageHeaderW
Tags adds tags after the title.
type PageLoadingW ¶
type PageLoadingW struct {
// contains filtered or unexported fields
}
PageLoadingW is ProLayout's centred, large Spin wrapper.
func PageLoading ¶
func PageLoading(c *Context) *PageLoadingW
PageLoading starts a page loading indicator; chain options, then Show. Like Pro v3 PageLoading, it adds 100px top padding and centres a large Spin. The legacy react-loadable isLoading/pastDelay/error props do not control visibility; Spinning is the Spin visibility input. ConfigProvider.Defaults("PageLoading", ...): "spinning", "size", "delay" (time.Duration), "description".
func (*PageLoadingW) Delay ¶
func (p *PageLoadingW) Delay(d time.Duration) *PageLoadingW
Delay delays showing the indicator; stopping always hides immediately.
func (*PageLoadingW) Description ¶
func (p *PageLoadingW) Description(s string) *PageLoadingW
Description sets the loading indicator's text and accessible name.
func (*PageLoadingW) Show ¶
func (p *PageLoadingW) Show() *PageLoadingW
Show builds the page loading wrapper using the shared Spin implementation.
func (*PageLoadingW) Size ¶
func (p *PageLoadingW) Size(size ControlSize) *PageLoadingW
Size selects the Spin size (default large).
func (*PageLoadingW) Spinning ¶
func (p *PageLoadingW) Spinning(on bool) *PageLoadingW
Spinning controls the loading indicator, not the surrounding page.
type PaginationLocale ¶
type PaginationLocale struct {
Jump, Current string
// Confirm is the quick jumper's go button (antd jump_to_confirm);
// Prev3 / Next3 name the ••• jumps of ShowLessItems.
Confirm, Prev3, Next3 string
// contains filtered or unexported fields
}
PaginationLocale holds the accessible names of the Pagination inputs (quick jumper, simple mode current page).
type PaginationPart ¶
type PaginationPart string
PaginationPart is one part of a Pagination arranged by PaginationW.Layout (Element's layout).
const ( PaginationPrev PaginationPart = "prev" // previous-page button PaginationPager PaginationPart = "pager" // page buttons (the editable page in Simple) PaginationNext PaginationPart = "next" // next-page button PaginationJumper PaginationPart = "jumper" // "go to [ ] page" PaginationSizes PaginationPart = "sizes" // page-size select (needs SizeChanger) PaginationTotal PaginationPart = "total" // "total N items" PaginationSpacer PaginationPart = "->" // pushes the following parts to the end )
type PaginationW ¶
type PaginationW struct {
// contains filtered or unexported fields
}
PaginationW is a page navigator: page buttons with ellipsis jumps, total text, size changer, quick jumper, simple mode, hide on a single page, disabled state and Element's background (filled) style.
func Pagination ¶
func Pagination(c *Context, page *int, total, pageSize int) *PaginationW
Pagination adds a pager bound to *page (1-based).
ConfigProvider.Defaults("Pagination", ...) keys: "showQuickJumper", "showTotal", "simple", "hideOnSinglePage", "background", "disabled", "showLessItems" (bool), "size" (ControlSize or "small" | "default" | "large"), "align" ("start" | "center" | "end"), "pageSizeOptions" ([]int), "pagerCount" (int).
The page buttons follow @rc-component/pagination: every page up to 7 pages (5 with ShowLessItems), else the first, the last, the pages around the current one and ••• jumps of 5 (3) pages. The Element theme uses PagerCount(7) by default (el-pagination pager-count), Background on, and page sizes 10/20/30/40/50/100 (PaginationToken). With total 0 a single disabled page 1 shows, like antd.
Under shadcn/ui page links are ghost buttons, the current page an outline button and Previous / Next carry their label next to the chevron (icon only in the small and simple pagers).
func (*PaginationW) Align ¶
func (p *PaginationW) Align(a string) *PaginationW
Align places the pager in its row: "start", "center" or "end" (antd align); "" leaves it at its natural width.
func (*PaginationW) Background ¶
func (p *PaginationW) Background(on bool) *PaginationW
Background toggles the filled page buttons (Element background; the default of the Element theme, off by default in Ant). A Simple pager is plain unless Background(true) is given, so it sits lightly at the bottom of a list or transfer panel.
func (*PaginationW) Changed ¶
func (p *PaginationW) Changed() bool
func (*PaginationW) Disabled ¶
func (p *PaginationW) Disabled(on bool) *PaginationW
Disabled disables every part of the pager.
func (*PaginationW) GoButton ¶
func (p *PaginationW) GoButton(label string) *PaginationW
GoButton adds a confirm button after the quick jumper input (antd showQuickJumper.goButton) and turns the jumper on; label "" uses Locale().Pagination.Confirm.
func (*PaginationW) HideOnSinglePage ¶
func (p *PaginationW) HideOnSinglePage() *PaginationW
HideOnSinglePage hides the pager when there is at most one page.
func (*PaginationW) Layout ¶
func (p *PaginationW) Layout(parts ...PaginationPart) *PaginationW
Layout arranges the pager from parts in the given order (Element's layout "total, prev, pager, next, sizes, jumper"); only the listed parts show, whatever ShowTotal / ShowQuickJumper say. PaginationSizes needs SizeChanger. PaginationSpacer pushes the parts after it to the end of the row.
func (*PaginationW) NextIcon ¶
func (p *PaginationW) NextIcon(ic *icon.Icon) *PaginationW
func (*PaginationW) NextText ¶
func (p *PaginationW) NextText(s string) *PaginationW
func (*PaginationW) PageSizeOptions ¶
func (p *PaginationW) PageSizeOptions(sizes ...int) *PaginationW
PageSizeOptions sets the choices of the size changer (antd pageSizeOptions, default 10/20/50/100; Element page-sizes, default 10/20/30/40/50/100).
func (*PaginationW) PagerCount ¶
func (p *PaginationW) PagerCount(n int) *PaginationW
PagerCount sets how many page-number buttons the pager shows at most (Element pager-count: an odd number from 5 to 21, others are rounded up to the next odd number in range). The first and last pages always show; the rest are a window around the current page with ••• jumps. Without it the pager follows Ant: every page up to 9 pages, else the first, the last and five around the current page.
func (*PaginationW) PrevIcon ¶
func (p *PaginationW) PrevIcon(ic *icon.Icon) *PaginationW
PrevIcon / NextIcon replace the chevrons (Element prev-icon / next-icon, antd itemRender for prev / next).
func (*PaginationW) PrevText ¶
func (p *PaginationW) PrevText(s string) *PaginationW
PrevText / NextText show a text instead of the chevron in the previous / next buttons (Element prev-text / next-text).
func (*PaginationW) ReadOnly ¶
func (p *PaginationW) ReadOnly() *PaginationW
ReadOnly shows the current page of a Simple pager as text instead of an input ("< 2 / 5 >", Ant simple.readOnly): the narrowest pager, for embedding at the bottom of a list.
func (*PaginationW) ShowLessItems ¶
func (p *PaginationW) ShowLessItems() *PaginationW
ShowLessItems shows fewer page buttons: one page on each side of the current one and ••• jumps of 3 pages (antd showLessItems).
func (*PaginationW) ShowQuickJumper ¶
func (p *PaginationW) ShowQuickJumper() *PaginationW
ShowQuickJumper adds the "go to [ ] page" input (Enter or leaving the input jumps).
func (*PaginationW) ShowTotal ¶
func (p *PaginationW) ShowTotal() *PaginationW
func (*PaginationW) ShowTotalFunc ¶
func (p *PaginationW) ShowTotalFunc(fn func(total, from, to int) string) *PaginationW
ShowTotalFunc shows the text fn returns before the pager (antd showTotal(total, range)): from and to are the 1-based items of the current page (0, 0 when total is 0).
func (*PaginationW) Simple ¶
func (p *PaginationW) Simple() *PaginationW
Simple shows only prev, an editable current page, "/ pages" and next.
func (*PaginationW) Size ¶
func (p *PaginationW) Size(s ControlSize) *PaginationW
Size picks the small pager (Small), the default one or the large one (Large: 40px buttons, antd 6 size="large", Element size="large"); Small with Simple is the narrow pager for list and transfer footers.
func (*PaginationW) SizeChanger ¶
func (p *PaginationW) SizeChanger(size *int) *PaginationW
SizeChanger shows a page-size select bound to *size.
func (*PaginationW) Small ¶
func (p *PaginationW) Small() *PaginationW
type PanAxis ¶
type PanAxis uint8
PanAxis is a set of drag directions.
Append-only: never reorder or insert; existing values never change.
type PickerType ¶
type PickerType uint8
PickerType is the granularity of a DatePickerPanel (Ant picker, Element type).
Append-only: never reorder or insert; the zero value stays PickerDate.
const ( PickerDate PickerType = iota PickerWeek PickerMonth PickerQuarter PickerYear )
type Placement ¶
type Placement uint8
Placement positions an overlay relative to an anchor or the window.
BottomStart/BottomEnd/TopStart/TopEnd and the Inline* and Screen{Start, End,TopStart,TopEnd} values are logical: Start is the inline start edge (left in LTR, right in RTL). Left/Right/RightStart/LeftStart/RightEnd/ LeftEnd and ScreenLeft/ScreenRight/ScreenTopRight/ScreenTopLeft are physical and never mirror. The overlay's direction is that of the scope that built it; see Resolve.
Append-only: never reorder or insert; the zero value stays BottomStart.
const ( BottomStart Placement = iota // below anchor, aligned to its inline start edge BottomEnd // below anchor, aligned to its inline end edge Bottom // below, centered TopStart // above anchor, aligned to its inline start edge TopEnd // above anchor, aligned to its inline end edge Top RightStart // right of anchor, top edges aligned LeftStart // left of anchor, top edges aligned ScreenCenter // centered in the window ScreenTop // horizontally centered, near the top (messages) ScreenTopRight // notifications ScreenRight // drawers: full height on the right ScreenLeft // full height on the left ScreenFill // covers the window (masks) ScreenTopCenter // modal: centered horizontally, 100px from top Right // right of anchor, vertically centered Left // left of anchor, vertically centered RightEnd // right of anchor, bottom edges aligned LeftEnd // left of anchor, bottom edges aligned InlineEnd // after the anchor on the inline axis, vertically centered InlineEndTop // after the anchor, top edges aligned (submenus) InlineEndBottom // after the anchor, bottom edges aligned InlineStart // before the anchor on the inline axis, vertically centered InlineStartTop // before the anchor, top edges aligned InlineStartBottom // before the anchor, bottom edges aligned ScreenEnd // full height on the inline end side (drawers) ScreenStart // full height on the inline start side ScreenTopEnd // top corner on the inline end side (notifications) ScreenTopStart // top corner on the inline start side ScreenTopLeft // physical top-left corner InsideTopRight // inside the anchor, at its physical top-right corner )
type PopconfirmW ¶
type PopconfirmW struct {
// contains filtered or unexported fields
}
PopconfirmW asks for confirmation before an action. Options apply when the build finishes (or at Confirmed / Cancelled).
ConfigProvider.Defaults("Popconfirm", ...) keys: "okText", "cancelText", "placement", "okType", "cancelType" (string), "showCancel", "arrow", "disabled" (bool), "width" (float32).
func Popconfirm ¶
func Popconfirm(c *Context, title, desc string, trigger func()) *PopconfirmW
Popconfirm wraps trigger content; clicking it opens a confirm bubble. The default placement, width, arrow and cancel button type come from theme.PopoverToken (Ant top; Element bottom, 150 wide, text cancel button; shadcn no arrow).
func (*PopconfirmW) Arrow ¶
func (p *PopconfirmW) Arrow(on bool) *PopconfirmW
Arrow shows or hides the bubble arrow (default from the theme; antd arrow).
func (*PopconfirmW) CancelText ¶
func (p *PopconfirmW) CancelText(s string) *PopconfirmW
CancelText sets the cancel button text (default Locale().Cancel).
func (*PopconfirmW) CancelType ¶
func (p *PopconfirmW) CancelType(t string) *PopconfirmW
CancelType sets the cancel button type, as OkType (default "default"; Element "text", its cancel-button-type).
func (*PopconfirmW) Cancelled ¶
func (p *PopconfirmW) Cancelled() bool
Cancelled reports the cancel button.
func (*PopconfirmW) Confirmed ¶
func (p *PopconfirmW) Confirmed() bool
Confirmed reports the OK button.
func (*PopconfirmW) Description ¶
func (p *PopconfirmW) Description(s string) *PopconfirmW
Description sets the text under the title.
func (*PopconfirmW) Disabled ¶
func (p *PopconfirmW) Disabled(on bool) *PopconfirmW
Disabled keeps the bubble from opening.
func (*PopconfirmW) Icon ¶
func (p *PopconfirmW) Icon(ic *icon.Icon) *PopconfirmW
Icon replaces the warning icon (nil hides it).
func (*PopconfirmW) IconColor ¶
func (p *PopconfirmW) IconColor(col theme.Color) *PopconfirmW
IconColor colors a custom Icon (default the warning color).
func (*PopconfirmW) IsOpen ¶
func (p *PopconfirmW) IsOpen() bool
IsOpen reports whether the bubble is shown.
func (*PopconfirmW) OkDanger ¶
func (p *PopconfirmW) OkDanger() *PopconfirmW
OkDanger styles the confirm button as dangerous (okType="danger").
func (*PopconfirmW) OkText ¶
func (p *PopconfirmW) OkText(s string) *PopconfirmW
OkText sets the confirm button text (default Locale().OK).
func (*PopconfirmW) OkType ¶
func (p *PopconfirmW) OkType(t string) *PopconfirmW
OkType sets the confirm button type: "primary" (default), "default", "dashed", "text", "link" or "danger" (antd okType, Element confirm-button-type).
func (*PopconfirmW) Placement ¶
func (p *PopconfirmW) Placement(s string) *PopconfirmW
Placement as Popover.Placement (default "top").
func (*PopconfirmW) ShowCancel ¶
func (p *PopconfirmW) ShowCancel(on bool) *PopconfirmW
ShowCancel shows or hides the cancel button (default shown).
func (*PopconfirmW) Width ¶
func (p *PopconfirmW) Width(px float32) *PopconfirmW
Width fixes the bubble width (Element width, default 150 there; zero fits the content).
type PopoverW ¶
type PopoverW struct {
// contains filtered or unexported fields
}
PopoverW is a floating card attached to a trigger: title, content and an arrow, in twelve placements, opened by hover, click or focus.
func Popover ¶
Popover starts a popover; set options then call Body with the trigger.
ConfigProvider.Defaults("Popover", ...) keys: "placement", "trigger", "arrow" (bool; default PopoverToken.Arrow: true, false for shadcn whose popover has none), "mouseEnterDelay", "mouseLeaveDelay" (time.Duration; default the theme's PopoverToken delays: antd 0.1 s / 0.1 s, Element 0 / 0.2 s).
func (*PopoverW) MouseEnterDelay ¶
MouseEnterDelay waits d before a hover popover opens (antd mouseEnterDelay, Element show-after).
func (*PopoverW) MouseLeaveDelay ¶
MouseLeaveDelay keeps a hover popover open for d after the pointer left the trigger and the panel (antd mouseLeaveDelay, Element hide-after).
func (*PopoverW) OpenChanged ¶
OpenChanged reports a state change caused by the user this frame.
func (*PopoverW) Placement ¶
Placement: top, topLeft, topRight, bottom, bottomLeft, bottomRight, left, leftTop, leftBottom, right, rightTop, rightBottom. Left and right are logical (start / end): in RTL "left" opens on the right.
type ProBreadcrumbW ¶
type ProBreadcrumbW struct {
*BreadcrumbW
// contains filtered or unexported fields
}
ProBreadcrumbW is the route-aware Breadcrumb exported by ProLayout. It delegates rendering, keyboard handling and semantics to BreadcrumbW.
func ProBreadcrumb ¶
func ProBreadcrumb(c *Context) *ProBreadcrumbW
ProBreadcrumb starts a breadcrumb from the innermost ProLayout's route. Items overrides the route items, including with an empty slice. ConfigProvider.Defaults("ProBreadcrumb", ...): "separator" (string).
func (*ProBreadcrumbW) Items ¶
func (b *ProBreadcrumbW) Items(items []BreadcrumbItem) *ProBreadcrumbW
Items replaces the breadcrumb items (rather than appending).
func (*ProBreadcrumbW) Len ¶
func (b *ProBreadcrumbW) Len() int
Len reports the number of breadcrumb items.
func (*ProBreadcrumbW) Separator ¶
func (b *ProBreadcrumbW) Separator(s string) *ProBreadcrumbW
Separator replaces the separator between items.
func (*ProBreadcrumbW) Show ¶
func (b *ProBreadcrumbW) Show() *ProBreadcrumbW
Show builds the breadcrumb. Empty route breadcrumbs produce no landmark.
type ProCardLocale ¶
type ProCardLocale struct {
MoreInfo string // accessible name of the title tooltip icon
// contains filtered or unexported fields
}
ProCardLocale holds the ProCard / StatisticCard texts.
type ProCardTab ¶
ProCardTab is one tab of a tabbed ProCard.
type ProCardW ¶
type ProCardW struct {
// contains filtered or unexported fields
}
ProCardW builds a ProCard.
func ProCard ¶
ProCard starts a ProCard ("" title = no header unless Extra, Tooltip or Collapsible need one); chain options, then call Body.
ConfigProvider.Defaults("ProCard", ...) keys: "size" ("small" | "default" or a ControlSize), "bordered", "headerBordered", "ghost", "hoverable", "collapsible", "boxShadow" (bool), "gutter" (number).
Like Pro Components v3 (variant defaults to "outlined") a card is bordered unless Borderless is set; ghost cards and split children have no border.
func StatisticCardGroup ¶
StatisticCardGroup builds StatisticCard.Group: a ProCard with zero body padding. Use Divider for explicit separators, or Split for automatic ones.
func (*ProCardW) Actions ¶
Actions adds the bottom action bar (Ant ProCard actions): each fn builds one equal-width slot, separated by dividers (CardAction makes an icon action). The bar is hidden while the card is folded.
func (*ProCardW) BodyPadding ¶
BodyPadding overrides the body padding.
func (*ProCardW) Bordered ¶
Bordered draws a border around the card (the default; it overrides a "bordered": false ConfigProvider default).
func (*ProCardW) Borderless ¶
Borderless removes the border (Pro v3 variant "borderless").
func (*ProCardW) BoxShadow ¶
BoxShadow gives the card the tertiary shadow and hides its border (Pro v3 boxShadow).
func (*ProCardW) Collapsible ¶
Collapsible lets a click on the header fold the body.
func (*ProCardW) DefaultCollapsed ¶
DefaultCollapsed starts an uncontrolled collapsible card folded.
func (*ProCardW) Direction ¶
Direction sets how child ProCards are arranged: "row" (default) or "column".
func (*ProCardW) HeaderBordered ¶
HeaderBordered draws a divider under the header.
func (*ProCardW) IsCollapsed ¶
IsCollapsed reports whether the body is folded.
func (*ProCardW) Split ¶
Split lays the child ProCards out on one surface separated by dividers (SplitVertical or SplitHorizontal).
func (*ProCardW) TabChanged ¶
TabChanged reports a tab switch this frame.
func (*ProCardW) Tabs ¶
func (w *ProCardW) Tabs(active *string, tabs []ProCardTab) *ProCardW
Tabs turns the card into a tab card bound to active; the active tab's Body is shown as the card body.
type ProColumn ¶
type ProColumn[T any] struct { Key, Title string Width float32 MinWidth float32 Fixed string Align TextAlign Ellipsis bool Hidden bool // hidden until enabled in the column settings // ValueType formats Value (see the Value* constants). ValueType string ValueEnum []ProEnum Value func(row T) any // Render overrides the cell (i is the row index in the current page). Render func(row T, i int) // OnClick makes link cells clickable. OnClick func(row T) // Currency is the ISO 4217 code ("USD", "JPY") or symbol of money cells // (default: the Locale's, "¥" for zh-CN / ja, "$" for en-US, "NT$" for // zh-TW). A code also sets the decimals (JPY: none); see FormatMoney. Currency string // Editor makes the column editable in EditableProTable: the field // (Required, Rules, Validate, AsyncValidate, Options, Min / Max ...) // picks the control by its ValueType; Key, Label, ValueType and // ValueEnum default to the column's. Set writes an edited value back // into a copy of the row; without Set the column stays read-only. Editor *ProField Set func(row *T, v any) Sortable bool // server-side sort (reported in ProRequest.Sort) Filterable bool // filter dropdown from ValueEnum (ProRequest.Filters) HideInSearch bool HideInTable bool }
ProColumn is a ProTable column over rows of type T.
type ProDescItem ¶
type ProDescItem struct {
Key, Label string
ValueType string
ValueEnum []ProEnum
Span int // columns taken (default 1)
// ReadOnly keeps the item out of inline editing.
ReadOnly bool
// Render replaces the value display (all holds every value).
Render func(c *Context, v any, all ProValues)
// Field configures the inline editor (Required, Rules, Min / Max,
// Placeholder, Options ...). Key, Label, ValueType and ValueEnum
// default to the item's.
Field *ProField
}
ProDescItem is one entry of ProDescriptions. ValueType and ValueEnum use the ProTable / ProForm value types (text, money, digit, percent, date, dateTime, select, status, tag, progress, textarea ...): they format the value and pick the inline editor.
type ProDescriptionsLocale ¶
type ProDescriptionsLocale struct {
EditFmt string // inline edit button, arg: item label ("编辑%s")
// contains filtered or unexported fields
}
ProDescriptionsLocale holds the ProDescriptions texts.
type ProDescriptionsW ¶
type ProDescriptionsW struct {
// contains filtered or unexported fields
}
ProDescriptionsW is a description list driven by item definitions (Ant Design Pro ProDescriptions): values formatted by value type, data loaded by a request function with a loading state, and inline editing of single items with save / cancel.
ui.ProDescriptions(c, items).Title("Rule").Column(2).Bordered().
Request(func() (map[string]any, error) { return api.Rule(id) }).
Editable(func(key string, v any, all ui.ProValues, done func(error)) { go save(key, v, done) }).
Show()
func ProDescriptions ¶
func ProDescriptions(c *Context, items []ProDescItem) *ProDescriptionsW
ProDescriptions starts a description list over items; chain options, then Show.
func (*ProDescriptionsW) Bordered ¶
func (p *ProDescriptionsW) Bordered() *ProDescriptionsW
Bordered draws the table-like bordered style.
func (*ProDescriptionsW) Column ¶
func (p *ProDescriptionsW) Column(n int) *ProDescriptionsW
Column sets the number of columns (default: Descriptions' DEFAULT_COLUMN_MAP, 1 on xs, 2 on sm, 3 from md up).
func (*ProDescriptionsW) ColumnAt ¶
func (p *ProDescriptionsW) ColumnAt(bp Breakpoint, n int) *ProDescriptionsW
ColumnAt sets the number of columns from breakpoint bp upwards.
func (*ProDescriptionsW) Columns ¶
func (p *ProDescriptionsW) Columns(m map[Breakpoint]int) *ProDescriptionsW
Columns sets the number of columns for several breakpoints.
func (*ProDescriptionsW) DataSource ¶
func (p *ProDescriptionsW) DataSource(v *ProValues) *ProDescriptionsW
DataSource binds the values (inline edits are written into it).
func (*ProDescriptionsW) Editable ¶
func (p *ProDescriptionsW) Editable(onSave func(key string, v any, all ProValues, done func(error))) *ProDescriptionsW
Editable turns on inline editing: every item without ReadOnly gets an edit icon. onSave (may be nil) receives the new value; call done from any goroutine. A nil error commits the value, an error stays shown under the editor.
func (*ProDescriptionsW) Editing ¶
func (p *ProDescriptionsW) Editing(key string) bool
Editing reports whether the item key is being edited.
func (*ProDescriptionsW) Err ¶
func (p *ProDescriptionsW) Err() error
Err returns the last request error.
func (*ProDescriptionsW) Extra ¶
func (p *ProDescriptionsW) Extra(fn func()) *ProDescriptionsW
Extra builds actions right of the heading.
func (*ProDescriptionsW) ID ¶
func (p *ProDescriptionsW) ID() ID
ID returns the widget ID (valid after Show).
func (*ProDescriptionsW) Loading ¶
func (p *ProDescriptionsW) Loading() bool
Loading reports a pending request.
func (*ProDescriptionsW) Reload ¶
func (p *ProDescriptionsW) Reload()
Reload runs the request again (valid after Show).
func (*ProDescriptionsW) Request ¶
func (p *ProDescriptionsW) Request(fn func() (map[string]any, error)) *ProDescriptionsW
Request loads the values on a background goroutine; the list shows a loading mask meanwhile and an error banner when it fails.
func (*ProDescriptionsW) Saved ¶
func (p *ProDescriptionsW) Saved() string
Saved returns the key of the item committed this frame ("" if none).
func (*ProDescriptionsW) Show ¶
func (p *ProDescriptionsW) Show() *ProDescriptionsW
Show builds the list.
func (*ProDescriptionsW) Size ¶
func (p *ProDescriptionsW) Size(s ControlSize) *ProDescriptionsW
Size sets the density (Large default, Middle, Small).
func (*ProDescriptionsW) Title ¶
func (p *ProDescriptionsW) Title(s string) *ProDescriptionsW
Title sets the heading.
func (*ProDescriptionsW) Values ¶
func (p *ProDescriptionsW) Values() ProValues
Values returns the current values.
func (*ProDescriptionsW) Vertical ¶
func (p *ProDescriptionsW) Vertical() *ProDescriptionsW
Vertical puts labels above values.
type ProEnum ¶
type ProEnum struct {
Value, Label string
Status, Color string
// Children nests options for the cascader and treeSelect value types.
Children []ProEnum
// Disabled marks an option that can't be picked (Pro valueEnum
// disabled, es/field/components/Select/index.js
// proFieldParsingValueEnumToArray).
Disabled bool
}
ProEnum is one value of an enumerated ProTable column (status, tag, select). Status is a badge status ("success", "error", "processing", "warning", "default"); Color a tag color.
type ProField ¶
type ProField struct {
Key, Label string
ValueType string // see the Value* constants (default text)
ValueEnum []ProEnum // options of select / radio / checkbox / status / tag
Placeholder string
Help string // hint under the control
Span int // grid columns out of 24 (default: 24 / form columns)
// Group puts the field in a titled ProFormGroup with the consecutive
// fields of the same Group (ProForm, ModalForm, StepsForm).
Group string
Width float32 // fixed control width (default: fill the column)
Initial any // value when the form starts or resets
// Validation: Required adds a required rule with the locale message;
// Rules check the value's text form; Validate checks the typed value
// against all values (cross-field); AsyncValidate runs after them.
Required bool
Rules []Rule
Validate func(v any, all ProValues) string
AsyncValidate func(v any, done func(msg string))
// Linkage: Dependencies lists keys whose change re-validates this
// field, refreshes Options and drops a value Options no longer offers.
Dependencies []string
Hide func(all ProValues) bool
Disable func(all ProValues) bool
Options func(all ProValues) []ProEnum
// Number fields.
Min, Max float64
Precision int
// Pick handles the upload field's trigger (open a file dialog); call
// done from any goroutine with the files to add.
Pick func(done func(files []UploadFile))
// Dragger shows the upload field as a drag area (Upload.Dragger):
// it highlights while files are dragged over it and takes dropped
// files (DropZone inside Upload).
Dragger bool
// Render replaces the built-in control (bind it to vals[Key]).
Render func(c *Context, vals ProValues)
// Readonly shows the value as read-only text (ProFormW.Readonly does
// it for every field); a read-only field is not validated.
Readonly bool
// OnCaptcha sends the code of a captcha field (call done from any
// goroutine; nil starts the countdown); the button then counts down
// CaptchaSeconds (default 60).
OnCaptcha func(vals ProValues, done func(error))
CaptchaSeconds int
// Captcha configures the phone key, button text and timing callback.
Captcha *ProFieldCaptcha
// Segmented configures the ValueSegmented editor (custom item content,
// direction, size, icons, etc.) before it is built.
Segmented func(w *SegmentedW)
// List gives the row fields of a formList field.
List *ProFieldList
// contains filtered or unexported fields
}
ProField describes a form field; ProForm, QueryFilter, StepsForm, ModalForm and DrawerForm render fields from it.
func ProFormFieldSet ¶
func ProFormFieldSet(c *Context, fs ProFieldSet) ProField
ProFormFieldSet turns a field set into a ProField for ProForm, QueryFilter, ModalForm, StepsForm …:
fields = append(fields, ui.ProFormFieldSet(c, ui.ProFieldSet{
Key: "budget", Label: "Budget", Separator: "~", Required: true,
Parts: []ui.ProField{{ValueType: ui.ValueDigit}, {ValueType: ui.ValueDigit}},
}))
type ProFieldCaptcha ¶
type ProFieldCaptcha struct {
// PhoneKey is the key of the phone field: inside a form that field is
// validated first and nothing is sent while it is invalid (Pro
// phoneName). OnCaptcha receives all values, the phone included.
PhoneKey string
// Text returns the button text while counting down (timing true, count
// = seconds left) or idle (count = the full countdown); nil uses the
// locale's "get code" / "resend in %d s" (Pro captchaTextRender).
Text func(timing bool, count int) string
// OnTiming receives the count whenever it changes: the full countdown
// when idle, then every second left while counting down (Pro onTiming).
OnTiming func(count int)
// contains filtered or unexported fields
}
ProFieldCaptcha configures a captcha field beyond ProField.OnCaptcha and ProField.CaptchaSeconds (Pro ProFormCaptcha phoneName, captchaTextRender, onTiming).
type ProFieldList ¶
type ProFieldList struct {
Fields []ProField
Min, Max int // Max 0: no limit
AddText string // default: the locale's "add row"
// contains filtered or unexported fields
}
ProFieldList configures a ValueFormList field: the fields of one row, the row count limits and the add button's text.
type ProFieldLocale ¶
type ProFieldLocale struct {
On, Off string // switch value text
StartFmt, EndFmt string // time range ends, arg: field label ("%s开始")
Min, Max string // digit range placeholders
RangeEndFmt string // accessible name of a digit range end, args: field label, Min / Max ("%s:%s")
// fromNow and second value types: JustNow for under a minute, AgoFmt /
// LaterFmt wrap an amount ("%s前"), the unit formats take a count
// ("%d 分钟"); second joins the day … second amounts.
JustNow, AgoFmt, LaterFmt string
SecondFmt, MinuteFmt, HourFmt, DayFmt, MonthFmt, YearFmt string
InvalidJSON string // jsonCode validation message
// contains filtered or unexported fields
}
ProFieldLocale holds texts of ProField / ProColumn value types (editors and read-only views).
type ProFieldMode ¶
type ProFieldMode string
ProFieldMode selects how ProFieldOf shows its value.
const ( ProFieldRead ProFieldMode = "read" // formatted read-only value (default) ProFieldEdit ProFieldMode = "edit" // the value type's editor )
Modes of ProFieldOf.
type ProFieldSet ¶
type ProFieldSet struct {
Key, Label string
Parts []ProField // ValueType, ValueEnum, Placeholder, Width, Min / Max of each part
Separator string // text between the parts (e.g. "~"); empty: a gap
Required bool // every part must be filled
// Validate checks the combined value (e.g. min <= max).
Validate func(parts []any, all ProValues) string
Help string
Span int
Initial []any
}
ProFieldSet combines several controls into one form value (Ant Design Pro ProFormFieldSet), such as a numeric range or a phone area code plus number. The value of Key is a []any with one entry per part (nil for an empty part); read it with ProValues.Parts.
type ProFieldW ¶
type ProFieldW struct {
// contains filtered or unexported fields
}
ProFieldW renders a single value outside a form (Ant Design ProField): the same value types as ProForm, ProTable and ProDescriptions, read-only or as the editor, switched with Mode.
var price any = 12800.0
mode := ui.ProFieldRead
ui.ProFieldOf(c, ui.ProField{Label: "价格", ValueType: ui.ValueMoney}, &price).Mode(mode).Show()
func ProFieldOf ¶
ProFieldOf starts a standalone field over *val described by fd (its Label names the editor for assistive technologies; Key may be empty); chain options, then Show. The Go type of *val follows the value type, as in ProValues.
ConfigProvider.Defaults("ProField", ...) keys: "mode" ("read" | "edit").
func (*ProFieldW) Mode ¶
func (w *ProFieldW) Mode(m ProFieldMode) *ProFieldW
Mode switches between the read-only view and the editor.
type ProFormGroupW ¶
type ProFormGroupW struct {
// contains filtered or unexported fields
}
ProFormGroupW builds a ProFormGroup.
func ProFormGroup ¶
func ProFormGroup(c *Context, title string) *ProFormGroupW
ProFormGroup starts a group titled title ("" = no title row); chain options, then Body.
ConfigProvider.Defaults("ProFormGroup", ...) keys: "collapsible" (bool), "columns", "gutter", "size" (gap between rows, number).
func (*ProFormGroupW) Body ¶
func (g *ProFormGroupW) Body(fn func()) *ProFormGroupW
Body builds the group with fn as its items.
func (*ProFormGroupW) Collapsed ¶
func (g *ProFormGroupW) Collapsed(v *bool) *ProFormGroupW
Collapsed binds the folded state (implies Collapsible).
func (*ProFormGroupW) Collapsible ¶
func (g *ProFormGroupW) Collapsible() *ProFormGroupW
Collapsible lets a click on the title fold the items.
func (*ProFormGroupW) Columns ¶
func (g *ProFormGroupW) Columns(n int) *ProFormGroupW
Columns lays the items out n per line (0: stacked).
func (*ProFormGroupW) DefaultCollapsed ¶
func (g *ProFormGroupW) DefaultCollapsed() *ProFormGroupW
DefaultCollapsed starts an uncontrolled collapsible group folded.
func (*ProFormGroupW) Description ¶
func (g *ProFormGroupW) Description(s string) *ProFormGroupW
Description adds a muted line under the title.
func (*ProFormGroupW) Extra ¶
func (g *ProFormGroupW) Extra(fn func()) *ProFormGroupW
Extra builds content at the right of the title row.
func (*ProFormGroupW) Gutter ¶
func (g *ProFormGroupW) Gutter(px float32) *ProFormGroupW
Gutter sets the horizontal space between columns (default 24).
func (*ProFormGroupW) ID ¶
func (g *ProFormGroupW) ID() ID
ID returns the group's widget ID (after Body).
func (*ProFormGroupW) Size ¶
func (g *ProFormGroupW) Size(px float32) *ProFormGroupW
Size sets the vertical space between item rows (default 0: the items' own margins).
func (*ProFormGroupW) Toggled ¶
func (g *ProFormGroupW) Toggled() bool
Toggled reports a fold / unfold by the user this frame.
type ProFormW ¶
type ProFormW struct {
// contains filtered or unexported fields
}
ProFormW renders a form from field definitions (Ant Design ProForm): a grid of fields whose controls follow their value types (shared with ProTable columns), linkage, validation (sync, cross-field, async), submit / reset buttons with a loading state and asynchronous initial values.
ui.ProForm(c, fields).Columns(2).
Request(func(done func(ui.ProValues, error)) { go load(done) }).
OnFinish(func(v ui.ProValues, done func(error)) { go save(v, done) }).
Show()
func (*ProFormW) Columns ¶
Columns lays fields out in a grid of n equal columns (ProField.Span overrides a field's width out of 24).
func (*ProFormW) Horizontal ¶
Horizontal puts labels left of the controls (default: above).
func (*ProFormW) LabelWidth ¶
LabelWidth sets the label width of a horizontal form.
func (*ProFormW) NoSubmitter ¶
NoSubmitter hides the buttons (submit with Submit, e.g. from a modal).
func (*ProFormW) OnFinish ¶
OnFinish receives the values after a successful validation; call done (from any goroutine) when saved. The submit button spins meanwhile and a non-nil error is shown above the buttons.
func (*ProFormW) Readonly ¶
Readonly shows every field as its formatted read-only value (Ant ProForm readonly) and hides the submit / reset buttons; ProField.Readonly does it for one field. Read-only fields are not validated.
func (*ProFormW) Request ¶
Request loads the initial values asynchronously; call done from any goroutine. The form shows a loading mask meanwhile.
func (*ProFormW) Reset ¶
func (p *ProFormW) Reset()
Reset restores the initial values and clears validation.
func (*ProFormW) Submit ¶
func (p *ProFormW) Submit()
Submit validates (waiting for async rules) and calls OnFinish.
func (*ProFormW) SubmitText ¶
SubmitText sets the submit button's text.
func (*ProFormW) Submitter ¶
func (p *ProFormW) Submitter(fn func(s *ProSubmitter)) *ProFormW
Submitter replaces the buttons.
func (*ProFormW) Submitting ¶
Submitting reports validation or OnFinish in progress.
type ProLayoutConfig ¶
type ProLayoutConfig struct {
Title string
Logo *icon.Icon
Menu []MenuItem
Selected *string
Collapsed *bool
LightSider bool // explicitly request a light sider
Breadcrumb []string // shown in the header
UserName string
Actions func() // extra header actions (left of the avatar)
PageTitle string
// Layout is "side" (default: sider with logo and menu, header with
// the collapse toggle), "top" (header with logo and a horizontal
// menu, no sider) or "mix" (full-width header with logo and actions
// above a sider with the menu and a collapse trigger).
Layout string
// NoPadding drops the 24px padding of the content area, so a
// PageContainer (or any page) fills it edge to edge.
NoPadding bool
// Breakpoint collapses the sider when the window is narrower (side
// and mix layouts; XS = never).
Breakpoint Breakpoint
// SiderWidth overrides the expanded sider width (0: the theme's).
SiderWidth float32
// ContentWidth is "Fluid" (default) or "Fixed": the content is then
// centred in a 1152px GridContent in the top layout (Ant contentWidth).
ContentWidth string
// NoFixedHeader lets the header scroll away with the content (Ant
// fixedHeader=false, the v3 default). FixedHeader explicitly pins it.
NoFixedHeader bool
// FixedHeader explicitly pins the header; NoFixedHeader takes precedence.
FixedHeader bool
// NoFixSiderbar lets the sider scroll with the page (Ant
// fixSiderbar=false): sider and content share one scroll, so a long
// menu is reached by scrolling the page. By default the sider stays
// fixed and only the content area scrolls (side and mix layouts; in the
// side layout the header then scrolls with the page too).
NoFixSiderbar bool
// AutoBreadcrumb derives the breadcrumb from the menu path of
// *Selected (parent submenus, then the item) when Breadcrumb is empty;
// clicking an ancestor that is a menu item selects it. MenuPath gives
// the same path to the page (e.g. for PageContainer.Breadcrumb).
AutoBreadcrumb bool
// BreadcrumbRender adjusts the breadcrumb items (static or automatic)
// before they are shown; returning none hides the breadcrumb.
BreadcrumbRender func(items []BreadcrumbItem) []BreadcrumbItem
// Render hooks (Ant menuHeaderRender, headerRender ...). def builds the
// default part, so a hook can wrap or replace it.
//
// MenuHeaderRender builds the logo and title area (top of the sider;
// the start of the header in the top and mix layouts).
MenuHeaderRender func(def func(), collapsed bool)
MenuFooterRender func(collapsed bool)
// HeaderRender builds the whole header bar.
HeaderRender func(def func())
// HeaderContentRender builds the middle of the header: in the side
// layout it replaces the breadcrumb, in the top layout the horizontal
// menu, in the mix layout it follows the logo.
HeaderContentRender func()
// MenuItemRender rewrites every menu item (children first) before the
// menu is built: change labels, icons, Disabled, add Shortcut text.
// The menu draws the items itself, so the hook returns data, not UI.
MenuItemRender func(item MenuItem) MenuItem
// place of the default one (DefaultFooter with FooterLinks and Footer).
FooterRender func()
// text (Ant DefaultFooter links); read DefaultFooterW.Clicked through
// FooterRender to react, or give each link an OnClick.
FooterLinks []FooterLink
}
ProLayoutConfig configures the admin shell.
type ProListMetas ¶
type ProListMetas[T any] struct { Title func(row T) string SubTitle func(c *Context, row T) // next to the title (tags) Description func(row T) string Avatar func(c *Context, row T) Content func(c *Context, row T) // middle area Actions func(c *Context, row T) // links at the end, split by bars Extra func(c *Context, row T) // right-most (an image) }
ProListMetas maps a row to the parts of a ProList item. Every part is optional.
type ProListW ¶
type ProListW[T any] struct { // contains filtered or unexported fields }
ProListW is a data-driven list (Ant Design Pro ProList): items built from metas, a toolbar with a title and actions, selection, expandable items, pagination, a loading state and a card grid mode.
ui.ProList(c, rows, metas).HeaderTitle("Projects").RowKey(key).
Selection(&sel).Pagination(5).Show()
func ProList ¶
func ProList[T any](c *Context, rows []T, metas ProListMetas[T]) *ProListW[T]
ProList starts a list over rows; chain options, then Show.
func (*ProListW[T]) DefaultExpandAllRows ¶
DefaultExpandAllRows controls the initial expansion of each row (default true).
func (*ProListW[T]) EstimatedItemHeight ¶
EstimatedItemHeight is the height Virtual assumes for an item not measured yet (List.EstimatedItemHeight).
func (*ProListW[T]) ExpandRowByClick ¶
ExpandRowByClick toggles expansion when the row body is activated.
func (*ProListW[T]) Expandable ¶
Expandable adds an expand toggle per item showing fn below it.
func (*ProListW[T]) ExpandedRowKeys ¶
ExpandedRowKeys binds the expanded keys to application-owned state.
func (*ProListW[T]) HeaderTitle ¶
HeaderTitle sets the toolbar title.
func (*ProListW[T]) Height ¶
Height fixes the height of the items' viewport (List.Height); the toolbar, selection bar and pager stay outside it.
func (*ProListW[T]) ItemLayout ¶
ItemLayout selects horizontal (default) or vertical item actions.
func (*ProListW[T]) OnItemClick ¶
OnItemClick makes the items (cards in grid mode) clickable.
func (*ProListW[T]) Pagination ¶
Pagination shows n items per page with a pager.
func (*ProListW[T]) Reload ¶
func (p *ProListW[T]) Reload()
Reload loads the current page again (valid after Show).
func (*ProListW[T]) Request ¶
Request loads the list page by page from a server: fn runs on a background goroutine with the 1-based page and the page size (set with Pagination, default 10) and returns the page's rows and the total count. The rows passed to ProList are ignored; the list shows a loading mask while a page loads and an error with a retry button when it fails.
func (*ProListW[T]) RowExpandable ¶
RowExpandable determines which rows offer an expand control.
func (*ProListW[T]) RowKey ¶
RowKey gives rows stable keys (selection and expansion follow them; default: the row index).
func (*ProListW[T]) SelectionChanged ¶
SelectionChanged reports a selection change in the last Show.
func (*ProListW[T]) Virtual ¶
Virtual builds only the items in view (List.Virtual; needs Height). Item heights, expanded items included, are measured as they come into view and cached by RowKey; selection and expansion are kept by key and do not depend on which items are built. Keyboard focus in an item scrolled out of view is lost, as in the non-virtual Height form.
type ProRequest ¶
type ProRequest struct {
Page, PageSize int
Sort []SortState
Filters map[string][]string
Params map[string]string // query form values (non-empty only)
// ExtParams is the value given to ProTableW.Params (Ant params); a
// map[string]string / map[string]any is also merged into Params
// (the query form wins on a shared key).
ExtParams any
}
ProRequest is what the request function receives.
type ProSettings ¶
type ProSettings struct {
PrimaryColor theme.Color // zero: the theme's brand color
Layout string // "side" (default), "top" or "mix"
ContentWidth string // "Fluid" (default) or "Fixed"
FixedHeader bool
FixSiderbar bool
ColorWeak bool
Compact bool
// contains filtered or unexported fields
}
ProSettings are the shell settings edited by SettingDrawer.
func DefaultProSettings ¶
func DefaultProSettings() ProSettings
DefaultProSettings returns Pro v3 defaults: light menu, side layout, fluid content, scrolling header and fixed side menu.
func (ProSettings) Apply ¶
func (s ProSettings) Apply(cfg *ProLayoutConfig)
Apply copies the layout settings into cfg.
type ProSkeletonW ¶
type ProSkeletonW struct {
// contains filtered or unexported fields
}
ProSkeletonW builds a page skeleton.
func ProSkeleton ¶
func ProSkeleton(c *Context, kind string) *ProSkeletonW
ProSkeleton starts a page skeleton of kind (SkeletonList, SkeletonResult or SkeletonDescriptions; "" = list). Defaults: active, with page header, 2 statistics, a toolbar and 5 list rows (4 table rows on the descriptions page).
Pro v3 picks the statistic count from the first breakpoint key that is true; antd's screens put xs/sm first, so in a browser that is always 2 (xs and sm both map to 2). Tango renders that observed default, not the md/xl entries of the lookup table.
func (*ProSkeletonW) Active ¶
func (s *ProSkeletonW) Active(on bool) *ProSkeletonW
Active turns the shimmer on or off.
func (*ProSkeletonW) Layout ¶
func (s *ProSkeletonW) Layout(o ...layout.Option) *ProSkeletonW
Layout applies layout options to the skeleton.
func (*ProSkeletonW) List ¶
func (s *ProSkeletonW) List(n int) *ProSkeletonW
List sets the number of list rows (list type, default 5) or table rows (descriptions type, default 4); 0 hides the list, or the divider and table. The list toolbar is controlled by Toolbar alone.
func (*ProSkeletonW) PageHeader ¶
func (s *ProSkeletonW) PageHeader(on bool) *ProSkeletonW
PageHeader shows or hides the page header placeholder.
func (*ProSkeletonW) Statistic ¶
func (s *ProSkeletonW) Statistic(n int) *ProSkeletonW
Statistic sets the number of statistic placeholders (list type; 0 hides them; default 2).
func (*ProSkeletonW) Toolbar ¶
func (s *ProSkeletonW) Toolbar(on bool) *ProSkeletonW
Toolbar shows or hides the list toolbar placeholder.
type ProStatisticW ¶
type ProStatisticW struct {
// contains filtered or unexported fields
}
ProStatisticW is the standalone Pro statistic (StatisticCard.Statistic). It shares StatisticCard's statistic renderer without adding a card surface.
func ProStatistic ¶
func ProStatistic(c *Context, title string) *ProStatisticW
ProStatistic starts a compact Pro statistic. ui.Statistic is the antd statistic; this entry adds Pro layout, descriptions, status, tip and trend.
func (*ProStatisticW) Description ¶
func (w *ProStatisticW) Description(fn func()) *ProStatisticW
Description builds description content.
func (*ProStatisticW) Icon ¶
func (w *ProStatisticW) Icon(ic *icon.Icon) *ProStatisticW
Icon adds a leading icon.
func (*ProStatisticW) Prefix ¶
func (w *ProStatisticW) Prefix(s string) *ProStatisticW
Prefix adds text before the value.
func (*ProStatisticW) Show ¶
func (w *ProStatisticW) Show() *ProStatisticW
Show builds a standalone statistic. Consecutive standalone statistics have a 4px block gap, as in Pro's `& + &` rule.
func (*ProStatisticW) StatisticLayout ¶
func (w *ProStatisticW) StatisticLayout(s string) *ProStatisticW
StatisticLayout sets vertical, horizontal or inline layout.
func (*ProStatisticW) Status ¶
func (w *ProStatisticW) Status(s string) *ProStatisticW
Status adds a status dot.
func (*ProStatisticW) Suffix ¶
func (w *ProStatisticW) Suffix(s string) *ProStatisticW
Suffix adds text after the value.
func (*ProStatisticW) Tooltip ¶
func (w *ProStatisticW) Tooltip(s string) *ProStatisticW
Tooltip adds a title tooltip.
func (*ProStatisticW) Trend ¶
func (w *ProStatisticW) Trend(s string) *ProStatisticW
Trend sets the trend direction.
func (*ProStatisticW) TrendColors ¶
func (w *ProStatisticW) TrendColors(up, down theme.Color) *ProStatisticW
TrendColors overrides the trend colors.
func (*ProStatisticW) Value ¶
func (w *ProStatisticW) Value(v float64, precision int) *ProStatisticW
Value formats a numeric value.
func (*ProStatisticW) ValueColor ¶
func (w *ProStatisticW) ValueColor(col theme.Color) *ProStatisticW
ValueColor overrides the value color.
func (*ProStatisticW) ValueText ¶
func (w *ProStatisticW) ValueText(s string) *ProStatisticW
ValueText sets a preformatted value.
type ProSubmitter ¶
type ProSubmitter struct {
// contains filtered or unexported fields
}
ProSubmitter is passed to a custom submitter.
func (*ProSubmitter) Context ¶
func (s *ProSubmitter) Context() *Context
Context returns the build context.
func (*ProSubmitter) Loading ¶
func (s *ProSubmitter) Loading() bool
Loading reports a running submit (show it on the submit button).
func (*ProSubmitter) Submit ¶
func (s *ProSubmitter) Submit()
Submit validates and submits the form.
type ProTableLocale ¶
type ProTableLocale struct {
Query, Reload, Density, DensityDefault, DensityMiddle, DensityCompact string
ColumnSetting, ColumnDisplay, ClearSelection string
LoadErrorFmt string // alert text, arg: error message
// contains filtered or unexported fields
}
ProTableLocale holds the ProTable search form and toolbar texts.
type ProTableW ¶
type ProTableW[T any] struct { // contains filtered or unexported fields }
ProTableW is a query list page: an auto-generated query form, a toolbar (refresh, density, column settings, fullscreen) and a table fed by an asynchronous request function.
func ProTable ¶
ProTable starts a ProTable; set Request, then Show.
ConfigProvider.Defaults("ProTable", ...) keys: "search", "bordered", "options" (bool), "pagination" (false, a page size or Props{"pageSize": n}), "size" (density: "small" | "middle" | "large"), "headerTitle" (string), "polling" (time.Duration or milliseconds).
func (*ProTableW[T]) ColumnsState ¶
func (p *ProTableW[T]) ColumnsState(s *TableColumnState) *ProTableW[T]
ColumnsState binds the column state (order, visibility, widths, pinned side) to *s, so the application controls it (Ant columnsState.value).
func (*ProTableW[T]) DragSort ¶
DragSort adds a drag handle column (Ant Design Pro DragSortTable): dropping a row calls fn with the indices of the moved row and of the row it was dropped on, both in the current page (Rows). Reorder the data (locally or on the server) and Reload, or reorder the page in place with MovePageRow.
func (*ProTableW[T]) Expandable ¶
Expandable adds detail panels.
func (*ProTableW[T]) FullScreen ¶
FullScreen enables the fullscreen toolbar option (v3 default: false).
func (*ProTableW[T]) MovePageRow ¶
MovePageRow moves row from to the position of row to in the current page without a new request (valid after Show; use it from DragSort).
func (*ProTableW[T]) NoPagination ¶
NoPagination drops the pager: requests ask for every row (PageSize 0).
func (*ProTableW[T]) NoTableAlert ¶
NoTableAlert hides the selection bar (Ant tableAlertRender={false}).
func (*ProTableW[T]) OnColumnsStateChange ¶
func (p *ProTableW[T]) OnColumnsStateChange(fn func(TableColumnState)) *ProTableW[T]
OnColumnsStateChange is called with the new column state after the user changes it in the column settings or by resizing (Ant columnsState.onChange).
func (*ProTableW[T]) Params ¶
Params sets external request parameters (Ant params): a change of the value (compared by its printed form) requests page 1 again. The value reaches the request as ProRequest.ExtParams; maps are also merged into ProRequest.Params.
func (*ProTableW[T]) PausePolling ¶
func (p *ProTableW[T]) PausePolling()
PausePolling stops polling until ResumePolling (valid after Show).
func (*ProTableW[T]) PersistColumnsState ¶
func (p *ProTableW[T]) PersistColumnsState(key string, store ColumnsStateStore) *ProTableW[T]
PersistColumnsState loads the column state from store under key once and saves every change there (Ant columnsState.persistenceKey); the store decides where the state lives.
func (*ProTableW[T]) Polling ¶
Polling requests the current page again every d after the previous result arrived (0: off). Polling requests keep the rows on screen without the loading mask; PausePolling / ResumePolling control it.
func (*ProTableW[T]) PollingPaused ¶
PollingPaused reports whether polling is paused.
func (*ProTableW[T]) Reload ¶
func (p *ProTableW[T]) Reload()
Reload requests the data again (valid after Show).
func (*ProTableW[T]) Request ¶
func (p *ProTableW[T]) Request(fn func(req ProRequest, done func(ProResult[T]))) *ProTableW[T]
Request sets the data source. It is called on the UI thread whenever the page, sort, filters or query change; call done (from any goroutine) with the page rows and total. The table shows a loading mask meanwhile and an error banner if Err is set.
func (*ProTableW[T]) ResumePolling ¶
func (p *ProTableW[T]) ResumePolling()
ResumePolling restarts paused polling (valid after Show); the next poll is due one interval after the last result.
func (*ProTableW[T]) RowHeight ¶
RowHeight overrides the row height derived from the density (TableW.RowHeight).
func (*ProTableW[T]) Rows ¶
func (p *ProTableW[T]) Rows() []T
Rows returns the rows of the current page.
func (*ProTableW[T]) ScrollY ¶
ScrollY bounds the table body to maxH (TableW.ScrollY): the header stays in place and only the visible rows of the page are built, so a page of many thousand rows stays fast. The toolbar, search form, alert and pager stay outside the scrolling body. Default 0: unbounded, every row of the page is built.
func (*ProTableW[T]) TableAlertOptionRender ¶
TableAlertOptionRender replaces the actions of the selection bar (the default clear link), e.g. with batch operations (Ant tableAlertOptionRender).
func (*ProTableW[T]) TableAlertRender ¶
TableAlertRender replaces the text of the selection bar (Ant tableAlertRender); clear empties the selection.
func (*ProTableW[T]) Toolbar ¶
func (p *ProTableW[T]) Toolbar(fn func(*ListToolBarW)) *ProTableW[T]
Toolbar configures the public ListToolBar used by ProTable (search, subtitle, tooltip, filters, tabs and menus). ToolBar still adds actions.
func (*ProTableW[T]) Virtual ¶
Virtual is TableW.Virtual for the inner table: with ScrollY the body is windowed either way, Virtual states the intent and, like TableW.Virtual, takes the theme's Table V2 row height where it has one (Element Plus). Otherwise rows keep the height of the density (the density setting) unless RowHeight overrides it.
type ProValues ¶
ProValues holds form values by field key. The Go type depends on the value type: string (text, select, radio ...), float64 (digit, money, percent, rate, slider, progress), time.Time (date, dateTime), [2]time.Time (dateRange), []string (multiSelect, checkbox), bool (switch). A missing key is an empty value.
func (ProValues) DigitRange ¶
DigitRange returns a number range; a missing value or end is NaN.
func (ProValues) Files ¶
func (v ProValues) Files(k string) []UploadFile
Files returns an upload value.
type ProgressW ¶
type ProgressW struct {
// contains filtered or unexported fields
}
ProgressW is the full progress indicator: line / circle / dashboard types, steps, gradients, success segment, inside text, stripes and indeterminate motion.
func Progress ¶
Progress adds a progress indicator (percent 0..100): a line bar by default, Circle/Dashboard for rings.
func (*ProgressW) A11yLabel ¶
A11yLabel sets the accessible name (default: the Locale's "progress").
func (*ProgressW) ColorFunc ¶
ColorFunc picks the bar color from the percentage (Element color function; a color array is a ColorFunc with thresholds).
func (*ProgressW) GapDegree ¶
GapDegree sets the ring opening in degrees (dashboard default 75°; a circle with GapDegree opens too, like antd).
func (*ProgressW) GapPlacement ¶
GapPlacement sets where the ring opening sits: "bottom" (default), "top", "start" or "end" (logical: mirrored in RTL). antd 6 gapPlacement (gapPosition is deprecated there).
func (*ProgressW) Indeterminate ¶
Indeterminate shows an endlessly moving segment (Element).
func (*ProgressW) PercentPosition ¶
PercentPosition places the info text of a line bar (antd 6 percentPosition): align "start", "center" or "end" (default); typ "outer" (default; center puts it under the bar) or "inner" (inside the filled part, like Element text-inside).
func (*ProgressW) ShowInfo ¶
ShowInfo shows the percentage text / status icon. It is the default, except for a line bar under a theme whose ProgressToken.ShowInfo is false (shadcn: like shadcn/ui's Progress, only the bar unless asked).
func (*ProgressW) StepsGap ¶
StepsGap sets the gap between step segments in px (antd steps.gap; default 2).
func (*ProgressW) StrokeWidth ¶
StrokeWidth sets the bar thickness / ring width in px.
func (*ProgressW) TextInside ¶
TextInside draws the percentage inside the bar (Element text-inside).
func (*ProgressW) TrailColor
deprecated
type PromptItem ¶
type PromptItem struct {
Key string
Label string
Description string
Icon *icon.Icon
Disabled bool
// contains filtered or unexported fields
}
PromptItem is one suggestion card of Prompts.
type PromptsW ¶
type PromptsW struct {
// contains filtered or unexported fields
}
PromptsW is a group of clickable prompt suggestion cards (the empty state of a chat, follow-up questions under an answer). Not to be confused with Prompt, the input dialog.
func Prompts ¶
func Prompts(c *Context, items []PromptItem) *PromptsW
Prompts adds prompt cards for items.
if k, ok := ui.Prompts(c, prompts).Title("试试这样问").Wrap().Clicked(); ok { ask(k) }
type Props ¶
Props are default properties of one component, by property name ("size", "round", "duration" ...). Components document the keys they read.
type QRCodeLocale ¶
type QRCodeLocale struct {
Expired, Refresh, Scanned string
// contains filtered or unexported fields
}
QRCodeLocale holds the QRCode status masks.
type QRCodeW ¶
type QRCodeW struct {
// contains filtered or unexported fields
}
QRCodeW renders a QR code (Ant Design QRCode / Element has none; the Element flavor keeps the same component with Element tokens).
func QRCode ¶
QRCode adds a QR code for value (default 160px, level M, bordered). An empty value draws nothing (Ant renders null), keeping the box size.
func (*QRCodeW) BoostLevel ¶
BoostLevel(false) keeps the requested error-correction level; by default (Ant boostLevel true) the level is raised as far as the code keeps the same version (size).
func (*QRCodeW) MarginSize ¶
MarginSize adds a quiet zone of n modules around the code (Ant marginSize, default 0).
type QRLevel ¶
type QRLevel uint8
QRLevel is the error-correction level.
Append-only: never reorder or insert; the zero value stays QRLevelL.
func ParseQRLevel ¶
ParseQRLevel maps "L","M","Q","H" (any case) to a level; unknown → M.
type QRMatrix ¶
type QRMatrix struct {
Version int
Level QRLevel
Mask int
Size int
// contains filtered or unexported fields
}
QRMatrix is an encoded symbol without quiet zone. Dark(x, y) reports a dark module at column x, row y.
type QueryFilterW ¶
type QueryFilterW struct {
// contains filtered or unexported fields
}
QueryFilterW is a collapsible query form (Ant Design Pro QueryFilter): fields flow in 1–4 columns by width with the buttons in the last cell; beyond the first row they fold behind an expand link. ProTable uses it for its search form.
q := ui.QueryFilter(c, fields).Values(&query).Show()
if q.Searched() { reload(q.Params()) }
func QueryFilter ¶
func QueryFilter(c *Context, fields []ProField) *QueryFilterW
QueryFilter starts a query form over fields; chain options, then Show.
ConfigProvider.Defaults("QueryFilter", ...) keys: "labelWidth" (number), "defaultCollapsed" (bool, false = start expanded), "searchText", "resetText" (string).
func (*QueryFilterW) DefaultExpanded ¶
func (q *QueryFilterW) DefaultExpanded() *QueryFilterW
DefaultExpanded starts with every field shown.
func (*QueryFilterW) ID ¶
func (q *QueryFilterW) ID() ID
ID returns the widget ID (valid after Show).
func (*QueryFilterW) LabelWidth ¶
func (q *QueryFilterW) LabelWidth(px float32) *QueryFilterW
LabelWidth sets the label width (default 80).
func (*QueryFilterW) Loading ¶
func (q *QueryFilterW) Loading(on bool) *QueryFilterW
Loading spins the search button.
func (*QueryFilterW) Params ¶
func (q *QueryFilterW) Params() map[string]string
Params returns the non-empty values as text (dates as 2006-01-02).
func (*QueryFilterW) ResetClicked ¶
func (q *QueryFilterW) ResetClicked() bool
ResetClicked reports a reset in the last Show.
func (*QueryFilterW) ResetText ¶
func (q *QueryFilterW) ResetText(s string) *QueryFilterW
ResetText sets the reset button's text.
func (*QueryFilterW) SearchText ¶
func (q *QueryFilterW) SearchText(s string) *QueryFilterW
SearchText sets the search button's text.
func (*QueryFilterW) Searched ¶
func (q *QueryFilterW) Searched() bool
Searched reports a search (or a reset, which searches again) in the last Show.
func (*QueryFilterW) Values ¶
func (q *QueryFilterW) Values(v *ProValues) *QueryFilterW
Values binds the values (otherwise the filter keeps its own).
type RadioGroupW ¶
type RadioGroupW struct {
// contains filtered or unexported fields
}
RadioGroupW is a group of mutually exclusive options.
func RadioGroup ¶
func RadioGroup(c *Context, val *string, opts []Option) *RadioGroupW
RadioGroup adds radio options bound to *val.
func (*RadioGroupW) A11yLabel ¶
func (g *RadioGroupW) A11yLabel(s string) *RadioGroupW
A11yLabel names the group for screen readers (inside a FormItem the item label is used).
func (*RadioGroupW) Block ¶
func (g *RadioGroupW) Block() *RadioGroupW
Block stretches the group to the full width and shares it equally among the options (antd block, typically with Buttons).
func (*RadioGroupW) Border ¶
func (g *RadioGroupW) Border() *RadioGroupW
Border draws each radio with a frame (see RadioW.Border); it has no effect on the button style.
func (*RadioGroupW) Buttons ¶
func (g *RadioGroupW) Buttons() *RadioGroupW
Buttons renders the group as segmented buttons.
func (*RadioGroupW) Changed ¶
func (g *RadioGroupW) Changed() bool
Changed reports a selection change this frame.
func (*RadioGroupW) Disabled ¶
func (g *RadioGroupW) Disabled(on bool) *RadioGroupW
Disabled disables every option of the group (radios or buttons).
func (*RadioGroupW) Orientation ¶
func (g *RadioGroupW) Orientation(o string) *RadioGroupW
Orientation sets the direction of the options: "horizontal" (default) or "vertical" (antd 6 orientation). Other values are ignored.
func (*RadioGroupW) Size ¶
func (g *RadioGroupW) Size(s ControlSize) *RadioGroupW
Size sets the size of the buttons (and of the radios: label font and Border height).
func (*RadioGroupW) Solid ¶
func (g *RadioGroupW) Solid() *RadioGroupW
Solid fills the selected button with the primary color.
func (*RadioGroupW) Vertical ¶
func (g *RadioGroupW) Vertical() *RadioGroupW
Vertical stacks the options in a column (antd 6 vertical); buttons join top to bottom.
type RadioW ¶
type RadioW struct {
// contains filtered or unexported fields
}
RadioW is a single radio button.
func (*RadioW) Border ¶
Border draws a frame around the circle and the label (Element el-radio border); a checked one gets a brand-colored frame.
func (*RadioW) Size ¶
func (w *RadioW) Size(s ControlSize) *RadioW
Size sets the radio size: the label font and the height of the Border style.
type RangePickerW ¶
type RangePickerW struct {
// contains filtered or unexported fields
}
RangePickerW selects a date range in two adjacent month panels.
func RangePicker ¶
func RangePicker(c *Context, val *[2]time.Time) *RangePickerW
RangePicker adds a date range input bound to *val ([start, end], zero = empty). The first click picks one end, the second click the other; the result is ordered. Picker switches to week, month, quarter or year ranges. Each end can also be typed: printable keys edit the active end in place; Enter (or leaving the field) applies valid text, invalid text is dropped.
func (*RangePickerW) A11yLabel ¶
func (w *RangePickerW) A11yLabel(s string) *RangePickerW
A11yLabel sets the accessible name (inside a FormItem the item label is used; otherwise the two placeholders).
func (*RangePickerW) AllowClear ¶
func (w *RangePickerW) AllowClear(on bool) *RangePickerW
func (*RangePickerW) Changed ¶
func (w *RangePickerW) Changed() bool
Changed reports a committed range this frame.
func (*RangePickerW) Disabled ¶
func (w *RangePickerW) Disabled(on bool) *RangePickerW
Disabled disables the picker.
func (*RangePickerW) DisabledDate ¶
func (w *RangePickerW) DisabledDate(fn func(time.Time) bool) *RangePickerW
DisabledDate marks days that cannot be picked.
func (*RangePickerW) DisabledTime ¶
func (w *RangePickerW) DisabledTime(fn func(day time.Time, end bool) DisabledTimes) *RangePickerW
DisabledTime disables hours, minutes and seconds per day in the ShowTime columns (Ant disabledTime with type "start" / "end"): fn receives the drafted day of an end (UTC midnight) and end=false for the start, true for the end. A range with a disabled clock cannot be confirmed.
func (*RangePickerW) Format ¶
func (w *RangePickerW) Format(f string) *RangePickerW
func (*RangePickerW) IsOpen ¶
func (w *RangePickerW) IsOpen() bool
IsOpen reports whether the panels are shown.
func (*RangePickerW) Layout ¶
func (w *RangePickerW) Layout(o ...layout.Option) *RangePickerW
func (*RangePickerW) MaxDate ¶
func (w *RangePickerW) MaxDate(t time.Time) *RangePickerW
MaxDate limits the pickable dates (Ant maxDate), like MinDate.
func (*RangePickerW) MinDate ¶
func (w *RangePickerW) MinDate(t time.Time) *RangePickerW
MinDate limits the pickable dates (Ant minDate): periods wholly before t cannot be picked or typed, and the panel arrows stop at t's page.
func (*RangePickerW) Open ¶
func (w *RangePickerW) Open() *RangePickerW
Open forces the panels open (screenshots, tests).
func (*RangePickerW) Order ¶
func (w *RangePickerW) Order(on bool) *RangePickerW
Order toggles sorting the two ends (Ant order, on by default). With Order(false) the first pick is the start and the second the end, even when the end comes earlier.
func (*RangePickerW) Picker ¶
func (w *RangePickerW) Picker(p PickerType) *RangePickerW
Picker sets the granularity of both ends: PickerDate (default), PickerWeek, PickerMonth, PickerQuarter or PickerYear (Ant picker, Element type="monthrange" / "yearrange"). Ends are the first days of their periods (UTC midnights, like DatePicker with Picker); ShowTime is ignored.
func (*RangePickerW) Placeholder ¶
func (w *RangePickerW) Placeholder(start, end string) *RangePickerW
func (*RangePickerW) Placement ¶
func (w *RangePickerW) Placement(p Placement) *RangePickerW
Placement sets where the panels open: BottomStart (default), BottomEnd, TopStart or TopEnd (Ant placement); they flip when there is no room.
func (*RangePickerW) Presets ¶
func (w *RangePickerW) Presets(p ...DatePreset) *RangePickerW
func (*RangePickerW) Separator ¶
func (w *RangePickerW) Separator(s string) *RangePickerW
Separator sets the text between the two ends (Ant separator; default the Locale's RangeSeparator).
func (*RangePickerW) ShowTime ¶
func (w *RangePickerW) ShowTime() *RangePickerW
ShowTime adds start / end time columns under the month panels and an OK button (Ant RangePicker showTime, Element type="datetimerange"): days and times are drafts until OK (or Enter on the picked end day) commits. The default format becomes "2006-01-02 15:04:05"; a format without seconds hides the second columns.
func (*RangePickerW) Size ¶
func (w *RangePickerW) Size(s ControlSize) *RangePickerW
func (*RangePickerW) Status ¶
func (w *RangePickerW) Status(s string) *RangePickerW
func (*RangePickerW) Variant ¶
func (w *RangePickerW) Variant(v string) *RangePickerW
Variant sets the frame look: "outlined" (default), "filled", "borderless" or "underlined".
func (*RangePickerW) Width ¶
func (w *RangePickerW) Width(px float32) *RangePickerW
type RateW ¶
type RateW struct {
// contains filtered or unexported fields
}
RateW is a star rating (Ant Rate / Element el-rate).
func (*RateW) A11yLabel ¶
A11yLabel sets the accessible name (default: the Locale's "rating"; inside a FormItem the item label is used).
func (*RateW) AllowClear ¶
AllowClear lets a click on the current value reset it to 0 (default on).
func (*RateW) CharacterFunc ¶
CharacterFunc draws the character fn returns for star i (0-based; Ant character as a function of the index).
func (*RateW) Colors ¶
Colors sets the active color by the value (Element colors): a value at or below the low threshold uses the first color, below the high threshold the second, from it on the third. One color applies to every value; Color overrides them all.
func (*RateW) Icons ¶
Icons replaces the star icons: on for the filled part, void for the empty one (Element icons / void-icon; nil keeps the star).
func (*RateW) Keyboard ¶
Keyboard enables or disables the arrow / Home / End keys (Ant keyboard, default on).
func (*RateW) Large ¶
Large uses the large star size (Ant size="large": 25px; Element keeps 18px in a 40px row).
func (*RateW) ScoreFormat ¶
ScoreFormat formats the score of ShowScore (Element score-template; by default the bare number).
func (*RateW) Thresholds ¶
Thresholds sets the values that switch Colors (Element low-threshold / high-threshold; default 2 and 4).
type ResultW ¶
type ResultW struct {
// contains filtered or unexported fields
}
ResultW is a result page: a status icon or illustration, a title, a subtitle, actions (Extra) and optional content (Body).
func (*ResultW) Body ¶
Body builds the result; fn (optional) fills the grey content panel below the actions (Ant) or the bottom slot (Element).
type RichTextW ¶
type RichTextW struct {
// contains filtered or unexported fields
}
RichTextW is a paragraph of spans.
func RichText ¶
RichText adds a wrapping paragraph made of spans.
ui.RichText(c, ui.Span{Text: "普通、"}, ui.Span{Text: "加粗", Bold: true}, ui.Span{Text: "链接", Link: "https://…"})
func (*RichTextW) ClickedLink ¶
ClickedLink returns the URL of a link clicked this frame ("" if none).
func (*RichTextW) HoveredLink ¶
HoveredLink returns the URL under the pointer ("" if none).
func (*RichTextW) Pre ¶
Pre keeps spaces and tabs and only breaks at newlines or when a line is too long (code blocks).
func (*RichTextW) Selectable ¶
Selectable lets the user select the text with the pointer (double click selects a word, triple click the paragraph) and copy it with Cmd/Ctrl+C; Cmd/Ctrl+A selects the whole paragraph while it has focus.
type RouteInfo ¶
type RouteInfo struct {
InLayout bool // built inside a ProLayout content area
Layout string // "side", "top" or "mix"
Collapsed bool // sider collapsed
IsMobile bool // window narrower than MD
HasSiderMenu bool // side and mix layouts
Breadcrumb []string // the shell's breadcrumb
BreadcrumbItems []BreadcrumbItem // structured route breadcrumb, including navigation callbacks
PageTitle string
Selected string // selected menu key
ContentWidth string // "Fluid" or "Fixed"
FixedHeader bool
FixSiderbar bool // the sider stays while the content scrolls
}
RouteInfo is the shell state seen by the content of a ProLayout.
func RouteContext ¶
RouteContext returns the state of the innermost ProLayout being built around the caller.
type RowEditorTableW ¶
type RowEditorTableW[T any] struct { // contains filtered or unexported fields }
RowEditorTableW is an editable table that edits one whole row at a time (Pro Components v3 RowEditorTable): double-click a row (or press Enter on one of its cells) to edit every editable cell of it; Enter or moving focus out of the row validates all of its editors and saves, Escape cancels and drops the drafts (a new row is removed). It is an EditableProTable preset, bordered and without pagination by default.
func RowEditorTable ¶
func RowEditorTable[T any](c *Context, cols []ProColumn[T], rows *[]T) *RowEditorTableW[T]
RowEditorTable starts a row-editing table over *rows; chain options, then Show.
ConfigProvider.Defaults("RowEditorTable", ...) keys: "bordered" (bool, default true), "size", "pagination" (page size or Props{"pageSize": n}; default none).
func (*RowEditorTableW[T]) AddAtTop ¶
func (w *RowEditorTableW[T]) AddAtTop() *RowEditorTableW[T]
AddAtTop puts new rows (and the add button) above the data.
func (*RowEditorTableW[T]) AddRow ¶
func (w *RowEditorTableW[T]) AddRow() string
AddRow adds a new draft row in edit mode and returns its key ("" when NewRow is not set or another row is being edited).
func (*RowEditorTableW[T]) Bordered ¶
func (w *RowEditorTableW[T]) Bordered(on bool) *RowEditorTableW[T]
Bordered turns the cell borders on or off (default on).
func (*RowEditorTableW[T]) Cancel ¶
func (w *RowEditorTableW[T]) Cancel()
Cancel leaves row editing without saving (as Escape does).
func (*RowEditorTableW[T]) Changed ¶
func (w *RowEditorTableW[T]) Changed() bool
Changed reports a change of *rows in the last Show.
func (*RowEditorTableW[T]) Edit ¶
func (w *RowEditorTableW[T]) Edit(k string)
Edit starts editing the row with key k (valid after Show).
func (*RowEditorTableW[T]) EditingKey ¶
func (w *RowEditorTableW[T]) EditingKey() string
EditingKey returns the key of the edited row ("" when none).
func (*RowEditorTableW[T]) Errors ¶
func (w *RowEditorTableW[T]) Errors(k string) map[string]string
Errors returns the validation messages of row k by column key.
func (*RowEditorTableW[T]) ID ¶
func (w *RowEditorTableW[T]) ID() ID
ID returns the widget ID (valid after Show).
func (*RowEditorTableW[T]) MaxLength ¶
func (w *RowEditorTableW[T]) MaxLength(n int) *RowEditorTableW[T]
MaxLength hides the add button once there are n rows.
func (*RowEditorTableW[T]) NewRow ¶
func (w *RowEditorTableW[T]) NewRow(fn func() T) *RowEditorTableW[T]
NewRow shows the "add a row" button (see EditableProTableW.NewRow); the new row opens in edit mode with focus in its first editor.
func (*RowEditorTableW[T]) OnSave ¶
func (w *RowEditorTableW[T]) OnSave(fn func(row T, index int, done func(error))) *RowEditorTableW[T]
OnSave receives a validated row (index -1 for a new row) before it is written back (see EditableProTableW.OnSave).
func (*RowEditorTableW[T]) Pagination ¶
func (w *RowEditorTableW[T]) Pagination(n int) *RowEditorTableW[T]
Pagination pages the rows locally, n per page (default: no pagination).
func (*RowEditorTableW[T]) RowEditable ¶
func (w *RowEditorTableW[T]) RowEditable(fn func(row T) bool) *RowEditorTableW[T]
RowEditable limits which rows can be edited.
func (*RowEditorTableW[T]) RowKey ¶
func (w *RowEditorTableW[T]) RowKey(f func(T) string) *RowEditorTableW[T]
RowKey gives rows stable keys (default: the row index).
func (*RowEditorTableW[T]) Save ¶
func (w *RowEditorTableW[T]) Save()
Save validates the edited row and saves it (as Enter does).
func (*RowEditorTableW[T]) Saved ¶
func (w *RowEditorTableW[T]) Saved() bool
Saved reports a row written back in the last Show.
func (*RowEditorTableW[T]) ScrollX ¶
func (w *RowEditorTableW[T]) ScrollX(px float32) *RowEditorTableW[T]
ScrollX sets the table's scroll width.
func (*RowEditorTableW[T]) ScrollY ¶
func (w *RowEditorTableW[T]) ScrollY(maxH float32) *RowEditorTableW[T]
ScrollY bounds the table body to maxH (EditableProTableW.ScrollY): only the visible rows are built. The edited row is always built, even scrolled out of view, so its draft and focus survive; starting to edit it (Edit), focus moving into it (Tab), typing in it and a failed validation scroll it into view. Default 0: unbounded, every row is built.
func (*RowEditorTableW[T]) Show ¶
func (w *RowEditorTableW[T]) Show() *RowEditorTableW[T]
Show builds the table.
func (*RowEditorTableW[T]) Size ¶
func (w *RowEditorTableW[T]) Size(s ControlSize) *RowEditorTableW[T]
Size sets the density.
func (*RowEditorTableW[T]) Table ¶
func (w *RowEditorTableW[T]) Table() *TableW
Table returns the inner table of the last Show.
func (*RowEditorTableW[T]) Title ¶
func (w *RowEditorTableW[T]) Title(s string) *RowEditorTableW[T]
Title sets the toolbar title.
func (*RowEditorTableW[T]) ToolBar ¶
func (w *RowEditorTableW[T]) ToolBar(fn func()) *RowEditorTableW[T]
ToolBar adds actions at the right of the toolbar.
func (*RowEditorTableW[T]) Validating ¶
func (w *RowEditorTableW[T]) Validating(k string) bool
Validating reports async validation or a save in flight for row k.
func (*RowEditorTableW[T]) Virtual ¶
func (w *RowEditorTableW[T]) Virtual() *RowEditorTableW[T]
Virtual is TableW.Virtual for the inner table (see EditableProTableW.Virtual): with ScrollY the body is windowed either way; rows keep the height of the density (Size) unless the theme has a Table V2 row height (Element Plus).
type RowStyle ¶
type RowStyle struct {
// Status tints the row with a palette background ("success",
// "warning", "error", "info", "processing"), like Element Plus'
// success-row / warning-row classes.
Status string
// Bg sets the row background (wins over Status).
Bg theme.Color
// Text colors the text of plain (Text) cells; Render cells style
// their own widgets.
Text theme.Color
// Bold draws plain cell text in medium weight.
Bold bool
}
RowStyle styles one body row (RowClass). Zero fields keep the default look; hover, selection and the current-row highlight still win over Bg.
type Rule ¶
type Rule struct {
// contains filtered or unexported fields
}
Rule validates a form value; build rules with Required, MinLen, MaxLen, Pattern, Email, Match, Check or AsyncCheck.
func AsyncCheck ¶
AsyncCheck validates asynchronously (a server lookup): fn starts the check and calls done (from any goroutine) with an error message or "". It runs after the synchronous rules pass, once per value; the item shows a "validating" hint meanwhile.
func Match ¶
Match fails when the value differs from *other (confirm password). Give the item Dependencies(otherName) to re-check when the other field changes.
func MinLen ¶
MinLen fails when the value has fewer than n characters (empty passes; combine with Required).
type RuleOf ¶
type RuleOf[T any] struct { // contains filtered or unexported fields }
RuleOf validates a form value of type T; build them with RequiredValue, MinValue, MaxValue, RangeValue, RequiredItems, MinItems, MaxItems, MustBeTrue or CheckValue, and attach them with RulesOf.
func CheckValue ¶
CheckValue wraps a custom validator returning an error message or "".
func MinItems ¶
MinItems fails when a non-empty slice has fewer than n elements (combine with RequiredItems).
func MustBeTrue ¶
MustBeTrue fails unless the value is true ("I agree to the terms"); the item shows the required mark.
func RangeValue ¶
RangeValue fails outside [lo, hi].
func RequiredItems ¶
RequiredItems fails on an empty slice (checkbox group, multi-select, upload list).
func RequiredValue ¶
func RequiredValue[T comparable](msg string) RuleOf[T]
RequiredValue fails on the zero value (0, false, "", nil).
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner drives one window: it queues input, runs the page function, lays out, paints and presents. All methods except Invalidate, Post and Close must be called on the UI thread. Invalidate and Close are safe from any goroutine; so is Post when a thread is bound or the window implements UIPoster, while on a headless runner (neither) Post runs fn inline on the caller, which must then be on the UI thread. The UI thread is the one bound with BindThread, or the host's main thread when none is bound. Development builds (-tags tango_dev) panic when a bound runner is used off its thread.
With uihost.Open, uihost.Attach and tan dev, the UI thread is the app's main thread. Dedicated macOS UI threads are currently used only for internal testing. A headless Driver runs on the caller's thread. Use Post to update page state or call Runner methods from a background goroutine. The thread checks cover Runner and Context state on bound runners.
func NewRunner ¶
func NewRunner(page func(*Context), o RunnerOptions) *Runner
NewRunner creates a runner for page. Call Attach before Frame.
func Open ¶
func Open(h Host, opts WindowOptions, page func(*Context), ropts RunnerOptions) (*Runner, error)
Open creates a Runner for page and asks host to put it in a window.
func (*Runner) AccessibilityTree ¶
AccessibilityTree returns the semantics tree of the last frame, or nil when accessibility is off.
func (*Runner) BindThread ¶
BindThread makes t the runner's UI thread: Post queues work there and, in development builds, the UI-thread entry points panic when called from elsewhere. Call it once, before Attach; only the host can end the binding (corehook.ReturnRunnerToMain, when it hands the window back to its main thread), never bind it again. Experimental: used by the platform host (uihost).
func (*Runner) ClearKeyboardInset ¶
func (r *Runner) ClearKeyboardInset()
ClearKeyboardInset removes the SetKeyboardInset override. UI thread.
func (*Runner) ClearSafeArea ¶
func (r *Runner) ClearSafeArea()
ClearSafeArea removes the SetSafeArea override.
func (*Runner) Close ¶
func (r *Runner) Close()
Close releases resources. It may be called from any goroutine.
func (*Runner) Composing ¶
Composing reports whether an input method is composing (a non-empty input.Composition has not been committed or cancelled yet) as of the latest frame. A host whose main thread decides on keys without the UI thread (window shortcuts) reads it after Frame.
Experimental: used by the platform host (uihost).
func (*Runner) DragRegions ¶
DragRegions returns the parts of the window, in window logical pixels, where a primary-button press in the latest frame lands on a self-drawn TitleBar's drag area (not on a control inside it or on anything drawn above it) and so would move the window. Only title bars that act on the runner's own window (no TitleBarW.Frame, not Manual) count, and the list is empty while any layer (Overlay) is open, since a press then may first have to close it. Call it after Frame; it allocates a new slice.
Experimental: used by the platform host (uihost), which may start the move itself on the main thread.
func (*Runner) DropFiles ¶
DropFiles delivers files dropped at p (window logical pixels) to the DropZone under it: its Dropped returns them during the next frame. Files dropped outside every zone are discarded. UI thread only.
func (*Runner) EnableAccessibility ¶
EnableAccessibility builds the semantics tree every frame even when the window is not an AccessibilityHost (or reports it disabled): tests, automation and hosts that enable it explicitly. Off again leaves the decision to the host.
func (*Runner) FileDrag ¶
FileDrag returns the position of a file drag in host window logical pixels.
func (*Runner) FileDragLeave ¶
func (r *Runner) FileDragLeave()
FileDragLeave reports that the file drag left the window, was cancelled or was dropped (hosts call it before DropFiles).
func (*Runner) FileDragOver ¶
FileDragOver reports files dragged over the window at p (window logical pixels), when the drag enters and as it moves. Hosts call it on the UI thread (uihost does from platform.CanvasDropTarget).
func (*Runner) FrameMetrics ¶
FrameMetrics returns the viewport and effective device-pixel scale to use when rendering List again, for example to capture a screenshot.
func (*Runner) HandleEvent ¶
HandleEvent queues an input event and requests a frame.
func (*Runner) Invalidate ¶
func (r *Runner) Invalidate()
Invalidate requests a frame. It is safe to call from any goroutine (it only forwards to Window.Invalidate, which hosts must make thread-safe); the frame itself still runs on the UI thread.
func (*Runner) List ¶
List returns the display list in UI logical pixels (debugging, GPU hosts). FrameMetrics gives the parameters for rendering it.
func (*Runner) NativeRegions ¶
func (r *Runner) NativeRegions() []NativeRegion
NativeRegions returns the native views of the latest frame in build order (later ones stack above earlier ones). Call it after Frame (or from Window.Present); it allocates a new slice.
func (*Runner) PerformAction ¶
PerformAction asks the widget behind node id to perform act (from a screen reader, voice control or a test). arg is the new value for SetValue (text, or a number for sliders and spin buttons). The node and action must be in the last reported tree; the action runs at the start of the next frame, which this call requests. It must be called on the UI thread.
func (*Runner) PointerPos ¶
PointerPos returns the last pointer position in the window and whether the pointer is inside it (hosts placing drops that carry no point).
func (*Runner) Post ¶
func (r *Runner) Post(fn func())
Post runs fn on the UI thread, then requests a frame. It never blocks. On a bound runner (BindThread) fn is queued on that thread; otherwise, when the attached window implements UIPoster, it is queued through PostUI. Either way any goroutine may call Post, and a Post from the page function runs fn after the frame. A headless runner (no bound thread, no UIPoster: Driver, tests) runs fn on the calling goroutine before Post returns, so the caller must be on the UI thread. After Close, fn is dropped, also when it was queued before.
func (*Runner) SetKeyboardInset ¶
SetKeyboardInset sets the window's soft-keyboard inset (logical pixels), taking precedence over KeyboardInsetWindow, and requests a frame. Hosts that are told about keyboard changes call it instead of implementing KeyboardInsetWindow. UI thread.
func (*Runner) SetReduceMotion ¶
SetReduceMotion turns the reduced-motion preference on or off (see RunnerOptions.ReduceMotion) and requests a frame.
func (*Runner) SetSafeArea ¶
SetSafeArea sets the window's safe-area insets (logical pixels), taking precedence over SafeAreaWindow, and requests a frame. Hosts that are told about inset changes (iOS safeAreaInsetsDidChange, Android WindowInsets listeners) call it instead of implementing SafeAreaWindow.
func (*Runner) SetTouchPointerEmulation ¶
SetTouchPointerEmulation turns the pointer events synthesized from the first finger of a touch gesture on (the default) or off. Hosts that already deliver emulated mouse events for touches turn it off.
func (*Runner) SetUIScale ¶
SetUIScale requests a window-wide UI scale for the next frame. A value of 1 is 100%; nonpositive and nonfinite values reset to 1, and other values are clamped to [0.25, 4]. Call on the UI thread.
func (*Runner) TitleBarActed ¶
func (r *Runner) TitleBarActed(p geom.Point, act WindowAction)
TitleBarActed tells the runner that the host itself performed act (WindowActionMaximize or WindowActionRestore) for a double click at p on a TitleBar's drag area (see DragRegions): the next frame's TitleBarW.Action of the bar under p reports act without performing it again. UI thread; it does not request a frame.
Experimental: used by the platform host (uihost).
func (*Runner) TrimCaches ¶
func (r *Runner) TrimCaches()
TrimCaches asks the runner's renderer to discard rebuildable caches and requests another frame. Call on the UI thread, between frames. It does not clear application state, editor LineCaches, current Layouts or the current presented pixels. A renderer without Trim() is left alone.
type RunnerOptions ¶
type RunnerOptions struct {
// UIScale is the initial logical UI scale. Zero defaults to 1.
UIScale float32
Theme *theme.Theme // default theme.AntDesign()
// Renderer overrides the CPU renderer (GPU backends). When it is not a
// *paint.CPU the runner calls Window.Present(nil) after rendering.
Renderer paint.Renderer
// Clock overrides time.Now (tests, deterministic screenshots).
Clock func() time.Time
// NoAnimations makes every transition jump to its end state.
NoAnimations bool
// ReduceMotion honours the user's "reduce motion" preference: every
// transition (Anim, AnimFrom, enter/leave motion, chart growth)
// jumps to its end value and decorative loops (skeleton shimmer,
// badge pulse) stand still. Unlike NoAnimations it does not change
// timers such as hover delays. Hosts that track the OS setting call
// Runner.SetReduceMotion when it changes.
ReduceMotion bool
// Content says what the window mostly shows, which lets the host pick
// a renderer suited to it (see ContentData). The host reads it once,
// when the window is created; it is ignored when Renderer or the
// TANGO_RENDERER environment variable selects a renderer.
Content ContentKind
}
RunnerOptions configure a Runner.
type SafeAreaWindow ¶
type SafeAreaWindow interface {
// SafeAreaInsets returns the distances, in logical pixels, from each
// edge of the content area to the region that is fully visible and
// free of system controls.
SafeAreaInsets() geom.Insets
}
SafeAreaWindow is implemented by windows that know the parts of their content area covered by system UI: the status bar, a display notch or camera cut-out, rounded corners, the home indicator, on-screen navigation buttons. The Runner polls it every frame, like Size.
type SchemaFormW ¶
type SchemaFormW struct {
// contains filtered or unexported fields
}
SchemaFormW renders a form from a field schema in one of the form shells (Ant Design Pro BetaSchemaForm): the same []ProField drives ProForm, ModalForm, DrawerForm, StepsForm, QueryFilter or LightFilter. Nested lists are fields of ValueType ValueFormList with ProField.List.
ui.SchemaForm(c, schema).LayoutType(ui.SchemaLayoutModalForm).
Open(&open).Title("新建规则").Values(&vals).
OnFinish(func(v ui.ProValues, done func(error)) { go save(v, done) }).
Show()
func SchemaForm ¶
func SchemaForm(c *Context, schema []ProField) *SchemaFormW
SchemaForm starts a form over schema; chain options, then Show.
ConfigProvider.Defaults("SchemaForm", ...) keys: "layoutType" (one of the SchemaLayout* names).
func (*SchemaFormW) Columns ¶
func (s *SchemaFormW) Columns(n int) *SchemaFormW
Columns lays the fields out in n grid columns (form shells).
func (*SchemaFormW) Finished ¶
func (s *SchemaFormW) Finished() bool
Finished reports a completed submit of a form shell, once.
func (*SchemaFormW) LayoutType ¶
func (s *SchemaFormW) LayoutType(t SchemaLayoutType) *SchemaFormW
LayoutType selects the form shell (default SchemaLayoutForm).
func (*SchemaFormW) OnFinish ¶
func (s *SchemaFormW) OnFinish(fn func(vals ProValues, done func(error))) *SchemaFormW
OnFinish receives the validated values of the form shells; call done (from any goroutine) when saved.
func (*SchemaFormW) Open ¶
func (s *SchemaFormW) Open(open *bool) *SchemaFormW
Open binds the visibility of ModalForm and DrawerForm.
func (*SchemaFormW) Params ¶
func (s *SchemaFormW) Params() map[string]string
Params returns the filter values as text after a QueryFilter or LightFilter Show (nil for the form shells).
func (*SchemaFormW) Readonly ¶
func (s *SchemaFormW) Readonly(on bool) *SchemaFormW
Readonly shows the values read-only (Form, ModalForm, DrawerForm).
func (*SchemaFormW) Searched ¶
func (s *SchemaFormW) Searched() bool
Searched reports a search of QueryFilter or a change of LightFilter.
func (*SchemaFormW) Title ¶
func (s *SchemaFormW) Title(t string) *SchemaFormW
Title sets the dialog title of ModalForm and DrawerForm.
func (*SchemaFormW) Values ¶
func (s *SchemaFormW) Values(v *ProValues) *SchemaFormW
Values binds the values (otherwise the shell keeps its own).
func (*SchemaFormW) Width ¶
func (s *SchemaFormW) Width(px float32) *SchemaFormW
Width sets the dialog / drawer width, or the StepsForm form width.
type SchemaLayoutType ¶
type SchemaLayoutType string
SchemaLayoutType selects the form shell of a SchemaForm.
const ( SchemaLayoutForm SchemaLayoutType = "Form" // ProForm (default) SchemaLayoutModalForm SchemaLayoutType = "ModalForm" // ProForm in a Modal (needs Open) SchemaLayoutDrawerForm SchemaLayoutType = "DrawerForm" // ProForm in a Drawer (needs Open) SchemaLayoutStepsForm SchemaLayoutType = "StepsForm" // one step per run of fields with the same Group SchemaLayoutQueryFilter SchemaLayoutType = "QueryFilter" // query form with search / reset SchemaLayoutLightFilter SchemaLayoutType = "LightFilter" // compact filter pills )
Form shells of SchemaForm.LayoutType.
type ScrollBox ¶
type ScrollBox struct {
*Box
// contains filtered or unexported fields
}
ScrollBox is a scrollable container with overlay scrollbars that appear on hover; drag a thumb to scroll, click the track to jump there, wheel or trackpad anywhere inside.
func Scroll ¶
Scroll creates a vertically scrolling column. Give it a bounded height (Grow inside a sized parent, or layout.H/MaxH).
func (*ScrollBox) MaxOffset ¶
MaxOffset returns the maximum logical offsets measured by the last paint. Subtract PaintedOffset from it to get the remaining scroll range.
func (*ScrollBox) Offset ¶
Offset returns the scroll offset: the content position at the viewport's top-left corner (top-right in RTL, where x counts from the right end).
func (*ScrollBox) PaintedOffset ¶
PaintedOffset returns the logical scroll offset used by the last paint. It stays at that position until scheduled scrolling is drawn.
func (*ScrollBox) Reveal ¶
Reveal scrolls the minimum amount that makes the vertical content range [y, y+h) visible (no-op before the first paint). Use it to keep a keyboard-selected row in view.
type SearchW ¶
type SearchW struct {
// contains filtered or unexported fields
}
SearchW is an input with a search button (Ant Input.Search, Element input with an append search button).
func (*SearchW) A11yLabel ¶
A11yLabel sets the accessible name of the search box (inside a FormItem the item label is used; the placeholder is the last resort).
func (*SearchW) AllowClear ¶
func (*SearchW) EnterButton ¶
EnterButton replaces the icon button with a primary button labelled s.
func (*SearchW) Placeholder ¶
func (*SearchW) Size ¶
func (w *SearchW) Size(s ControlSize) *SearchW
type SegmentedShape ¶
type SegmentedShape string
SegmentedShape is the outline of a Segmented control.
const ( SegmentedShapeDefault SegmentedShape = "default" // the control's corner radius SegmentedShapeRound SegmentedShape = "round" // pill-shaped track and thumb (Ant shape="round") )
type SegmentedW ¶
type SegmentedW struct {
// contains filtered or unexported fields
}
SegmentedW is a segmented control (Ant Segmented / Element el-segmented).
func Segmented ¶
func Segmented(c *Context, val *string, opts []Option) *SegmentedW
Segmented adds a segmented control bound to *val.
func (*SegmentedW) A11yLabel ¶
func (w *SegmentedW) A11yLabel(s string) *SegmentedW
A11yLabel sets the accessible name of the group (inside a FormItem the item label is used).
func (*SegmentedW) Block ¶
func (w *SegmentedW) Block() *SegmentedW
Block stretches the control to its container, items share the width.
func (*SegmentedW) Changed ¶
func (w *SegmentedW) Changed() bool
Changed reports a new selection this frame.
func (*SegmentedW) Disabled ¶
func (w *SegmentedW) Disabled(on bool) *SegmentedW
Disabled disables every option.
func (*SegmentedW) Icons ¶
func (w *SegmentedW) Icons(ics ...*icon.Icon) *SegmentedW
Icons sets an icon per option (nil entries allowed).
func (*SegmentedW) ItemRender ¶
func (w *SegmentedW) ItemRender(fn func(o Option, selected bool)) *SegmentedW
ItemRender builds the content of every option in place of its icon and label (Element el-segmented default slot, Ant options[].label as a node): fn runs inside the segment, which centres what it adds, with the option and whether it is the selected one. The option label stays the accessible name; a hint per option is a Tooltip around the content.
ui.Segmented(c, &v, opts).ItemRender(func(o ui.Option, sel bool) {
ui.Icon(c, icons[o.Value])
ui.Text(c, o.Label).Size(12)
})
func (*SegmentedW) Orientation ¶
func (w *SegmentedW) Orientation(o string) *SegmentedW
Orientation sets the direction: "horizontal" (default) or "vertical" (Ant v6 orientation, Element direction). Other values are ignored.
func (*SegmentedW) Shape ¶
func (w *SegmentedW) Shape(s SegmentedShape) *SegmentedW
Shape sets the outline: SegmentedShapeRound makes the track and the thumb pill-shaped.
func (*SegmentedW) Size ¶
func (w *SegmentedW) Size(s ControlSize) *SegmentedW
Size sets the control size.
func (*SegmentedW) Tooltips ¶
func (w *SegmentedW) Tooltips(tips ...string) *SegmentedW
Tooltips shows a tooltip per option while the pointer is over it (Ant options[].tooltip); "" entries show none.
func (*SegmentedW) Vertical ¶
func (w *SegmentedW) Vertical() *SegmentedW
Vertical stacks the options top to bottom (Ant orientation="vertical", Element direction="vertical"); they share the width of the widest one and the up / down arrow keys move the selection.
type SelectW ¶
type SelectW struct {
// contains filtered or unexported fields
}
SelectW is a dropdown select.
func (*SelectW) A11yLabel ¶
A11yLabel sets the accessible name (inside a FormItem the item label is used; the placeholder is the last resort).
func (*SelectW) AllowClear ¶
func (*SelectW) AllowCreate ¶
AllowCreate offers the typed text as a new option when no label equals it (Element allow-create); read it with Created. Implies Searchable.
func (*SelectW) Created ¶
Created returns the value of an entry created with AllowCreate this frame.
func (*SelectW) DataVersion ¶
DataVersion tells the select that the option slice was modified in place (the virtual dropdown caches by slice identity and this number).
func (*SelectW) FilterMethod ¶
FilterMethod replaces the case-insensitive label match of the search text with fn (same as VirtualSelect.FilterMethod); it is not used with Remote, whose results are already filtered. Implies Searchable.
func (*SelectW) Groups ¶
func (w *SelectW) Groups(groups []OptionGroup) *SelectW
Groups shows the options under titled groups (Ant OptGroup, Element el-option-group); the opts passed to Select are ignored. Options can also be grouped with Option.Group.
func (*SelectW) LabelRender ¶
LabelRender sets the text shown for the selected value (Ant labelRender). fn also receives values that are not among the options, as Option{Label: value, Value: value}.
func (*SelectW) ListHeight ¶
ListHeight sets the maximum dropdown height with or without virtual scrolling (Ant listHeight, 256).
func (*SelectW) NotFoundContent ¶
NotFoundContent sets the text of an empty dropdown (Ant notFoundContent, Element no-data-text / no-match-text); by default the Locale's NoData.
func (*SelectW) OpenChanged ¶
OpenChanged reports that the dropdown opened or closed this frame (Ant onOpenChange, Element visible-change); read IsOpen for the new state.
func (*SelectW) OptionRender ¶
func (w *SelectW) OptionRender(fn func(o Option, s OptionState)) *SelectW
OptionRender builds each option row's content with fn (row background, highlight and selection marks stay).
func (*SelectW) Placeholder ¶
func (*SelectW) Placement ¶
Placement sets where the dropdown opens: BottomStart (default), BottomEnd, TopStart or TopEnd (Ant placement bottomLeft / bottomRight / topLeft / topRight; Element placement). It flips when there is no room. ConfigProvider.Defaults("Select", "placement") takes the Ant names.
func (*SelectW) PrefixText ¶
PrefixText shows s before the value (Ant prefix, Element prefix slot), e.g. a field name inside the frame.
func (*SelectW) Remote ¶
Remote turns on server-side search: fn receives the typed text after Debounce (300ms by default) and should replace the options. Pair it with Loading while the request runs. Implies Searchable.
func (*SelectW) Searchable ¶
func (*SelectW) Size ¶
func (w *SelectW) Size(s ControlSize) *SelectW
func (*SelectW) SuffixIcon ¶
SuffixIcon replaces the dropdown arrow with ic (Ant suffixIcon, Element suffix-icon); it is not rotated and also stays while searching. The clear button still takes its place on hover with AllowClear.
func (*SelectW) Variant ¶
func (w *SelectW) Variant(v FieldVariant) *SelectW
Variant sets the frame look (FieldOutlined by default).
type SenderW ¶
type SenderW struct {
// contains filtered or unexported fields
}
SenderW is the chat input: an auto-growing multi-line editor where Enter sends and Shift+Enter inserts a line break, with an attachment strip, @ / command suggestions, a toolbar and a send / stop button.
func Sender ¶
Sender adds a chat input bound to *val. Read Submitted each frame and clear *val after sending:
s := ui.Sender(c, &draft).Loading(busy).Commands(cmds)
if s.Submitted() { send(draft); draft = "" }
if s.Stopped() { cancel() }
func (*SenderW) A11yLabel ¶
A11yLabel sets the accessible name of the editor (default: placeholder).
func (*SenderW) AttachButton ¶
AttachButton shows a paperclip button in the toolbar (see AttachClicked; the application opens its file dialog).
func (*SenderW) AttachClicked ¶
AttachClicked reports a click on the attach button.
func (*SenderW) Attachments ¶
func (w *SenderW) Attachments(files *[]ChatAttachment) *SenderW
Attachments shows *files as removable chips above the editor; a click on a chip's remove button deletes it from the slice (see Removed).
func (*SenderW) Header ¶
Header adds content at the top of the input (quoted message, context chips).
func (*SenderW) Loading ¶
Loading shows the stop button instead of the send button; Enter does not send and Escape (or the button) reports Stopped.
func (*SenderW) Placeholder ¶
Placeholder replaces the default placeholder.
func (*SenderW) Submitted ¶
Submitted reports Enter or a click on the send button with something to send (text or attachments).
type SettingDrawerLocale ¶
type SettingDrawerLocale struct {
Open, Title string // trigger (accessible name, tooltip) and drawer title
SettingDrawerLocale holds the ProLayout SettingDrawer texts.
type SettingDrawerW ¶
type SettingDrawerW struct {
// contains filtered or unexported fields
}
SettingDrawerW builds a SettingDrawer.
func SettingDrawer ¶
func SettingDrawer(c *Context, s *ProSettings) *SettingDrawerW
SettingDrawer starts the settings drawer editing *s; chain options, then Show.
ConfigProvider.Defaults("SettingDrawer", ...) keys: "hideColors", "hideLayout", "hideOther" (bool) hide those sections.
func (*SettingDrawerW) Changed ¶
func (w *SettingDrawerW) Changed() bool
Changed reports a settings change this frame.
func (*SettingDrawerW) Colors ¶
func (w *SettingDrawerW) Colors(cols []theme.Color) *SettingDrawerW
Colors replaces the preset theme colors.
func (*SettingDrawerW) NoTrigger ¶
func (w *SettingDrawerW) NoTrigger() *SettingDrawerW
NoTrigger hides the floating button (open it with Open).
func (*SettingDrawerW) Open ¶
func (w *SettingDrawerW) Open(v *bool) *SettingDrawerW
Open binds the open state (otherwise the drawer keeps its own).
func (*SettingDrawerW) Show ¶
func (w *SettingDrawerW) Show() *SettingDrawerW
Show builds the trigger and, when open, the drawer.
type ShortcutCaptureWindow ¶
type ShortcutCaptureWindow interface {
SetShortcutCapture(on bool)
}
ShortcutCaptureWindow is an optional host capability for shortcut recorders. While capture is on, window shortcuts (including those enabled in text fields) and native menu accelerators must yield to the focused canvas. This is not text input: it must not enable IME or a software keyboard. System-reserved keys and global OS hotkeys are outside this capability. The runner releases capture on completion, cancel, blur or removal. Calls are made on the UI thread, only when the requested state changes.
type SiderBoxW ¶
type SiderBoxW struct {
*Box
// contains filtered or unexported fields
}
SiderBoxW is the side column Sider returns; it embeds the column's Box.
type SiderW ¶
type SiderW struct {
// contains filtered or unexported fields
}
SiderW builds a collapsible Sider (Ant Layout.Sider collapsible).
ui.CollapsibleSider(c, 200, &collapsed).Breakpoint(ui.LG).Body(menu)
ConfigProvider.Defaults("Sider", ...) keys: "breakpoint" (Breakpoint), "collapsedWidth" (float32), "theme" ("light" | "dark").
func CollapsibleSider ¶
CollapsibleSider starts a sider whose collapsed state lives in *collapsed: a trigger bar at the bottom toggles it and Breakpoint collapses it on narrow windows. Chain options, then Body.
func (*SiderW) Breakpoint ¶
func (s *SiderW) Breakpoint(bp Breakpoint) *SiderW
Breakpoint collapses the sider when the window becomes narrower than bp and expands it when it grows past it again (Ant breakpoint).
func (*SiderW) CollapsedWidth ¶
CollapsedWidth sets the width when collapsed (default the theme's).
func (*SiderW) ReverseArrow ¶
ReverseArrow flips the trigger arrow (a sider on the end side: the right, or the left in a right-to-left scope).
type SkeletonW ¶
type SkeletonW struct {
// contains filtered or unexported fields
}
SkeletonW is a loading placeholder: optional avatar, a title bar and paragraph lines, with an optional shimmer ("active").
func Skeleton ¶
Skeleton starts a skeleton with a title and paragraph rows: three rows, or two next to an avatar or without a title (antd).
ConfigProvider.Defaults("Skeleton", ...) keys: "active", "round" (bool).
func (*SkeletonW) AvatarSize ¶
AvatarSize sets the avatar placeholder size in px (antd avatar.size; default the large control height, 40).
func (*SkeletonW) ParagraphWidth ¶
ParagraphWidth sets the paragraph line widths (antd paragraph.width): one value sets the last line, several set the lines in order; fractions when 0 < w <= 1, else px. The default last line is 61%.
func (*SkeletonW) Throttle ¶
Throttle delays the switch (EP throttle): the skeleton appears only after Loading(true) lasted leading and goes away only after Loading(false) lasted trailing (0: at once), so quick loads do not flash. The first frame shows the content unless ThrottleInitial(true).
func (*SkeletonW) ThrottleInitial ¶
ThrottleInitial sets what a throttled skeleton shows before its first delay ends: true the skeleton, false (default) the content (EP throttle.initVal).
func (*SkeletonW) TitleWidth ¶
TitleWidth sets the title bar width (antd title.width): a fraction of the row when 0 < w <= 1, else px. The default is 38%, 50% next to an avatar, full width without a paragraph.
type SliderLocale ¶
type SliderLocale struct {
Min, Max string
// contains filtered or unexported fields
}
SliderLocale holds the accessible names of the two SliderRange handles.
type SliderW ¶
type SliderW struct {
// contains filtered or unexported fields
}
SliderW is a slider; chain modifiers after Slider / SliderRange.
func Slider ¶
Slider adds a slider bound to *val in [min,max] (step 1).
ui.Slider(c, &v, 0, 100).Marks(map[float64]string{0: "0°C", 100: "100°C"}).Tooltip(nil)
ui.Slider(c, &v, 0, 100).Vertical(200)
ui.Slider(c, &v, 0, 10).Step(0.5).WithInput()
func SliderRange ¶
SliderRange adds a two-handle slider bound to *lo and *hi (Ant range, Element range).
func (*SliderW) A11yLabel ¶
A11yLabel sets the accessible name (inside a FormItem the item label is used). A range names its group; the handles are "minimum" / "maximum".
func (*SliderW) AllowCross ¶
AllowCross sets whether a dragged range handle may pass the other one (they swap values and the dragged handle continues as the other end). Default true; false stops it at the other handle. Keyboard steps never cross.
func (*SliderW) ChangeComplete ¶
ChangeComplete reports the end of a change (antd onChangeComplete): the frame the pointer is released after dragging changed the value, or a keyboard / number box / assistive change.
func (*SliderW) Included ¶
Included sets whether the part from the start to the value (a range: between the handles) is filled (antd included, default true); false leaves the rail plain, for marks that are points rather than ranges.
func (*SliderW) Keyboard ¶
Keyboard turns the arrow / Page / Home / End keys on (the default) or off (antd keyboard); the handles stay focusable.
func (*SliderW) Pushable ¶
Pushable keeps range handles at least gap apart: moving one towards the other pushes it along (until it reaches the end of the slider). It turns crossing off. 0 disables.
func (*SliderW) Reverse ¶
Reverse runs the slider the other way (antd reverse): max at the inline start (at the bottom when vertical). The arrow keys follow the visual direction.
func (*SliderW) Tooltip ¶
Tooltip sets the tooltip formatter of the handle value (nil: the plain number). The tooltip shows while a handle is hovered, dragged or focused with the keyboard; TooltipOpen forces it.
func (*SliderW) TooltipOpen ¶
TooltipOpen always shows (true) or never shows (false) the tooltips.
func (*SliderW) Vertical ¶
Vertical lays the slider out vertically with the given height (min at the bottom).
func (*SliderW) WithInput ¶
WithInput adds InputNumbers bound to the values (Element show-input). A single horizontal slider has the box after the track; a range has the start box before the track and the end box after it. Vertically the boxes go below the track (a range: the end box above, the start box below).
type SortOrder ¶
type SortOrder uint8
SortOrder is a column sort direction.
Append-only: never reorder or insert; the zero value stays SortNone.
type SortState ¶
SortState is a column's sort, owned by the app (controlled) or by the table (uncontrolled).
type SpaceW ¶
type SpaceW struct {
// contains filtered or unexported fields
}
SpaceW sets the spacing between inline items (Ant Space).
func Space ¶
Space starts a horizontal group with the Small (8px) gap and centered items; chain options, then Body. ConfigProvider's Defaults("Space", Props{...}) keys: "size" (ControlSize), "orientation" ("horizontal" | "vertical").
ui.Space(c).Body(func() { ui.Button(c, "A"); ui.Button(c, "B") })
ui.Space(c).Orientation("vertical").Size(ui.Large).Body(fn)
ui.Space(c).Separator(func() { ui.VDivider(c) }).Body(fn)
func (*SpaceW) Align ¶
Align positions items on the cross axis (default center; start when vertical).
func (*SpaceW) Orientation ¶
Orientation sets the direction: "horizontal" (default) or "vertical" (Ant v6 orientation, which replaces direction; Element direction). Vertical items align to the start. Other values are ignored.
func (*SpaceW) Separator ¶
Separator builds a separator between every two items (Ant v6 separator, Element spacer), e.g. ui.VDivider or a Text; it is built once per gap, never before the first item or after the last.
func (*SpaceW) Size ¶
func (s *SpaceW) Size(sz ControlSize) *SpaceW
Size sets the gap with a size token (Small 8, Middle 16, Large 24).
type Span ¶
type Span struct {
Text string
Bold bool
Italic bool // synthetic oblique (text.Style.Italic)
Strike bool
Underline bool
Code bool // inline code box, monospace
Mono bool // monospace without the box
Mark bool // highlighted background
Link string
Color theme.Color // zero: default color
Size float32 // 0: paragraph size
}
Span is a run of styled inline text.
func ParseMarkdownInline ¶
ParseMarkdownInline converts inline Markdown (emphasis, code, links...) into spans for RichText.
type SpinW ¶
type SpinW struct {
// contains filtered or unexported fields
}
SpinW is a loading indicator: sizes, description, delayed show, progress percent and a nested mode (Wrap) that dims the wrapped content.
func Spin ¶
Spin adds a loading indicator; chain options. Wrap turns it into a container that covers its content while spinning:
ui.Spin(c).Size(ui.Large).Description("加载中")
ui.Spin(c).Spinning(loading).Wrap(func() { ... })
ConfigProvider.Defaults("Spin", ...) keys: "size", "delay", "description" ("tip" before antd 6).
func (*SpinW) Delay ¶
Delay shows the indicator only after spinning lasted d (avoids flashes); it hides at once when spinning stops (antd delay).
func (*SpinW) Description ¶
Description shows a text under the indicator (antd 6 description).
func (*SpinW) Indicator ¶
Indicator replaces the indicator with a spinning icon (antd indicator, EP spinner).
func (*SpinW) IndicatorSize ¶
IndicatorSize sets a custom indicator size in px.
func (*SpinW) Percent ¶
Percent replaces the indicator with a progress ring (0..100); at 0 the indicator still spins (antd).
func (*SpinW) PercentAuto ¶
PercentAuto shows a simulated progress that slows down as it nears 100 while spinning (antd percent="auto": every 200ms it advances 5% of the rest up to 30, 3% up to 70, 1% up to 96).
func (*SpinW) Size ¶
func (s *SpinW) Size(sz ControlSize) *SpinW
Size sets small, middle (default) or large.
type SplitterPanelW ¶
type SplitterPanelW struct {
// contains filtered or unexported fields
}
SplitterPanelW is one pane of a Splitter.
func SplitterPanel ¶
func SplitterPanel(c *Context) *SplitterPanelW
SplitterPanel adds a pane; call it inside Splitter.Body.
func (*SplitterPanelW) AlwaysShowCollapse ¶
func (p *SplitterPanelW) AlwaysShowCollapse(on bool) *SplitterPanelW
AlwaysShowCollapse keeps the adjacent bar's collapse controls visible without hover, like antd's collapsible.showCollapsibleIcon=true. It applies to Collapsible and Tango's single-arrow CollapseToggle.
func (*SplitterPanelW) Body ¶
func (p *SplitterPanelW) Body(fn func()) *SplitterPanelW
Body sets the pane content.
func (*SplitterPanelW) CollapseOffsets ¶
func (p *SplitterPanelW) CollapseOffsets(expanded, collapsed float32) *SplitterPanelW
CollapseOffsets sets the toggle center's distance from the bar in logical pixels. Positive values shift it toward the expanded pane, or toward its neighbor when collapsed. Use with CollapseToggle.
func (*SplitterPanelW) CollapseToggle ¶
func (p *SplitterPanelW) CollapseToggle(collapseTip, expandTip string) *SplitterPanelW
CollapseToggle shows a single arrow on the adjacent bar, like an IDE side bar: it points at this pane and collapses it, then flips and restores the saved size. Hovering the arrow shows collapseTip (expandTip while collapsed); the tips also name the button for screen readers and default to the locale's Collapse / Expand. Enter on the bar toggles it.
func (*SplitterPanelW) Collapsed ¶
func (p *SplitterPanelW) Collapsed(on bool) *SplitterPanelW
Collapsed controls whether this pane is folded. Use Collapsible or CollapseToggle to add a bar control and OnCollapse to accept its changes.
func (*SplitterPanelW) Collapsible ¶
func (p *SplitterPanelW) Collapsible() *SplitterPanelW
Collapsible shows collapse arrows on the adjacent bars.
func (*SplitterPanelW) DefaultPercent ¶
func (p *SplitterPanelW) DefaultPercent(f float32) *SplitterPanelW
DefaultPercent sets the initial size as a fraction (0.3 = 30%).
func (*SplitterPanelW) DefaultSize ¶
func (p *SplitterPanelW) DefaultSize(px float32) *SplitterPanelW
DefaultSize sets the initial size in pixels.
func (*SplitterPanelW) Max ¶
func (p *SplitterPanelW) Max(px float32) *SplitterPanelW
Max sets the maximum size in pixels.
func (*SplitterPanelW) MaxPercent ¶
func (p *SplitterPanelW) MaxPercent(f float32) *SplitterPanelW
func (*SplitterPanelW) Min ¶
func (p *SplitterPanelW) Min(px float32) *SplitterPanelW
Min sets the minimum size in pixels.
func (*SplitterPanelW) MinPercent ¶
func (p *SplitterPanelW) MinPercent(f float32) *SplitterPanelW
MinPercent / MaxPercent limit the size as a fraction of the splitter (antd min / max "20%"); with Min / Max too, the tighter limit wins. A minimum above the maximum keeps the pane at the minimum.
func (*SplitterPanelW) OnCollapse ¶
func (p *SplitterPanelW) OnCollapse(fn func(bool)) *SplitterPanelW
OnCollapse reports whether a bar action folded or restored this pane. Programmatic changes to Collapsed do not emit this callback.
func (*SplitterPanelW) OnResize ¶
func (p *SplitterPanelW) OnResize(fn func(float32)) *SplitterPanelW
OnResize reports an expanded pane's new size in logical pixels when a bar is moved by the user. Lazy pointer drags report on release.
func (*SplitterPanelW) Resizable ¶
func (p *SplitterPanelW) Resizable(on bool) *SplitterPanelW
Resizable(false) locks the bars next to this pane.
func (*SplitterPanelW) Size ¶
func (p *SplitterPanelW) Size(px float32) *SplitterPanelW
Size controls the expanded pane size in logical pixels along the splitter's axis. A pane without Size shares the remaining space. Use OnResize to accept changes made with the bar.
type SplitterW ¶
type SplitterW struct {
// contains filtered or unexported fields
}
SplitterW lays panes side by side with draggable bars.
func Splitter ¶
Splitter starts a split view; chain options, then Body with SplitterPanel calls.
ConfigProvider.Defaults("Splitter", ...) keys: "orientation" ("vertical"; antd 6), "layout" (its deprecated name), "lazy", "withHandle" (bool).
Under shadcn/ui this is Resizable: a 1px border line, WithHandle adds the grip box of ResizableHandle withHandle.
func (*SplitterW) DragEnded ¶
DragEnded reports the bar whose pointer drag ended this frame (released or cancelled). In Lazy mode the sizes are already committed.
func (*SplitterW) DragStarted ¶
DragStarted reports the bar (1-based: bar i sits before pane i) whose pointer drag began this frame.
func (*SplitterW) KeyboardMinimumCap ¶
KeyboardMinimumCap caps each pane's keyboard-only minimum to the given fraction of the adjacent pair's total size. A non-positive value uses the pane minima unchanged. Pointer dragging always uses the pane minima.
func (*SplitterW) KeyboardStep ¶
KeyboardStep sets arrow and Shift+arrow increments as fractions of the two adjacent panes' total size. A positive step also restricts arrows to the splitter's axis. Zero restores the default 10 px step.
func (*SplitterW) KeyboardStepPixels ¶
KeyboardStepPixels sets arrow and Shift+arrow increments in logical pixels. A positive step restricts arrows to the splitter's axis.
func (*SplitterW) Lazy ¶
Lazy makes a drag show only a preview line; the panes keep their sizes until the pointer is released, then the new ratio is committed at once (Changed reports it on that frame). Keyboard resizing is unaffected.
func (*SplitterW) Orientation ¶
Orientation lays the panes out "horizontal" (default, side by side) or "vertical" (antd 6 orientation; layout deprecated).
func (*SplitterW) PixelSizes ¶
PixelSizes returns the effective pane sizes in logical pixels along the splitter's axis, excluding the bars. Call it after Body.
func (*SplitterW) Style ¶
Style applies layout options (give the splitter a size, e.g. layout.H(200)).
func (*SplitterW) WithHandle ¶
WithHandle draws a grip on every resizable bar (shadcn ResizableHandle withHandle).
type StatisticCardDividerW ¶
type StatisticCardDividerW struct {
// contains filtered or unexported fields
}
StatisticCardDividerW is an explicit Pro statistic divider.
func StatisticCardDivider ¶
func StatisticCardDivider(c *Context, orientation string) *StatisticCardDividerW
StatisticCardDivider builds StatisticCard.Divider. Empty orientation reads the Defaults key "orientation" and otherwise defaults to vertical.
func (*StatisticCardDividerW) Layout ¶
func (w *StatisticCardDividerW) Layout(opts ...layout.Option) *StatisticCardDividerW
Layout applies layout options to the divider.
type StatisticCardLocale ¶
type StatisticCardLocale struct {
Up, Down string
// contains filtered or unexported fields
}
StatisticCardLocale holds the accessible names of the trend marks.
type StatisticCardOperationW ¶
type StatisticCardOperationW struct {
// contains filtered or unexported fields
}
StatisticCardOperationW is an operator between statistics.
func StatisticCardOperation ¶
func StatisticCardOperation(c *Context, value string) *StatisticCardOperationW
StatisticCardOperation builds StatisticCard.Operation using heading-4 typography and Pro's marginLG block spacing.
func (*StatisticCardOperationW) Layout ¶
func (w *StatisticCardOperationW) Layout(opts ...layout.Option) *StatisticCardOperationW
Layout applies layout options to the operation.
type StatisticCardW ¶
type StatisticCardW struct {
// contains filtered or unexported fields
}
StatisticCardW builds a StatisticCard.
func StatisticCard ¶
func StatisticCard(c *Context, title string) *StatisticCardW
StatisticCard starts a statistic card titled title (the statistic's label; use CardTitle for a card header). Chain options, then Show.
func (*StatisticCardW) Bordered ¶
func (w *StatisticCardW) Bordered() *StatisticCardW
Bordered draws a border.
func (*StatisticCardW) Card ¶
func (w *StatisticCardW) Card() *ProCardW
Card returns the underlying ProCard (valid after Show for queries).
func (*StatisticCardW) CardTitle ¶
func (w *StatisticCardW) CardTitle(s string) *StatisticCardW
CardTitle shows a card header with title (the statistic keeps its own).
func (*StatisticCardW) Chart ¶
func (w *StatisticCardW) Chart(fn func()) *StatisticCardW
Chart builds the chart area (a chart.Tiny*, any chart, or content).
func (*StatisticCardW) ChartPlace ¶
func (w *StatisticCardW) ChartPlace(p string) *StatisticCardW
ChartPlace puts the chart below (ChartBottom, default), left or right of the statistic.
func (*StatisticCardW) Clicked ¶
func (w *StatisticCardW) Clicked() bool
Clicked reports a click on a hoverable card.
func (*StatisticCardW) ColSpan ¶
func (w *StatisticCardW) ColSpan(span int) *StatisticCardW
ColSpan sizes the card in a parent ProCard / StatisticCardGroup row.
func (*StatisticCardW) Desc ¶
func (w *StatisticCardW) Desc(title, value, trend string) *StatisticCardW
Desc adds an inline statistic under the value ("Week 12% ▲"); trend is "up", "down" or "".
func (*StatisticCardW) Description ¶
func (w *StatisticCardW) Description(fn func()) *StatisticCardW
Description builds custom content under the value.
func (*StatisticCardW) Extra ¶
func (w *StatisticCardW) Extra(fn func()) *StatisticCardW
Extra builds the header actions.
func (*StatisticCardW) Footer ¶
func (w *StatisticCardW) Footer(fn func()) *StatisticCardW
Footer builds a footer below a divider.
func (*StatisticCardW) Ghost ¶
func (w *StatisticCardW) Ghost() *StatisticCardW
Ghost removes the card background and outer padding.
func (*StatisticCardW) Hoverable ¶
func (w *StatisticCardW) Hoverable() *StatisticCardW
Hoverable lifts the card on hover.
func (*StatisticCardW) Icon ¶
func (w *StatisticCardW) Icon(ic *icon.Icon) *StatisticCardW
Icon shows an icon left of the statistic.
func (*StatisticCardW) Layout ¶
func (w *StatisticCardW) Layout(o ...layout.Option) *StatisticCardW
Layout applies layout options to the card.
func (*StatisticCardW) Loading ¶
func (w *StatisticCardW) Loading(on bool) *StatisticCardW
Loading shows the card's loading placeholder.
func (*StatisticCardW) Prefix ¶
func (w *StatisticCardW) Prefix(s string) *StatisticCardW
Prefix sets text before the value (e.g. a currency sign).
func (*StatisticCardW) StatisticLayout ¶
func (w *StatisticCardW) StatisticLayout(mode string) *StatisticCardW
StatisticLayout sets the statistic layout: vertical (default), horizontal (title and value at opposite ends), or inline (compact, secondary value).
func (*StatisticCardW) Status ¶
func (w *StatisticCardW) Status(s string) *StatisticCardW
Status shows a colored dot before the title ("success", "processing", "warning", "error", "default").
func (*StatisticCardW) Suffix ¶
func (w *StatisticCardW) Suffix(s string) *StatisticCardW
Suffix sets text after the value (e.g. a unit).
func (*StatisticCardW) Tooltip ¶
func (w *StatisticCardW) Tooltip(tip string) *StatisticCardW
Tooltip adds a question icon after the title showing tip on hover.
func (*StatisticCardW) Trend ¶
func (w *StatisticCardW) Trend(dir string) *StatisticCardW
Trend marks the value as rising ("up") or falling ("down").
func (*StatisticCardW) TrendColors ¶
func (w *StatisticCardW) TrendColors(up, down theme.Color) *StatisticCardW
TrendColors overrides the rising / falling colors (default: error red for up, success green for down, as in Pro).
func (*StatisticCardW) Value ¶
func (w *StatisticCardW) Value(v float64, precision int) *StatisticCardW
Value sets a number formatted with thousands separators.
func (*StatisticCardW) ValueColor ¶
func (w *StatisticCardW) ValueColor(col theme.Color) *StatisticCardW
ValueColor colors the value.
func (*StatisticCardW) ValueText ¶
func (w *StatisticCardW) ValueText(s string) *StatisticCardW
ValueText sets the value as preformatted text.
type StatisticW ¶
type StatisticW struct {
// contains filtered or unexported fields
}
StatisticW shows a labelled number.
func Statistic ¶
func Statistic(c *Context, title string, value float64, precision int) *StatisticW
Statistic adds a statistic display. The value is shown with precision decimals, cut (not rounded) like antd and Element Plus; a negative precision shows the decimals the value has. NaN and ±Inf are shown as "NaN" and "Infinity".
ConfigProvider.Defaults("Statistic", ...) keys: "groupSeparator", "decimalSeparator" (string).
func (*StatisticW) Color ¶
func (s *StatisticW) Color(col theme.Color) *StatisticW
func (*StatisticW) CountUp ¶
func (s *StatisticW) CountUp(v float64, precision int) *StatisticW
CountUp animates the displayed value from 0 to v (precision digits) over the slow duration ×4 the first time the statistic appears.
func (*StatisticW) DecimalSeparator ¶
func (s *StatisticW) DecimalSeparator(sep string) *StatisticW
DecimalSeparator sets the decimal point (default ".").
func (*StatisticW) Formatter ¶
func (s *StatisticW) Formatter(fn func(v float64) string) *StatisticW
Formatter formats the value with fn instead (antd / Element formatter).
func (*StatisticW) GroupSeparator ¶
func (s *StatisticW) GroupSeparator(sep string) *StatisticW
GroupSeparator sets the thousands separator (default ",").
func (*StatisticW) Layout ¶
func (s *StatisticW) Layout(o ...layout.Option) *StatisticW
Layout applies layout options.
func (*StatisticW) Loading ¶
func (s *StatisticW) Loading(on bool) *StatisticW
Loading replaces the value with a skeleton bar.
func (*StatisticW) Prefix ¶
func (s *StatisticW) Prefix(p string) *StatisticW
func (*StatisticW) PrefixIcon ¶
func (s *StatisticW) PrefixIcon(ic *icon.Icon) *StatisticW
func (*StatisticW) Suffix ¶
func (s *StatisticW) Suffix(p string) *StatisticW
func (*StatisticW) Value ¶
func (s *StatisticW) Value(v string) *StatisticW
func (*StatisticW) ValueSize ¶
func (s *StatisticW) ValueSize(px float32) *StatisticW
ValueSize sets the value font size (line height follows).
type StatusBarItemW ¶
type StatusBarItemW struct {
// contains filtered or unexported fields
}
StatusBarItemW is one entry of a StatusBar: an icon, text, a count badge and a progress bar, in that order, any of them optional.
func StatusBarItem ¶
func StatusBarItem(c *Context, label string) *StatusBarItemW
StatusBarItem adds an entry to the StatusBar being built (outside a bar it draws the same, at the bar's height). label is the visible text and the accessible name; an icon-only item ("" label) is named by its Tooltip or A11yLabel.
Items are buttons by default: hover highlight, Tab stop, Enter / Space or a click report Clicked. Static makes a plain read-out.
func (*StatusBarItemW) A11yLabel ¶
func (w *StatusBarItemW) A11yLabel(s string) *StatusBarItemW
A11yLabel replaces the accessible name.
func (*StatusBarItemW) Badge ¶
func (w *StatusBarItemW) Badge(n int) *StatusBarItemW
Badge shows a count after the text (0 hides it; above 99 shows "99+").
func (*StatusBarItemW) BadgeText ¶
func (w *StatusBarItemW) BadgeText(s string) *StatusBarItemW
BadgeText shows s in the badge ("" hides it).
func (*StatusBarItemW) Clicked ¶
func (w *StatusBarItemW) Clicked() bool
Clicked reports a click (or Enter / Space) on the item.
func (*StatusBarItemW) Disabled ¶
func (w *StatusBarItemW) Disabled(on bool) *StatusBarItemW
Disabled dims the item and stops it from reacting.
func (*StatusBarItemW) Hovered ¶
func (w *StatusBarItemW) Hovered() bool
Hovered reports whether the pointer is over the item.
func (*StatusBarItemW) Icon ¶
func (w *StatusBarItemW) Icon(ic *icon.Icon) *StatusBarItemW
Icon shows ic before the text.
func (*StatusBarItemW) Loading ¶
func (w *StatusBarItemW) Loading(on bool) *StatusBarItemW
Loading spins the icon (icon.Loading when the item has none): a task is running.
func (*StatusBarItemW) Progress ¶
func (w *StatusBarItemW) Progress(p float64) *StatusBarItemW
Progress shows a small determinate progress bar after the text; p runs from 0 to 1 (a negative p hides it). Use Loading for work of unknown length.
func (*StatusBarItemW) Static ¶
func (w *StatusBarItemW) Static() *StatusBarItemW
Static makes the item a plain read-out: no hover highlight, not a Tab stop, never Clicked (a Tooltip still shows on hover).
func (*StatusBarItemW) Status ¶
func (w *StatusBarItemW) Status(s string) *StatusBarItemW
Status fills the item with a status color ("warning", "error", "success", "info", "primary"), as VS Code marks problems or a remote connection.
func (*StatusBarItemW) Tooltip ¶
func (w *StatusBarItemW) Tooltip(tip string) *StatusBarItemW
Tooltip shows tip above the item while the pointer rests on it or while it has keyboard focus; screen readers get it as the description (as the name of an icon-only item).
type StatusBarLocale ¶
type StatusBarLocale struct {
Label string // accessible name of the bar ("状态栏")
// contains filtered or unexported fields
}
StatusBarLocale holds the StatusBar texts.
type StatusBarW ¶
type StatusBarW struct {
// contains filtered or unexported fields
}
StatusBarW is the strip at the bottom of a workbench window (VS Code / JetBrains status bar): items at its start (Left) and end (Right).
func StatusBar ¶
func StatusBar(c *Context) *StatusBarW
StatusBar adds a status bar; fill its two sides with StatusBarItem:
ui.StatusBar(c).
Left(func() {
if ui.StatusBarItem(c, "main").Icon(icon.Branch).Tooltip("切换分支").Clicked() { ... }
ui.StatusBarItem(c, "").Icon(icon.Sync).Loading(true)
}).
Right(func() {
ui.StatusBarItem(c, "Ln 12, Col 5")
ui.StatusBarItem(c, "UTF-8").Static()
})
Left and right are logical: in RTL the sides swap. The bar stretches across its parent column; the left side clips when the items do not fit.
func (*StatusBarW) A11yLabel ¶
func (s *StatusBarW) A11yLabel(name string) *StatusBarW
A11yLabel replaces the accessible name (Locale.StatusBar.Label).
func (*StatusBarW) Layout ¶
func (s *StatusBarW) Layout(o ...layout.Option) *StatusBarW
Layout adds layout options to the bar (margins, width).
func (*StatusBarW) Left ¶
func (s *StatusBarW) Left(fn func()) *StatusBarW
Left builds the items at the bar's start.
func (*StatusBarW) Right ¶
func (s *StatusBarW) Right(fn func()) *StatusBarW
Right builds the items at the bar's end.
func (*StatusBarW) Status ¶
func (s *StatusBarW) Status(st string) *StatusBarW
Status fills the whole bar with a status color ("primary", "success", "warning", "error", "info"; "" the default neutral bar), as VS Code colors it while debugging or without a folder. Item text switches to the matching on-solid color.
type StepDot ¶
type StepDot struct {
Index int // 0-based step index
Status string // "wait", "process", "finish", "error" or the finish status ("success")
Title string // the step's title
Rect geom.Rect // the area of the default dot; draw around its center
Color theme.Color // the default dot color for Status
// Default draws the standard dot, so a renderer can decorate it.
Default func()
// contains filtered or unexported fields
}
StepDot describes one dot to a custom dot renderer (DotRender).
type StepItem ¶
type StepItem struct {
Title string
SubTitle string
// Description is the text under the title.
//
// Deprecated: use Content (antd 6 items[].content).
Description string
Content string // text under the title (antd 6 content); wins over Description
Icon *icon.Icon // custom icon replaces the numbered circle
Status string // override: "wait", "process", "finish", "error"
Disabled bool // not clickable
// contains filtered or unexported fields
}
StepItem is one entry of Steps.
type StepsFormStep ¶
type StepsFormStep struct {
Title, Description string
Fields []ProField
Columns int
// Children builds extra items after the fields (FormList ...).
Children func(f *FormW)
}
StepsFormStep is one step of a StepsForm.
type StepsFormW ¶
type StepsFormW struct {
// contains filtered or unexported fields
}
StepsFormW splits a form into steps (Ant Design Pro StepsForm): the current step's fields validate before moving on; the last step submits the values of all steps.
func StepsForm ¶
func StepsForm(c *Context, steps []StepsFormStep) *StepsFormW
StepsForm starts a step form; chain options, then Show.
func (*StepsFormW) Current ¶
func (s *StepsFormW) Current() int
Current returns the 0-based current step (valid after Show).
func (*StepsFormW) Finished ¶
func (s *StepsFormW) Finished() bool
Finished reports a completed submit of the last step, once.
func (*StepsFormW) OnFinish ¶
func (s *StepsFormW) OnFinish(fn func(vals ProValues, done func(error))) *StepsFormW
OnFinish receives the values after the last step validated; call done (from any goroutine) when saved.
func (*StepsFormW) SetCurrent ¶
func (s *StepsFormW) SetCurrent(i int) *StepsFormW
SetCurrent jumps to step i (no validation).
func (*StepsFormW) Show ¶
func (s *StepsFormW) Show() *StepsFormW
Show builds the steps and the current step's form.
func (*StepsFormW) Values ¶
func (s *StepsFormW) Values(v *ProValues) *StepsFormW
Values binds the values of all steps.
func (*StepsFormW) Width ¶
func (s *StepsFormW) Width(px float32) *StepsFormW
Width sets the form width under the steps (default 600).
type StepsW ¶
type StepsW struct {
// contains filtered or unexported fields
}
StepsW shows progress through a sequence: horizontal / vertical, dot style, small size, label placement, custom icons and clickable steps.
func Steps ¶
Steps starts a step bar; chain options, then Show:
ui.Steps(c, items).Current(1).Status("error").Show()
ConfigProvider.Defaults("Steps", ...) keys: "type" ("default" | "navigation" | "inline" | "panel" | "dot"), "size" (ControlSize or "small"), "orientation" / "direction" ("vertical"), "titlePlacement" / "labelPlacement" ("vertical"), "variant" ("filled" | "outlined"), "progressDot" (bool), "maxCount" (int). The antd 6 names (orientation, titlePlacement, type "dot", items[].content) win over the deprecated ones.
Out-of-range Current values are kept: below 0 every step waits, past the last one every step is finished (antd).
func (*StepsW) DotRender ¶
DotRender uses the dot style with dots drawn by fn (Ant progressDot as a function). fn gets the step index and status with the dot's rectangle, and may call d.Default to draw the standard dot first. It also draws the dots of the inline type.
ui.Steps(c, items).Current(1).DotRender(func(l *paint.List, d ui.StepDot) {
d.Default()
if d.Status == "process" {
p := d.Rect.Center()
l.StrokePath(paint.NewPath().Circle(p.X, p.Y, 8), paint.StrokeStyle{Width: 1}, d.Color)
}
})
func (*StepsW) FinishStatus ¶
FinishStatus sets the status shown by finished steps ("success" paints them green, Element finish-status).
func (*StepsW) Initial ¶
Initial numbers the steps from initial+1; Current, Clickable and the bound value count from it too (antd initial).
func (*StepsW) Inline ¶
Inline uses the inline type (Ant type="inline"): a compact row of small dots on a line with the titles under them, sized to its content so it fits inside list rows and cards. Descriptions are not drawn; they stay in the accessible description.
func (*StepsW) LabelVertical
deprecated
func (*StepsW) MaxCount ¶
MaxCount shows at most n steps (n >= 3; antd 6.7 maxCount): the first, the last and the current step stay, the nearest ones fill the other slots and each hidden range becomes a disabled ellipsis step whose status sums it up (error if any hidden step failed, finish if all are done).
func (*StepsW) Orientation ¶
Orientation lays the steps out "horizontal" (default) or "vertical" (antd 6 orientation; direction is its deprecated name).
func (*StepsW) Panel ¶
Panel uses the panel type (Ant type="panel"): every step is an arrow-shaped panel sharing the row, the current one highlighted.
func (*StepsW) Percent ¶
Percent shows the progress (0..100) of the current step as a ring around its icon (Ant percent).
func (*StepsW) Size ¶
func (s *StepsW) Size(sz ControlSize) *StepsW
Size sets the size (Small or Middle).
func (*StepsW) Status ¶
Status sets the status of the current step ("process", "error", "finish", "wait").
func (*StepsW) TitlePlacement ¶
TitlePlacement puts the titles beside the icons ("horizontal", default) or under them ("vertical"; antd 6 titlePlacement, labelPlacement deprecated). Dot steps always put them under.
func (*StepsW) Type ¶
Type selects "default", "navigation" (Ant type="navigation": steps as tabs with chevrons, the current one underlined; Element's simple steps look the same way in the Element theme; "simple" is accepted too), "inline" (see Inline) or "panel" (see Panel).
type SwitchW ¶
type SwitchW struct {
// contains filtered or unexported fields
}
SwitchW is a toggle switch.
func SwitchValue ¶
func SwitchValue[T comparable](c *Context, val *T, on, off T) *SwitchW
SwitchValue adds a switch bound to an arbitrary value (Element active-value / inactive-value): it is on while *val == on, and toggling writes on or off into *val. Any other value shows the switch off.
func (*SwitchW) A11yLabel ¶
A11yLabel sets the accessible name (a switch has no visible label; inside a FormItem the item label is used).
func (*SwitchW) ActionIcons ¶
ActionIcons shows an icon on the thumb (Element active-action-icon / inactive-action-icon), in the track color of the state. Either may be nil.
func (*SwitchW) BeforeChange ¶
BeforeChange is asked before every toggle with the value the switch would take; returning false keeps the current value.
func (*SwitchW) BeforeChangeAsync ¶
BeforeChangeAsync asks fn before every toggle; the switch shows loading and ignores clicks until fn calls done (from any goroutine, once): with true the switch takes next, with false it stays. done wakes the window.
func (*SwitchW) Icons ¶
Icons shows on / off icons inside the track (Element inline-prompt with active-icon / inactive-icon). Either may be nil.
func (*SwitchW) OuterTexts ¶
OuterTexts shows labels beside the track (Element active-text / inactive-text): off before it, on after it; the label of the current state takes the brand color. Clicking a label toggles the switch.
func (*SwitchW) Size ¶
func (w *SwitchW) Size(s ControlSize) *SwitchW
Size sets the switch size (Small, Middle or Large).
type TabItem ¶
type TabItem struct {
Key, Label string
Icon *icon.Icon
Disabled bool
NoClose bool // no close button on this tab of a Closable bar
// contains filtered or unexported fields
}
TabItem is a tab.
type TableColumn ¶
type TableColumn struct {
Key string
Title string
// Width fixes the width; 0 shares the remaining space by Grow (default
// 1), never below MinWidth (default 80).
Width float32
Grow float32
MinWidth float32
// Align aligns the cell and header text: AlignLeft / AlignRight
// (AlignStart / AlignEnd) follow the direction, so an end-aligned
// numeric column lines up on the left in RTL; AlignPhysicalLeft /
// AlignPhysicalRight never flip.
Align TextAlign
// Fixed pins the column ("left" | "right": start | end, see FixedLeft)
// while scrolling sideways.
Fixed string
// Ellipsis shows the full text in a tooltip when a truncated cell is
// hovered (text cells stay on one line).
Ellipsis bool
// Wrap lets the cell text wrap onto several lines; rows grow to fit
// their tallest cell (measured, also under virtual scrolling). Render
// cells of a Wrap column wrap their widgets and are measured after
// layout. Wrap and Ellipsis are exclusive: Wrap wins.
Wrap bool
// Hidden hides the column until it is enabled in the column settings.
Hidden bool
// Sortable shows the sorter. With Compare the table sorts locally;
// without it the app sorts (server-side) using the reported SortState.
Sortable bool
Compare func(a, b int) int
// SortMultiple > 0 lets this column take part in multi-column sorting;
// a higher value has a higher priority.
SortMultiple int
// DefaultSort is the initial order when the table owns its sort state.
DefaultSort SortOrder
// SortDirections lists the orders a sorter click cycles through
// (Ant Design sortDirections, Element Plus sort-orders); after the
// last one the column returns to unsorted. Empty: the table's
// SortDirections, by default ascending, descending.
SortDirections []SortOrder
// Filters lists the values of the filter dropdown. OnFilter filters
// locally (a row passes if it matches any selected value); without it
// the app filters using the reported filter state.
Filters []Option
FilterSearch bool // search box above the options
FilterSingle bool // radio instead of checkboxes
OnFilter func(row int, value string) bool
// FilterPanel replaces the option list with a custom panel.
FilterPanel func(p *TableFilterPanel)
// DefaultFilter is the initial filter of the column when the table
// owns its filter state, or when the bound Filters map has no entry
// for the column on the first frame (Ant Design defaultFilteredValue).
DefaultFilter []string
// FilterResetToDefault makes the filter's reset button restore
// DefaultFilter instead of clearing it (Ant Design
// filterResetToDefaultFilteredValue).
FilterResetToDefault bool
// Text returns the cell text; Render, if set, builds custom content
// (any widget: tags, badges, buttons, progress, avatars).
Text func(row int) string
Render func(row int)
// Children makes this a header group (multi-level header).
Children []TableColumn
// Editor makes the cells editable.
Editor *TableEditor
}
TableColumn describes one column. Only Key/Title and one of Text/Render are needed; everything else is optional.
type TableColumnState ¶
type TableColumnState struct {
Order []string
Hidden map[string]bool
Widths map[string]float32
// Fixed overrides a top-level column's Fixed side: FixedLeft,
// FixedRight or "none" (unpinned).
Fixed map[string]string
}
TableColumnState is the user-adjustable column layout: order, visibility and resized widths. ProTable's column settings edit it.
type TableDropdownW ¶
type TableDropdownW struct {
// contains filtered or unexported fields
}
TableDropdownW is a row-action dropdown backed by DropdownW. Menu keys, disabled items, focus navigation and dismissal use the same menu model.
func TableDropdown ¶
func TableDropdown(c *Context, items []MenuItem) *TableDropdownW
TableDropdown starts a table-row action menu. Show uses an ellipsis trigger with a localized accessible name. Button selects the ordinary button variant (not a split button). ConfigProvider.Defaults keys: "disabled" (false), "trigger" (TriggerHover), "placement" (BottomStart).
func (*TableDropdownW) Button ¶
func (w *TableDropdownW) Button(label string) *TableDropdownW
Button uses an ordinary button with a down arrow, as TableDropdown.Button.
func (*TableDropdownW) Clicked ¶
func (w *TableDropdownW) Clicked() string
Clicked returns the menu key selected this frame, or an empty string.
func (*TableDropdownW) Disabled ¶
func (w *TableDropdownW) Disabled(on bool) *TableDropdownW
Disabled disables the trigger and menu.
func (*TableDropdownW) ID ¶
func (w *TableDropdownW) ID() ID
ID returns the trigger wrapper ID after Show.
func (*TableDropdownW) IsOpen ¶
func (w *TableDropdownW) IsOpen() bool
IsOpen reports whether the menu is expanded.
func (*TableDropdownW) Label ¶
func (w *TableDropdownW) Label(s string) *TableDropdownW
Label replaces the ellipsis with text.
func (*TableDropdownW) OnSelect ¶
func (w *TableDropdownW) OnSelect(fn func(string)) *TableDropdownW
OnSelect receives the selected menu key.
func (*TableDropdownW) Open ¶
func (w *TableDropdownW) Open(on *bool) *TableDropdownW
Open binds the expanded state.
func (*TableDropdownW) Show ¶
func (w *TableDropdownW) Show() *TableDropdownW
Show builds the trigger and menu.
func (*TableDropdownW) Trigger ¶
func (w *TableDropdownW) Trigger(t Trigger) *TableDropdownW
Trigger chooses hover, click or context menu activation.
type TableEditor ¶
type TableEditor struct {
Kind string // "text" (default) | "number" | "select" | "date"
Options []Option
Precision int
Value func(row int) string // current value (default: column Text)
Set func(row int, v string) // commit
// Validate returns an error message for an invalid value.
Validate func(v string) string
// Render builds a custom editor for row-edit mode (EditableRows) in
// place of Kind, bound to the app's own draft; Error returns the
// message shown in a tip under it ("" when valid). EditableProTable
// uses it for ProField controls. Without Set the cell is not
// click-to-edit.
Render func(row int)
Error func(row int) string
}
TableEditor makes a column's cells editable in place.
type TableFilterPanel ¶
type TableFilterPanel struct {
Values *[]string // draft values; Confirm applies them
// contains filtered or unexported fields
}
TableFilterPanel is passed to custom filter panels.
func (*TableFilterPanel) Close ¶
func (p *TableFilterPanel) Close()
Close closes the panel without applying.
func (*TableFilterPanel) Confirm ¶
func (p *TableFilterPanel) Confirm()
Confirm applies the draft values and closes the panel.
func (*TableFilterPanel) Context ¶
func (p *TableFilterPanel) Context() *Context
Context returns the build context.
func (*TableFilterPanel) Reset ¶
func (p *TableFilterPanel) Reset()
Reset clears the filter and closes the panel.
type TableLocale ¶
type TableLocale struct {
FilterSearch string // search box placeholder
FilterAll string // "all" entry of single-choice filters
Filter string // Element's apply button ("筛选")
// Column settings: group titles and pin actions.
FixedLeft, NoFixed, FixedRight, PinLeft, PinRight, Unpin string
// SelectRowFmt names a row's selection checkbox, arg: row number
// ("选择第 %d 行").
SelectRowFmt string
// Selection dropdown next to the header checkbox: its accessible name
// and the built-in SelectionPage / SelectionNone items.
Selections, SelectPage, SelectNone string
// SumText is the first cell of ShowSummary's row (Element Plus
// sum-text, "合计").
SumText string
// contains filtered or unexported fields
}
TableLocale holds the Table filter dropdown texts not covered by the common Filter* fields.
type TableSelection ¶
TableSelection is an item of the header selection menu (Ant Design rowSelection.selections). Key is one of the Selection* constants or a custom key; custom items need Text and OnSelect, which receives the displayed data rows of the current page (change the selection there).
type TableSpan ¶
TableSpan identifies a body cell for Span: Row is the data index, Pos the position among the displayed rows, Col the index of the leaf data column.
type TableW ¶
type TableW struct {
// contains filtered or unexported fields
}
TableW is a data table (Ant Design Table / Element Plus Table + Table V2).
ui.Table(c, cols, len(data)).Selection(&sel).Sort(&sort).ScrollY(400).Show()
Rows are addressed by data index 0..rows-1 (or the ids given to Tree); column callbacks receive that index, so local sorting and filtering never change what a callback sees.
func Table ¶
func Table(c *Context, cols []TableColumn, rows int) *TableW
Table starts a table over rows data rows; chain modifiers, then Show.
func (*TableW) A11yLabel ¶
A11yLabel names the table (grid) for screen readers, e.g. the title of the card it sits in.
func (*TableW) CheckLinked ¶
CheckLinked turns on the parent/child linkage of tree selection (Ant Design rowSelection.checkStrictly false, Element Plus' default tree-props checkStrictly false): checking a row checks its descendants, a parent is checked once all its children are and shows a half state when only some are. By default (Ant Design checkStrictly true) rows are checked independently.
func (*TableW) CheckStrictly ¶
CheckStrictly checks tree rows independently, without parent/child linkage. It is the default (Ant Design rowSelection.checkStrictly true); it overrides a ConfigProvider default of false. See CheckLinked.
func (*TableW) ColumnState ¶
func (t *TableW) ColumnState(s *TableColumnState) *TableW
ColumnState binds column order, visibility and widths.
func (*TableW) CurrentChanged ¶
CurrentChanged reports that the current row moved in the last Show (Element Plus current-change).
func (*TableW) CurrentRowKey ¶
CurrentRowKey binds the highlighted current row by key (Element Plus current-row-key / setCurrentRow); "" means none. It turns on HighlightCurrentRow; CurrentChanged reports clicks that moved it.
func (*TableW) DefaultExpandAllRows ¶
DefaultExpandAllRows expands every expandable row and tree node on the first frame when the table owns the expansion state (Ant Design expandable.defaultExpandAllRows, Element Plus default-expand-all). Rows of TreeLazy whose children are not loaded stay closed.
func (*TableW) DisplayedRows ¶
DisplayedRows returns the data rows shown on the current page, in order (valid after Show).
func (*TableW) DragSort ¶
DragSort adds a drag handle column; fn(from, to) moves data row from to the position of data row to.
func (*TableW) EditableRows ¶
EditableRows binds the keys of rows in row-edit mode (every column with an Editor shows an input; use Save/Cancel from an action column).
func (*TableW) ExpandChanged ¶
ExpandChanged reports an expand or tree toggle in the last Show.
func (*TableW) ExpandRowByClick ¶
ExpandRowByClick toggles a row's detail panel (Expandable) or tree children when the row is clicked (Ant Design expandable.expandRowByClick).
func (*TableW) Expandable ¶
Expandable adds an expand column; render builds a row's detail panel.
func (*TableW) ExpandedKeys ¶
ExpandedKeys binds the expanded rows (controlled).
func (*TableW) FilterChanged ¶
FilterChanged reports a confirmed or reset filter in the last Show.
func (*TableW) HeaderHeight ¶
HeaderHeight overrides the height of a header row (Element Plus Table V2 header-height); 0 keeps the height derived from the size.
func (*TableW) HideExpandColumn ¶
HideExpandColumn hides the expand column of Expandable (Ant Design expandable.showExpandColumn false); rows then expand by ExpandRowByClick, Enter or the bound ExpandedKeys.
func (*TableW) HideHeader ¶
HideHeader hides the header row (Ant Design / Element Plus showHeader false). Sorting and filters stay bound but have no controls.
func (*TableW) HideSelectAll ¶
HideSelectAll hides the header checkbox.
func (*TableW) HighlightCurrentRow ¶
HighlightCurrentRow keeps the clicked row highlighted (Element Plus).
func (*TableW) Indent ¶
Indent sets the per-level tree indent (default TableToken.IndentSize: 15, Element Plus 16).
func (*TableW) PageChanged ¶
PageChanged reports a page or page-size change in the last Show.
func (*TableW) Pagination ¶
Pagination paginates locally: rows are all data; page is 1-based.
func (*TableW) PaginationConfig ¶
func (t *TableW) PaginationConfig(fn func(p *PaginationW)) *TableW
PaginationConfig customizes the pager after the table set it up (Ant Design's pagination object): fn receives it before Show, e.g. p.ShowTotal().ShowQuickJumper(). Like Ant Design, the table's pager shows no total by default and is small for Small and Middle tables.
func (*TableW) PaginationPlacement ¶
PaginationPlacement places the pager: one top and/or one bottom placement (PageTopStart … PageBottomEnd); PageNone hides it while paging still applies. The default is PageBottomEnd.
func (*TableW) PreserveSelectedRowKeys ¶
PreserveSelectedRowKeys keeps selected keys whose rows are no longer in the data (Ant Design preserveSelectedRowKeys, Element Plus reserve-selection). By default a selection change drops them, so with ServerPagination the selection covers the current page only.
func (*TableW) Revision ¶
Revision tells the table its data changed, so cached local sorting and filtering is recomputed (bump it whenever rows change in place).
func (*TableW) RowClass ¶
RowClass styles rows: fn returns the style of data row i (background, status tint, text color, weight). It is the Ant rowClassName / Element row-class-name hook without CSS.
func (*TableW) RowClicked ¶
RowClicked returns the clicked data row or -1.
func (*TableW) RowDoubleClicked ¶
RowDoubleClicked returns the double-clicked data row or -1.
func (*TableW) RowExpandable ¶
RowExpandable limits which rows can expand.
func (*TableW) Save ¶
Save validates the row's editors and commits them; it returns false and shows the errors when a value is invalid.
func (*TableW) ScrollToFirstRowOnChange ¶
ScrollToFirstRowOnChange sets whether a page, sort or filter change scrolls a bounded body back to the first row (Ant Design scroll.scrollToFirstRowOnChange, default true).
func (*TableW) ScrollY ¶
ScrollY bounds the body height; the header (and a fixed summary) stay in place and only the visible rows are built, so huge tables stay fast.
func (*TableW) SelectDisabled ¶
SelectDisabled disables the selection box of some rows.
func (*TableW) SelectedKeys ¶
SelectedKeys binds the selection to row keys (RowKey). Keys survive paging, sorting and server-side data replacement.
func (*TableW) SelectionChanged ¶
SelectionChanged reports a selection change in the last Show.
func (*TableW) SelectionColumnWidth ¶
SelectionColumnWidth sets the width of the selection column (Ant Design rowSelection.columnWidth).
func (*TableW) SelectionFixed ¶
SelectionFixed pins the selection column (and the expand column) to the start side (Ant Design rowSelection.fixed). Without it they are pinned when the first data column is.
func (*TableW) Selections ¶
func (t *TableW) Selections(items ...TableSelection) *TableW
Selections adds a menu next to the header checkbox (Ant Design rowSelection.selections). Without items it offers select all, select current page (when paginated), invert current page and clear.
func (*TableW) ServerPagination ¶
ServerPagination shows a pager for server data: rows are the current page's rows and total is the count of all rows.
func (*TableW) ShowOverflowTooltip ¶
ShowOverflowTooltip makes every text column ellipsis with a tooltip (Element Plus' table-level show-overflow-tooltip).
func (*TableW) ShowSorterTooltip ¶
ShowSorterTooltip shows or hides the "click to sort" tooltip of sortable headers (Ant Design showSorterTooltip, default true). A theme whose TableToken.SorterTooltip is false (Element Plus) shows none.
func (*TableW) ShowSummary ¶
ShowSummary adds Element Plus' default summary row (show-summary): the first data column shows Locale().Table.SumText, columns whose displayed texts are numbers show their sum, others stay empty. Use Summary for a custom summary-method.
func (*TableW) SingleSelect ¶
SingleSelect turns the selection column into radios.
func (*TableW) Size ¶
func (t *TableW) Size(s ControlSize) *TableW
Size picks the density: Large (default), Middle or Small (Element: default, Large, Small).
func (*TableW) SortChanged ¶
SortChanged reports a sorter click in the last Show.
func (*TableW) SortDirections ¶
SortDirections sets the orders a sorter click cycles through for every column without its own TableColumn.SortDirections (Ant Design sortDirections, Element Plus sort-orders). The default is SortAsc, SortDesc; after the last order the column returns to unsorted. SortDesc, SortAsc starts with descending; a single order toggles between it and unsorted.
func (*TableW) Span ¶
Span merges body cells: return (rowSpan, colSpan); 0 hides a cell that a neighbour covers, (1,1) is a normal cell.
func (*TableW) Sticky ¶
Sticky pins the header to the top of the scroll container the table scrolls in (the nearest ancestor Scroll, or StickyContainer), offset px below its top edge (Ant Design sticky.offsetHeader).
func (*TableW) StickyContainer ¶
StickyContainer names the scroll container (a ScrollBox ID) Sticky and StickySummary measure against (default: the nearest scrolling ancestor).
func (*TableW) StickySummary ¶
StickySummary pins the summary rows to the bottom of the scroll container, offset px above its bottom edge, while the table extends below it (Ant Design summary fixed + sticky.offsetSummary).
func (*TableW) Summary ¶
Summary adds a summary (totals) row; fn returns the text of each column for the displayed rows. Call it again for more rows.
func (*TableW) SummaryFixed ¶
SummaryFixed keeps the summary visible under a scrolling body.
func (*TableW) Transposed ¶
Transposed swaps the axes for comparing records side by side: every TableColumn becomes a row and every record a column. The data model is unchanged (cols are the fields, rows the record count, callbacks get the record index).
The first column is the header column: it shows each field's Title in header style (Table HeaderBg / HeaderColor / HeaderFontWeight tokens), is a row header for assistive technology and is pinned to the inline start (the right edge in RTL) unless TransposedHeaderFixed(false). Each record column is at least TransposedColumnWidth wide (default 160; record columns share the width of a wider table equally) and shows the field's Text or Render for that record, aligned by the field's Align. The header row shows TransposedHeader's titles; without TransposedHeader there is no header row. Hidden fields are skipped and header groups (Children) are flattened to their leaves.
Transposition turns off, without error, every feature that addresses records as rows or fields as columns: sorting and filtering (Sort, MultiSort, Filters, column Sortable / Filters), row selection (Selection, SelectedKeys, Selections), expandable rows, Tree, Span, DragSort, editing (column Editor, EditableRows), Resizable, ColumnState, Summary, Pagination / ServerPagination, RowClass, HighlightCurrentRow, Sticky / StickySummary and the Wrap of field columns (cells stay one line; Ellipsis still works). The change queries (SortChanged, ...) report false. RowClicked / RowDoubleClicked return the record whose column was clicked (or -1 on the header column) and DisplayedRows lists every record.
ScrollX scrolls many records sideways (the header column stays pinned); ScrollY bounds the body height. Virtual is ignored: there are as many rows as fields (usually few) and record columns are not virtualized.
func (*TableW) TransposedColumnWidth ¶
TransposedColumnWidth sets the width of every record column of a Transposed table (default 160). It is a minimum: in a wider table the record columns share the free width equally (the header column keeps its width); when they do not fit, the body scrolls sideways.
func (*TableW) TransposedHeader ¶
TransposedHeader titles the record columns of a Transposed table: title returns the column title of record row. Without it the transposed table has no header row.
func (*TableW) TransposedHeaderFixed ¶
TransposedHeaderFixed pins the header column of a Transposed table to the inline start while the records scroll sideways (default on; the right edge in RTL).
func (*TableW) TransposedHeaderWidth ¶
TransposedHeaderWidth sets the width of the header column of a Transposed table (default: the widest field title plus cell padding, at least 80).
func (*TableW) Tree ¶
Tree shows hierarchical data: roots are the top-level row ids and children lists a row's child rows.
func (*TableW) TreeLazy ¶
TreeLazy loads children on demand: has reports rows that have children not loaded yet; load is called once when such a row is expanded (the app fetches, appends children and calls Invalidate). A spinner shows meanwhile.
func (*TableW) TreeOpenKeys ¶
TreeOpenKeys binds the expanded tree nodes (controlled).
func (*TableW) Virtual ¶
Virtual is Table V2 mode: a bounded body (ScrollY) where only visible rows and columns are built. Rows are fixed-height unless a column wraps (Wrap): then visible rows are measured, the rest estimated, and the heights cached. With ScrollY the table always virtualizes; Virtual documents the intent.
type TabsLocale ¶
type TabsLocale struct {
More, Add string
// contains filtered or unexported fields
}
TabsLocale holds the accessible names of the Tabs overflow and add buttons.
type TabsW ¶
type TabsW struct {
// contains filtered or unexported fields
}
TabsW is a tab bar: line or card style, editable cards (close and add buttons), top / bottom / left / right placement, centered tabs and a scrolling tab list with a "more" dropdown for the tabs that do not fit.
func Tabs ¶
Tabs adds a tab bar bound to the active key; render the panel yourself based on *active (or with Panel). Call Show after options.
ConfigProvider.Defaults("Tabs", ...) keys: "type" ("line" | "card" | "editable-card" | "border-card"), "size" (ControlSize), "centered" (bool), "tabPlacement" (Placement or Ant v6 "top" | "bottom" | "start" | "end"; the deprecated keys "placement" and "tabPosition" take "top" | "bottom" | "left" | "right" too), "stretch" (bool), "tabBarGutter" (px), "variant" ("default" | "line", the shadcn TabsList variant).
active may be nil (the Tabs keep the key themselves). When *active is not a key of items, the tab at the last active index (clamped; the first tab at first) becomes active, like Ant's Tabs when the active key goes away; Changed does not report that fallback.
Under shadcn/ui every combination is drawn as the segmented TabsList (muted track, background pill with shadow-sm): vertical placements stack the triggers, Closable adds a small x to each trigger, OnAdd a ghost + button after the list, Card switches to an outline track and BorderCard puts the list and panel in a bordered card.
func (*TabsW) ActiveTabFontWeight ¶
ActiveTabFontWeight sets the active tab label's font weight (100–900). Zero restores the theme weight.
func (*TabsW) BeforeLeave ¶
BeforeLeave is asked before the active tab changes (Element before-leave): returning false keeps the current tab.
func (*TabsW) BorderCard ¶
BorderCard puts the bar and the panel built by Panel in a bordered card whose header strip holds the tabs (Element type="border-card").
func (*TabsW) Closable ¶
Closable makes an editable card bar (Ant type="editable-card", Element closable): every tab without NoClose gets a close button; read Closed. Delete or Backspace on a focused tab closes it too.
func (*TabsW) Closed ¶
Closed returns the key of the tab closed this frame ("" when none). The app removes it from the items (and picks a new active key).
func (*TabsW) Draggable ¶
Draggable lets the user reorder the tabs by dragging them (the moved tab becomes active); read the new order with Reordered. With the keyboard, Shift plus the shortcut modifier (Ctrl, Cmd on macOS) and the arrow keys move the focused tab.
func (*TabsW) ExtraLeft ¶
ExtraLeft builds content at the start of the bar, before the tabs (Ant tabBarExtraContent.left); Extra is the right one.
func (*TabsW) Height ¶
Height fixes the height of a Left / Right Tabs (bar and panel); tabs that do not fit scroll and are listed in the more menu.
func (*TabsW) Indicator ¶
Indicator sets the ink bar of line tabs (Ant v6 indicator): size is its length in px (0: the tab's extent; Element: the label's), align places it along the tab: "start", "center" (default) or "end".
func (*TabsW) IndicatorThickness ¶
IndicatorThickness sets the cross-axis thickness of a line-tab indicator in logical pixels. A non-positive value restores the theme thickness.
func (*TabsW) NoMargin ¶
NoMargin drops the gap between the bar and the content (for a bar that sits at the bottom edge of a header, as in PageContainer).
func (*TabsW) OnAdd ¶
OnAdd shows the add button of an editable card bar; fn runs when it is clicked (Added reports it as well).
func (*TabsW) OnTearOff ¶
OnTearOff makes the tabs draggable and lets a tab be dragged out of the window: released outside, fn runs with its key and the release point, and TornOff reports them. pos is in the window's logical coordinates, so it lies outside the window's bounds (negative, or past its size); package ui does not know where the window is on the screen, so add the window's position (for a uihost window, tango.Surface.Bounds) to place a new window under the pointer. The bar does not remove the tab: the application opens it in a new window and removes it from the items.
func (*TabsW) Panel ¶
Panel builds the content of the active tab in a tab panel (exposed to screen readers as the tabpanel labelled by the active tab). Call it after Show; rendering the panel without it works too. With Bottom, Left or Right placement the panel is placed next to the bar.
func (*TabsW) Placement ¶
Placement puts the bar at the Top (default), Bottom, Left or Right of the panel built by Panel. Left and Right are logical: in a right-to-left scope a Left bar sits on the right (the start side), as the layout mirrors the row of bar and panel. This is Ant v6 tabPlacement (TabPlacement takes its string names; Left = "start", Right = "end").
func (*TabsW) RemoveIcon ¶
RemoveIcon replaces the x of the close buttons (Ant removeIcon).
func (*TabsW) Reordered ¶
Reordered returns the items in their new order after a drag or keyboard move this frame (nil when none). Assign it to the slice the bar is built from.
func (*TabsW) Size ¶
func (t *TabsW) Size(s ControlSize) *TabsW
func (*TabsW) Stretch ¶
Stretch makes the tabs of a horizontal bar share its width (Element stretch); the bar no longer scrolls.
func (*TabsW) TabBarGutter ¶
TabBarGutter sets the space between two tabs (Ant tabBarGutter; the default comes from the theme: Ant 32 for line tabs, 2 for cards).
func (*TabsW) TabBarStyle ¶
TabBarStyle applies layout options to the bar (padding, margin ...; Ant tabBarStyle). They apply after the theme's defaults.
func (*TabsW) TabClicked ¶
TabClicked returns the key of the tab clicked this frame, also when it is already active ("" when none; Ant onTabClick, Element tab-click).
func (*TabsW) TabItemHeight ¶
TabItemHeight sets the height of horizontal tabs in logical pixels. A non-positive value restores the theme height.
func (*TabsW) TabPlacement ¶
TabPlacement puts the bar by Ant v6 name: "top" (default), "bottom", "start" or "end" (logical sides: mirrored in RTL); "left" and "right" are accepted as their deprecated aliases. Same as Placement.
func (*TabsW) TornOff ¶
TornOff reports the tab torn off this frame and its release point (see OnTearOff).
func (*TabsW) Variant ¶
Variant picks the list look in every theme: "default" or "line" (line tabs: a transparent list with an underline under the active tab). Where the default bar is a segmented track (TabsToken.SegmentedList: the shadcn TabsList) "line" switches to line tabs; where the default is line tabs already (Ant, Element) it is the same look. Card and BorderCard pick their own types.
type TagW ¶
type TagW struct {
// contains filtered or unexported fields
}
TagW is a small label.
func Tag ¶
Tag adds a tag. color may be "success", "processing", "error", "warning", "default", an Ant preset ("blue", "magenta" ...; with the suffix "-inverse", e.g. "blue-inverse", the preset solid unless a Variant is set, like antd), a shadcn Badge variant ("primary", "secondary", "destructive", "outline", "ghost", "link") or a hex color.
ConfigProvider.Defaults("Tag", ...) keys: "size" (ControlSize), "effect", "variant", "color" (string), "bordered" (bool; deprecated, false = variant "filled"), "disabled" (bool).
func (*TagW) Borderless
deprecated
func (*TagW) Closable ¶
Closable shows a close icon. The tag becomes a "remove" button for the keyboard: Enter, Space, Delete or Backspace close it.
func (*TagW) CloseIcon ¶
CloseIcon replaces the close icon (antd closeIcon); it also makes the tag closable.
func (*TagW) Closed ¶
Closed reports a click on the close icon (or a keyboard close); always false while disabled.
func (*TagW) Disabled ¶
Disabled greys the tag out (antd 6 disabled); a disabled closable tag does not close. ConfigProvider.ComponentDisabled applies too.
func (*TagW) Effect ¶
Effect sets the Element theme of the tag: "light" (tinted with a border; = Variant("outlined")), "dark" (solid color, white text; = Variant("solid")) or "plain" (container background, colored border and text). Variant wins when both are set.
func (*TagW) Size ¶
func (t *TagW) Size(sz ControlSize) *TagW
Size sets small (20px), middle (default) or large (Element 32px) tags.
type TextAlign ¶
type TextAlign uint8
TextAlign aligns text inside its box. Start and End are logical: they resolve per line, so a right-to-left line (Arabic, Hebrew, or any line of an RTL scope) starts at the right edge.
Append-only: never reorder or insert; the zero value stays AlignStart.
const ( // AlignStart aligns each line to its start edge: left for LTR lines, // right for RTL lines. It is the zero value. AlignStart TextAlign = iota // AlignCenter centers each line. AlignCenter // AlignEnd aligns each line to its end edge: right for LTR lines, left // for RTL lines. AlignEnd // AlignPhysicalLeft always aligns to the left edge. AlignPhysicalLeft // AlignPhysicalRight always aligns to the right edge. AlignPhysicalRight )
type TextAreaW ¶
type TextAreaW struct {
// contains filtered or unexported fields
}
TextAreaW is a multi-line input with character count, auto-size, clear button and wheel scrolling (Ant Input.TextArea, Element type=textarea).
func (*TextAreaW) A11yLabel ¶
A11yLabel sets the accessible name. Inside a FormItem the item label is used; otherwise the placeholder is the last resort.
func (*TextAreaW) AllowClear ¶
func (*TextAreaW) AutoSize ¶
AutoSize grows the box with its content between minRows and maxRows (maxRows <= 0: unbounded); beyond maxRows the content scrolls.
func (*TextAreaW) Exceed ¶
Exceed lets the text grow beyond MaxLength and marks it as an error instead of truncating.
func (*TextAreaW) Placeholder ¶
func (*TextAreaW) ReadOnly ¶
ReadOnly prevents edits but allows selection and scrolling (antd / Element readonly).
func (*TextAreaW) Rows ¶
Rows sets the fixed number of visible rows (default 2, like antd's native textarea and Element's rows).
type TextInputStateWindow ¶
type TextInputStateWindow interface {
SetTextInputState(st input.TextInputState)
}
TextInputStateWindow is implemented by windows whose input method can use the text around the caret. SetTextInputState is called after SetTextInput(true, …) whenever the focused field's state changes. When focus moves to a text widget without a state, the Runner turns text input off and on again so the platform forgets the old state.
type ThoughtChainW ¶
type ThoughtChainW struct {
// contains filtered or unexported fields
}
ThoughtChainW is a vertical chain of steps with status icons, durations and collapsible details, optionally under a collapsible title.
func ThoughtChain ¶
func ThoughtChain(c *Context, items []ChainItem) *ThoughtChainW
ThoughtChain adds a chain of steps.
ui.ThoughtChain(c, steps).Title("思考过程").Card()
func (*ThoughtChainW) Card ¶
func (w *ThoughtChainW) Card() *ThoughtChainW
Card draws the chain inside a bordered card.
func (*ThoughtChainW) DefaultCollapsed ¶
func (w *ThoughtChainW) DefaultCollapsed() *ThoughtChainW
DefaultCollapsed starts with the steps hidden (needs Title).
func (*ThoughtChainW) Expanded ¶
func (w *ThoughtChainW) Expanded() bool
Expanded reports whether the steps are shown.
func (*ThoughtChainW) ItemToggled ¶
func (w *ThoughtChainW) ItemToggled() (string, bool)
ItemToggled returns the key of the step whose detail was opened or closed this frame.
func (*ThoughtChainW) Layout ¶
func (w *ThoughtChainW) Layout(opts ...layout.Option) *ThoughtChainW
Layout applies layout options to the chain.
func (*ThoughtChainW) Title ¶
func (w *ThoughtChainW) Title(s string) *ThoughtChainW
Title adds a header that collapses the chain and shows its progress.
func (*ThoughtChainW) Toggled ¶
func (w *ThoughtChainW) Toggled() bool
Toggled reports a click on the title this frame.
type TimePanelW ¶
type TimePanelW struct {
// contains filtered or unexported fields
}
TimePanelW is a standalone set of hour/minute/second columns.
func TimePanel ¶
func TimePanel(c *Context, val *time.Time) *TimePanelW
TimePanel adds hour/minute(/second) scroll columns bound to *val. It is focusable: Up/Down change the active column, Left/Right switch columns.
ConfigProvider.Defaults("TimePicker", ...) keys "format", "use12Hours", "hourStep", "minuteStep", "secondStep" and "hideDisabledOptions" apply.
func (*TimePanelW) A11yLabel ¶
func (w *TimePanelW) A11yLabel(s string) *TimePanelW
A11yLabel sets the accessible name (default: the Locale's SelectTime).
func (*TimePanelW) Changed ¶
func (w *TimePanelW) Changed() bool
Changed reports a new value this frame.
func (*TimePanelW) DisabledHours ¶
func (w *TimePanelW) DisabledHours(fn func(h int) bool) *TimePanelW
DisabledHours marks hours (0-23) that cannot be picked.
func (*TimePanelW) DisabledMinutes ¶
func (w *TimePanelW) DisabledMinutes(fn func(h, m int) bool) *TimePanelW
DisabledMinutes marks minutes of hour h that cannot be picked.
func (*TimePanelW) DisabledSeconds ¶
func (w *TimePanelW) DisabledSeconds(fn func(h, m, s int) bool) *TimePanelW
DisabledSeconds marks seconds of h:m that cannot be picked.
func (*TimePanelW) Format ¶
func (w *TimePanelW) Format(f string) *TimePanelW
Format sets the Go layout that decides the columns ("15:04" or "15:04:05").
func (*TimePanelW) Height ¶
func (w *TimePanelW) Height(px float32) *TimePanelW
Height sets the column height.
func (*TimePanelW) HideDisabledOptions ¶
func (w *TimePanelW) HideDisabledOptions(on bool) *TimePanelW
HideDisabledOptions leaves disabled options out of the columns.
func (*TimePanelW) Steps ¶
func (w *TimePanelW) Steps(h, m, s int) *TimePanelW
Steps sets the hour, minute and second steps.
func (*TimePanelW) Use12Hours ¶
func (w *TimePanelW) Use12Hours() *TimePanelW
Use12Hours shows a 12-hour clock with an AM / PM column.
type TimePickerLocale ¶
type TimePickerLocale struct {
StartTime, EndTime string // range placeholders
AM, PM string // 12-hour clock words
Meridiem string // accessible name of the AM / PM column
// contains filtered or unexported fields
}
TimePickerLocale holds the TimePicker / TimeRangePicker texts.
type TimePickerW ¶
type TimePickerW struct {
// contains filtered or unexported fields
}
TimePickerW is an input with a dropdown of time columns.
func TimePicker ¶
func TimePicker(c *Context, val *time.Time) *TimePickerW
TimePicker adds a time input bound to *val (zero = empty). The date part of a new value is today's date.
ConfigProvider.Defaults("TimePicker", ...) keys: "format", "placeholder", "use12Hours", "hourStep", "minuteStep", "secondStep", "allowClear", "width", "size", "variant", "hideDisabledOptions", "placement", "showNow", "needConfirm".
func (*TimePickerW) A11yLabel ¶
func (w *TimePickerW) A11yLabel(s string) *TimePickerW
A11yLabel sets the accessible name (inside a FormItem the item label is used; the placeholder is the last resort).
func (*TimePickerW) AllowClear ¶
func (w *TimePickerW) AllowClear(on bool) *TimePickerW
AllowClear toggles the clear button (on by default).
func (*TimePickerW) Changed ¶
func (w *TimePickerW) Changed() bool
Changed reports a committed value this frame.
func (*TimePickerW) Disabled ¶
func (w *TimePickerW) Disabled(on bool) *TimePickerW
Disabled disables the picker.
func (*TimePickerW) DisabledHours ¶
func (w *TimePickerW) DisabledHours(fn func(h int) bool) *TimePickerW
DisabledHours marks hours (0-23) that cannot be picked or typed.
func (*TimePickerW) DisabledMinutes ¶
func (w *TimePickerW) DisabledMinutes(fn func(h, m int) bool) *TimePickerW
DisabledMinutes marks minutes of hour h that cannot be picked or typed.
func (*TimePickerW) DisabledSeconds ¶
func (w *TimePickerW) DisabledSeconds(fn func(h, m, s int) bool) *TimePickerW
DisabledSeconds marks seconds of h:m that cannot be picked or typed.
func (*TimePickerW) Format ¶
func (w *TimePickerW) Format(f string) *TimePickerW
Format sets the Go time layout, e.g. "15:04:05" (default), "15:04" or with Use12Hours "03:04 PM" (AM / PM are shown with the Locale words).
func (*TimePickerW) HideDisabledOptions ¶
func (w *TimePickerW) HideDisabledOptions(on bool) *TimePickerW
HideDisabledOptions leaves disabled hours, minutes and seconds out of the columns instead of greying them (Ant hideDisabledOptions).
func (*TimePickerW) HourStep ¶
func (w *TimePickerW) HourStep(n int) *TimePickerW
func (*TimePickerW) IsOpen ¶
func (w *TimePickerW) IsOpen() bool
IsOpen reports whether the dropdown is shown.
func (*TimePickerW) Layout ¶
func (w *TimePickerW) Layout(o ...layout.Option) *TimePickerW
Layout applies layout options to the input frame.
func (*TimePickerW) MinuteStep ¶
func (w *TimePickerW) MinuteStep(n int) *TimePickerW
func (*TimePickerW) NeedConfirm ¶
func (w *TimePickerW) NeedConfirm(on bool) *TimePickerW
NeedConfirm keeps column picks as a draft until OK or Enter (Ant needConfirm; on by default for time pickers). With NeedConfirm(false) every pick in the columns (or arrow key step) sets the value at once, the panel stays open and the OK button is left out.
func (*TimePickerW) Open ¶
func (w *TimePickerW) Open() *TimePickerW
Open forces the dropdown open (screenshots, tests).
func (*TimePickerW) Placeholder ¶
func (w *TimePickerW) Placeholder(s string) *TimePickerW
func (*TimePickerW) Placement ¶
func (w *TimePickerW) Placement(p Placement) *TimePickerW
Placement sets where the columns open: BottomStart (default), BottomEnd, TopStart or TopEnd (Ant placement); they flip when there is no room.
func (*TimePickerW) SecondStep ¶
func (w *TimePickerW) SecondStep(n int) *TimePickerW
func (*TimePickerW) ShowNow ¶
func (w *TimePickerW) ShowNow(on bool) *TimePickerW
ShowNow toggles the Now link in the footer (Ant showNow, on by default).
func (*TimePickerW) Size ¶
func (w *TimePickerW) Size(s ControlSize) *TimePickerW
func (*TimePickerW) Status ¶
func (w *TimePickerW) Status(s string) *TimePickerW
func (*TimePickerW) Steps ¶
func (w *TimePickerW) Steps(h, m, s int) *TimePickerW
Steps sets the hour, minute and second steps at once.
func (*TimePickerW) Use12Hours ¶
func (w *TimePickerW) Use12Hours() *TimePickerW
Use12Hours shows a 12-hour clock: hours 12, 01 … 11 and an AM / PM column; the default format becomes "03:04:05 PM".
func (*TimePickerW) Variant ¶
func (w *TimePickerW) Variant(v string) *TimePickerW
Variant sets the frame look: "outlined" (default), "filled", "borderless" or "underlined".
func (*TimePickerW) Width ¶
func (w *TimePickerW) Width(px float32) *TimePickerW
type TimeRangePickerW ¶
type TimeRangePickerW struct {
// contains filtered or unexported fields
}
TimeRangePickerW selects a start and an end time.
func TimeRangePicker ¶
func TimeRangePicker(c *Context, val *[2]time.Time) *TimeRangePickerW
TimeRangePicker adds a time range input bound to *val ([start, end], zero = empty). Both ends are edited in side-by-side columns and committed with OK (or Enter); the result is ordered by clock (see Order). Each end can also be typed: printable keys edit the active end, Enter applies valid text (and commits once both ends are set), invalid or disabled text is dropped.
ui.TimeRangePicker(c, &span).Format("15:04").MinuteStep(15)
ConfigProvider.Defaults("TimeRangePicker", ...) keys: "format", "separator", "use12Hours", "hourStep", "minuteStep", "secondStep", "allowClear", "width", "size", "variant", "hideDisabledOptions", "placeholder" ([2]string), "placement", "order".
func (*TimeRangePickerW) A11yLabel ¶
func (w *TimeRangePickerW) A11yLabel(s string) *TimeRangePickerW
A11yLabel sets the accessible name (inside a FormItem the item label is used; otherwise the two placeholders).
func (*TimeRangePickerW) AllowClear ¶
func (w *TimeRangePickerW) AllowClear(on bool) *TimeRangePickerW
func (*TimeRangePickerW) Changed ¶
func (w *TimeRangePickerW) Changed() bool
Changed reports a committed range this frame.
func (*TimeRangePickerW) Disabled ¶
func (w *TimeRangePickerW) Disabled(on bool) *TimeRangePickerW
Disabled disables the picker.
func (*TimeRangePickerW) DisabledHours ¶
func (w *TimeRangePickerW) DisabledHours(fn func(h int) bool) *TimeRangePickerW
DisabledHours marks hours (0-23) that cannot be picked.
func (*TimeRangePickerW) DisabledMinutes ¶
func (w *TimeRangePickerW) DisabledMinutes(fn func(h, m int) bool) *TimeRangePickerW
DisabledMinutes marks minutes of hour h that cannot be picked.
func (*TimeRangePickerW) DisabledSeconds ¶
func (w *TimeRangePickerW) DisabledSeconds(fn func(h, m, s int) bool) *TimeRangePickerW
DisabledSeconds marks seconds of h:m that cannot be picked.
func (*TimeRangePickerW) Format ¶
func (w *TimeRangePickerW) Format(f string) *TimeRangePickerW
Format sets the Go time layout ("15:04:05" default, "15:04", or with Use12Hours "03:04 PM").
func (*TimeRangePickerW) HideDisabledOptions ¶
func (w *TimeRangePickerW) HideDisabledOptions(on bool) *TimeRangePickerW
HideDisabledOptions leaves disabled hours, minutes and seconds out of the columns instead of greying them (Ant hideDisabledOptions).
func (*TimeRangePickerW) HourStep ¶
func (w *TimeRangePickerW) HourStep(n int) *TimeRangePickerW
func (*TimeRangePickerW) IsOpen ¶
func (w *TimeRangePickerW) IsOpen() bool
IsOpen reports whether the dropdown is shown.
func (*TimeRangePickerW) Layout ¶
func (w *TimeRangePickerW) Layout(o ...layout.Option) *TimeRangePickerW
func (*TimeRangePickerW) MinuteStep ¶
func (w *TimeRangePickerW) MinuteStep(n int) *TimeRangePickerW
func (*TimeRangePickerW) Open ¶
func (w *TimeRangePickerW) Open() *TimeRangePickerW
Open forces the dropdown open (screenshots, tests).
func (*TimeRangePickerW) Order ¶
func (w *TimeRangePickerW) Order(on bool) *TimeRangePickerW
Order toggles sorting the two ends by clock (Ant order, on by default). Order(false) keeps an end earlier than the start, e.g. an overnight shift 22:00 – 06:00.
func (*TimeRangePickerW) Placeholder ¶
func (w *TimeRangePickerW) Placeholder(start, end string) *TimeRangePickerW
func (*TimeRangePickerW) Placement ¶
func (w *TimeRangePickerW) Placement(p Placement) *TimeRangePickerW
Placement sets where the columns open: BottomStart (default), BottomEnd, TopStart or TopEnd (Ant placement); they flip when there is no room.
func (*TimeRangePickerW) SecondStep ¶
func (w *TimeRangePickerW) SecondStep(n int) *TimeRangePickerW
func (*TimeRangePickerW) Separator ¶
func (w *TimeRangePickerW) Separator(s string) *TimeRangePickerW
Separator sets the text between the two ends (Ant separator, Element range-separator; default the Locale's RangeSeparator).
func (*TimeRangePickerW) Size ¶
func (w *TimeRangePickerW) Size(s ControlSize) *TimeRangePickerW
func (*TimeRangePickerW) Status ¶
func (w *TimeRangePickerW) Status(s string) *TimeRangePickerW
func (*TimeRangePickerW) Use12Hours ¶
func (w *TimeRangePickerW) Use12Hours() *TimeRangePickerW
Use12Hours shows 12-hour columns with AM / PM.
func (*TimeRangePickerW) Variant ¶
func (w *TimeRangePickerW) Variant(v string) *TimeRangePickerW
Variant sets the frame look: "outlined" (default), "filled", "borderless" or "underlined".
func (*TimeRangePickerW) Width ¶
func (w *TimeRangePickerW) Width(px float32) *TimeRangePickerW
type TimeSelectW ¶
type TimeSelectW struct {
// contains filtered or unexported fields
}
TimeSelectW picks a "HH:MM" time from a fixed list generated by Start/End/Step.
func TimeSelect ¶
func TimeSelect(c *Context, val *string) *TimeSelectW
TimeSelect adds a time select bound to *val ("HH:MM", "" = empty). Defaults follow Element: 09:00–18:00 every 00:30.
ConfigProvider.Defaults("TimeSelect", ...) keys: "start", "end", "step", "placeholder", "clearable" (Element) / "allowClear", "size", "width", "variant".
func (*TimeSelectW) A11yLabel ¶
func (w *TimeSelectW) A11yLabel(s string) *TimeSelectW
A11yLabel sets the accessible name (inside a FormItem the item label is used; the placeholder is the last resort).
func (*TimeSelectW) Changed ¶
func (w *TimeSelectW) Changed() bool
Changed reports a new value this frame.
func (*TimeSelectW) Clearable ¶
func (w *TimeSelectW) Clearable(on bool) *TimeSelectW
Clearable shows the clear icon on hover (default on).
func (*TimeSelectW) Disabled ¶
func (w *TimeSelectW) Disabled(on bool) *TimeSelectW
func (*TimeSelectW) End ¶
func (w *TimeSelectW) End(s string) *TimeSelectW
func (*TimeSelectW) IncludeEndTime ¶
func (w *TimeSelectW) IncludeEndTime(on bool) *TimeSelectW
IncludeEndTime adds End as the last option when the steps skip it, e.g. 09:00–17:45 every 00:30 ends with 17:45 (Element include-end-time).
func (*TimeSelectW) IsOpen ¶
func (w *TimeSelectW) IsOpen() bool
IsOpen reports whether the dropdown is shown.
func (*TimeSelectW) Layout ¶
func (w *TimeSelectW) Layout(o ...layout.Option) *TimeSelectW
func (*TimeSelectW) MaxTime ¶
func (w *TimeSelectW) MaxTime(s string) *TimeSelectW
func (*TimeSelectW) MinTime ¶
func (w *TimeSelectW) MinTime(s string) *TimeSelectW
MinTime disables times at or before s; MaxTime disables times at or after s (Element semantics).
func (*TimeSelectW) Open ¶
func (w *TimeSelectW) Open() *TimeSelectW
Open forces the dropdown open (screenshots, tests).
func (*TimeSelectW) Options ¶
func (w *TimeSelectW) Options() []Option
Options returns the generated items (Disabled marks MinTime/MaxTime).
func (*TimeSelectW) Placeholder ¶
func (w *TimeSelectW) Placeholder(s string) *TimeSelectW
func (*TimeSelectW) Placement ¶
func (w *TimeSelectW) Placement(p Placement) *TimeSelectW
Placement sets where the list opens: BottomStart (default), BottomEnd, TopStart or TopEnd (Element placement); it flips when there is no room.
func (*TimeSelectW) Size ¶
func (w *TimeSelectW) Size(s ControlSize) *TimeSelectW
func (*TimeSelectW) Start ¶
func (w *TimeSelectW) Start(s string) *TimeSelectW
Start / End / Step set the generated range ("HH:MM"; End is inclusive).
func (*TimeSelectW) Status ¶
func (w *TimeSelectW) Status(s string) *TimeSelectW
func (*TimeSelectW) Step ¶
func (w *TimeSelectW) Step(s string) *TimeSelectW
func (*TimeSelectW) Variant ¶
func (w *TimeSelectW) Variant(v string) *TimeSelectW
Variant sets the frame look: "outlined" (default), "filled", "borderless" or "underlined".
func (*TimeSelectW) Width ¶
func (w *TimeSelectW) Width(px float32) *TimeSelectW
type TimelineItem ¶
type TimelineItem struct {
Content string // main text (Ant v6 content)
Body func() // custom content (replaces Content)
// Title is the text on the opposite side of the axis (Ant v6 title);
// any item with a Title centers the axis of a vertical timeline.
Title string
// Deprecated: use Title.
Label string
Time string // Element: timestamp under (or above) the content
TimeTop bool // put Time above the content
// Color is a status ("primary", "success", "warning", "error", "info",
// "gray") or a hex color; empty uses the theme default.
Color string
DotIcon *icon.Icon // icon instead of the circle
Dot func() // fully custom dot node
Hollow bool // Element: hollow dot
Large bool // Element: larger dot
// Placement puts this item's content at the "start" or "end" side,
// overriding the Mode (Ant v6 items[].placement).
Placement string
// Loading shows a spinning dot (Ant v6 items[].loading); the axis
// entering it (leaving it under Reverse) is dotted where the theme's
// TimelineToken.BusyTailDashed says so.
Loading bool
// Center centers the dot vertically on the item (Element center).
Center bool
}
TimelineItem is one event of a Timeline.
type TimelineW ¶
type TimelineW struct {
// contains filtered or unexported fields
}
TimelineW shows events along a vertical axis.
func Timeline ¶
func Timeline(c *Context, items []TimelineItem) *TimelineW
Timeline starts a timeline; finish with Show.
ConfigProvider.Defaults("Timeline", ...) keys: "mode" ("start" | "end" | "alternate" | "alternate-reverse"; "left" / "right" are the deprecated names of start / end), "reverse" (bool), "orientation" ("vertical" | "horizontal"), "variant" ("outlined" | "filled").
func (*TimelineW) Horizontal ¶
Horizontal lays the events out along a horizontal axis (Ant v6 orientation="horizontal"): every event takes an equal share of the width with its dot on the axis. Mode keeps its meaning with the axis turned: "left" / "start" puts the content under the axis, "right" / "end" above it, "alternate" alternates (first under); a Label goes to the opposite side. In RTL the events run from the right.
func (*TimelineW) Mode ¶
Mode places the content: "start" (axis at the inline start, content after it; default), "end" (axis at the inline end), "alternate" (content alternates around a centered axis, the first item after it) or "alternate-reverse" (Element: the first item before it). "left" and "right" are the deprecated Ant names of "start" and "end". Items with a Title also center the axis. The sides are logical: in RTL "start" puts the axis at the right.
func (*TimelineW) Orientation ¶
Orientation lays the events out "vertical" (default) or "horizontal" (Ant v6 orientation; same as Horizontal).
type TitleBarLocale ¶
type TitleBarLocale struct {
Minimize, Maximize, Restore string
WindowControls string // accessible name of the button group
// contains filtered or unexported fields
}
TitleBarLocale holds the window button names of TitleBar and WindowControls (Close is Locale.Close, the full-screen pair Locale.Fullscreen / Locale.ExitFullscreen).
type TitleBarW ¶
type TitleBarW struct {
// contains filtered or unexported fields
}
TitleBarW is the self-drawn title bar TitleBar returns.
func TitleBar ¶
TitleBar adds the title bar of a frameless window (SurfaceOptions Appearance.TitleBar = TitleBarNone, or TitleBarHidden on macOS):
ui.TitleBar(c).Icon(icon.Code).Title("Tango — main.go").
Menu(func() { ui.Menubar(c, menus) }).
Center(func() { ui.Search(c, &q) }).
Tools(func() { ui.IconButton(c, icon.Setting, "设置") })
Pressing the bar's empty parts moves the window and a double click maximizes or restores it; the window buttons follow the platform (see WindowControlsStyle). Everything acts on Context.Window when it implements WindowFrame (uihost windows do); without a frame the bar still draws and reports Action.
func (*TitleBarW) Action ¶
func (t *TitleBarW) Action() WindowAction
Action reports the window action the user asked for this frame (a window button, or a double click on the bar), "" for none. A host that handles double clicks on the bar itself (uihost windows with their own UI thread) has already performed the action when Action reports it, one frame later.
func (*TitleBarW) Center ¶
Center builds content in the middle of the bar (a command search box). Without it the title is centered on macOS and follows the menu elsewhere.
func (*TitleBarW) Controls ¶
func (t *TitleBarW) Controls(s WindowControlsStyle) *TitleBarW
Controls picks the window button style (WindowControlsAuto by default).
func (*TitleBarW) Frame ¶
func (t *TitleBarW) Frame(f WindowFrame) *TitleBarW
Frame sets the window the bar drives, in place of Context.Window.
func (*TitleBarW) Manual ¶
Manual only reports window actions (Action) and leaves the window alone; dragging still moves it.
type ToggleGroupW ¶
type ToggleGroupW struct {
// contains filtered or unexported fields
}
ToggleGroupW is a set of toggles (shadcn/ui ToggleGroup).
func ToggleGroup ¶
func ToggleGroup(c *Context, selected *[]string, opts []Option) *ToggleGroupW
ToggleGroup adds one toggle per option bound to the selected values (multiple selection; Single keeps at most one). The toggles touch, with only the outer corners rounded, unless Spacing separates them.
ConfigProvider.Defaults("ToggleGroup", ...) keys: "size", "variant" ("default" | "outline"), "spacing" (int).
func (*ToggleGroupW) A11yLabel ¶
func (g *ToggleGroupW) A11yLabel(s string) *ToggleGroupW
A11yLabel sets the accessible name of the group.
func (*ToggleGroupW) Changed ¶
func (g *ToggleGroupW) Changed() bool
Changed reports a selection change this frame.
func (*ToggleGroupW) Icons ¶
func (g *ToggleGroupW) Icons(m map[string]*icon.Icon) *ToggleGroupW
Icons draws icon-only toggles; the option labels stay their names.
func (*ToggleGroupW) Outline ¶
func (g *ToggleGroupW) Outline() *ToggleGroupW
Outline joins the toggles into one bordered strip.
func (*ToggleGroupW) Single ¶
func (g *ToggleGroupW) Single() *ToggleGroupW
Single makes the group behave like radio buttons that can be cleared.
func (*ToggleGroupW) Size ¶
func (g *ToggleGroupW) Size(s ControlSize) *ToggleGroupW
Size sets the size of every toggle.
func (*ToggleGroupW) Spacing ¶
func (g *ToggleGroupW) Spacing(n int) *ToggleGroupW
Spacing sets the gap between the toggles in Tailwind spacing units of 4px (shadcn toggle-group spacing, default 0). With 0 the toggles touch and only the group's outer corners are rounded; otherwise every toggle is rounded (and bordered when outlined) on its own. Negative values are treated as 0.
func (*ToggleGroupW) Variant ¶
func (g *ToggleGroupW) Variant(v string) *ToggleGroupW
Variant sets the variant of every toggle: "default" or "outline". Other values are ignored.
type ToggleW ¶
type ToggleW struct {
// contains filtered or unexported fields
}
ToggleW is a two-state button (shadcn/ui Toggle): transparent when off, accent-filled when on.
func Toggle ¶
Toggle adds a toggle button bound to *on. label may be "" for an icon-only toggle (it still names the control for tests).
func (*ToggleW) A11yLabel ¶
A11yLabel sets the accessible name (icon-only toggles built with an empty label).
func (*ToggleW) Icon ¶
Icon puts an icon before the label (or alone when the label is shown only to tests: use IconOnly).
type ToolCallW ¶
type ToolCallW struct {
// contains filtered or unexported fields
}
ToolCallW is a collapsible card for one tool invocation: name, summary, status and duration in the header; arguments and result in the body.
func ToolCall ¶
ToolCall adds a tool call card for tool name.
ui.ToolCall(c, "read_file").Summary("src/main.go").Status(ui.ChainSuccess).
Duration(320*time.Millisecond).Args(`{"path":"src/main.go"}`).Result(out)
func (*ToolCallW) Body ¶
Body adds custom content at the end of the expanded body (a diff, an image, an Approval).
func (*ToolCallW) DefaultOpen ¶
DefaultOpen starts expanded.
func (*ToolCallW) Lang ¶
Lang sets the code languages of the arguments and the result (default "json" and none).
func (*ToolCallW) Status ¶
func (w *ToolCallW) Status(s ChainStatus) *ToolCallW
Status sets the call's state (default ChainPending).
type TooltipW ¶
type TooltipW struct {
*Box
// contains filtered or unexported fields
}
TooltipW is a tooltip wrapped around trigger content. It embeds the anchor *Box, so code that used the box Tooltip returned keeps working. Options apply when the build finishes (or at IsOpen).
ConfigProvider.Defaults("Tooltip", ...) keys: "placement", "trigger", "color", "effect" (string), "arrow" (bool), "mouseEnterDelay", "mouseLeaveDelay" (time.Duration).
func Tooltip ¶
Tooltip wraps fn's content and shows tip above it while hovered (or while keyboard focus is inside). The hover delays default to the theme (antd 0.1 s / 0.1 s, Element 0 / 0.2 s, shadcn 0 / 0).
func (*TooltipW) Color ¶
Color sets the bubble color: a status ("success", "error" ...), an Ant preset name ("blue", "magenta" ...) or "#rrggbb".
func (*TooltipW) Content ¶
Content replaces the text with rich content built by fn (the tip text still describes the trigger to screen readers).
func (*TooltipW) Effect ¶
Effect "light" draws a light bubble with a border (Element effect); "dark" is the default.
func (*TooltipW) MouseEnterDelay ¶
MouseEnterDelay waits d before showing on hover (Element show-after; default: the theme's TooltipToken.MouseEnterDelay).
func (*TooltipW) MouseLeaveDelay ¶
MouseLeaveDelay keeps the tooltip for d after the pointer left (Element hide-after; default: TooltipToken.MouseLeaveDelay).
func (*TooltipW) Open ¶
Open binds the open state (antd open / onOpenChange): *v decides whether the tooltip shows, and the trigger writes its wish (hover, focus, click) into *v when it changes. OpenChanged reports such a write.
func (*TooltipW) OpenChanged ¶
OpenChanged reports that the trigger changed the Open state this frame.
type TopNavHeaderW ¶
type TopNavHeaderW struct {
// contains filtered or unexported fields
}
TopNavHeaderW exposes ProLayout's horizontal header as a reusable entry. The desktop top menu is always expanded; overflow is handled by Menu, not by an additional sidebar collapse button (matching Pro v3).
func TopNavHeader ¶
func TopNavHeader(c *Context, menu []MenuItem, selected *string) *TopNavHeaderW
TopNavHeader starts a top navigation header; chain options, then Show. ConfigProvider.Defaults("TopNavHeader", ...): "title", "contentWidth", "userName" (string). Navigation selection is owned by selected.
func (*TopNavHeaderW) Actions ¶
func (w *TopNavHeaderW) Actions(fn func()) *TopNavHeaderW
Actions builds the trailing actions before the avatar.
func (*TopNavHeaderW) ContentWidth ¶
func (w *TopNavHeaderW) ContentWidth(s string) *TopNavHeaderW
ContentWidth selects Fluid or Fixed (1152px, centred).
func (*TopNavHeaderW) Logo ¶
func (w *TopNavHeaderW) Logo(ic *icon.Icon) *TopNavHeaderW
Logo replaces the default logo mark.
func (*TopNavHeaderW) OnMenuHeaderClick ¶
func (w *TopNavHeaderW) OnMenuHeaderClick(fn func()) *TopNavHeaderW
OnMenuHeaderClick makes the logo/title area a keyboard-accessible button.
func (*TopNavHeaderW) Show ¶
func (w *TopNavHeaderW) Show() *TopNavHeaderW
Show builds the header using ProLayout's existing header implementation.
func (*TopNavHeaderW) Title ¶
func (w *TopNavHeaderW) Title(s string) *TopNavHeaderW
Title sets the logo area's title.
func (*TopNavHeaderW) UserName ¶
func (w *TopNavHeaderW) UserName(s string) *TopNavHeaderW
UserName adds the user avatar and name in the trailing action area.
type TourActions ¶
type TourActions struct {
Current int // 0-based index of the shown step
Total int
// contains filtered or unexported fields
}
TourActions is what an ActionsRender function gets: the step position and the operations of the default buttons.
func (*TourActions) Close ¶
func (a *TourActions) Close()
Close dismisses the tour (Closed reports it).
func (*TourActions) Default ¶
func (a *TourActions) Default()
Default builds the default buttons (previous, next / finish) in place.
func (*TourActions) Next ¶
func (a *TourActions) Next()
Next moves to the next step, or finishes the tour on the last one.
type TourLocale ¶
type TourLocale struct {
Close, Prev, Next, Finish string
// contains filtered or unexported fields
}
TourLocale holds the Tour buttons.
type TourStep ¶
type TourStep struct {
Target ID // widget to highlight (0: centred panel, no hole)
Title string
Description string
Cover func() // optional picture above the title
Placement string // as Popover.Placement; default "bottom"
// Per-step overrides of the tour's options.
Mask TourMask // TourMaskOn / TourMaskOff; zero: the tour's setting
Type TourType // TourTypeDefault / TourTypePrimary; "": the tour's setting
PrevText string // label of the previous button ("": Locale)
NextText string // label of the next / finish button ("": Locale)
HidePrev bool // no previous button on this step
HideNext bool // no next / finish button on this step
// HideArrow hides the panel arrow on this step (antd steps[].arrow
// false).
HideArrow bool
}
TourStep is one step of a Tour.
type TourW ¶
type TourW struct {
// contains filtered or unexported fields
}
TourW is a guided tour: a mask with a hole around the current target and a panel with step indicators and prev/next buttons.
func (*TourW) ActionsRender ¶
func (t *TourW) ActionsRender(fn func(a *TourActions)) *TourW
ActionsRender replaces the previous / next buttons with the content fn builds (Ant actionsRender); a.Default() builds the default buttons and a.Prev / Next / GoTo / Close drive the tour.
func (*TourW) Closable ¶
Closable shows or hides the close button; without it Escape does not close the tour either (antd closable null; default shown).
func (*TourW) DisabledInteraction ¶
DisabledInteraction keeps the highlighted target from being clicked (antd disabledInteraction; by default the target stays interactive, Element target-area-clickable).
func (*TourW) Gap ¶
Gap sets the hole padding around the target (antd / Element gap.offset, default 6).
func (*TourW) GapRadius ¶
GapRadius sets the corner radius of the hole around the target (antd / Element gap.radius, default 2).
func (*TourW) IndicatorsRender ¶
IndicatorsRender replaces the step indicators (dots; Element: "1 / 3") with the content fn builds (Ant indicatorsRender). current is 0-based.
func (*TourW) Keyboard ¶
Keyboard sets whether Escape closes the tour and ←/→ move between steps (default true; antd keyboard, Element close-on-press-escape).
func (*TourW) MaskColor ¶
MaskColor sets the mask color (antd mask.color; default the theme's). A transparent color keeps the mask's pointer blocking without dimming.
func (*TourW) Placement ¶
Placement sets the default panel placement of the steps, as Popover.Placement (default "bottom"); TourStep.Placement overrides it.
func (*TourW) ScrollIntoView ¶
ScrollIntoView sets whether each step scrolls its target into the view of the scroll container holding it when the step is shown (default on, Ant scrollIntoViewOptions).
type TransferItem ¶
type TransferItem struct {
Key, Title string
Disabled bool
// contains filtered or unexported fields
}
TransferItem is an entry of a Transfer.
type TransferLocale ¶
type TransferLocale struct {
Source, Target, SearchPlaceholder string
// contains filtered or unexported fields
}
TransferLocale holds the Transfer defaults.
type TransferW ¶
type TransferW struct {
// contains filtered or unexported fields
}
TransferW is a two-list shuttle: items move between the source (left) and the target (right) list.
func Transfer ¶
func Transfer(c *Context, items []TransferItem, target *[]string) *TransferW
Transfer adds a transfer bound to the keys of the right-hand list.
func (*TransferW) Actions ¶
Actions labels the move buttons (Ant 6 actions, Element button-texts; default: icons only).
func (*TransferW) DefaultChecked ¶
DefaultChecked checks keys when the widget is first shown.
func (*TransferW) OneWay ¶
OneWay makes the transfer one-directional (Ant oneWay): only the move to the right remains, and right-hand items have a remove button.
func (*TransferW) Operations
deprecated
func (*TransferW) Pagination ¶
Pagination shows pageSize items per page with a pager under each list (Ant pagination).
func (*TransferW) Render ¶
Render builds each row's content with fn instead of the title (the row background and checkbox stay). The option carries the item's Title as Label, Key as Value and Disabled.
ui.Transfer(c, items, &keys).Render(func(o ui.Option) {
ui.Row(c, func() { ui.Icon(c, icon.User); ui.Text(c, o.Label) }, layout.Gap(6))
})
func (*TransferW) Searchable ¶
Searchable adds a filter input to each list.
func (*TransferW) ShowSelectAll ¶
ShowSelectAll shows or hides the select-all checkbox in the list headers (Ant showSelectAll, default true).
func (*TransferW) TargetOrder ¶
TargetOrder sets where moved keys go in the bound target slice and the order of the right list (Element target-order): "unshift" (default, as Ant: new keys first, the list follows the slice), "push" (new keys last, the list follows the slice) or "original" (the slice and the list follow the item order). ConfigProvider.Defaults("Transfer", "targetOrder") sets it for a subtree.
func (*TransferW) TreeSource ¶
TreeSource shows nodes as a checkable tree on the left (Ant tree transfer). Leaves are the transferable items (their Key / Title); leaves already on the right are shown checked and disabled. The items passed to Transfer are ignored.
type TreeNode ¶
type TreeNode struct {
Key string
Title string
Children []TreeNode
IsLeaf bool // never expandable (relevant with LoadData)
Disabled bool
DisableCheckbox bool
Icon *icon.Icon // shown with ShowIcon; nil uses folder/file
}
TreeNode is one node of a Tree. Keys must be unique in the whole tree.
type TreeSelectNode ¶
type TreeSelectNode struct {
Label, Value string
Disabled bool
Children []TreeSelectNode
IsLeaf bool // never expandable (relevant with LoadData)
}
TreeSelectNode is a node of a TreeSelect tree. Values must be unique. With LoadData, a node without Children that is not IsLeaf loads its children when expanded.
type TreeSelectW ¶
type TreeSelectW struct {
// contains filtered or unexported fields
}
TreeSelectW is a select whose options form a tree.
func TreeSelect ¶
func TreeSelect(c *Context, val *string, nodes []TreeSelectNode) *TreeSelectW
TreeSelect adds a tree select bound to *val (single selection). Use Multiple / Checkable for multiple values.
func (*TreeSelectW) A11yLabel ¶
func (w *TreeSelectW) A11yLabel(s string) *TreeSelectW
A11yLabel sets the accessible name (inside a FormItem the item label is used; the placeholder is the last resort).
func (*TreeSelectW) AllowClear ¶
func (w *TreeSelectW) AllowClear() *TreeSelectW
func (*TreeSelectW) Changed ¶
func (w *TreeSelectW) Changed() bool
Changed reports a selection change this frame.
func (*TreeSelectW) CheckStrictly ¶
func (w *TreeSelectW) CheckStrictly() *TreeSelectW
CheckStrictly unlinks parents and children in Checkable mode (Ant treeCheckStrictly, Element check-strictly; implies Checkable): every node, parent or leaf, is checked on its own, the value holds exactly the checked nodes and each one is a tag. ShowCheckedStrategy and StrategyValue do not apply.
func (*TreeSelectW) Checkable ¶
func (w *TreeSelectW) Checkable() *TreeSelectW
Checkable shows checkboxes with parent/child linkage (implies Multiple; the value holds the checked leaves).
func (*TreeSelectW) Checked ¶
func (w *TreeSelectW) Checked() []string
Checked returns the selected values; in Checkable mode they follow the checked strategy (the values shown as tags).
func (*TreeSelectW) DefaultExpandAll ¶
func (w *TreeSelectW) DefaultExpandAll() *TreeSelectW
func (*TreeSelectW) Disabled ¶
func (w *TreeSelectW) Disabled(on bool) *TreeSelectW
Disabled disables the control.
func (*TreeSelectW) ExpandChanged ¶
func (w *TreeSelectW) ExpandChanged() bool
ExpandChanged reports that the bound ExpandedKeys changed this frame.
func (*TreeSelectW) ExpandedKeys ¶
func (w *TreeSelectW) ExpandedKeys(keys *[]string) *TreeSelectW
ExpandedKeys binds the expanded nodes of the dropdown to *keys (controlled treeExpandedKeys): the tree shows exactly these nodes open, and expanding or collapsing (pointer, keyboard, opening on the current value, search) writes the new list back in tree order. DefaultExpandAll only seeds an empty list at the first frame.
func (*TreeSelectW) FilterTreeNode ¶
func (w *TreeSelectW) FilterTreeNode(fn func(query string, node TreeSelectNode) bool) *TreeSelectW
FilterTreeNode replaces the search match (by default the label containing the typed text, case-insensitively) with fn, which receives the typed text and a node (Ant filterTreeNode, Element filter-node-method). Matching nodes are shown with their ancestors; the typed text is still highlighted where it appears in a label. Implies Searchable.
func (*TreeSelectW) IsOpen ¶
func (w *TreeSelectW) IsOpen() bool
IsOpen reports whether the dropdown is shown.
func (*TreeSelectW) Layout ¶
func (w *TreeSelectW) Layout(o ...layout.Option) *TreeSelectW
func (*TreeSelectW) ListHeight ¶
func (w *TreeSelectW) ListHeight(px float32) *TreeSelectW
ListHeight sets the maximum dropdown height with or without virtual scrolling (Ant listHeight, 256).
func (*TreeSelectW) LoadData ¶
func (w *TreeSelectW) LoadData(fn func(value string) bool) *TreeSelectW
LoadData enables lazy loading with Tree's contract: expanding a node that has no Children and is not IsLeaf calls fn(value) every frame until it returns false (true = still loading); the application appends the children to its node slice meanwhile. A spinner replaces the switcher.
func (*TreeSelectW) MaxTagCount ¶
func (w *TreeSelectW) MaxTagCount(n int) *TreeSelectW
func (*TreeSelectW) MaxTagPlaceholder ¶
func (w *TreeSelectW) MaxTagPlaceholder(fn func(omitted []string) string) *TreeSelectW
MaxTagPlaceholder builds the text of the collapsed tag from the hidden labels (Ant maxTagPlaceholder; default "+ N ...").
func (*TreeSelectW) Multiple ¶
func (w *TreeSelectW) Multiple(vals *[]string) *TreeSelectW
Multiple binds the selection to *vals instead (each click toggles a node).
func (*TreeSelectW) NotFoundContent ¶
func (w *TreeSelectW) NotFoundContent(s string) *TreeSelectW
NotFoundContent sets the text of an empty dropdown (Ant notFoundContent, Element no-data-text).
func (*TreeSelectW) Open ¶
func (w *TreeSelectW) Open() *TreeSelectW
Open forces the dropdown open (screenshots, tests).
func (*TreeSelectW) Placeholder ¶
func (w *TreeSelectW) Placeholder(s string) *TreeSelectW
func (*TreeSelectW) Placement ¶
func (w *TreeSelectW) Placement(p Placement) *TreeSelectW
Placement sets where the dropdown opens: BottomStart (default), BottomEnd, TopStart or TopEnd (Ant placement, Element placement); it flips when there is no room. ConfigProvider.Defaults("TreeSelect", "placement") takes the Ant names.
func (*TreeSelectW) Searchable ¶
func (w *TreeSelectW) Searchable() *TreeSelectW
func (*TreeSelectW) ShowCheckedStrategy ¶
func (w *TreeSelectW) ShowCheckedStrategy(s CheckedStrategy) *TreeSelectW
ShowCheckedStrategy chooses the tags of Checkable mode (default ShowChild: checked leaves; ShowParent: a fully checked parent replaces its children; ShowAll: every checked node). By default the bound value holds the checked leaves and Checked returns the strategy's values; with StrategyValue(true) the bound value itself follows the strategy (Ant).
func (*TreeSelectW) Size ¶
func (w *TreeSelectW) Size(s ControlSize) *TreeSelectW
func (*TreeSelectW) Status ¶
func (w *TreeSelectW) Status(s string) *TreeSelectW
func (*TreeSelectW) StrategyValue ¶
func (w *TreeSelectW) StrategyValue(on bool) *TreeSelectW
StrategyValue makes the bound value of Checkable mode follow the checked strategy, as Ant's value does: with ShowParent a fully checked parent is stored instead of its leaves, with ShowAll parents and leaves are both stored. Values written by the application are read the same way (a parent value checks its whole subtree). Default false: the value holds the checked leaves whatever the strategy (lossless with lazy loading and disabled nodes, and what earlier versions stored).
func (*TreeSelectW) Variant ¶
func (w *TreeSelectW) Variant(v FieldVariant) *TreeSelectW
Variant sets the frame look (FieldOutlined by default).
func (*TreeSelectW) Virtual ¶
func (w *TreeSelectW) Virtual(on bool) *TreeSelectW
Virtual forces the virtual dropdown on or off (default: more than 100 visible rows).
func (*TreeSelectW) Width ¶
func (w *TreeSelectW) Width(px float32) *TreeSelectW
type TreeW ¶
type TreeW struct {
// contains filtered or unexported fields
}
TreeW is a hierarchical list with expand, select, check, drag and search.
func Tree ¶
Tree starts a tree over nodes; configure with modifiers and call Show.
The tree is one Tab stop. Keyboard: Up/Down move the focused row, Home/End jump to the first/last row, Right expands (or enters the first child), Left collapses (or returns to the parent), Enter selects, Space checks when Checkable and selects otherwise.
func (*TreeW) A11yLabel ¶
A11yLabel sets the tree's accessible name (inside a FormItem the item label is used).
func (*TreeW) Accordion ¶
Accordion keeps one node expanded per level: expanding a node collapses its expanded siblings (Element accordion).
func (*TreeW) AllowDrag ¶
AllowDrag decides which nodes can be dragged (antd draggable.nodeDraggable, Element allow-drag).
func (*TreeW) AllowDrop ¶
AllowDrop decides where a dragged node may land (antd allowDrop, Element allow-drop); pos is TreeDropBefore / Inside / After.
func (*TreeW) Built ¶
Built returns how many rows the last Show built. With virtual scrolling it counts the viewport rows and overscan.
func (*TreeW) CheckChanged ¶
func (*TreeW) CheckOnClick ¶
CheckOnClick toggles the checkbox when a checkable node's title is clicked (Element check-on-click-node).
func (*TreeW) CheckOnClickLeaf ¶
CheckOnClickLeaf toggles the checkbox when a checkable leaf's title is clicked (Element check-on-click-leaf, on by default there; antd selects instead, so it is off by default here: turn it on per tree or with Defaults("Tree", Props{"checkOnClickLeaf": true})).
func (*TreeW) CheckStrictly ¶
CheckStrictly disables parent/child check cascading.
func (*TreeW) DataVersion ¶
DataVersion turns on the cache for a virtual scrolling tree and tells it that its nodes were modified in place. The tree keeps the parent map, Filter visibility, flattened visible rows and check states between frames while the top-level nodes slice (identity and length), v, the expanded keys, the search keyword and the checked keys stay the same, so a frame costs O(rows in view) instead of O(nodes). Titles and the other node fields are read live; a structural change made in place (children added, removed or replaced, keys changed, a title edit that changes a Filter match) shows only after v changes (or with a new slice). The check states, parents' checked and half-checked marks included, are cached too: a child's Disabled or DisableCheckbox changed in place (which changes how checks cascade) also needs a change of v. Without DataVersion the tree rebuilds all of this every frame, as before.
func (*TreeW) DefaultExpandAll ¶
DefaultExpandAll expands every parent node the first time the tree is shown (antd defaultExpandAll, Element default-expand-all).
func (*TreeW) Disabled ¶
Disabled disables the whole tree (antd disabled): no selection, expansion, checking, dragging or keyboard focus.
func (*TreeW) Dropped ¶
Dropped reports a completed drag in the last Show: the dragged key, the key it was dropped on and the position (TreeDropBefore/Inside/After).
func (*TreeW) EmptyText ¶
EmptyText shows s when the tree has no rows to show (Element empty-text; antd shows nothing). The Element theme shows Locale.NoData by default (TreeToken.ShowEmptyText).
func (*TreeW) ExpandChanged ¶
func (*TreeW) ExpandOnClick ¶
ExpandOnClick toggles expansion when the title is clicked (Element's expand-on-click-node, on by default with the Element theme).
func (*TreeW) Filter ¶
Filter hides nodes that neither match the search keyword nor contain a match (Element's filter-node-method).
func (*TreeW) FilterMethod ¶
FilterMethod replaces the title-contains match used by Search and Filter (antd filterTreeNode, Element filter-node-method).
func (*TreeW) HalfChecked ¶
HalfChecked returns the keys drawn half-checked after the last Show.
func (*TreeW) Height ¶
Height turns the tree into a scrolling viewport of px. By default it builds only the rows in view (Ant height / virtual) and expands or collapses without a height animation. Set virtual: false in ConfigProvider.Defaults("Tree", ...) to build every expanded branch inside the scroll area. The virtual tree walks and flattens the nodes each frame unless DataVersion is set, which caches that work. VirtualTree also supports custom row renderers and Range.
func (*TreeW) LoadData ¶
LoadData enables lazy loading: expanding a non-leaf node without children calls fn(key) every frame until it returns false (still loading = true); a spinner replaces the switcher meanwhile.
func (*TreeW) Search ¶
Search highlights titles containing keyword and, when the keyword changes, expands the parents of every match.
func (*TreeW) SelectChanged ¶
SelectChanged / CheckChanged / ExpandChanged report changes in the last Show.
func (*TreeW) Selectable ¶
Selectable turns selection on or off (antd selectable, default true). An unselectable tree still expands, checks and drags.
type Trigger ¶
type Trigger uint8
Trigger selects how a popup opens.
Append-only: never reorder or insert; the zero value stays TriggerHover.
type UIPoster ¶
type UIPoster interface{ PostUI(fn func()) }
UIPoster is implemented by hosts whose UI thread is the main thread. PostUI runs fn on that thread later, never inline; any goroutine may call it. Runner.Post uses it when no thread is bound. Experimental.
type UploadFile ¶
type UploadFile struct {
Name string
Size int64
Status string
Percent float64
Thumb image.Image
// Set for files the Upload added itself (Picker, dropped files):
Path string // local path of the file
UID int64 // identifies the file while it uploads (0 = none)
Err string // why the upload failed
Response []byte // body of the server's reply to Action
}
UploadFile is an entry of an Upload list. Status is "uploading", "done" or "error"; Percent (0..100) is shown while uploading. Files the Upload adds without Action / CustomRequest are "done" (accepted locally, see CustomRequest).
type UploadListType ¶
type UploadListType string
UploadListType selects how an Upload lists its files (Ant listType).
const ( // UploadListText lists file names under a button (the default). UploadListText UploadListType = "text" // UploadListPicture lists bordered rows with a thumbnail, the name // and the upload progress under a button. UploadListPicture UploadListType = "picture" // UploadListPictureCard shows thumbnail cards with a "+" card // trigger (PictureCard). UploadListPictureCard UploadListType = "picture-card" )
type UploadLocale ¶
type UploadLocale struct {
Trigger string // picture-card add tile ("上传")
Uploading string // progress text of a file ("文件上传中")
Remove string // remove action of a file
Preview string // preview action of a file
Button string // select button / Element dragger link ("点击上传")
DragTitle string // Ant dragger title
DropPrefix string // Element dragger text before the link ("将文件拖到此处,或")
// Announcements and rejection messages of dropped / picked files.
DoneFmt string // upload finished, arg: file name ("%s 上传成功")
FailedFmt string // upload failed, arg: file name ("%s 上传失败")
TooManyFmt string // list full, arg: file name
BadTypeFmt string // type not accepted, arg: file name
TooLargeFmt string // over the size limit, args: file name, limit ("%s 超过 %s")
IsDirFmt string // a folder was dropped, arg: folder name
// contains filtered or unexported fields
}
UploadLocale holds the Upload texts. The dragger has no default hint line; set one with DragText.
type UploadW ¶
type UploadW struct {
// contains filtered or unexported fields
}
UploadW shows an upload trigger and the file list. The UI layer never opens a file dialog itself: OnPick (or Picked) tells the host to show one (e.g. with the dialog package) and append the chosen files to the list.
func Upload ¶
func Upload(c *Context, files *[]UploadFile) *UploadW
Upload adds an upload area bound to *files.
func (*UploadW) Accept ¶
Accept limits the files Picker offers and the files accepted from the picker or a drop: comma-separated extensions and MIME types (".png,.jpg,image/*", like the HTML accept attribute). Other files are rejected with a message.
func (*UploadW) Action ¶
Action uploads every added file to url (multipart/form-data POST, field "file"), showing its progress; Headers, Data, FieldName, Method, Retries and Client tune the request. A reply with status >= 400 or a network error marks the file "error" with a retry button.
func (*UploadW) Added ¶
func (w *UploadW) Added() []UploadFile
Added returns the files the Upload added this frame (picked or dropped, after the checks).
func (*UploadW) AutoUpload ¶
AutoUpload(false) holds the files added with Action or CustomRequest in the list with Status "ready" instead of uploading them at once (Element auto-upload=false, Ant beforeUpload returning false); Submit uploads them. Without Action / CustomRequest files are accepted locally either way.
func (*UploadW) BeforeUpload ¶
func (w *UploadW) BeforeUpload(fn func(f UploadFile) error) *UploadW
BeforeUpload runs for every file about to be added (after Accept and MaxSize); a non-nil error rejects it and is shown as the message.
func (*UploadW) ButtonText ¶
ButtonText sets the text of the default button trigger.
func (*UploadW) CustomRequest ¶
func (w *UploadW) CustomRequest(fn func(ctx context.Context, f UploadFile, progress func(pct float64)) ([]byte, error)) *UploadW
CustomRequest uploads every added file with fn instead of the built-in HTTP request (Ant customRequest): fn runs on its own goroutine, reports progress (0..100) and returns the reply body or an error. The file shows "uploading", then "done" or "error" with a retry button, like Action; Retries also applies. ctx is cancelled when the file is removed.
Without Action and CustomRequest the Upload only collects files: they are added with Status "done" (meaning accepted locally) and handed to the application through Added; an application that uploads them itself sets Status / Percent / Err on the bound list.
func (*UploadW) Directory ¶
Directory picks (and accepts dropped) folders and adds every file in them, named by their path inside the folder (Ant directory). The picker must support choosing folders (uihost.FilePicker does).
func (*UploadW) DragOver ¶
DragOver highlights the dragger while the host reports a file drag over the window.
func (*UploadW) ListType ¶
func (w *UploadW) ListType(t UploadListType) *UploadW
ListType selects the file list: UploadListText (default), UploadListPicture (PictureList) or UploadListPictureCard (PictureCard).
func (*UploadW) MaxCount ¶
MaxCount limits the number of files; the trigger is disabled (cards: hidden) once reached and further files are rejected (see Rejections; Element limit / on-exceed). MaxCount(1) replaces the current file with the new one instead, like antd maxCount={1}: the trigger stays enabled.
func (*UploadW) Picker ¶
Picker sets the file chooser the trigger opens (uihost.FilePicker for the native dialog). It runs on its own goroutine and returns the chosen paths (nil, nil when cancelled); accept is Accept, multiple is Multiple, dir is Directory. The files are then checked and added to the list (and uploaded with Action). OnPick still runs, for hosts that add files themselves.
func (*UploadW) PictureCard ¶
PictureCard shows files as thumbnail cards with a "+" card trigger.
func (*UploadW) PictureList ¶
PictureList lists the files as bordered rows with a thumbnail (the file's Thumb, else a picture glyph), the name and the progress bar, under the button trigger (Ant listType="picture", Element list-type="picture"). Clicking a thumbnail reports it through Previewed.
func (*UploadW) Previewed ¶
Previewed returns the index of the card whose preview icon was clicked, or -1.
func (*UploadW) Rejections ¶
Rejections returns the messages about files that were not added (wrong type, too large, BeforeUpload errors), shown under the trigger until the next pick or drop.
func (*UploadW) Retries ¶
Retries retries a failed request up to n more times before showing the error.
func (*UploadW) ShowUploadList ¶
ShowUploadList shows (true, the default) or hides the file list (antd showUploadList, Element show-file-list); the trigger, tip and rejections stay.
func (*UploadW) Submit ¶
Submit uploads every "ready" file of the list (see AutoUpload) with Action or CustomRequest, e.g. when a separate "upload" button is clicked. It returns how many uploads it started.
type ValueCopier ¶
ValueCopier is implemented by sources whose nodes show a shortened value: CopyValue returns the full value for "copy value".
type ValueNode ¶
type ValueNode struct {
// Name is the object key or variable name; for array elements the
// index (with Index set). The single root of a JSON document has
// none.
Name string
Index bool
Kind ValueKind
// Value is the display text: scalars as written (strings without
// quotes, possibly shortened), a summary for ValueOther; empty for
// objects and arrays (the view shows their size).
Value string
// Type is an optional type label shown after the value (debuggers).
Type string
// Count is the number of children of an object or array; -1 when
// unknown until they are loaded. A node with Count 0 has no children.
Count int
// Ref is the source's own handle of the node, passed back to
// Children.
Ref any
}
ValueNode is one node of a value tree.
type ValueSource ¶
type ValueSource interface {
// Roots returns the top-level nodes.
Roots() []ValueNode
// Children returns the children [from, to) of parent (to = -1: all).
Children(parent *ValueNode, from, to int) (kids []ValueNode, ok bool)
}
ValueSource supplies a value tree lazily: JSONView asks for children only when a node is expanded, and only for the expanded range of a large array or object (groups of 100). Sources may load asynchronously: Children returns ok=false while loading and the view asks again (call Context.Invalidator's function when the data arrives to repaint at once).
func GoValueSource ¶
func GoValueSource(v any) ValueSource
GoValueSource returns a ValueSource over a Go value: structs (exported fields, named by their json tag when present), maps (sorted keys), slices, arrays, pointers and interfaces are expanded; values with a String or Error method that are not containers show that text.
func JSONSource ¶
func JSONSource(data []byte) (ValueSource, error)
JSONSource returns a ValueSource over a JSON document, or an error when it is not valid JSON. The document is scanned lazily: expanding a node reads only that container, so multi-megabyte documents open at once. data must not change while the source is in use.
type VirtualListW ¶
type VirtualListW struct {
// contains filtered or unexported fields
}
VirtualListW is a vertically scrolling list of n fixed-height rows that only builds the rows inside the viewport (plus a small overscan), so it stays cheap for hundreds of thousands of items.
func VirtualList ¶
func VirtualList(c *Context, n int, itemHeight float32, fn func(i int), opts ...layout.Option) *VirtualListW
VirtualList adds a virtual list of n rows of itemHeight px; fn(i) builds row i (it runs inside a fixed-height row and its own identity scope, so row widgets keep their state while scrolling).
ui.VirtualList(c, len(rows), 32, func(i int) { ui.Text(c, rows[i]) }).Height(400)
func (*VirtualListW) A11yLabel ¶
func (w *VirtualListW) A11yLabel(s string) *VirtualListW
A11yLabel sets the accessible name of the list.
func (*VirtualListW) Height ¶
func (w *VirtualListW) Height(px float32) *VirtualListW
Height fixes the viewport height.
func (*VirtualListW) Layout ¶
func (w *VirtualListW) Layout(opts ...layout.Option) *VirtualListW
Layout applies layout options to the viewport.
func (*VirtualListW) Offset ¶
func (w *VirtualListW) Offset() float64
Offset returns the vertical scroll offset.
func (*VirtualListW) Overscan ¶
func (w *VirtualListW) Overscan(rows int) *VirtualListW
Overscan sets how many extra rows are built above and below the viewport (default 3).
func (*VirtualListW) Range ¶
func (w *VirtualListW) Range() (first, end int)
Range returns the half-open range [first, end) of rows built this frame.
func (*VirtualListW) ScrollIntoView ¶
func (w *VirtualListW) ScrollIntoView(i int) *VirtualListW
ScrollIntoView scrolls the minimum amount that makes row i fully visible.
func (*VirtualListW) ScrollToIndex ¶
func (w *VirtualListW) ScrollToIndex(i int) *VirtualListW
ScrollToIndex scrolls so row i is at the top (clamped to the list).
type VirtualOptionGroup ¶
VirtualOptionGroup is a titled group of options (Element's grouped options, Ant's OptGroup).
type VirtualOptionState ¶
type VirtualOptionState struct {
Active bool // keyboard / hover highlight
Selected bool
Disabled bool // disabled option, or the selection limit is reached
Created bool // the "create new entry" row of AllowCreate
}
VirtualOptionState tells a custom option renderer how the row is shown.
type VirtualSelectW ¶
type VirtualSelectW struct {
// contains filtered or unexported fields
}
VirtualSelectW is a single or multiple select with a virtualized dropdown. Build it with VirtualSelect and chain modifiers; the dropdown and value handling run when a query method is called or at the end of the build.
func VirtualSelect ¶
func VirtualSelect(c *Context, val *string, opts []Option) *VirtualSelectW
VirtualSelect adds a select bound to *val over opts whose dropdown only builds the visible rows (100k options stay smooth). Call Multiple to bind a list of values instead.
ui.VirtualSelect(c, &city, cities).Filterable().AllowClear() ui.VirtualSelect(c, nil, opts).Multiple(&tags).MaxCount(3)
func (*VirtualSelectW) AllowClear ¶
func (w *VirtualSelectW) AllowClear() *VirtualSelectW
AllowClear shows a clear button on hover.
func (*VirtualSelectW) AllowCreate ¶
func (w *VirtualSelectW) AllowCreate() *VirtualSelectW
AllowCreate offers the typed text as a new option when no label matches it exactly (Element allow-create, Ant mode="tags"); read it with Created.
func (*VirtualSelectW) Changed ¶
func (w *VirtualSelectW) Changed() bool
Changed reports a selection change this frame.
func (*VirtualSelectW) Created ¶
func (w *VirtualSelectW) Created() (string, bool)
Created returns the value of an entry created with AllowCreate this frame.
func (*VirtualSelectW) DataVersion ¶
func (w *VirtualSelectW) DataVersion(v int) *VirtualSelectW
DataVersion tells the select that the option slices were modified in place (caches are keyed by slice identity and this number).
func (*VirtualSelectW) Debounce ¶
func (w *VirtualSelectW) Debounce(d time.Duration) *VirtualSelectW
Debounce sets the delay of Remote calls.
func (*VirtualSelectW) Disabled ¶
func (w *VirtualSelectW) Disabled(on bool) *VirtualSelectW
Disabled turns the control off.
func (*VirtualSelectW) FilterMethod ¶
func (w *VirtualSelectW) FilterMethod(fn func(query string, o Option) bool) *VirtualSelectW
FilterMethod replaces the label match used by Filterable.
func (*VirtualSelectW) Filterable ¶
func (w *VirtualSelectW) Filterable() *VirtualSelectW
Filterable lets the user type to filter options by label (case-insensitive).
func (*VirtualSelectW) Groups ¶
func (w *VirtualSelectW) Groups(groups []VirtualOptionGroup) *VirtualSelectW
Groups replaces the options with titled groups (group titles are not selectable and are skipped by the keyboard).
func (*VirtualSelectW) IsOpen ¶
func (w *VirtualSelectW) IsOpen() bool
IsOpen reports whether the dropdown is shown.
func (*VirtualSelectW) ItemHeight ¶
func (w *VirtualSelectW) ItemHeight(px float32) *VirtualSelectW
ItemHeight sets the option row height (Element 34, Ant 32).
func (*VirtualSelectW) Layout ¶
func (w *VirtualSelectW) Layout(o ...layout.Option) *VirtualSelectW
Layout applies layout options to the control.
func (*VirtualSelectW) ListHeight ¶
func (w *VirtualSelectW) ListHeight(px float32) *VirtualSelectW
ListHeight sets the maximum dropdown height (Element 274, Ant 256).
func (*VirtualSelectW) Loading ¶
func (w *VirtualSelectW) Loading(on bool) *VirtualSelectW
Loading shows the loading text instead of the options and a spinner in place of the arrow (Ant loading).
func (*VirtualSelectW) MaxCount ¶
func (w *VirtualSelectW) MaxCount(n int) *VirtualSelectW
MaxCount limits how many values a multiple select may hold (Element multiple-limit, Ant maxCount); other options turn disabled at the limit.
func (*VirtualSelectW) MaxTagCount ¶
func (w *VirtualSelectW) MaxTagCount(n int) *VirtualSelectW
MaxTagCount collapses tags after n into "+ N ...".
func (*VirtualSelectW) Multiple ¶
func (w *VirtualSelectW) Multiple(vals *[]string) *VirtualSelectW
Multiple switches to multiple selection bound to *vals (selected values shown as closable tags).
func (*VirtualSelectW) NotFoundContent ¶
func (w *VirtualSelectW) NotFoundContent(s string) *VirtualSelectW
NotFoundContent replaces the text of an empty dropdown (Element no-data-text / no-match-text, Ant notFoundContent).
func (*VirtualSelectW) Open ¶
func (w *VirtualSelectW) Open() *VirtualSelectW
Open forces the dropdown open (screenshots, tests).
func (*VirtualSelectW) OptionRender ¶
func (w *VirtualSelectW) OptionRender(fn func(o Option, s VirtualOptionState)) *VirtualSelectW
OptionRender builds each option row's content with fn instead of the plain label (the row background, highlight and check mark stay).
func (*VirtualSelectW) Placeholder ¶
func (w *VirtualSelectW) Placeholder(s string) *VirtualSelectW
Placeholder sets the text shown without a value.
func (*VirtualSelectW) Placement ¶
func (w *VirtualSelectW) Placement(p Placement) *VirtualSelectW
Placement sets where the dropdown opens: BottomStart (default), BottomEnd, TopStart or TopEnd (Element placement, Ant placement); it flips when there is no room.
func (*VirtualSelectW) Query ¶
func (w *VirtualSelectW) Query() string
Query returns the current search text.
func (*VirtualSelectW) Remote ¶
func (w *VirtualSelectW) Remote(fn func(query string)) *VirtualSelectW
Remote turns on server-side search: fn receives the typed query after Debounce (default 300ms) and should replace the options; local filtering is off. Show progress with Loading.
func (*VirtualSelectW) Size ¶
func (w *VirtualSelectW) Size(s ControlSize) *VirtualSelectW
Size sets the control size.
func (*VirtualSelectW) Status ¶
func (w *VirtualSelectW) Status(s string) *VirtualSelectW
Status sets the validation status ("error", "warning").
func (*VirtualSelectW) Width ¶
func (w *VirtualSelectW) Width(px float32) *VirtualSelectW
Width fixes the control width.
type VirtualTreeW ¶
type VirtualTreeW struct {
// contains filtered or unexported fields
}
VirtualTreeW is a virtualized tree. Configure it with modifiers and call Show.
func VirtualTree ¶
func VirtualTree(c *Context, nodes []TreeNode) *VirtualTreeW
VirtualTree starts a virtualized tree over nodes (keys unique in the whole tree); configure with modifiers and call Show.
Keyboard (the tree is one Tab stop): Up/Down/PageUp/PageDown/Home/End move the cursor row, Right expands or enters the first child, Left collapses or returns to the parent, Enter makes the row current, Space checks it when Checkable.
ui.VirtualTree(c, nodes).Checkable(&checked).Height(400).Show()
func (*VirtualTreeW) Accordion ¶
func (w *VirtualTreeW) Accordion() *VirtualTreeW
Accordion keeps one node expanded per level: expanding a node collapses its expanded siblings (Element accordion).
func (*VirtualTreeW) CheckChanged ¶
func (w *VirtualTreeW) CheckChanged() bool
CheckChanged / ExpandChanged / CurrentChanged report changes in Show.
func (*VirtualTreeW) CheckOnClick ¶
func (w *VirtualTreeW) CheckOnClick() *VirtualTreeW
CheckOnClick toggles the check box when a row is clicked.
func (*VirtualTreeW) CheckOnClickLeaf ¶
func (w *VirtualTreeW) CheckOnClickLeaf(on bool) *VirtualTreeW
CheckOnClickLeaf toggles the check box when a leaf row is clicked (Element check-on-click-leaf; off by default, as antd selects instead).
func (*VirtualTreeW) CheckStrictly ¶
func (w *VirtualTreeW) CheckStrictly() *VirtualTreeW
CheckStrictly makes parent and child check states independent.
func (*VirtualTreeW) Checkable ¶
func (w *VirtualTreeW) Checkable(checked *[]string) *VirtualTreeW
Checkable shows check boxes bound to checked keys (fully checked keys, parents included; nil keeps them inside the tree).
func (*VirtualTreeW) Current ¶
func (w *VirtualTreeW) Current(key *string) *VirtualTreeW
Current binds the current (highlighted) node key.
func (*VirtualTreeW) CurrentChanged ¶
func (w *VirtualTreeW) CurrentChanged() bool
func (*VirtualTreeW) DataVersion ¶
func (w *VirtualTreeW) DataVersion(v int) *VirtualTreeW
DataVersion tells the tree that nodes were modified in place (the index is keyed by the slice identity and this number).
func (*VirtualTreeW) EmptyText ¶
func (w *VirtualTreeW) EmptyText(s string) *VirtualTreeW
EmptyText shows s instead of the empty illustration when no row is shown (Element empty-text); the Element theme shows Locale.NoData (TreeToken.ShowEmptyText).
func (*VirtualTreeW) ExpandChanged ¶
func (w *VirtualTreeW) ExpandChanged() bool
func (*VirtualTreeW) ExpandOnClick ¶
func (w *VirtualTreeW) ExpandOnClick(on bool) *VirtualTreeW
ExpandOnClick toggles expansion when a row is clicked (Element's expand-on-click-node; on by default with the Element theme).
func (*VirtualTreeW) Expanded ¶
func (w *VirtualTreeW) Expanded(keys *[]string) *VirtualTreeW
Expanded binds the expanded keys to the app.
func (*VirtualTreeW) Filter ¶
func (w *VirtualTreeW) Filter(query string) *VirtualTreeW
Filter shows only nodes matching query (case-insensitive title match) and their ancestors, expanding the ancestors when the query changes.
func (*VirtualTreeW) FilterMethod ¶
func (w *VirtualTreeW) FilterMethod(fn func(query string, n *TreeNode) bool) *VirtualTreeW
FilterMethod replaces the title match used by Filter.
func (*VirtualTreeW) HalfChecked ¶
func (w *VirtualTreeW) HalfChecked() []string
HalfChecked returns the half-checked keys (after Show).
func (*VirtualTreeW) Height ¶
func (w *VirtualTreeW) Height(px float32) *VirtualTreeW
Height sets the viewport height (default 200, Element's default).
func (*VirtualTreeW) ID ¶
func (w *VirtualTreeW) ID() ID
ID returns the scroll viewport's ID (after Show).
func (*VirtualTreeW) LoadData ¶
func (w *VirtualTreeW) LoadData(fn func(key string) bool) *VirtualTreeW
LoadData enables lazy loading: expanding a non-leaf node without children calls fn(key) every frame until it returns false (still loading = true). Add the children to the node meanwhile; the tree re-indexes when loading finishes.
func (*VirtualTreeW) NodeClicked ¶
func (w *VirtualTreeW) NodeClicked() (string, bool)
NodeClicked returns the key of the row clicked in Show.
func (*VirtualTreeW) NodeRender ¶
func (w *VirtualTreeW) NodeRender(fn func(n *TreeNode, depth int)) *VirtualTreeW
NodeRender builds each row's content with fn instead of the title.
func (*VirtualTreeW) Range ¶
func (w *VirtualTreeW) Range() (first, end int)
Range returns the rows [first, end) built by Show.
func (*VirtualTreeW) ScrollToKey ¶
func (w *VirtualTreeW) ScrollToKey(key string) *VirtualTreeW
ScrollToKey expands the ancestors of key and scrolls its row into view.
func (*VirtualTreeW) VisibleCount ¶
func (w *VirtualTreeW) VisibleCount() int
VisibleCount returns the number of rows (expanded and not filtered out).
type WatermarkW ¶
type WatermarkW struct {
// contains filtered or unexported fields
}
WatermarkW tiles rotated text (or an image) over its content. The marks are painted above the children but never take pointer input.
The tiling follows Ant Design 6.7 (es/watermark/useClips.js): each mark is rotated about its centre, the rotated bounding box plus the gap makes a cell, and every other column is shifted down by half a cell.
func Watermark ¶
func Watermark(c *Context, lines ...string) *WatermarkW
Watermark starts a watermark container; each argument is one text line. Defaults follow Ant Design / Element Plus: -22°, gap 100×100, 16px, rgba(0,0,0,.15) (theme-aware), every other column shifted by half a cell.
func (*WatermarkW) Body ¶
func (w *WatermarkW) Body(fn func()) *WatermarkW
Body builds the watermarked content.
func (*WatermarkW) Color ¶
func (w *WatermarkW) Color(col theme.Color) *WatermarkW
Color sets the mark color (use a translucent color).
func (*WatermarkW) FontSize ¶
func (w *WatermarkW) FontSize(px float32) *WatermarkW
FontSize sets the text size.
func (*WatermarkW) FontStyle ¶
func (w *WatermarkW) FontStyle(s string) *WatermarkW
FontStyle sets "normal" (default) or "italic" ("oblique" draws italic; Ant font.fontStyle).
func (*WatermarkW) Gap ¶
func (w *WatermarkW) Gap(x, y float32) *WatermarkW
Gap sets the spacing between marks.
func (*WatermarkW) Grid ¶
func (w *WatermarkW) Grid() *WatermarkW
Grid disables the shifted columns (marks on a plain grid).
func (*WatermarkW) Image ¶
func (w *WatermarkW) Image(img image.Image, wpx, hpx float32) *WatermarkW
Image uses img (drawn at w×h and rotated like text) instead of text.
func (*WatermarkW) ImageOpacity ¶
func (w *WatermarkW) ImageOpacity(a float32) *WatermarkW
ImageOpacity sets the opacity of image marks (default 1: Ant draws the image as it is, so use a faint image or a lower opacity).
func (*WatermarkW) Layout ¶
func (w *WatermarkW) Layout(o ...layout.Option) *WatermarkW
Layout applies layout options to the container.
func (*WatermarkW) MarkSize ¶
func (w *WatermarkW) MarkSize(wpx, hpx float32) *WatermarkW
MarkSize sets the size of one mark before rotation (Ant width / height; default: the text's size, or 120×64 for an image without a size).
func (*WatermarkW) Offset ¶
func (w *WatermarkW) Offset(x, y float32) *WatermarkW
Offset sets where the first mark's box starts, measured to the middle of its gap (Ant offset; default gap/2, the box at the top-left corner).
func (*WatermarkW) Rotate ¶
func (w *WatermarkW) Rotate(deg float64) *WatermarkW
Rotate sets the rotation in degrees (negative = counter-clockwise).
func (*WatermarkW) Weight ¶
func (w *WatermarkW) Weight(wt text.Weight) *WatermarkW
Weight sets the text weight.
type Window ¶
type Window interface {
// Size is the drawable content size in host logical pixels (before UI scaling).
Size() geom.Size
// Scale is the device-pixel ratio (2 on Retina).
Scale() float32
// Invalidate requests that the host call Runner.Frame soon (ideally on
// the next vsync). Calls coalesce.
Invalidate()
// InvalidateAt requests a frame no later than t (timers, animations
// paused between steps, caret blink). A later call with an earlier time
// wins.
InvalidateAt(t time.Time)
// SetCursor changes the pointer shape over the content area.
SetCursor(c input.Cursor)
// ReadClipboard / WriteClipboard access the plain-text clipboard.
ReadClipboard() string
WriteClipboard(s string)
// SetTextInput turns the platform text-input client (IME) on or off and
// reports the caret rectangle, in logical pixels, used to position the
// candidate window. While enabled the host delivers input.TextInput and
// input.Composition events instead of raw characters.
SetTextInput(enabled bool, caret geom.Rect)
// Present shows a finished CPU frame. img has Size()*Scale() pixels,
// is premultiplied RGBA (image.RGBA semantics) and is owned by the
// runner: copy it or upload it before returning. Hosts using a GPU
// renderer (RunnerOptions.Renderer) receive a nil image.
Present(img *image.RGBA) error
}
Window is what the UI runtime needs from a platform window. A platform backend (macOS NSView, Win32 HWND, GTK widget, mobile view) implements it; so does the headless Driver used by tests.
Threading: every method except Invalidate is called on the UI thread (the thread that calls Runner.Frame / Runner.HandleEvent). Invalidate may be called from any goroutine and must only schedule a frame.
type WindowAction ¶
type WindowAction string
WindowAction is a window button the user activated. Open set.
const ( WindowActionMinimize WindowAction = "minimize" WindowActionMaximize WindowAction = "maximize" WindowActionRestore WindowAction = "restore" // back from maximized or full screen WindowActionFullscreen WindowAction = "fullscreen" WindowActionClose WindowAction = "close" )
type WindowControlsStyle ¶
type WindowControlsStyle uint8
WindowControlsStyle is how WindowControls draws the window buttons.
Append-only: never reorder or insert; the zero value stays WindowControlsAuto.
const ( // WindowControlsAuto follows the platform: on macOS traffic lights at // the start (only room for them when the system draws its own), // elsewhere caption buttons at the end; nothing when the window keeps // its system title bar. WindowControlsAuto WindowControlsStyle = iota // WindowControlsCaption draws Windows / Linux caption buttons // (minimize, maximize / restore, close) at the end. WindowControlsCaption // WindowControlsTraffic draws macOS traffic lights (close, minimize, // full screen) at the start. WindowControlsTraffic // WindowControlsNone draws no buttons. WindowControlsNone )
type WindowControlsW ¶
type WindowControlsW struct {
// contains filtered or unexported fields
}
WindowControlsW is the window button group WindowControls returns.
func WindowControls ¶
func WindowControls(c *Context) *WindowControlsW
WindowControls adds the minimize / maximize / close buttons of a frameless window. By default they act on the window the page draws into (Context.Window, when it implements WindowFrame) and follow the platform (WindowControlsAuto). TitleBar includes them; use WindowControls alone in a custom title area.
func (*WindowControlsW) Action ¶
func (w *WindowControlsW) Action() WindowAction
Action reports the button activated this frame ("" for none). Unless Manual, the window has already been asked to perform it.
func (*WindowControlsW) Frame ¶
func (w *WindowControlsW) Frame(f WindowFrame) *WindowControlsW
Frame sets the window the buttons act on, in place of Context.Window.
func (*WindowControlsW) Height ¶
func (w *WindowControlsW) Height(px float32) *WindowControlsW
Height sets the height of caption buttons (the TitleBar token's Height by default).
func (*WindowControlsW) Manual ¶
func (w *WindowControlsW) Manual() *WindowControlsW
Manual only reports the activated button (Action) and leaves the window alone, for apps that confirm before closing or route the actions elsewhere.
func (*WindowControlsW) Style ¶
func (w *WindowControlsW) Style(s WindowControlsStyle) *WindowControlsW
Style picks the button style (WindowControlsAuto by default).
type WindowFrame ¶
type WindowFrame interface {
// FrameInfo describes the window's current state and buttons.
FrameInfo() WindowFrameInfo
// SetWindowState minimizes, maximizes, makes full screen or restores
// the window.
SetWindowState(s WindowState)
// CloseWindow asks the window to close, as its system close button
// would (close handlers may still veto it).
CloseWindow()
// StartWindowMove hands the primary-button press that is in progress
// to the window manager, which moves the window until the button is
// released. Call it while handling the press.
StartWindowMove()
}
WindowFrame is implemented by windows whose frame the page can drive: a frameless window with a self-drawn TitleBar asks it to move, to change state and to close. uihost windows implement it; TitleBar and WindowControls find it on Context.Window, or take one explicitly (TitleBarW.Frame) for other hosts and for tests.
All methods run on the UI thread.
type WindowFrameInfo ¶
type WindowFrameInfo struct {
State WindowState
// SystemButtons is true when the platform draws the window buttons
// over the page itself (macOS traffic lights over a hidden title bar):
// a title bar leaves room for them and draws none.
SystemButtons bool
// SystemTitleBar is true when the window keeps its system title bar
// (and buttons): a TitleBar in the page draws no window buttons.
SystemTitleBar bool
// NoMinimize, NoMaximize and NoClose disable those buttons (the
// window's appearance forbids the action).
NoMinimize, NoMaximize, NoClose bool
// contains filtered or unexported fields
}
WindowFrameInfo is what a WindowFrame reports about its window.
type WindowOptions ¶
type WindowOptions struct {
Title string
Width, Height float32 // logical
MinWidth, MinHeight float32
Resizable bool
BackgroundTransparent bool
// contains filtered or unexported fields
}
WindowOptions describe a window to open.
type WindowState ¶
type WindowState uint8
WindowState is the state of a window.
Append-only: never reorder or insert; the zero value stays WindowNormal.
const ( WindowNormal WindowState = iota WindowMinimized WindowMaximized WindowFullscreen )
Source Files
¶
- a11y_audit.go
- a11y_keys.go
- a11y_tree.go
- anim.go
- ansi.go
- antd_chevron.go
- aspect_ratio.go
- back.go
- button.go
- button_group.go
- chat_approval.go
- chat_bubble.go
- chat_bubble_list.go
- chat_chain.go
- chat_conversations.go
- chat_conversations_view.go
- chat_locale.go
- chat_prompts.go
- chat_sender.go
- choice.go
- code_highlight.go
- codeblock.go
- codeblock_header.go
- codeblock_search.go
- content.go
- context.go
- damage.go
- damage_fp.go
- data_badge.go
- data_calendar.go
- data_card.go
- data_carousel.go
- data_collapse.go
- data_image.go
- data_list.go
- data_list_virtual.go
- data_popover.go
- data_progress.go
- data_qrcode.go
- data_result.go
- data_skeleton.go
- data_timeline.go
- data_tree.go
- data_tree_cache.go
- data_typography.go
- data_util.go
- data_watermark.go
- date.go
- date_multi.go
- date_util.go
- defaults_more.go
- direction.go
- display.go
- doc.go
- dock.go
- dock_layout.go
- driver.go
- driver_touch.go
- editor.go
- entry_autocomplete.go
- entry_cascader.go
- entry_cascader_panel.go
- entry_checkall.go
- entry_color.go
- entry_compact.go
- entry_datepanel.go
- entry_daterange.go
- entry_datetime.go
- entry_inputtag.go
- entry_inputx.go
- entry_mentions.go
- entry_multiselect.go
- entry_otp.go
- entry_rate.go
- entry_segmented.go
- entry_time.go
- entry_transfer.go
- entry_treeselect.go
- entry_upload.go
- entry_util.go
- env.go
- escape_claim.go
- events_for.go
- feedback.go
- fill_border_beam.go
- fill_color_panel.go
- fill_date_panel.go
- fill_listy.go
- fill_masonry.go
- fill_util.go
- fill_virtual_select.go
- fill_virtual_tree.go
- focus.go
- form.go
- form_pro.go
- form_pro_captcha.go
- form_pro_field.go
- form_pro_list.go
- form_pro_modal.go
- form_pro_query.go
- form_pro_schema.go
- form_pro_steps.go
- form_pro_types.go
- frame_alloc.go
- globals.go
- hotkey_input.go
- hover.go
- icon_dir.go
- image_cache.go
- inline.go
- input.go
- input_hook.go
- item.go
- jsonview.go
- jsonview_source.go
- keyboard.go
- layers.go
- locale.go
- locale_dir.go
- locale_packs.go
- locale_shell.go
- logview.go
- logview_buffer.go
- markdown_anchor.go
- markdown_viewport.go
- menubar.go
- mirror_check.go
- money.go
- more_checktag.go
- more_confirm.go
- more_infinite.go
- more_markdown.go
- more_markdown_image.go
- more_mdeditor.go
- more_richtext.go
- more_timeselect.go
- more_virtual.go
- native_view.go
- nav.go
- nav_affix.go
- nav_config.go
- nav_contextmenu.go
- nav_dropdown.go
- nav_float.go
- nav_grid.go
- nav_menu.go
- nav_notify.go
- nav_pageheader.go
- nav_space.go
- nav_splitter.go
- nav_steps.go
- nav_tabs_drag.go
- nav_util.go
- node_reuse.go
- notification_center.go
- overlay.go
- p2a_date.go
- p2a_range_time.go
- p2a_time_range.go
- p2b_cascader.go
- p2b_config.go
- p2b_select.go
- p2b_slider.go
- p2b_transfer.go
- p2b_treeselect.go
- p2d_box.go
- p2d_form.go
- p2d_input.go
- p2d_number.go
- p2d_upload.go
- p2e_currency.go
- p2e_drop.go
- p2e_editable.go
- p2e_field.go
- pointer_capture.go
- popup_arrow.go
- pro2_card.go
- pro2_checkcard.go
- pro2_page.go
- pro2_skeleton.go
- pro2_statistic.go
- pro2_util.go
- pro3_descriptions.go
- pro3_fieldset.go
- pro3_lightfilter.go
- pro3_list.go
- pro3_login.go
- pro3_util.go
- pro4_app.go
- pro4_breadcrumb.go
- pro4_group.go
- pro4_pageloading.go
- pro4_route.go
- pro4_setting.go
- pro4_topnav.go
- prolayout.go
- remote_search.go
- reveal.go
- rtl_api.go
- runner.go
- runner_thread.go
- runner_trim.go
- safearea.go
- scroll.go
- scroll_touch.go
- select.go
- selector.go
- shad2a_defaults.go
- shad2a_form.go
- shad2a_slider.go
- shad2a_tree.go
- shad2a_upload.go
- shad2a_util.go
- shad2b_table.go
- shad2b_util.go
- shad2c_alert.go
- shad2c_confirm.go
- shad2c_defaults.go
- shad2d_card.go
- shad2d_layout.go
- shad2d_login.go
- shad2d_table.go
- shad2d_util.go
- shad_command.go
- shad_kbd.go
- shad_toggle.go
- shortcut_capture.go
- showcheck.go
- showcheck_release.go
- status.go
- statusbar.go
- tab_capture.go
- table.go
- table_body.go
- table_edit.go
- table_header.go
- table_icons.go
- table_keep.go
- table_keys.go
- table_model.go
- table_pro.go
- table_pro_dropdown.go
- table_pro_editor.go
- table_pro_toolbar.go
- table_show.go
- table_transpose.go
- text.go
- textstate.go
- theme_for.go
- threadcheck_release.go
- titlebar.go
- touch.go
- ui_scale.go
- viewer_text.go
- window.go
- window_frame.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package a11y defines the platform-neutral accessibility (semantics) tree produced by the Tango UI runner.
|
Package a11y defines the platform-neutral accessibility (semantics) tree produced by the Tango UI runner. |
|
Package chart is the chart library of the Tango self-drawn UI: line, area, column / bar, pie / donut, scatter / bubble, radar, gauge, funnel, heatmap, dual axes, liquid and tiny (sparkline) charts, drawn with the ui/paint display list and styled after Ant Design Charts (G2) for the Ant flavor and ECharts for Element Plus.
|
Package chart is the chart library of the Tango self-drawn UI: line, area, column / bar, pie / donut, scatter / bubble, radar, gauge, funnel, heatmap, dual axes, liquid and tiny (sparkline) charts, drawn with the ui/paint display list and styled after Ant Design Charts (G2) for the Ant flavor and ECharts for Element Plus. |
|
Package codehl implements ui.CodeHighlighter with the code editor's language support: the Monarch grammars of ui/editor/langs and the incremental tokenizer of ui/editor/highlight.
|
Package codehl implements ui.CodeHighlighter with the code editor's language support: the Monarch grammars of ui/editor/langs and the incremental tokenizer of ui/editor/highlight. |
|
Package editor is the code editor.
|
Package editor is the code editor. |
|
buffer
Package buffer is the immutable text model behind the code editor.
|
Package buffer is the immutable text model behind the code editor. |
|
diff
Package diff computes line and character level differences between two versions of a text, the algorithm layer behind a diff editor.
|
Package diff computes line and character level differences between two versions of a text, the algorithm layer behind a diff editor. |
|
diffview
Package diffview is the diff editor of ui/editor: two editors side by side (or one inline view) showing the differences between an original and a modified text, computed by ui/editor/diff in the background.
|
Package diffview is the diff editor of ui/editor: two editors side by side (or one inline view) showing the differences between an original and a modified text, computed by ui/editor/diff in the background. |
|
highlight
Package highlight runs Monarch tokenization incrementally for the code editor view: the UI thread tokenizes what is about to be drawn within a time budget (Highlight), and a background goroutine (Start) catches up on the rest of the document from immutable buffer snapshots.
|
Package highlight runs Monarch tokenization incrementally for the code editor view: the UI thread tokenizes what is about to be drawn within a time budget (Highlight), and a background goroutine (Start) catches up on the rest of the document from immutable buffer snapshots. |
|
internal/frameclock
Package frameclock supplies one monotonic clock for editor frame deadlines.
|
Package frameclock supplies one monotonic clock for editor frame deadlines. |
|
keymap
Package keymap parses keybinding text and resolves key events to commands, with VS Code's rule semantics.
|
Package keymap parses keybinding text and resolves key events to commands, with VS Code's rule semantics. |
|
langs
Package langs embeds the built-in language data of the code editor: Monaco Monarch grammars, language configurations and file associations, plus the four Monaco base themes.
|
Package langs embeds the built-in language data of the code editor: Monaco Monarch grammars, language configurations and file associations, plus the four Monaco base themes. |
|
monarch
Package monarch interprets Monaco Monarch grammars (JSON, as exported by ui/editor/langs) and tokenizes text line by line.
|
Package monarch interprets Monaco Monarch grammars (JSON, as exported by ui/editor/langs) and tokenizes text line by line. |
|
regex
Package regex 编译 Monaco Monarch 语法中的 JavaScript 正则。
|
Package regex 编译 Monaco Monarch 语法中的 JavaScript 正则。 |
|
theme
Package theme parses Monaco-format editor themes (IStandaloneThemeData: {base, inherit, rules, colors}) and resolves Monarch token types such as "keyword.go" or "string.escape.ts" to display styles.
|
Package theme parses Monaco-format editor themes (IStandaloneThemeData: {base, inherit, rules, colors}) and resolves Monarch token types such as "keyword.go" or "string.escape.ts" to display styles. |
|
when
Package when parses and evaluates VS Code "when" clause expressions, the conditions keybindings and commands use to decide whether they apply ("editorTextFocus && !editorReadonly").
|
Package when parses and evaluates VS Code "when" clause expressions, the conditions keybindings and commands use to decide whether they apply ("editorTextFocus && !editorReadonly"). |
|
Package geom holds the small geometry vocabulary shared by every layer of the Tango self-drawn UI (layout, paint, text, input).
|
Package geom holds the small geometry vocabulary shared by every layer of the Tango self-drawn UI (layout, paint, text, input). |
|
Package graph holds the graph widgets of the Tango self-drawn UI: a node-link diagram canvas (Diagram), an entity-relationship preset built on it (ER) and a git commit graph (GitGraph).
|
Package graph holds the graph widgets of the Tango self-drawn UI: a node-link diagram canvas (Diagram), an entity-relationship preset built on it (ER) and a git commit graph (GitGraph). |
|
Package icon draws vector UI icons (no icon font).
|
Package icon draws vector UI icons (no icon font). |
|
antd
Package antd is the complete Ant Design icon set (@ant-design/icons-svg, MIT; see LICENSE) in its three themes: Outlined, Filled and TwoTone, named like @ant-design/icons (SearchOutlined, CheckCircleFilled, CheckCircleTwoTone):
|
Package antd is the complete Ant Design icon set (@ant-design/icons-svg, MIT; see LICENSE) in its three themes: Outlined, Filled and TwoTone, named like @ant-design/icons (SearchOutlined, CheckCircleFilled, CheckCircleTwoTone): |
|
element
Package element is the complete Element Plus icon set (@element-plus/icons-svg, MIT; see LICENSE), 293 filled icons on a 1024-unit grid:
|
Package element is the complete Element Plus icon set (@element-plus/icons-svg, MIT; see LICENSE), 293 filled icons on a 1024-unit grid: |
|
filetype
Package filetype picks icons for files and folders, the way an IDE's file tree does: a file name resolves to a Kind (code, image, archive, …) by its exact name or extension, and a Set maps kinds to icons.
|
Package filetype picks icons for files and folders, the way an IDE's file tree does: a file name resolves to a Kind (code, image, archive, …) by its exact name or extension, and a Set maps kinds to icons. |
|
Package input defines the events a platform host feeds into the Tango self-drawn UI (pointer, multi-touch, wheel, keyboard, committed text and IME composition), the cursor shapes the UI asks the host to show, and the focus/Tab-order bookkeeping shared by focusable widgets.
|
Package input defines the events a platform host feeds into the Tango self-drawn UI (pointer, multi-touch, wheel, keyboard, committed text and IME composition), the cursor shapes the UI asks the host to show, and the focus/Tab-order bookkeeping shared by focusable widgets. |
|
internal
|
|
|
flexbox
Package flexbox is the flexbox-style layout solver of the Tango self-drawn UI: Row/Column with Grow/Shrink/Basis, Gap, Padding, Margin, Align, Justify and Wrap, plus Stack (children overlap) and absolute positioning for overlays.
|
Package flexbox is the flexbox-style layout solver of the Tango self-drawn UI: Row/Column with Grow/Shrink/Basis, Gap, Padding, Margin, Align, Justify and Wrap, plus Stack (children overlap) and absolute positioning for overlays. |
|
flexbox/flexstyle
Package flexstyle holds the layout input of a node, shared by the public option constructors (package ui/layout) and the solver (package ui/internal/flexbox).
|
Package flexstyle holds the layout input of a node, shared by the public option constructors (package ui/layout) and the solver (package ui/internal/flexbox). |
|
Package layout holds the layout options of the Tango self-drawn UI: Row/Column/Stack containers take Options built here (Grow, W, H, Pad, Gap, Align, Justify, Abs ...), and Box.Style applies more.
|
Package layout holds the layout options of the Tango self-drawn UI: Row/Column/Stack containers take Options built here (Grow, W, H, Pad, Gap, Align, Justify, Abs ...), and Box.Style applies more. |
|
Package mobile provides touch-first widgets for the Tango self-drawn UI in the visual language of Ant Design Mobile (default), Vant and a mobile derivation of shadcn/ui (Shadcn: chosen automatically under a theme.Shadcn ui theme; Drawer-style bottom sheets with a grab handle, grouped action sheet cards, Sonner toasts, segmented tabs): NavBar, TabBar, List/Cell, SwipeCell, PullToRefresh, InfiniteList, ActionSheet, Popup, Dialog, Toast, Picker (cascade, date/time), Stepper, SearchBar, Tabs, Swiper, Grid, NoticeBar, Skeleton, Empty, Result, Badge, Tag, Button, Form, IndexBar, FloatingBubble and SafeArea.
|
Package mobile provides touch-first widgets for the Tango self-drawn UI in the visual language of Ant Design Mobile (default), Vant and a mobile derivation of shadcn/ui (Shadcn: chosen automatically under a theme.Shadcn ui theme; Drawer-style bottom sheets with a grab handle, grouped action sheet cards, Sonner toasts, segmented tabs): NavBar, TabBar, List/Cell, SwipeCell, PullToRefresh, InfiniteList, ActionSheet, Popup, Dialog, Toast, Picker (cascade, date/time), Stepper, SearchBar, Tabs, Swiper, Grid, NoticeBar, Skeleton, Empty, Result, Badge, Tag, Button, Form, IndexBar, FloatingBubble and SafeArea. |
|
Package paint is the display-list layer of the Tango self-drawn UI.
|
Package paint is the display-list layer of the Tango self-drawn UI. |
|
Package terminal is a terminal component: it connects a Conn, the program end of a terminal such as a pseudo-terminal, to the emulator in ui/terminal/vt.
|
Package terminal is a terminal component: it connects a Conn, the program end of a terminal such as a pseudo-terminal, to the emulator in ui/terminal/vt. |
|
vt
Package vt is the terminal emulator core of ui/terminal: it turns the bytes a program writes into screen state, and the keys and text the user types into the bytes the program reads.
|
Package vt is the terminal emulator core of ui/terminal: it turns the bytes a program writes into screen state, and the keys and text the user types into the bytes the program reads. |
|
vt/internal/widthgen
command
Command widthgen generates ui/terminal/vt/width_table.go from the Unicode Character Database.
|
Command widthgen generates ui/terminal/vt/width_table.go from the Unicode Character Database. |
|
Package text shapes and lays out text for the Tango self-drawn UI.
|
Package text shapes and lays out text for the Tango self-drawn UI. |
|
Package theme defines the design tokens of the Tango self-drawn UI.
|
Package theme defines the design tokens of the Tango self-drawn UI. |