Files
heroui-vue/tests/package
maoyingjie 5e688680e9 feat(autocomplete): migrate Autocomplete with popover-owned filtering
Port the fixed-baseline Autocomplete onto the B02a collection protocol. The
trigger is the single Tab entry; opening moves focus to the search box inside the
popover, which owns filtering, aria-activedescendant and keyboard navigation
while the list only tracks an active row.

- Seven parts: root (field, value/open models, form value, owner wiring),
  trigger (anchor + activation), value (scoped slot with selectedItems and
  selectedText instead of copied item subtrees), indicator, clear button,
  popover (measured trigger width), filter (owns the search text and composes the
  inner SearchFieldInput into the combobox control).
- Filter exposes input-value/update:inputValue/inputChange, matching ComboBox.
- Confirming the active row in multiple mode now toggles it instead of replacing
  the accepted set (ComboBox shared the same bug).
- ComboBox shows the accepted label on the first render via a display value that
  falls back to the selected record, so preselected fields are readable before
  the selection watcher runs (including SSR).
- Popovers measure the anchor with a ResizeObserver because Reka does not publish
  the anchor size; the caller's root class is merged again so the trigger fills
  the field width.
- 24 baseline previews, Chinese doc page, navigation, 17 behaviour tests, 5
  demo/document contracts and an independent tarball consumption script for both
  pickers.

Not included: the full bundler/NodeNext type matrix (B02d).
2026-10-25 17:20:17 +08:00
..

独立打包消费用例

consume-slider.mjs 和 slider-contract.ts 应复制到工作区之外的全新 Vue 工程运行,依赖安装使用 pnpm pack 生成的两个 tarball,不设置指向源码的 paths/alias。private 样式包通过 pnpm overrides 指向本地样式 tarball。

库构建与打包后,在消费工程执行:

node consume-slider.mjs
pnpm exec tsc --noEmit --strict --skipLibCheck --module nodenext --moduleResolution nodenext --target es2022 slider-contract.ts
pnpm exec tsc --noEmit --strict --skipLibCheck --module esnext --moduleResolution bundler --target es2022 slider-contract.ts

@ts-expect-error 必须实际生效;出现 unused 指令是失败,不得删除反例。数字字段的 validate 参数也必须保留推断类型。skipLibCheck 只略过依赖内部诊断,不略过这些消费端反例。

SLIDER-01 已在 /private/tmp/heroui-slider-consumer 完成上述检查,临时契约文件名为 contract.ts。默认工作区 typecheck 仍使用源码 alias,所以不能代替此独立产物检查。

M30–M32 增加 consume-m30-m32.mjs 和 m30-m32-contract.ts。将它们复制到同一个独立消费工程,执行运行脚本,并将契约文件加入上述两种 tsc 命令。合并后的产物还应同时通过原 NumberField/Slider 消费检查,避免只验证新加组件。

LISTBOX-01 增加 consume-list-box.mjs / list-box-contract.ts。同样复制到独立消费者,用两份新 tarball 安装后运行脚本,并在 NodeNext / bundler 两种模式执行契约文件。Root 的泛型 Props 曾在 Parameters 提取后退化,非法模型/模式反例与事件参数推断必须保留。

M33–M34 使用 consume-m33-m34.mjs / m33-m34-contract.ts;同样复制到独立 tarball 消费工程,分别运行 node 与两种解析模式的 tsc。包括所有公开部件、真正 node SSR、CSS 关键帧与策略/尺寸/方向的正反类型检查。集成验证目录为 /private/tmp/heroui-m33-consumer,不复用其他并行任务的临时产物。

SELECT-01 增加 consume-select.mjs / select-contract.ts。新 tarball 安装后运行 ESM/SSR/CSS 脚本,两种模块解析模式都纳入类型正反例;数字/字符串/空 key、六部件、validate 与事件载荷推断不应退化。保留旧组件消费回归。

DATE-02 增加 consume-date-field.mjs / date-field-contract.ts。独立消费者显式安装 @internationalized/date@3.12.4,运行完整 ISO 时区提交/SSR/样式检查,分别用 NodeNext 与 bundler 验证 DateValue、粒度、变体、范围和 segment 的正反类型,不从源码 alias 取公共类型。

M35–M36 使用 consume-m35-m36.mjs / m35-m36-contract.ts,新建 /private/tmp/heroui-m35-consumer。pnpm 11 的本地样式 tarball override 写在消费者 pnpm-workspace.yaml;不依赖已弃用的 package.json pnpm 字段。分别验证 ESM/CSS、真正 node SSR、所有部件导出,以及 bundler/NodeNext 类型正反例(含 Promise 参数推断)。

B03 使用 consume-b03-tag-error-message.mjs / b03-tag-error-message-contract.ts,消费者目录 /private/tmp/heroui-b03-consumer(pnpm 11 的样式包 override 写在 pnpm-workspace.yaml)。验证 ESM 运行时(导出、SSR HTML 契约)、编译产物 CSS 选择器,以及 Tag/TagGroup/TagGroupList/TagRemoveButton/ErrorMessage 的正反类型(bundler 与 NodeNext)。