fix(virtualization): measure natural rows and align viewport geometry

This commit is contained in:
maoyingjie
2026-10-29 17:13:12 +08:00
parent 9f7eb1fa8d
commit 5a00e25a25
18 changed files with 770 additions and 257 deletions
+2
View File
@@ -384,3 +384,5 @@ Link/Breadcrumbs 对照固定 ce90ea3;Breadcrumbs 的34种名称移植自该
## HD-09 虚拟布局(2026-10-29)
固定 ce90ea3 的 `TableLayout`/`ListLayout` 布局契约(table.mdx / list-box.mdx 参数表)与三个虚拟化示例(table 42px、list-box/autocomplete 50px 显式行高;autocomplete 弹层整体滚动 + sticky 搜索框)。`packages/vue/src/components/collection/virtual-rows.ts` 为自研纯测量实现(前缀和+二分),仅语义对齐契约(gap 在内容行之间、padding 为两端占位、loader 预留在行流末尾),非上游代码移植;ListBox 行序列走 VueUse `useVirtualList`(函数式 itemHeight)。autocomplete.css 的虚拟化弹层滚动规则为本仓新增(历史 320px 列表自滚规则限定 `:not([data-virtualized])` 保留);上游样式无 max-h 限制,`max-h-[min(400px,70vh)]` 是近似可用空间钳制的替代,差异如实记录。dropIndicatorThickness 对应拖放布局,Vue 侧 ListBox/Table 零拖放实现,不提供。
HD09-R1:自然行/标题测量、类型保真尺寸缓存和滚动绑定为本库Vue适配;ListBox复用同一useVirtualRows几何,保留既有集合选择/焦点模型,不引入React状态或第二套全局协议。Table原生th/td的padding最小高度与42px虚拟行冲突已证实,新增TableRow.height内容盒适配,不改变非虚拟表格默认DOM。TableLayout headingHeight对应常驻表头,按真实tbody原点处理,纠正原“无分区表头模型所以不提供”的解释。