Table(Draft)
Base Table draft structural protocol、已实现的 host-neutral topology、accessibility 边界与待补 Adapter 证据。
Base Table 是已有 Checkpoint B host-neutral 实现的 draft protocol,不是已发布的 Adapter conformance 声明。当前切片由 D-BASE-TABLE-STRUCTURE-0001、C-TABLE-STRUCTURE-0001、M-TABLE-STRUCTURE-0001、五个 P-BASE-TABLE* identity 与 T-TABLE-STRUCTURE-0001 治理。React、Vue 与 Vue 2 Adapter profile 证据、CLI facade 注册、可用 runtime preview 与 design-language 工作仍由 #621 Checkpoint C 继续完成。
为什么 Table 是协议
Section titled “为什么 Table 是协议”Table 携带了 Template anatomy 本身无法表达的信息:ordered parts 会形成包含 coordinates 与 spans 的二维 topology,author 声明的 header keys 会解析成 semantic objects 之间的 relationship。Adapter 可以把这张 graph 投影到 accessibility surface,而不必从 prototype name、host tree、CSS class 或 Web-only attribute 猜测 Table behavior。
信息路径是:
Maker-authored parts、spans 与 header keys -> Table Structure topology 与 header graph -> 通用 A11y semantic-object graph -> Adapter 选择的 host projection -> User 可观察的 table relationships当前定义已有 portable Module、Base family 与有界的 Web Component host-projection 证据;它不声明完整 Adapter conformance。
已实现的 host-neutral family
Section titled “已实现的 host-neutral family”Checkpoint B 以匹配的 source 与 executable evidence 精确导出以下 Base identities:
| Identity | Cardinality | 结构职责 |
|---|---|---|
P-BASE-TABLE | 1..1 | 拥有一个独立 Table anatomy domain 及其只读结构 snapshot。 |
P-BASE-TABLE-CAPTION | 0..1 | 提供 authored caption/purpose semantic object。 |
P-BASE-TABLE-ROW | 1..* | 建立一个有序 logical row。 |
P-BASE-TABLE-HEADER-CELL | 1..* | 声明 column/row header、same-domain headerKey 与 spans。 |
P-BASE-TABLE-CELL | 1..* | 声明 spans 与有序、非空的 header-key set。 |
每个 Row 至少包含一个 HeaderCell 或 Cell。Head、Body 与 RowGroup 被明确排除:现有跨宿主证据不足以让它们成为 required portable identity。Web 或 native Adapter 可以在 host materialization 中使用 row-group wrapper,但不能把 wrapper 反推为 Base fact。
Caption、HeaderCell 与 Cell content 仍由 App 通过每个 part 的单一 anonymous Template slot 提供。Table Structure 不把 content 解析成 data record。
Topology 与 header relationships
Section titled “Topology 与 header relationships”Row 与 cell 顺序来自当前 host-observable Anatomy order。每个 Row 的第一个 cell 从 column 0 开始搜索;后续 cell 从前一个已 placement cell 的 exclusive end 开始,选择 cursor 之后第一个可容纳的 rectangle。Placement 不会回填更早的 hole 并反转 authored order。Index 从零开始;rowSpan 与 columnSpan 必须是 positive safe integer,默认值为一。Span 不能和已占用 rectangle overlap,也不能越过当前 row count 或 safe coordinate boundary。Occupancy 使用 ranges,而不是逐个 materialize 所覆盖的 column,因此 large span 不会按数值大小成比例分配空间。
HeaderCell 声明 non-empty、same-domain unique 的 headerKey 与 headerKind: 'column' | 'row'。Cell 声明 ordered、non-empty header-key set。HeaderCell 可以为 layered header 声明 upstream header keys;upstream 表示 target 在 computed row-major topology 中先于 source,self 与 later/downstream reference 均无效。
Resolution 产出 opaque same-domain semantic-object refs,并按 target kind 分成有序 columnHeaders 与 rowHeaders;orderedHeaders 同时保留跨 header kind 的 authored order,供 host labeling 使用。同一个 cell 可以关联多个 header。Missing、empty、duplicate、ambiguous、unprojectable、self 或 downstream reference 都产生 structural diagnostic;实现不得猜测 target 或制造 host id。Resolution 不会搜索 sibling 或 nested Table domain,因此当前 domain 缺失的 key 即使在其它 domain 存在同名 key,也仍然是 missing target。
Insert、remove 与 reorder 会根据 actual parts 重算 snapshot。暂时无效的结构可以保持 mounted 并报告 invalid snapshot,但必须清除 owned structural role、coordinate、span 与 relationship;它不能改写 authored content,也不能发送 data-operation signal。
Accessibility 与 host 边界
Section titled “Accessibility 与 host 边界”Base Table 复用 draft 的通用 A11y 方向与 HC-A11Y-0001,不创建 HC-TABLE。Table Structure 不请求 physical widget、measurement、input、resource 或 system service。
通用 A11y path 已通过合入的 #625 prerequisite 支持 opaque semantic-object references 与有序 multi-target relationships。Web Component 证据现已验证 one-based ARIA row/column count、index、span、caption naming,以及保留各 cell authored content 的显式 header label。React、Vue 与 Vue 2 的 Table projection tests 仍为 planned;通过的 Web Component 切片不表示完整的 cross-Adapter 或 assistive-technology conformance。
外部 host 对照只证明 shared information shape:
| Portable fact | Web accessibility vocabulary | UIKit evidence | Windows UIA evidence |
|---|---|---|---|
| Table domain | 包含 row、cell 与 header descendants 的 table | UIAccessibilityContainerDataTable | TablePattern 与 GridPattern |
| Coordinates 与 spans | ordered rows/cells 与 span properties | row/column counts、addressed cells、row/column ranges | Row、Column、RowSpan、ColumnSpan、ContainingGrid |
| Header relationships | rowheader/columnheader;必要时显式 relation | row/column header element methods | TableItem row/column header providers |
| Multiple headers | 多个 semantic relationship targets | header-element arrays | header-provider collections |
这张 matrix 不会把有界的 Web Component assertions 扩大成完整 Web、UIKit、Windows 或 cross-host conformance。Native 或 translated materialization 仍是需要 executable evidence 的 Adapter-profile decision。
Table 与 Data Table
Section titled “Table 与 Data Table”Base Table 只拥有 passive structure。它明确排除:
- App data records 与 Collection membership;
- sorting;
- row/cell selection;
- pagination 与 virtualization;
- column resize/reorder;
- editing 与 data fetching;
- keyboard grid 与 focus policy;
- form workflow;
- layout-table mode;
- shadcn 或 Brutalist styling。
Later Data Table composition 可以消费 passive structure,同时组合分别受治理的 data、Collection、selection、pagination、virtualization、editing 与其它 capabilities。
Host-neutral reference probe 与 Module/Base tests 已覆盖 deterministic placement、multiple-header resolution、diagnostics、nearest-domain isolation、authored-fact churn、exact anatomy、passive negative boundaries、generic A11y emission 与 projection cleanup。Web Component Adapter test 覆盖 count、index、span、caption identity 与保留内容的 header identity ARIA materialization。新增 @proto.ui/module-table-structure 与 @proto.ui/prototypes-base/table exports 仍为 draft;React、Vue 与 Vue 2 Adapter tests 仍为 planned,本页也暂不提供交互式 Table preview。