fix(table): full-width empty state, sort focus ring and fr column widths

HD-08 scope, against heroui ce90ea3 table sources and their
react-aria/react-stately dependencies:

- TableBody empty state now spans every real leaf column by default
  (self-registered TableColumns — selection and wrapper-rendered ones
  included — reactively following column changes), explicit colspan
  still wins, and the vnode-level empty detection keeps avoiding
  unknown-component setup/render probing
- sorting keeps one activation per click/Enter/Space (single sort path
  via the column) while the baseline focus ring returns: the trigger
  button keeps keyboard focus and forwards its real :focus-visible
  state to the th's existing [data-focus-visible] hook, so the inset
  ring lands on the column header like the pinned source and the UA
  outline is suppressed only inside a column; aria-sort="none" on
  sortable unsorted columns matches useTableColumnHeader and stays
- defaultWidth="Nfr" distributes the remaining width by weight
  instead of silently becoming auto: widths.ts ports react-stately's
  calculateColumnSizes (static px/% first, fr flex-grow sharing,
  min/max violation freezing, cascade rounding); fr mode locks
  table-layout: fixed for exact geometry, re-shares on container
  resize, freezes dragged columns to their pixel width and keeps
  geometry (with flipped drag direction) in RTL; unmeasured
  environments keep native widths
- .table__cell's text-start/font-normal verified to block caller
  inheritance and narrowed to th.hv-table__cell { inherit }, keeping
  the baseline td row-header typography while ancestor align/weight
  cascade into cells again; th scope=row, corner selectors and the
  resizer z-index fix are untouched
- tests/fixtures/table-layout.vue (playground) drives the real-browser
  geometry/drag/RTL/theme verification; m35-m36 contract pins the two
  new CSS markers in the final tarball

Full suite 111 files / 1657 tests, typecheck, build:docs and the
m35-m36 + handbook-styles tarball contracts pass.
This commit is contained in:
maoyingjie
2026-10-29 10:59:24 +08:00
parent aac93db658
commit 658dfbb7d9
14 changed files with 629 additions and 34 deletions
+5 -2
View File
@@ -362,12 +362,15 @@ Button/ButtonGroup/ToggleButton/ToggleButtonGroup与指定Accordion/Disclosure
- packages/styles/src/index.ts 的 `labelVariants`/`descriptionVariants`/`fieldErrorVariants`/`textFieldVariants`/`switchGroupVariants`:移植 `heroui/packages/styles/src/components/{label/label,description/description,field-error/field-error,textfield/textfield,switch-group/switch-group}.styles.ts`,仅加 `hv-` 前缀;变体键、默认值与 slot 集合逐键保留(Apache-2.0,见 third-party/HEROUI-LICENSE)。
- packages/styles/base/base.css:移植 `heroui/packages/styles/base/base.css` 的边框色继承规则(`*, ::after, ::before, ::backdrop, ::file-selector-button { border-color: var(--border, currentColor) }`),导入序保持 preflight 之后的 base 层。同文件的 `:root { view-transition-name: none }` 与 `::view-transition { pointer-events: none }` 未移植:库与文档站均无 View Transitions API 使用证据,按 HD-05 约定记录无需修改,不建立专项。
### HD-06(2026-10-29)
Link/Breadcrumbs 对照固定 ce90ea3;Breadcrumbs 的34种名称移植自该上游锁文件的 react-aria 3.52.1 `dist/private/intl/breadcrumbs`,仅数据,不引入 React 运行时。Adobe Apache-2.0声明保留于第三方许可及组件包 `LICENSE.react-aria`(随 tarball发布)。Vue identity采用 id/key/index,事件为 @action。日期焦点标记适配真实 DOM :focus-visible。
### HD-07(2026-10-29)
固定HeroUI ce90ea3的InputOTP公开类型及锁定input-otp1.5.0(npm tarball只读source map)核对:pattern.test整值、pasteTransformer先转换、complete effect只跟随accepted value跨阈值。仅在现有Vue/Reka字段/PinInput边界适配,不安装React或增加运行时依赖;底座多input、索引空位、单字段提交保留。全局/sticky RegExp去状态化延续既有Vue行为;字符选区限单槽,非单input任意跨槽选择。字段错误与focus采用现有共享上下文,新增原生ValidityState快照。
## HD-08 来源(2026-10-29)
- packages/vue/src/components/table/widths.ts:移植 react-stately `TableUtils.js`(`calculateColumnSizes` flex-grow 列宽解析、min/max 违规冻结、级联取整)与 `TableColumnLayout.js` 的默认宽度语义(未设宽度按 `1fr`),Apache-2.0;仅函数级移植,无新状态内核。
- 排序焦点环转发与空状态跨列自适应为 Vue 适配(基线由 RAC useTableColumnHeader 的 press/focus 与 TableBody colSpan 承担);`aria-sort` 的 `"none"` 输出与基线 useTableColumnHeader 一致,不作改动。