Refactor: results expose Element as a named field

Every component result type now names its element Element instead of
embedding *ui.Element. The eleven element-plus-changed results
(AccordionView, CarouselView, CollapsibleView, ImageViewerView,
PaginationResult, StepsResult, SidebarResult, TabsResult, RatingParts,
FileDropZoneParts, TransferParts) fold into ChoiceResult.

Fixes four Gallery demos where .Width(...).Changed() read the element's
flag instead of the component's: Accordion, MultiSelect, Cascader,
TreeSelect. TestDataAccordionDemoLogsChange covers the Accordion.
This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 13:35:53 -04:00
1 parent 078dcab8b4
commit 8880865021
73 files changed
+163 -245

No files matched your search

+2 -2
View File
@@ -65,7 +65,7 @@ func (s *ListState[K]) ScrollTo(i int) {
// ListView is a built List and what happened to it in this frame.
type ListView struct {
*ui.Element
Element *ui.Element
changed, submitted, retry bool
}
@@ -93,7 +93,7 @@ func List[K comparable](c *ui.Context, s *ListState[K], n int, opts ListOptions[
k := Tokens(c)
var v ListView
v.Element = ui.Column(c).MinHeight(0)
v.Children(func() {
v.Element.Children(func() {
if n == 0 {
v.retry = dataPlaceholder(c, opts.Status, opts.Error, opts.Empty, msg(c, "list.empty"))
return