fix: portal dropdown surfaces and close the review capability gaps

- Root and submenu surfaces render through the dropdown portal with the overlay
  z-index, so clipping/isolation ancestors no longer cut the menu; panel height
  is capped by the floating available height and the animation origin maps the
  real transform origin.
- Standalone Menu is a static in-flow list: no scroll lock, no outside pointer
  blocking, no floating placement and no focus stealing.
- Selection ownership is isolated per level: section disabled keys add to the
  menu list, and a nested Menu resets the section owner.
- closeOnSelect resolves item > menu policy > per-mode default for selection
  items; actions and radio items close, checkboxes stay open.
- Business keys no longer become DOM ids (instance ids + data-key), and submenu
  surfaces label themselves from the real trigger.
- Long-press keydown runs the caller's handlers first and only opens when not
  cancelled; submenu panels merge caller keydown with the internal Escape.
- Link items render a real anchor, aria labels land on the role=menu node,
  submenu panels forward placement/offset/collision props and caller attrs, and
  the popover provides the default Surface variant.
- Wrapper parts declare real props/emits, plus the missing official capability
  props (disallowEmptySelection, escapeKeyBehavior, shouldFocusWrap, autoFocus,
  shouldCloseOnSelect, close, empty slot, isKeyboardDismissDisabled,
  shouldCloseOnInteractOutside, placement/offset family, scoped slots).
- Ship an independent consumer fixture for browser-level verification.
This commit is contained in:
maoyingjie
2026-10-24 22:56:44 +08:00
parent 043a5418f3
commit 53b4639b0e
25 changed files with 1721 additions and 203 deletions
+7 -5
View File
@@ -102,9 +102,11 @@
### 仍保留 / 未修
- **A5**:链接型菜单项(`href`/`target`)未实现——Reka 菜单项没有锚点路径,需自建或换底座;文档已写明不支持。
- **A18**:子菜单悬停延迟由 Reka 固定 100ms,未暴露官方 `delay`。
- **A19**:长按键盘用 Enter/Space(本批复核明确要求),与 RAC 文档的 Alt+↓ 不同。
> 上表状态为忠实度审计当轮结果;`A5`(链接项)与 `A21` 中的多数能力已在随后的[整批复核返修](B01-complete-review.md)中补齐,以下为当前实际边界。
- **A5**:链接型菜单项已实现(`href` 渲染真实 `<a>`,保留 `target/rel` 等,禁用项阻止导航);剩余差异仅是 key 与 DOM id 分离。
- **A18**:子菜单悬停延迟由底层固定 100ms,未暴露官方 `delay`;子菜单面板 `side/align` 也由底层固定。
- **A19**:长按键盘用 Enter/Space(本批复核要求),与 RAC 文档的 Alt+↓ 不同;长按计时 500ms、10px 取消为自定实现。
- **A20**:`DropdownRoot` 保留 `.hv-dropdown` 包裹元素(承载根级 class/dir),官方该类没有 DOM 宿主。
- **A21**:`disallowEmptySelection`、`escapeKeyBehavior`、`shouldFocusWrap`、`autoFocus`、`onClose`、`items`/`renderEmptyState`、菜单级 `shouldCloseOnSelect`、`isKeyboardDismissDisabled`、`shouldCloseOnInteractOutside`、Popover/Trigger render props 仍未提供。
- **B1/B7**:显示用 `DropdownTrigger` 包裹触发器、`Selection`→`MenuKey[]`(含无 `"all"`)为既定 Vue API 适配,文档已登记。
- **A21**:`disallowEmptySelection`、`escapeKeyBehavior`、`shouldFocusWrap`、`autoFocus`、`close`、`renderEmptyState`(`empty` 插槽)、菜单级 `shouldCloseOnSelect`、`isKeyboardDismissDisabled`、`shouldCloseOnInteractOutside`、`placement` 系列已补齐;`items` 以 `v-for` 表达;Trigger/Popover 作用域插槽为官方 render props 的子集(`{isOpen}` / `{isEntering,isExiting,placement}`)。
- **B1/B7**:显式 `DropdownTrigger` 包裹触发器、`Selection`→`MenuKey[]`(含无 `"all"`)为既定 Vue API 适配,文档已登记。