Add input components 066-085; gallery chrome on real components; deploy warms the edge

This commit is contained in:
ZacharyZhang-NY committed 2026-10-11 19:05:42 -04:00
1 parent 0247a130f5
commit 095eab2b4c
38 files changed
+2340 -172

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
package input
import (
"github.com/egoist/mygo/ui"
"git.zacharyzhang.com/ZacharyZhang-NY/8bitMyGoUI/icon"
"git.zacharyzhang.com/ZacharyZhang-NY/8bitMyGoUI/pixel"
)
type SearchFieldOptions struct {
Placeholder string
Width int
Disabled bool
}
type SearchFieldResult = TextInputResult
// SearchField has a magnifier; Escape clears, Enter submits.
func SearchField(c *ui.Context, label string, value *string, o SearchFieldOptions) SearchFieldResult {
ed, e := field(c, value, pixel.EditorOptions{Label: label, Placeholder: o.Placeholder, Disabled: o.Disabled}, o.Width, nil, icon.Search, nil)
if ed.Input.Shortcut(0, ui.KeyEscape) && *value != "" {
*value, ed.Changed = "", true
}
return result(e, ed, label)
}