merge: integrate verified Root aliases and ProgressBar demo
This commit is contained in:
@@ -160,6 +160,11 @@ export const componentItems: DocsItem[] = [
|
||||
url: "/components/drawer",
|
||||
category: "overlays",
|
||||
},
|
||||
{
|
||||
title: "Dropdown 下拉菜单",
|
||||
url: "/components/dropdown",
|
||||
category: "collections",
|
||||
},
|
||||
{
|
||||
title: "EmptyState 空状态",
|
||||
url: "/components/empty-state",
|
||||
@@ -220,11 +225,6 @@ export const componentItems: DocsItem[] = [
|
||||
url: "/components/link",
|
||||
category: "navigation",
|
||||
},
|
||||
{
|
||||
title: "Dropdown 下拉菜单",
|
||||
url: "/components/dropdown",
|
||||
category: "collections",
|
||||
},
|
||||
{
|
||||
title: "ListBox 列表框",
|
||||
url: "/components/list-box",
|
||||
|
||||
@@ -85,7 +85,7 @@ import {
|
||||
|
||||
<ComponentPreview name="progress-bar-custom-value" />
|
||||
|
||||
> 基线差异:上游示例使用 `NumberField` 与 `Select` 调节数值与格式;这两个组件尚未迁移。本示例以原生 `input[type=number]` / `select` 搭配 `hv-input` 样式临时替代,交互与布局对齐基线,控件本身不是本库已发布的 NumberField/Select。
|
||||
> 控件说明:该示例与上游一致,使用本库公共 `NumberField` 与 `Select` 调节数值与格式。清空或无效输入草稿被拒绝并恢复上一个接受值;越界输入收敛到当前最小/最大值范围内,不会产生 NaN 或进度显示失配。
|
||||
|
||||
## 自定义样式
|
||||
|
||||
|
||||
@@ -2,10 +2,23 @@
|
||||
import { computed, ref } from "vue";
|
||||
import {
|
||||
Label,
|
||||
ListBox,
|
||||
ListBoxItem,
|
||||
ListBoxItemIndicator,
|
||||
NumberField,
|
||||
NumberFieldDecrementButton,
|
||||
NumberFieldGroup,
|
||||
NumberFieldIncrementButton,
|
||||
NumberFieldInput,
|
||||
ProgressBar,
|
||||
ProgressBarFill,
|
||||
ProgressBarOutput,
|
||||
ProgressBarTrack,
|
||||
Select,
|
||||
SelectIndicator,
|
||||
SelectPopover,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
Separator,
|
||||
} from "@heroui-vue/components";
|
||||
|
||||
@@ -30,22 +43,27 @@ const formatOptionsMap: Record<string, Intl.NumberFormatOptions> = {
|
||||
|
||||
const formatOptions = computed(() => formatOptionsMap[format.value]);
|
||||
|
||||
function onValueChange(event: Event) {
|
||||
const next = Number((event.target as HTMLInputElement).value);
|
||||
function onValueChange(next: number | null) {
|
||||
// 清空或无效草稿不接受,受控字段恢复上一个接受值。
|
||||
if (next == null || !Number.isFinite(next)) return;
|
||||
value.value = Math.min(Math.max(next, minValue.value), maxValue.value);
|
||||
}
|
||||
|
||||
function onMinChange(event: Event) {
|
||||
const next = Number((event.target as HTMLInputElement).value);
|
||||
function onMinChange(next: number | null) {
|
||||
if (next == null || !Number.isFinite(next)) return;
|
||||
minValue.value = Math.min(next, maxValue.value - 1);
|
||||
if (value.value < minValue.value) value.value = minValue.value;
|
||||
}
|
||||
|
||||
function onMaxChange(event: Event) {
|
||||
const next = Number((event.target as HTMLInputElement).value);
|
||||
function onMaxChange(next: number | null) {
|
||||
if (next == null || !Number.isFinite(next)) return;
|
||||
maxValue.value = Math.max(next, minValue.value + 1);
|
||||
if (value.value > maxValue.value) value.value = maxValue.value;
|
||||
}
|
||||
|
||||
function onFormatChange(next: string | number | (string | number)[] | null) {
|
||||
if (typeof next === "string" && next in formatOptionsMap) format.value = next;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -73,53 +91,75 @@ function onMaxChange(event: Event) {
|
||||
<div class="flex max-w-52 flex-col gap-3">
|
||||
<Label class="text-xs font-medium text-muted">选项</Label>
|
||||
|
||||
<Label for="pb-cv-value">值</Label>
|
||||
<input
|
||||
id="pb-cv-value"
|
||||
class="hv-input hv-input--secondary hv-input--full-width"
|
||||
type="number"
|
||||
:min="minValue"
|
||||
:max="maxValue"
|
||||
:value="value"
|
||||
@change="onValueChange"
|
||||
/>
|
||||
|
||||
<Label for="pb-cv-min">最小值</Label>
|
||||
<input
|
||||
id="pb-cv-min"
|
||||
class="hv-input hv-input--secondary hv-input--full-width"
|
||||
type="number"
|
||||
min="0"
|
||||
:max="maxValue - 1"
|
||||
:value="minValue"
|
||||
@change="onMinChange"
|
||||
/>
|
||||
|
||||
<Label for="pb-cv-max">最大值</Label>
|
||||
<input
|
||||
id="pb-cv-max"
|
||||
class="hv-input hv-input--secondary hv-input--full-width"
|
||||
type="number"
|
||||
:min="minValue + 1"
|
||||
max="2000"
|
||||
:value="maxValue"
|
||||
@change="onMaxChange"
|
||||
/>
|
||||
|
||||
<Label for="pb-cv-format">格式</Label>
|
||||
<select
|
||||
id="pb-cv-format"
|
||||
v-model="format"
|
||||
class="hv-input hv-input--secondary hv-input--full-width"
|
||||
<NumberField
|
||||
:max-value="maxValue"
|
||||
:min-value="minValue"
|
||||
:model-value="value"
|
||||
variant="secondary"
|
||||
@update:model-value="onValueChange"
|
||||
>
|
||||
<option
|
||||
v-for="option in formatStyleOptions"
|
||||
:key="option.value"
|
||||
:value="option.value"
|
||||
>
|
||||
{{ option.label }}
|
||||
</option>
|
||||
</select>
|
||||
<Label>值</Label>
|
||||
<NumberFieldGroup>
|
||||
<NumberFieldDecrementButton />
|
||||
<NumberFieldInput />
|
||||
<NumberFieldIncrementButton />
|
||||
</NumberFieldGroup>
|
||||
</NumberField>
|
||||
|
||||
<NumberField
|
||||
:max-value="maxValue - 1"
|
||||
:min-value="0"
|
||||
:model-value="minValue"
|
||||
variant="secondary"
|
||||
@update:model-value="onMinChange"
|
||||
>
|
||||
<Label>最小值</Label>
|
||||
<NumberFieldGroup>
|
||||
<NumberFieldDecrementButton />
|
||||
<NumberFieldInput />
|
||||
<NumberFieldIncrementButton />
|
||||
</NumberFieldGroup>
|
||||
</NumberField>
|
||||
|
||||
<NumberField
|
||||
:max-value="2000"
|
||||
:min-value="minValue + 1"
|
||||
:model-value="maxValue"
|
||||
variant="secondary"
|
||||
@update:model-value="onMaxChange"
|
||||
>
|
||||
<Label>最大值</Label>
|
||||
<NumberFieldGroup>
|
||||
<NumberFieldDecrementButton />
|
||||
<NumberFieldInput />
|
||||
<NumberFieldIncrementButton />
|
||||
</NumberFieldGroup>
|
||||
</NumberField>
|
||||
|
||||
<Select
|
||||
:model-value="format"
|
||||
variant="secondary"
|
||||
@update:model-value="onFormatChange"
|
||||
>
|
||||
<Label>格式</Label>
|
||||
<SelectTrigger>
|
||||
<SelectValue />
|
||||
<SelectIndicator />
|
||||
</SelectTrigger>
|
||||
<SelectPopover>
|
||||
<ListBox>
|
||||
<ListBoxItem
|
||||
v-for="option in formatStyleOptions"
|
||||
:id="option.value"
|
||||
:key="option.value"
|
||||
:text-value="option.label"
|
||||
>
|
||||
{{ option.label }}
|
||||
<ListBoxItemIndicator />
|
||||
</ListBoxItem>
|
||||
</ListBox>
|
||||
</SelectPopover>
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
| date-picker | 已迁移(客户端,有已知差异) | DatePicker/Root、Trigger、TriggerIndicator、Popover;10/10 基线例;复用 DateField 字段、Calendar 视图/年份层与 Popover;唯一日期提交、受控拒绝/重试、时间草稿、locale/RTL、嵌套 Modal Escape;见 DATE-PICKER 结果。 |
|
||||
| date-range-picker | 已迁移(客户端,有已知差异) | DateRangePicker 五部件;10/10 基线例;复用双端点 DateField、RangeCalendar 与 Popover;完整范围/双命名提交/时间草稿/非连续策略;见 DATE-RANGE-PICKER 结果。 |
|
||||
| drawer | 验证中(M34) | 11 部件;四方向拖动关闭(30%/0.5px/ms);9/9 基线例;Content/Dialog 职责分离 |
|
||||
| progress-bar | 验证中(M18) | ProgressBar/Output/Track/Fill;7/7 基线例;确定/未知进度、min/max/formatOptions/valueLabel;custom-value 的 NumberField/Select 为原生临时控件 |
|
||||
| progress-bar | 验证中(M18) | ProgressBar/Output/Track/Fill;7/7 基线例;确定/未知进度、min/max/formatOptions/valueLabel;custom-value 使用公共 NumberField/Select 正式部件(清空/无效草稿拒绝恢复、越界收敛) |
|
||||
| progress-circle | 验证中(M19) | ProgressCircle/Track/TrackCircle/FillCircle;7/7 基线例;圆环几何可覆盖;与 ProgressBar 共用取值语义 |
|
||||
| time-field | 已迁移(客户端) | TimeField/Root及六个共享输入部件;15/15基线例;Time/CalendarDateTime/ZonedDateTime、完整精度、受控拒绝、键盘/Enter、校验/提交/reset;框架差异见 TIME-FIELD 结果。 |
|
||||
| disclosure | 验证中(M21) | Disclosure/Heading/Trigger/Content/Body/Indicator;3/3 基线例;v-model:expanded;asChild 触发;高度动画映射测量变量 |
|
||||
@@ -81,7 +81,7 @@
|
||||
| menu-section | 验证中(B01) | MenuSection 分组与分组级选择;见 B01 |
|
||||
| modal | 验证中(OVERLAY-02) | Root/Trigger/Backdrop/Container/Dialog/Heading/Header/Body/Footer/Icon/Close/CloseTrigger;14/14 基线例;焦点/锁/滚动/退出动画;Vue close 部件替代 React slot |
|
||||
| pagination | 验证中(M30) | 组合式 nav 容器(无 total/page 状态机);11 具名部件;9/9 基线例;onPress→@click;显式 aria-current 可覆盖 |
|
||||
| number-field | 验证中(NUMBER-01) | 五部件与 17/17 基线例;Reka 数值内核;受控/只读/表单 reset、SSR/水合;差异见 NUMBER-01 报告 |
|
||||
| number-field | 验证中(NUMBER-01) | 五部件与 17/17 基线例;Reka 数值内核;受控/只读/表单 reset、SSR/水合;键入草稿保留(修复 keydown 后还原字符,见 API-ROOT-AND-PROGRESS-DEMO 结果);差异见 NUMBER-01 报告 |
|
||||
| select | 验证中(SELECT-01) | 六部件、19/19 例、单/多选、清空、字段/原生提交/SSR/异步;复用 ListBox + Popover,重点浏览器已验,限制见 SELECT-01 |
|
||||
| meter | 验证中(M20) | Meter/Output/Track/Fill;6/6 基线例;role=meter progressbar;无 isIndeterminate;测量语义独立于 Progress |
|
||||
| slider | 验证中(SLIDER-01) | 六部件、9/9 基线例;原生 range/局部指针适配,单值/范围、受控/reset/SSR/水合;差异见 SLIDER-01 |
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
## 公共行为
|
||||
|
||||
- 采用Vue具名部件、v-model与插槽;React PressEvent、React上下文、集合Set等框架机制不承诺直接等价。具体默认值、事件、插槽以组件文档和公共类型为准。
|
||||
- 根组件在包根同时导出 `Xxx` 与 `XxxRoot` 双名(含上游公开的子部件 Root 名),两名称指向同一组件对象,Props 类型为同一类型;上游未导出的名字(如 `CheckboxGroupRoot`、`ToastRootProps`)不杜撰。完整 82 对映射与身份断言见 [API-ROOT-AND-PROGRESS-DEMO 结果](tasks/results/API-ROOT-AND-PROGRESS-DEMO.md)。
|
||||
- 字段/Form使用共享ID、校验、原生提交/reset与外部form协议,不由每组件另建状态。见 [字段决策](decisions/field-form-foundation.md)。Checkbox/Radio等共享协议见 [选择字段决策](decisions/selection-field-foundation.md)。
|
||||
- 弹层复用Reka及统一焦点/定位/嵌套/关闭生命周期。Root展开不等于面板已可见;Trigger与定位Anchor分别落实。见 [弹层决策](decisions/overlay-foundation.md)。
|
||||
- ListBox/Select/ComboBox/Autocomplete使用有类型key及统一集合状态;数字0、字符串0与空key不同。逻辑全集与挂载DOM集合分开,虚拟化不以挂载项数当全集。见 [集合决策](decisions/collection-foundation.md)。ComboBox/Autocomplete当前公开验收见 [B02结果](tasks/results/B02-REVIEW.md)。
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
- DateField、TimeField、Calendar、CalendarYearPicker、DatePicker 与 DateRangePicker 已有公共组件;RangeCalendar 已完成公共客户端迁移(20 个基线预览),范围选择与 Calendar 共用视图/焦点/年份设施。DatePicker 复用 DateField 字段、Calendar 视图与 Popover 弹层,10 个基线预览已接入。DateRangePicker 复用双端点 DateField、RangeCalendar 与 Popover,10 个基线预览已接入。
|
||||
- ColorSwatch/ColorSwatchRoot及Color/parseColor公共子集已公开;ColorArea/ColorAreaRoot、ColorAreaThumb 与 colorAreaVariants 已公开,复用共享颜色 owner、二维交互与固定源 7 例;ColorSlider/ColorSliderRoot、ColorSliderOutput/Track/Thumb 与 colorSliderVariants 已公开,复用共享通道/轨道内核与固定源 9 例。ColorField/ColorFieldRoot、配套 ColorInputGroup 与具名字段部件、两套 variants 已完成客户端迁移,含固定源 13 例,并按用户授权合入 main。ColorSwatchPicker/ColorSwatchPickerRoot、ColorSwatchPickerItem/Swatch/Indicator 与 colorSwatchPickerVariants 已完成客户端迁移,含固定源 10 例(见 [结果](tasks/results/COLOR-SWATCH-PICKER.md),复核通过并已按用户授权合入 main)。ColorPicker/ColorPickerRoot、ColorPickerTrigger/Popover 与 colorPickerVariants 已完成客户端迁移,含固定源 6 例(见 [结果](tasks/results/COLOR-PICKER.md),独立复核通过,已按用户授权合入 main)。颜色家族公开迁移已完成。
|
||||
- 兼容矩阵目前85条(包含子部件与基础设施),文档有74个组件页面。矩阵中的“验证中”保留其原有限制,不升级为完整兼容。
|
||||
- 公共根组件已对齐固定上游的 Root 双名导出(82 对 `Xxx`/`XxxRoot` 同对象,含上游公开的子部件 Root 名),完整清单与身份/类型断言见 [API-ROOT-AND-PROGRESS-DEMO 结果](tasks/results/API-ROOT-AND-PROGRESS-DEMO.md)。ProgressBar custom-value 演示已回填公共 NumberField/Select;NumberField 键入草稿保留缺陷已修复并入回归。
|
||||
|
||||
## 尚未完成的公共家族
|
||||
|
||||
|
||||
+10
-9
@@ -1,11 +1,12 @@
|
||||
# 当前工作区交接
|
||||
|
||||
- 任务:FORM 已由主会话亲自完成并自测通过,状态 accepted;未委派其他AI。
|
||||
- 工作区/分支:heroui-vue / `main`;当前无实施占用。
|
||||
- 起点:`f424fa559725ef62909eccf56c9d63a3f0e161e6`;实施 `2c221e09954aaa21d6bb72040db429ce48643e73`;验收 `f53ce0a`。
|
||||
- 已按用户授权合main,合并SHA `0847db9ae02eb4266301f398f37ac9397496aa83`;本轮未push。
|
||||
- 验证:相关7文件/165项、main全量109文件/1594项、typecheck、build:docs、最终tarball form契约通过。
|
||||
- 浏览器:3个正式源例、错误/首个焦点/Enter提交/FormData/reset、1280px浅色与390px深色/表格无横向溢出通过;主题与viewport已恢复。
|
||||
- 入口:`docs/tasks/FORM.md`、`docs/tasks/results/FORM.md`。
|
||||
- 保留原有5173文档服务与 `/components/form` 预览;未停止他人服务。
|
||||
- 接续:从实际git状态及docs/tasks选择工作,不从历史自动猜测。
|
||||
- 任务:API-ROOT-AND-PROGRESS-DEMO 已完成实施及集成复核,状态 accepted;未委派其他AI。
|
||||
- 工作区/分支:heroui-vue / `task/api-root-and-progress-demo`;起点 `e0dd052cc3626303ee0dbeb74c4f9ad69f938998`。
|
||||
- 实施提交 `8f51b0e097968d5560b4871a279d07c2900046da`(Root 别名、ProgressBar 演示回填、NumberField 键入修复、导航排序修正、契约与测试);结果提交见 Git 历史。未合 main、未 push。
|
||||
- 验证:相关 4 文件/91 项、typecheck、build:docs、最终 tarball `api-root-aliases form avatar b01-menu-dropdown` 契约通过(82 对别名身份/类型断言)。
|
||||
- 浏览器(5173 `/components/progress-bar`):三个数字字段键入/步进/清空拒绝/越界收敛、动态上下限联动、四格式键盘与点击选择、浅深主题截图、390px 窄屏无页面横向溢出、控制台干净;主题已恢复跟随系统。
|
||||
- 附带修复:NumberFieldInput keydown 还原键入字符缺陷(回归入 tests/number-field.test.ts);文档导航 dropdown 归位固定 meta.json 顺序(回归入 tests/docs-shell.test.ts)。
|
||||
- 入口:`docs/tasks/API-ROOT-AND-PROGRESS-DEMO.md`、`docs/tasks/results/API-ROOT-AND-PROGRESS-DEMO.md`。
|
||||
- 保留原有 5173 文档服务;未停止他人服务。
|
||||
- 复核修正:`593757710179859e3e5c11c8d24e938eeb572df6`;NumberField 回归用例改为同任务事件序列,旧实现反证失败、当前实现通过。全量109文件/1602项、typecheck、build:docs、四契约最终tarball通过;本次未重复浏览器操作。
|
||||
- 接续:用户已授权合 main 并 push,正在完成集成;准确合并状态随后更新。
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<!-- task-metadata
|
||||
{
|
||||
"base": "e0dd052cc3626303ee0dbeb74c4f9ad69f938998",
|
||||
"upstream": "ce90ea3ab49d58f6c428f71bfd6fe8ae2a87b960",
|
||||
"status": "accepted",
|
||||
"requires": [
|
||||
"packages/vue/src/index.ts",
|
||||
"packages/vue/src/components/number-field/NumberField.vue",
|
||||
"apps/docs/demos/progress-bar-custom-value.vue",
|
||||
"tests/package/client-checks.json",
|
||||
"tests/progress-meter.test.ts"
|
||||
],
|
||||
"sources": [
|
||||
"packages/react/src/index.ts",
|
||||
"packages/react/src/components/progress-bar/index.ts",
|
||||
"apps/docs/src/demos/cn/progress-bar/custom-value.tsx"
|
||||
],
|
||||
"checks": [
|
||||
"pnpm exec vitest run tests/progress-meter.test.ts tests/number-field.test.ts tests/select.test.ts",
|
||||
"pnpm typecheck",
|
||||
"pnpm build:docs"
|
||||
]
|
||||
}
|
||||
-->
|
||||
|
||||
# API-ROOT-AND-PROGRESS-DEMO:Root 别名对齐与 ProgressBar 正式控件回填
|
||||
|
||||
## 启动与边界
|
||||
|
||||
先读 AGENTS.md、docs/tasks/README.md、docs/tasks/ACTIVE.md 和实际 git 状态,运行 `node scripts/task-check.mjs API-ROOT-AND-PROGRESS-DEMO`。确认目录无人占用后,从包含本卡和前置实现的提交创建独立任务分支,记录准确起点 SHA。保留既有改动及服务,不合 main、不 push。
|
||||
|
||||
本任务只处理两项既有能力收尾:公共导出的 Root 别名缺口,以及 ProgressBar 演示使用正式 NumberField/Select。**55 是待核对的别名缺口数量,不是缺少 55 个组件,不得新建 55 套组件或空壳实现。** 仅客户端,不增加 SSR、水合、Nuxt 或逐像素专项。
|
||||
|
||||
## 一、补齐公共 Root 别名
|
||||
|
||||
1. 以固定上游提交的公开导出为准,逐项对照 Vue 包根 `packages/vue/src/index.ts` 及现有实现,列出“上游名称 → Vue 现有组件 → 目标 Root 别名 → 当前状态”。核对报告中的 55 项;若当前基线数量已变化,记录真实差异与原因,不为凑数生成名称,也不重新添加已有别名。
|
||||
2. 对有现成根实现的缺失项增量补导出,保持旧名称兼容。Root 别名必须指向同一组件对象,不能用包装组件改变 attrs、事件、插槽、ref 或组件实例类型。不要机械地为每个子部件追加 Root。
|
||||
3. 核对公共类型与最终声明可用性;不额外杜撰上游没有要求的类型别名。确无现成实现或存在框架语义差异的项目单独列出,禁止以空壳冒充补齐。
|
||||
4. 在现有导出/产物验证设施中补上完整别名清单和身份等价断言,并验证最终 tarball 中具名导入、Props/事件/插槽/实例类型。沿用 `scripts/check-package.mjs` 与既有契约机制;若新增契约 ID,应登记并在结果中给出准确运行命令,不另建消费者框架。
|
||||
|
||||
## 二、ProgressBar 演示回填正式组件
|
||||
|
||||
主要入口为 `apps/docs/demos/progress-bar-custom-value.vue`,对照固定源 `apps/docs/src/demos/cn/progress-bar/custom-value.tsx`。
|
||||
|
||||
1. 用已实现的公共 NumberField 及其正式部件替换三个原生 number input,用公共 Select 及其正式部件替换原生 select。使用包根导入及现有 Vue 值协议,不通过手写 CSS 仿冒控件,也不直接导入底层 Reka。
|
||||
2. 保持固定源中文文案、顺序、布局、初始值、范围和四种格式选项;值、最小值、最大值与进度文本/填充保持同步。核对源行为及既有边界处理,覆盖输入、步进、清空/无效草稿、范围变更和格式切换,不产生 NaN、非法区间或显示失配。
|
||||
3. 保证标签关联、键盘操作、Select 面板定位/选择/关闭及焦点正常;预览、复制与高亮仍使用同一份 SFC。扫描其他 ProgressBar 演示,若有同类临时替代一并处理;不扩大为全站演示重写。
|
||||
4. 修正 `docs/compatibility.md` 和相关当前组件说明中“NumberField/Select 为原生临时控件”的陈述。历史验证记录保留历史语义,不批量改写为本轮已验收。
|
||||
|
||||
## 验证与通过条件
|
||||
|
||||
- 所有待补别名均有逐项核对结果;实际新增数、已有数、明确差异可追溯。原导出保留,别名与原组件严格相等。
|
||||
- 元数据中的相关单测、类型检查、文档构建通过;新增的别名契约/演示回归也须实际执行并记录准确命令。导出验证覆盖完整清单,不能只抽查一个别名。
|
||||
- 使用 `node scripts/check-package.mjs <本轮相关或新增契约ID>` 检查最终 tarball 的 ESM 导出与 bundler/NodeNext 类型正反例;源码 alias 通过不能代替发布产物通过。
|
||||
- 在真实文档站 5173 的 `/components/progress-bar` 操作正式演示:三个数字字段输入和步进、动态上下限、四种格式选择及键盘操作;检查进度值、文本和填充同步,浅深主题及窄屏无溢出,控制台无新增异常。原生 input 作为 NumberField 内部实现正常,禁止以 DOM 中没有 input 作为验收要求。
|
||||
- 本轮只编写任务卡不代表实施或验收完成;实施者完成后按实际验证更新任务状态与当前矩阵,不将 API 别名补齐描述成新增组件完成。
|
||||
|
||||
## 交付
|
||||
|
||||
按 `docs/tasks/RESULT-TEMPLATE.md` 写 `docs/tasks/results/API-ROOT-AND-PROGRESS-DEMO.md`,包含分支/起点/实施 SHA、完整别名映射、演示改动、命令与场景证据、未完成项和限制。代码、任务卡及结果记录一并提交到任务分支,不合 main、不 push。
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
| 卡 | 用途 |
|
||||
| ----------------------------------------- | ----------------------------------------------------------- |
|
||||
| [API-ROOT-AND-PROGRESS-DEMO](API-ROOT-AND-PROGRESS-DEMO.md) | 补齐既有组件 Root 公共别名;ProgressBar 演示回填正式 NumberField/Select |
|
||||
| [FORM](FORM.md) | 主会话亲自迁移表单正式API、3例与校验/焦点验收 |
|
||||
| [AVATAR](AVATAR.md) | 主会话亲自补齐头像三部件、7例与加载回退验收 |
|
||||
| [COLOR-PICKER](COLOR-PICKER.md) | 公共可组合颜色选择器迁移,含固定源 6 例、共享颜色与嵌套弹层验收 |
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
# API-ROOT-AND-PROGRESS-DEMO 交付
|
||||
|
||||
- 分支 `task/api-root-and-progress-demo`;起点 `e0dd052cc3626303ee0dbeb74c4f9ad69f938998`(含本任务卡);此前 main 同 `e0dd052`。
|
||||
- 实施提交 `8f51b0e097968d5560b4871a279d07c2900046da`(代码、任务卡、README 任务表);结果/进度记录见本提交。未合 main、未 push。
|
||||
- 固定源 HeroUI 3.2.6 / `ce90ea3ab49d58f6c428f71bfd6fe8ae2a87b960`:`packages/react/src/components/*/index.ts` 公开导出、`apps/docs/src/demos/cn/progress-bar/custom-value.tsx`、`apps/docs/content/docs/cn/react/components/meta.json`;只读核对。
|
||||
|
||||
## 一、Root 别名映射(上游名称 → Vue 现有组件 → 目标别名 → 状态)
|
||||
|
||||
核对口径:以固定上游每个组件 barrel 的公开值导出为准,取 `XxxRoot` 且上游同名导出 `Xxx` 的成对根名(含上游自有组件模块的 `ListBoxItemRoot/ListBoxSectionRoot/MenuItemRoot/MenuSectionRoot/DateInputGroupRoot`)。机器可读完整清单与断言在 `tests/package/client-checks.json` 的 `api-root-aliases.aliases`(82 对)。
|
||||
|
||||
| 类别 | 数量 | 明细 |
|
||||
| --- | --- | --- |
|
||||
| 本轮新增 `XxxRoot` 值别名 | 55 | Accordion、Alert、Autocomplete、AvatarGroup、Badge、Breadcrumbs、Button、ButtonGroup、Card、Checkbox、Chip、CloseButton、ComboBox、DateInputGroup、Description、Disclosure、DisclosureGroup、EmptyState、ErrorMessage、FieldError、Fieldset、Input、InputGroup、Kbd、Label、Link、ListBoxItem、ListBoxSection、MenuItem、MenuSection、Meter、Modal、Popover、ProgressBar、ProgressCircle、Radio、RadioGroup、ScrollShadow、SearchField、Separator、Skeleton、Spinner、Surface、Switch、SwitchGroup、Tabs、Tag、TagGroup、TextArea、TextField、ToggleButton、ToggleButtonGroup、Toolbar、Tooltip、Typography(各补 `+Root` 同对象导出) |
|
||||
| 本轮新增反向别名 | 1 | `Dropdown`(此前仅 `DropdownRoot`;上游导出双名) |
|
||||
| 基线已有双名(不改) | 26 | AlertDialog、Avatar、Calendar、ColorArea、ColorField、ColorInputGroup、ColorPicker、ColorSlider、ColorSwatch、ColorSwatchPicker、DateField、DatePicker、DateRangePicker、Drawer、Form、Header、InputOTP、ListBox、Menu、NumberField、Pagination、RangeCalendar、Select、Slider、Table、TimeField |
|
||||
| 合计上游成对根名 | 82 | 与上游逐项一致,缺口 0(审计脚本重跑确认) |
|
||||
|
||||
类型侧(同一类型双名,不杜撰上游没有的名称):新增 57 个 `XxxRootProps`(上表 55 项减 MenuItem/MenuSection 加 AlertDialog/Drawer)+ `MenuItemRootProps`、`MenuSectionRootProps`、`MenuProps`、`DropdownProps`,共 59 个。例外:上游无 `CheckboxGroupRoot`(checkbox-group 只导出 `CheckboxGroup`)故不加;上游 toast barrel 只导出 `Toast`(无 `ToastRoot`/`ToastRootProps`),本库 `ToastRoot` 值兼容名保留不删、不计入 82 对;上游无 `TagProps`(只有 `TagRootProps`),本库 `TagProps` 旧名保留;`ColorField*` 等 3 项经 `export type *` 已有 RootProps,非缺口。上游 `Xxx.Props` 复合类型命名空间属 React 类型机制,列为框架语义差异,不平移。
|
||||
|
||||
## 二、ProgressBar 演示回填
|
||||
|
||||
`apps/docs/demos/progress-bar-custom-value.vue`(预览/复制/高亮同一 SFC,文件名未变)用包根公共 NumberField(Group/Input/IncrementButton/DecrementButton)替换三个原生 number input,公共 Select(Trigger/Value/Indicator/Popover + ListBox/ListBoxItem/Indicator)替换原生 select;保留固定源中文文案、顺序、布局、初始 750/0/1000、四格式选项与 `variant="secondary"`。边界沿用既有处理并明确:清空/无效草稿拒绝并恢复上一接受值;越界提交收敛到当前范围。`progress-bar.md` 与 `compatibility.md` 的“原生临时控件”陈述已修正;其他 progress/indicator 演示扫描无同类临时替代。
|
||||
|
||||
## 场景与证据
|
||||
|
||||
| 验收场景 | 断言或复现步骤 | 实际结果 |
|
||||
| --- | --- | --- |
|
||||
| 别名完整清单 | `node scripts/task-check.mjs` 前置 + 审计脚本对照上游 barrel | 55 项与报告口径一致(55 缺 Root + 1 反向 `Dropdown`);重跑缺口 0 |
|
||||
| 别名身份等价 | `node scripts/check-package.mjs api-root-aliases`(`check-client.mjs` 遍历 82 对 `lib[a]===lib[b]`、164 具名导出) | 通过(最终 tarball) |
|
||||
| 别名类型/事件/插槽/实例 | `tests/package/api-root-aliases-contract.ts` strict NodeNext/bundler 正反例(`Same<>` 等价、`h()` 属性/事件/插槽、`@ts-expect-error` 变体与事件负载反例) | 通过(最终 tarball;泛型函数式 ListBox/Calendar 以组件对象等价覆盖实例成员) |
|
||||
| 演示输入/步进 | `pnpm exec vitest run tests/progress-meter.test.ts`(6 个 custom-value 用例)+ 真实浏览器键入 500 → 500/50%/50%;增/减按钮 → 501(fill 50.1%)/500 | 通过 |
|
||||
| 清空/无效草稿 | 单测:清空/`abc`/`-` 拒绝恢复、无 NaN;浏览器:清空 + Tab 恢复“500”,字母被输入层过滤 | 通过 |
|
||||
| 动态上下限 | 单测 + 浏览器:min→800 时值 200→800(min=800、输出 0%);max→600 时值 900→600(max=600、输出 100%、增量按钮禁用) | 通过 |
|
||||
| 四格式与键盘 | 浏览器 Select:ArrowDown 打开面板(208×168、4 项可见可点)→ ArrowDown+Enter 选 小数/单位(输出 600 / 600英里,页内 Intl 计算一致);点击 货币 → US$600.00,面板关闭、选择值回显 | 通过 |
|
||||
| 浅深主题/窄屏/控制台 | 明确深色与浅色各截图;390px 同源 iframe:documentScrollWidth==clientWidth==390 无页面横向溢出、演示纵排、表无溢出;console 无 warn/error | 通过(截图存 opencode-browser 临时目录) |
|
||||
| 单测/类型/文档构建 | `pnpm exec vitest run tests/progress-meter.test.ts tests/number-field.test.ts tests/select.test.ts tests/docs-shell.test.ts`(91 项)、`pnpm typecheck`、`pnpm build:docs` | 通过(chunk 大小提示为既有) |
|
||||
| 最终产物回归 | `node scripts/check-package.mjs api-root-aliases form avatar b01-menu-dropdown` | 通过 |
|
||||
| 文档排序 | 对照固定 meta.json 逐项审计 74 项:仅 `dropdown` 错位(位于 link 后),已归位 drawer 后;empty-state/header 为真实 Vue 页按字母位;类别全匹配;`docs-shell.test.ts` 增加固定顺序断言 | 通过 |
|
||||
|
||||
相关命令:
|
||||
|
||||
```sh
|
||||
pnpm exec vitest run tests/progress-meter.test.ts tests/number-field.test.ts tests/select.test.ts tests/docs-shell.test.ts
|
||||
pnpm typecheck
|
||||
pnpm build:docs
|
||||
node scripts/check-package.mjs api-root-aliases form avatar b01-menu-dropdown
|
||||
```
|
||||
|
||||
## 缺陷修复(随本任务)
|
||||
|
||||
NumberFieldInput 的 `keydown` 在任意按键后 `nextTick(restore)`,会把同任务内真实键入的字符还原(同任务 keydown+insertText 探针:`1,0005` 微任务后回退 `1,000`;逐步键入/退格呈“每次从提交文本重算”)。已改为仅状态键(步进/边界/Enter)恢复提交文本,普通键入保留草稿;`tests/number-field.test.ts` 新增键入保留回归(16 项通过)。受影响面核对:既有受控拒绝/清空恢复、步进边界、表单用例全部保持通过。
|
||||
|
||||
## 未完成与限制
|
||||
|
||||
- 首轮实施未跑全量;后续集成复核已执行,结果见下文。
|
||||
- NumberField 键入修复的真实输入链路由浏览器键入与同任务探针验证;未做人工 IME 逐输入法矩阵(不在范围)。
|
||||
- 逐像素对比、完整读屏矩阵、真机矩阵、SSR/水合/Nuxt 不在范围。`ToastRoot`/`TagProps` 等本库兼容旧名保留并已记录;未新增上游不存在的名称。
|
||||
- 上游 `Xxx.Props` 复合类型命名空间未平移(React 类型机制差异),如需另行立项。
|
||||
|
||||
## 2026-10-27 集成复核与回归修正
|
||||
|
||||
用户授权修正复核问题后合 main 并 push。修正提交 `593757710179859e3e5c11c8d24e938eeb572df6`,沿用任务分支及原实施基线。
|
||||
|
||||
| 问题 / 场景 | 证据 | 结果 |
|
||||
| --- | --- | --- |
|
||||
| P2:键入回归测试错开缺陷时序 | 原用例先 await keydown,导致旧 nextTick(restore) 在插入文本前执行;现改为同一同步任务派发可取消 keydown、写入文本、派发 input,随后等待刷新 | 已修正;不修改组件实现 |
|
||||
| 旧实现反证 | 临时副本使用 `e0dd052` 的 NumberFieldInput 及本次修正用例;定向执行 `keeps characters typed after keydown` | 按预期失败:期望 49,实际 4;副本已删除 |
|
||||
| 当前实现验证 | `pnpm exec vitest run tests/number-field.test.ts -t 'keeps characters typed after keydown'` | 通过 |
|
||||
| 别名审计 | 固定上游组件 barrel 的值导出与当前契约清单逐项比对 | 82 对,无缺失、无额外项 |
|
||||
| 集成回归 | `pnpm test` | 109 文件 / 1602 项通过;无新增 skip |
|
||||
| 类型与静态文档 | `pnpm typecheck`、`pnpm build:docs` | 通过;文档保留既有 chunk 大小提示 |
|
||||
| 最终 tarball | `node scripts/check-package.mjs api-root-aliases form avatar b01-menu-dropdown` | 四契约 ESM/CSS 与 NodeNext/bundler 类型正反例通过;普通沙箱 DNS 失败后联网重跑成功 |
|
||||
|
||||
本次未重复浏览器操作;正式演示浏览器证据沿用上述实施记录,不将本次单测描述为浏览器验收。复核问题已关闭,任务 accepted。准确合并及推送状态见 ACTIVE 与后续集成记录。
|
||||
@@ -53,40 +53,49 @@ export default defineComponent({
|
||||
if (event.defaultPrevented || event.isComposing || composing.value)
|
||||
return;
|
||||
if (field.disabled.value || field.readOnly.value) return;
|
||||
// 只有状态键(步进/边界/提交)才在下一刷新恢复提交文本。
|
||||
// 普通键入必须保留草稿,否则同任务内键入的字符会被还原。
|
||||
let restoreAfter = false;
|
||||
switch (event.key) {
|
||||
case "ArrowUp":
|
||||
event.preventDefault();
|
||||
number.handleIncrease();
|
||||
restoreAfter = true;
|
||||
break;
|
||||
case "ArrowDown":
|
||||
event.preventDefault();
|
||||
number.handleDecrease();
|
||||
restoreAfter = true;
|
||||
break;
|
||||
case "PageUp":
|
||||
event.preventDefault();
|
||||
number.handleIncrease(10);
|
||||
restoreAfter = true;
|
||||
break;
|
||||
case "PageDown":
|
||||
event.preventDefault();
|
||||
number.handleDecrease(10);
|
||||
restoreAfter = true;
|
||||
break;
|
||||
case "Home":
|
||||
if (number.min.value !== undefined) {
|
||||
event.preventDefault();
|
||||
number.handleMinMaxValue("min");
|
||||
restoreAfter = true;
|
||||
}
|
||||
break;
|
||||
case "End":
|
||||
if (number.max.value !== undefined) {
|
||||
event.preventDefault();
|
||||
number.handleMinMaxValue("max");
|
||||
restoreAfter = true;
|
||||
}
|
||||
break;
|
||||
case "Enter":
|
||||
commit();
|
||||
break;
|
||||
}
|
||||
void nextTick(restore);
|
||||
if (restoreAfter) void nextTick(restore);
|
||||
}
|
||||
function beforeinput(event: InputEvent) {
|
||||
if (event.defaultPrevented || event.isComposing || composing.value)
|
||||
|
||||
+128
-1
@@ -1,7 +1,11 @@
|
||||
export { default as Button } from "./components/button/Button.vue";
|
||||
export { default as ButtonRoot } from "./components/button/Button.vue";
|
||||
export { default as Card } from "./components/card/Card.vue";
|
||||
export { default as CardRoot } from "./components/card/Card.vue";
|
||||
export { default as Input } from "./components/input/Input.vue";
|
||||
export { default as InputRoot } from "./components/input/Input.vue";
|
||||
export { default as Switch } from "./components/switch/Switch.vue";
|
||||
export { default as SwitchRoot } from "./components/switch/Switch.vue";
|
||||
export { default as CardHeader } from "./components/card/CardHeader.vue";
|
||||
export { default as CardTitle } from "./components/card/CardTitle.vue";
|
||||
export { default as CardDescription } from "./components/card/CardDescription.vue";
|
||||
@@ -12,7 +16,9 @@ export { default as SwitchControl } from "./components/switch/SwitchControl.vue"
|
||||
export { default as SwitchThumb } from "./components/switch/SwitchThumb.vue";
|
||||
export { default as SwitchIcon } from "./components/switch/SwitchIcon.vue";
|
||||
export { default as Label } from "./components/label/Label.vue";
|
||||
export { default as LabelRoot } from "./components/label/Label.vue";
|
||||
export { default as Description } from "./components/description/Description.vue";
|
||||
export { default as DescriptionRoot } from "./components/description/Description.vue";
|
||||
export {
|
||||
buttonVariants,
|
||||
cardVariants,
|
||||
@@ -95,19 +101,26 @@ export type {
|
||||
export { tv, cn, type VariantProps } from "@heroui-vue/styles";
|
||||
|
||||
export { default as SwitchGroup } from "./components/switch/SwitchGroup.vue";
|
||||
export { default as SwitchGroupRoot } from "./components/switch/SwitchGroup.vue";
|
||||
export { default as FieldError } from "./components/field/FieldError.vue";
|
||||
export { default as FieldErrorRoot } from "./components/field/FieldError.vue";
|
||||
|
||||
export { default as Surface } from "./components/surface/Surface.vue";
|
||||
export { default as SurfaceRoot } from "./components/surface/Surface.vue";
|
||||
export {
|
||||
surfaceContextKey,
|
||||
type SurfaceContext,
|
||||
} from "./components/surface/context";
|
||||
export { default as Link } from "./components/link/Link.vue";
|
||||
export { default as LinkRoot } from "./components/link/Link.vue";
|
||||
export { default as LinkIcon } from "./components/link/LinkIcon.vue";
|
||||
export { default as Spinner } from "./components/spinner/Spinner.vue";
|
||||
export { default as SpinnerRoot } from "./components/spinner/Spinner.vue";
|
||||
export { default as TextArea } from "./components/textarea/TextArea.vue";
|
||||
export { default as TextAreaRoot } from "./components/textarea/TextArea.vue";
|
||||
|
||||
export { default as CloseButton } from "./components/close-button/CloseButton.vue";
|
||||
export { default as CloseButtonRoot } from "./components/close-button/CloseButton.vue";
|
||||
export {
|
||||
default as Avatar,
|
||||
default as AvatarRoot,
|
||||
@@ -115,6 +128,7 @@ export {
|
||||
export { default as AvatarImage } from "./components/avatar/AvatarImage.vue";
|
||||
export { default as AvatarFallback } from "./components/avatar/AvatarFallback.vue";
|
||||
export { default as AvatarGroup } from "./components/avatar/AvatarGroup.vue";
|
||||
export { default as AvatarGroupRoot } from "./components/avatar/AvatarGroup.vue";
|
||||
export { default as AvatarGroupCount } from "./components/avatar/AvatarGroupCount.vue";
|
||||
export {
|
||||
AVATAR_GROUP_CHILD,
|
||||
@@ -126,9 +140,12 @@ export {
|
||||
type AvatarSlots,
|
||||
} from "./components/avatar/context";
|
||||
export { default as Skeleton } from "./components/skeleton/Skeleton.vue";
|
||||
export { default as SkeletonRoot } from "./components/skeleton/Skeleton.vue";
|
||||
|
||||
export { default as Separator } from "./components/separator/Separator.vue";
|
||||
export { default as SeparatorRoot } from "./components/separator/Separator.vue";
|
||||
export { default as Kbd } from "./components/kbd/Kbd.vue";
|
||||
export { default as KbdRoot } from "./components/kbd/Kbd.vue";
|
||||
export { default as KbdAbbr } from "./components/kbd/KbdAbbr.vue";
|
||||
export { default as KbdContent } from "./components/kbd/KbdContent.vue";
|
||||
export {
|
||||
@@ -142,6 +159,7 @@ export {
|
||||
type KbdSlots,
|
||||
} from "./components/kbd/context";
|
||||
export { default as Chip } from "./components/chip/Chip.vue";
|
||||
export { default as ChipRoot } from "./components/chip/Chip.vue";
|
||||
export { default as ChipLabel } from "./components/chip/ChipLabel.vue";
|
||||
export {
|
||||
chipContextKey,
|
||||
@@ -150,6 +168,7 @@ export {
|
||||
} from "./components/chip/context";
|
||||
|
||||
export { default as Badge } from "./components/badge/Badge.vue";
|
||||
export { default as BadgeRoot } from "./components/badge/Badge.vue";
|
||||
export { default as BadgeAnchor } from "./components/badge/BadgeAnchor.vue";
|
||||
export { default as BadgeLabel } from "./components/badge/BadgeLabel.vue";
|
||||
export {
|
||||
@@ -158,6 +177,7 @@ export {
|
||||
type BadgeSlots,
|
||||
} from "./components/badge/context";
|
||||
export { default as Alert } from "./components/alert/Alert.vue";
|
||||
export { default as AlertRoot } from "./components/alert/Alert.vue";
|
||||
export { default as AlertIndicator } from "./components/alert/AlertIndicator.vue";
|
||||
export { default as AlertContent } from "./components/alert/AlertContent.vue";
|
||||
export { default as AlertTitle } from "./components/alert/AlertTitle.vue";
|
||||
@@ -170,6 +190,7 @@ export {
|
||||
} from "./components/alert/context";
|
||||
|
||||
export { default as TextField } from "./components/textfield/TextField.vue";
|
||||
export { default as TextFieldRoot } from "./components/textfield/TextField.vue";
|
||||
export {
|
||||
default as Form,
|
||||
default as FormRoot,
|
||||
@@ -200,6 +221,7 @@ export type {
|
||||
} from "./types";
|
||||
|
||||
export { default as InputGroup } from "./components/input-group/InputGroup.vue";
|
||||
export { default as InputGroupRoot } from "./components/input-group/InputGroup.vue";
|
||||
export { default as InputGroupInput } from "./components/input-group/InputGroupInput.vue";
|
||||
export { default as InputGroupTextArea } from "./components/input-group/InputGroupTextArea.vue";
|
||||
export { default as InputGroupPrefix } from "./components/input-group/InputGroupPrefix.vue";
|
||||
@@ -211,6 +233,7 @@ export {
|
||||
} from "./components/input-group/context";
|
||||
|
||||
export { default as Fieldset } from "./components/fieldset/Fieldset.vue";
|
||||
export { default as FieldsetRoot } from "./components/fieldset/Fieldset.vue";
|
||||
export type { FieldsetProps } from "./types";
|
||||
|
||||
export { default as FieldsetLegend } from "./components/fieldset/FieldsetLegend.vue";
|
||||
@@ -223,6 +246,7 @@ export { default as FieldsetActions } from "./components/fieldset/FieldsetAction
|
||||
export type { FieldsetActionsProps } from "./types";
|
||||
|
||||
export { default as SearchField } from "./components/search-field/SearchField.vue";
|
||||
export { default as SearchFieldRoot } from "./components/search-field/SearchField.vue";
|
||||
export type { SearchFieldProps } from "./types";
|
||||
|
||||
export { default as SearchFieldGroup } from "./components/search-field/SearchFieldGroup.vue";
|
||||
@@ -245,7 +269,12 @@ export {
|
||||
} from "@heroui-vue/styles";
|
||||
|
||||
export { Checkbox, Radio } from "./components/choice/item";
|
||||
export {
|
||||
Checkbox as CheckboxRoot,
|
||||
Radio as RadioRoot,
|
||||
} from "./components/choice/item";
|
||||
export { CheckboxGroup, RadioGroup } from "./components/choice/group";
|
||||
export { RadioGroup as RadioGroupRoot } from "./components/choice/group";
|
||||
export type { CheckboxProps } from "./types";
|
||||
export type { RadioProps } from "./types";
|
||||
export type { CheckboxGroupProps } from "./types";
|
||||
@@ -274,6 +303,7 @@ export {
|
||||
} from "@heroui-vue/styles";
|
||||
|
||||
export { default as Typography } from "./components/typography/Typography.vue";
|
||||
export { default as TypographyRoot } from "./components/typography/Typography.vue";
|
||||
export { default as TypographyHeading } from "./components/typography/TypographyHeading.vue";
|
||||
export { default as TypographyParagraph } from "./components/typography/TypographyParagraph.vue";
|
||||
export { default as TypographyCode } from "./components/typography/TypographyCode.vue";
|
||||
@@ -287,9 +317,11 @@ export type {
|
||||
} from "./types";
|
||||
|
||||
export { default as EmptyState } from "./components/empty-state/EmptyState.vue";
|
||||
export { default as EmptyStateRoot } from "./components/empty-state/EmptyState.vue";
|
||||
export type { EmptyStateProps } from "./types";
|
||||
|
||||
export { default as Breadcrumbs } from "./components/breadcrumbs/Breadcrumbs.vue";
|
||||
export { default as BreadcrumbsRoot } from "./components/breadcrumbs/Breadcrumbs.vue";
|
||||
export { default as BreadcrumbsItem } from "./components/breadcrumbs/BreadcrumbsItem.vue";
|
||||
export type { BreadcrumbsProps, BreadcrumbsItemProps } from "./types";
|
||||
|
||||
@@ -303,6 +335,7 @@ export {
|
||||
} from "@heroui-vue/styles";
|
||||
|
||||
export { default as ProgressBar } from "./components/progress-bar/ProgressBar.vue";
|
||||
export { default as ProgressBarRoot } from "./components/progress-bar/ProgressBar.vue";
|
||||
export { default as ProgressBarOutput } from "./components/progress-bar/ProgressBarOutput.vue";
|
||||
export { default as ProgressBarTrack } from "./components/progress-bar/ProgressBarTrack.vue";
|
||||
export { default as ProgressBarFill } from "./components/progress-bar/ProgressBarFill.vue";
|
||||
@@ -314,6 +347,7 @@ export type {
|
||||
} from "./types";
|
||||
|
||||
export { default as ProgressCircle } from "./components/progress-circle/ProgressCircle.vue";
|
||||
export { default as ProgressCircleRoot } from "./components/progress-circle/ProgressCircle.vue";
|
||||
export { default as ProgressCircleTrack } from "./components/progress-circle/ProgressCircleTrack.vue";
|
||||
export { default as ProgressCircleTrackCircle } from "./components/progress-circle/ProgressCircleTrackCircle.vue";
|
||||
export { default as ProgressCircleFillCircle } from "./components/progress-circle/ProgressCircleFillCircle.vue";
|
||||
@@ -325,6 +359,7 @@ export type {
|
||||
} from "./types";
|
||||
|
||||
export { default as Meter } from "./components/meter/Meter.vue";
|
||||
export { default as MeterRoot } from "./components/meter/Meter.vue";
|
||||
export { default as MeterOutput } from "./components/meter/MeterOutput.vue";
|
||||
export { default as MeterTrack } from "./components/meter/MeterTrack.vue";
|
||||
export { default as MeterFill } from "./components/meter/MeterFill.vue";
|
||||
@@ -345,6 +380,7 @@ export {
|
||||
} from "@heroui-vue/styles";
|
||||
|
||||
export { default as Disclosure } from "./components/disclosure/Disclosure.vue";
|
||||
export { default as DisclosureRoot } from "./components/disclosure/Disclosure.vue";
|
||||
export { default as DisclosureHeading } from "./components/disclosure/DisclosureHeading.vue";
|
||||
export { default as DisclosureTrigger } from "./components/disclosure/DisclosureTrigger.vue";
|
||||
export { default as DisclosureContent } from "./components/disclosure/DisclosureContent.vue";
|
||||
@@ -360,6 +396,7 @@ export type {
|
||||
} from "./types";
|
||||
|
||||
export { default as DisclosureGroup } from "./components/disclosure-group/DisclosureGroup.vue";
|
||||
export { default as DisclosureGroupRoot } from "./components/disclosure-group/DisclosureGroup.vue";
|
||||
export type { DisclosureGroupProps } from "./types";
|
||||
export { useDisclosureGroupNavigation } from "./components/disclosure-group/useDisclosureGroupNavigation";
|
||||
export type {
|
||||
@@ -369,6 +406,7 @@ export type {
|
||||
export type { DisclosureKey } from "./components/disclosure-group/context";
|
||||
|
||||
export { default as Accordion } from "./components/accordion/Accordion.vue";
|
||||
export { default as AccordionRoot } from "./components/accordion/Accordion.vue";
|
||||
export { default as AccordionItem } from "./components/accordion/AccordionItem.vue";
|
||||
export { default as AccordionHeading } from "./components/accordion/AccordionHeading.vue";
|
||||
export { default as AccordionTrigger } from "./components/accordion/AccordionTrigger.vue";
|
||||
@@ -403,6 +441,7 @@ export { default as ConfigProvider } from "./providers/ConfigProvider.vue";
|
||||
export type { ConfigProviderProps } from "./types";
|
||||
|
||||
export { default as Modal } from "./components/modal/Modal";
|
||||
export { default as ModalRoot } from "./components/modal/Modal";
|
||||
export type { ModalProps } from "./types";
|
||||
|
||||
export { default as ModalTrigger } from "./components/modal/ModalTrigger.vue";
|
||||
@@ -442,6 +481,7 @@ export { modalVariants, type ModalVariants } from "@heroui-vue/styles";
|
||||
export type { ModalPlacement } from "./components/modal/context";
|
||||
|
||||
export { default as Popover } from "./components/popover/Popover";
|
||||
export { default as PopoverRoot } from "./components/popover/Popover";
|
||||
export type { PopoverProps } from "./types";
|
||||
|
||||
export { default as PopoverTrigger } from "./components/popover/PopoverTrigger.vue";
|
||||
@@ -462,6 +502,7 @@ export type { PopoverArrowProps } from "./types";
|
||||
export { popoverVariants, type PopoverVariants } from "@heroui-vue/styles";
|
||||
|
||||
export { default as Tooltip } from "./components/tooltip/Tooltip";
|
||||
export { default as TooltipRoot } from "./components/tooltip/Tooltip";
|
||||
export type { TooltipProps } from "./types";
|
||||
|
||||
export { default as TooltipTrigger } from "./components/tooltip/TooltipTrigger.vue";
|
||||
@@ -478,6 +519,7 @@ export { tooltipVariants, type TooltipVariants } from "@heroui-vue/styles";
|
||||
export type { OverlayPlacement } from "./components/overlay/placement";
|
||||
|
||||
export { default as ScrollShadow } from "./components/scroll-shadow/ScrollShadow.vue";
|
||||
export { default as ScrollShadowRoot } from "./components/scroll-shadow/ScrollShadow.vue";
|
||||
export type { ScrollShadowVisibility } from "./components/scroll-shadow/types";
|
||||
export {
|
||||
scrollShadowVariants,
|
||||
@@ -486,6 +528,7 @@ export {
|
||||
type TabsVariants,
|
||||
} from "@heroui-vue/styles";
|
||||
export { default as Tabs } from "./components/tabs/Tabs";
|
||||
export { default as TabsRoot } from "./components/tabs/Tabs";
|
||||
export { default as TabsListContainer } from "./components/tabs/TabsListContainer.vue";
|
||||
export { default as TabsList } from "./components/tabs/TabsList.vue";
|
||||
export { default as TabsTab } from "./components/tabs/TabsTab.vue";
|
||||
@@ -511,6 +554,7 @@ export type {
|
||||
} from "./types";
|
||||
|
||||
export { default as ButtonGroup } from "./components/button-group/ButtonGroup.vue";
|
||||
export { default as ButtonGroupRoot } from "./components/button-group/ButtonGroup.vue";
|
||||
export { default as ButtonGroupSeparator } from "./components/button-group/ButtonGroupSeparator.vue";
|
||||
export type { ButtonGroupContextValue } from "./components/button-group/context";
|
||||
export {
|
||||
@@ -523,7 +567,9 @@ export {
|
||||
} from "@heroui-vue/styles";
|
||||
|
||||
export { default as ToggleButton } from "./components/toggle-button/ToggleButton.vue";
|
||||
export { default as ToggleButtonRoot } from "./components/toggle-button/ToggleButton.vue";
|
||||
export { default as ToggleButtonGroup } from "./components/toggle-button-group/ToggleButtonGroup.vue";
|
||||
export { default as ToggleButtonGroupRoot } from "./components/toggle-button-group/ToggleButtonGroup.vue";
|
||||
export { default as ToggleButtonGroupSeparator } from "./components/toggle-button-group/ToggleButtonGroupSeparator.vue";
|
||||
export type {
|
||||
ToggleButtonGroupKey,
|
||||
@@ -539,6 +585,7 @@ export type {
|
||||
} from "./types";
|
||||
|
||||
export { default as Toolbar } from "./components/toolbar/Toolbar.vue";
|
||||
export { default as ToolbarRoot } from "./components/toolbar/Toolbar.vue";
|
||||
export type {
|
||||
ToolbarOrientation,
|
||||
ToolbarDir,
|
||||
@@ -646,8 +693,10 @@ export {
|
||||
default as ListBoxRoot,
|
||||
} from "./components/list-box/ListBox.vue";
|
||||
export { default as ListBoxItem } from "./components/list-box/ListBoxItem.vue";
|
||||
export { default as ListBoxItemRoot } from "./components/list-box/ListBoxItem.vue";
|
||||
export { default as ListBoxItemIndicator } from "./components/list-box/ListBoxItemIndicator.vue";
|
||||
export { default as ListBoxSection } from "./components/list-box/ListBoxSection.vue";
|
||||
export { default as ListBoxSectionRoot } from "./components/list-box/ListBoxSection.vue";
|
||||
export type {
|
||||
ListBoxKey,
|
||||
ListBoxDataItem,
|
||||
@@ -768,6 +817,9 @@ export {
|
||||
default as DateInputGroup,
|
||||
default as DateFieldGroup,
|
||||
} from "./components/date-field/DateInputGroup.vue";
|
||||
export {
|
||||
default as DateInputGroupRoot,
|
||||
} from "./components/date-field/DateInputGroup.vue";
|
||||
export {
|
||||
default as DateInputGroupInput,
|
||||
default as DateFieldInput,
|
||||
@@ -1017,10 +1069,15 @@ export type { CalendarYearState as CalendarYearPickerCellRenderProps } from "./c
|
||||
export { default as Menu } from "./components/menu/Menu.vue";
|
||||
export { default as MenuRoot } from "./components/menu/Menu.vue";
|
||||
export { default as MenuItem } from "./components/menu-item/MenuItem.vue";
|
||||
export { default as MenuItemRoot } from "./components/menu-item/MenuItem.vue";
|
||||
export { default as MenuItemIndicator } from "./components/menu-item/MenuItemIndicator.vue";
|
||||
export { default as MenuItemSubmenuIndicator } from "./components/menu-item/MenuItemSubmenuIndicator.vue";
|
||||
export { default as MenuSection } from "./components/menu-section/MenuSection.vue";
|
||||
export { default as DropdownRoot } from "./components/dropdown/DropdownRoot.vue";
|
||||
export { default as MenuSectionRoot } from "./components/menu-section/MenuSection.vue";
|
||||
export {
|
||||
default as Dropdown,
|
||||
default as DropdownRoot,
|
||||
} from "./components/dropdown/DropdownRoot.vue";
|
||||
export { default as DropdownTrigger } from "./components/dropdown/DropdownTrigger.vue";
|
||||
export { default as DropdownPopover } from "./components/dropdown/DropdownPopover.vue";
|
||||
export { default as DropdownMenu } from "./components/dropdown/DropdownMenu.vue";
|
||||
@@ -1057,9 +1114,17 @@ export type {
|
||||
DropdownSubmenuIndicatorProps,
|
||||
DropdownSubmenuTriggerProps,
|
||||
} from "./types-menu";
|
||||
export type {
|
||||
MenuItemRootProps,
|
||||
MenuSectionRootProps,
|
||||
MenuProps,
|
||||
DropdownProps,
|
||||
} from "./types-menu";
|
||||
|
||||
export { default as Tag } from "./components/tag/Tag.vue";
|
||||
export { default as TagRoot } from "./components/tag/Tag.vue";
|
||||
export { default as TagGroup } from "./components/tag/TagGroup.vue";
|
||||
export { default as TagGroupRoot } from "./components/tag/TagGroup.vue";
|
||||
export { default as TagGroupList } from "./components/tag/TagGroupList.vue";
|
||||
export { default as TagRemoveButton } from "./components/tag/TagRemoveButton.vue";
|
||||
export type {
|
||||
@@ -1076,6 +1141,7 @@ export type {
|
||||
} from "./components/tag/context";
|
||||
|
||||
export { default as ErrorMessage } from "./components/error-message/ErrorMessage.vue";
|
||||
export { default as ErrorMessageRoot } from "./components/error-message/ErrorMessage.vue";
|
||||
export type { ErrorMessageProps } from "./types";
|
||||
|
||||
export {
|
||||
@@ -1088,6 +1154,7 @@ export {
|
||||
} from "@heroui-vue/styles";
|
||||
|
||||
export { default as ComboBox } from "./components/combo-box/ComboBox.vue";
|
||||
export { default as ComboBoxRoot } from "./components/combo-box/ComboBox.vue";
|
||||
export { default as ComboBoxInputGroup } from "./components/combo-box/ComboBoxInputGroup.vue";
|
||||
export { default as ComboBoxTrigger } from "./components/combo-box/ComboBoxTrigger.vue";
|
||||
export { default as ComboBoxValue } from "./components/combo-box/ComboBoxValue.vue";
|
||||
@@ -1115,6 +1182,7 @@ export type { ComboBoxModelValue };
|
||||
export { comboBoxVariants, type ComboBoxVariants } from "@heroui-vue/styles";
|
||||
|
||||
export { default as Autocomplete } from "./components/autocomplete/Autocomplete.vue";
|
||||
export { default as AutocompleteRoot } from "./components/autocomplete/Autocomplete.vue";
|
||||
export { default as AutocompleteTrigger } from "./components/autocomplete/AutocompleteTrigger.vue";
|
||||
export { default as AutocompleteValue } from "./components/autocomplete/AutocompleteValue.vue";
|
||||
export { default as AutocompleteIndicator } from "./components/autocomplete/AutocompleteIndicator.vue";
|
||||
@@ -1378,3 +1446,62 @@ export {
|
||||
export type * from "./components/color-picker/types";
|
||||
export { colorPickerVariants } from "@heroui-vue/styles";
|
||||
export type { ColorPickerVariants } from "@heroui-vue/styles";
|
||||
|
||||
/* Root 别名类型:对齐固定上游公开的 XxxRootProps 命名,与同名 XxxProps 为同一类型。 */
|
||||
export type {
|
||||
AccordionRootProps,
|
||||
AlertRootProps,
|
||||
AlertDialogRootProps,
|
||||
AutocompleteRootProps,
|
||||
AvatarGroupRootProps,
|
||||
BadgeRootProps,
|
||||
BreadcrumbsRootProps,
|
||||
ButtonRootProps,
|
||||
ButtonGroupRootProps,
|
||||
CardRootProps,
|
||||
CheckboxRootProps,
|
||||
ChipRootProps,
|
||||
CloseButtonRootProps,
|
||||
ComboBoxRootProps,
|
||||
DateInputGroupRootProps,
|
||||
DescriptionRootProps,
|
||||
DisclosureRootProps,
|
||||
DisclosureGroupRootProps,
|
||||
DrawerRootProps,
|
||||
EmptyStateRootProps,
|
||||
ErrorMessageRootProps,
|
||||
FieldErrorRootProps,
|
||||
FieldsetRootProps,
|
||||
InputRootProps,
|
||||
InputGroupRootProps,
|
||||
KbdRootProps,
|
||||
LabelRootProps,
|
||||
LinkRootProps,
|
||||
ListBoxItemRootProps,
|
||||
ListBoxSectionRootProps,
|
||||
MeterRootProps,
|
||||
ModalRootProps,
|
||||
PopoverRootProps,
|
||||
ProgressBarRootProps,
|
||||
ProgressCircleRootProps,
|
||||
RadioRootProps,
|
||||
RadioGroupRootProps,
|
||||
ScrollShadowRootProps,
|
||||
SearchFieldRootProps,
|
||||
SeparatorRootProps,
|
||||
SkeletonRootProps,
|
||||
SpinnerRootProps,
|
||||
SurfaceRootProps,
|
||||
SwitchRootProps,
|
||||
SwitchGroupRootProps,
|
||||
TabsRootProps,
|
||||
TagRootProps,
|
||||
TagGroupRootProps,
|
||||
TextAreaRootProps,
|
||||
TextFieldRootProps,
|
||||
ToggleButtonRootProps,
|
||||
ToggleButtonGroupRootProps,
|
||||
ToolbarRootProps,
|
||||
TooltipRootProps,
|
||||
TypographyRootProps,
|
||||
} from "./types";
|
||||
|
||||
@@ -38,3 +38,9 @@ export type DropdownSubmenuIndicatorProps = MenuItemSubmenuIndicatorProps;
|
||||
export type DropdownSubmenuTriggerProps = InstanceType<
|
||||
typeof DropdownSubmenuTrigger
|
||||
>["$props"];
|
||||
|
||||
/** Root 别名类型:对齐上游 MenuRootProps/MenuProps、DropdownRootProps/DropdownProps 双名导出。 */
|
||||
export type MenuItemRootProps = MenuItemProps;
|
||||
export type MenuSectionRootProps = MenuSectionProps;
|
||||
export type MenuProps = MenuRootProps;
|
||||
export type DropdownProps = DropdownRootProps;
|
||||
|
||||
@@ -978,3 +978,61 @@ export type RangeCalendarGridBodyProps = CalendarGridBodyProps;
|
||||
export type RangeCalendarHeaderCellProps = CalendarHeaderCellProps;
|
||||
export type RangeCalendarCellProps = CalendarCellProps;
|
||||
export type RangeCalendarCellIndicatorProps = CalendarCellIndicatorProps;
|
||||
|
||||
/* Root 别名类型:与固定上游 ce90ea3 公开导出的 XxxRootProps 同名,与 XxxProps 为同一类型。
|
||||
Toast 上游只导出 ToastProps、Tag 上游只导出 TagRootProps,不额外杜撰对侧别名。 */
|
||||
export type AccordionRootProps = AccordionProps;
|
||||
export type AlertRootProps = AlertProps;
|
||||
export type AlertDialogRootProps = AlertDialogProps;
|
||||
export type AutocompleteRootProps = AutocompleteProps;
|
||||
export type AvatarGroupRootProps = AvatarGroupProps;
|
||||
export type BadgeRootProps = BadgeProps;
|
||||
export type BreadcrumbsRootProps = BreadcrumbsProps;
|
||||
export type ButtonRootProps = ButtonProps;
|
||||
export type ButtonGroupRootProps = ButtonGroupProps;
|
||||
export type CardRootProps = CardProps;
|
||||
export type CheckboxRootProps = CheckboxProps;
|
||||
export type ChipRootProps = ChipProps;
|
||||
export type CloseButtonRootProps = CloseButtonProps;
|
||||
export type ComboBoxRootProps = ComboBoxProps;
|
||||
export type DateInputGroupRootProps = DateInputGroupProps;
|
||||
export type DescriptionRootProps = DescriptionProps;
|
||||
export type DisclosureRootProps = DisclosureProps;
|
||||
export type DisclosureGroupRootProps = DisclosureGroupProps;
|
||||
export type DrawerRootProps = DrawerProps;
|
||||
export type EmptyStateRootProps = EmptyStateProps;
|
||||
export type ErrorMessageRootProps = ErrorMessageProps;
|
||||
export type FieldErrorRootProps = FieldErrorProps;
|
||||
export type FieldsetRootProps = FieldsetProps;
|
||||
export type InputRootProps = InputProps;
|
||||
export type InputGroupRootProps = InputGroupProps;
|
||||
export type KbdRootProps = KbdProps;
|
||||
export type LabelRootProps = LabelProps;
|
||||
export type LinkRootProps = LinkProps;
|
||||
export type ListBoxItemRootProps = ListBoxItemProps;
|
||||
export type ListBoxSectionRootProps = ListBoxSectionProps;
|
||||
export type MeterRootProps = MeterProps;
|
||||
export type ModalRootProps = ModalProps;
|
||||
export type PopoverRootProps = PopoverProps;
|
||||
export type ProgressBarRootProps = ProgressBarProps;
|
||||
export type ProgressCircleRootProps = ProgressCircleProps;
|
||||
export type RadioRootProps = RadioProps;
|
||||
export type RadioGroupRootProps = RadioGroupProps;
|
||||
export type ScrollShadowRootProps = ScrollShadowProps;
|
||||
export type SearchFieldRootProps = SearchFieldProps;
|
||||
export type SeparatorRootProps = SeparatorProps;
|
||||
export type SkeletonRootProps = SkeletonProps;
|
||||
export type SpinnerRootProps = SpinnerProps;
|
||||
export type SurfaceRootProps = SurfaceProps;
|
||||
export type SwitchRootProps = SwitchProps;
|
||||
export type SwitchGroupRootProps = SwitchGroupProps;
|
||||
export type TabsRootProps = TabsProps;
|
||||
export type TagRootProps = TagProps;
|
||||
export type TagGroupRootProps = TagGroupProps;
|
||||
export type TextAreaRootProps = TextAreaProps;
|
||||
export type TextFieldRootProps = TextFieldProps;
|
||||
export type ToggleButtonRootProps = ToggleButtonProps;
|
||||
export type ToggleButtonGroupRootProps = ToggleButtonGroupProps;
|
||||
export type ToolbarRootProps = ToolbarProps;
|
||||
export type TooltipRootProps = TooltipProps;
|
||||
export type TypographyRootProps = TypographyProps;
|
||||
|
||||
@@ -134,6 +134,90 @@ it("uses a native version trigger, button-styled source anchor and detached them
|
||||
);
|
||||
});
|
||||
describe("documentation structure", () => {
|
||||
it("keeps component pages in the pinned HeroUI meta.json order", () => {
|
||||
// Upstream apps/docs/content/docs/cn/react/components/meta.json at
|
||||
// ce90ea3ab49d58f6c428f71bfd6fe8ae2a87b960, plus the two real Vue pages
|
||||
// (empty-state, header) at their alphabetical positions.
|
||||
const pinned = [
|
||||
"accordion",
|
||||
"alert",
|
||||
"alert-dialog",
|
||||
"autocomplete",
|
||||
"avatar",
|
||||
"avatar-group",
|
||||
"badge",
|
||||
"breadcrumbs",
|
||||
"button",
|
||||
"button-group",
|
||||
"calendar",
|
||||
"card",
|
||||
"checkbox",
|
||||
"checkbox-group",
|
||||
"chip",
|
||||
"close-button",
|
||||
"color-area",
|
||||
"color-field",
|
||||
"color-picker",
|
||||
"color-slider",
|
||||
"color-swatch",
|
||||
"color-swatch-picker",
|
||||
"combo-box",
|
||||
"date-field",
|
||||
"date-picker",
|
||||
"date-range-picker",
|
||||
"description",
|
||||
"disclosure",
|
||||
"disclosure-group",
|
||||
"drawer",
|
||||
"dropdown",
|
||||
"empty-state",
|
||||
"error-message",
|
||||
"field-error",
|
||||
"fieldset",
|
||||
"form",
|
||||
"header",
|
||||
"input",
|
||||
"input-group",
|
||||
"input-otp",
|
||||
"kbd",
|
||||
"label",
|
||||
"link",
|
||||
"list-box",
|
||||
"meter",
|
||||
"modal",
|
||||
"number-field",
|
||||
"pagination",
|
||||
"popover",
|
||||
"progress-bar",
|
||||
"progress-circle",
|
||||
"radio-group",
|
||||
"range-calendar",
|
||||
"scroll-shadow",
|
||||
"search-field",
|
||||
"select",
|
||||
"separator",
|
||||
"skeleton",
|
||||
"slider",
|
||||
"spinner",
|
||||
"surface",
|
||||
"switch",
|
||||
"table",
|
||||
"tabs",
|
||||
"tag-group",
|
||||
"textarea",
|
||||
"text-field",
|
||||
"time-field",
|
||||
"toast",
|
||||
"toggle-button",
|
||||
"toggle-button-group",
|
||||
"toolbar",
|
||||
"tooltip",
|
||||
"typography",
|
||||
];
|
||||
expect(componentItems.map((item) => item.url)).toEqual(
|
||||
pinned.map((slug) => "/components/" + slug),
|
||||
);
|
||||
});
|
||||
it("makes every existing component page reachable exactly once in navigation and its category overview", () => {
|
||||
const pages = readdirSync("apps/docs/components")
|
||||
.filter((name) => name.endsWith(".md"))
|
||||
|
||||
@@ -191,6 +191,32 @@ describe("NumberField public contracts", () => {
|
||||
expect((input.element as HTMLInputElement).value).toBe("4");
|
||||
}
|
||||
});
|
||||
it("keeps characters typed after keydown instead of restoring committed text", async () => {
|
||||
const update = vi.fn();
|
||||
const w = fixture(
|
||||
`<NumberField :model-value="4" @update:model-value="update">${parts}</NumberField>`,
|
||||
() => ({ update }),
|
||||
);
|
||||
const input = w.get('input[role="spinbutton"]');
|
||||
for (const [key, text] of [
|
||||
["9", "49"],
|
||||
["0", "490"],
|
||||
] as const) {
|
||||
// Keep keydown and text insertion in one task: awaiting trigger() here
|
||||
// would flush the old nextTick(restore) before typing and hide the bug.
|
||||
input.element.dispatchEvent(
|
||||
new KeyboardEvent("keydown", { key, bubbles: true, cancelable: true }),
|
||||
);
|
||||
(input.element as HTMLInputElement).value = text;
|
||||
input.element.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
await nextTick();
|
||||
await nextTick();
|
||||
expect((input.element as HTMLInputElement).value).toBe(text);
|
||||
}
|
||||
await input.trigger("blur");
|
||||
await flushPromises();
|
||||
expect(update).toHaveBeenCalledWith(490);
|
||||
});
|
||||
it("blocks readonly Home End wheel click and typing", async () => {
|
||||
const update = vi.fn();
|
||||
const w = fixture(
|
||||
|
||||
@@ -0,0 +1,840 @@
|
||||
// Root 别名公共契约:完整 82 对具名导入、Props/事件/插槽/实例类型等价与正反例。
|
||||
// Toast 上游不导出 ToastRootProps,只有值别名与实例等价,不杜撰类型别名。
|
||||
import { h } from "vue";
|
||||
import {
|
||||
Accordion,
|
||||
AccordionRoot,
|
||||
Alert,
|
||||
AlertRoot,
|
||||
AlertDialog,
|
||||
AlertDialogRoot,
|
||||
Autocomplete,
|
||||
AutocompleteRoot,
|
||||
Avatar,
|
||||
AvatarRoot,
|
||||
AvatarGroup,
|
||||
AvatarGroupRoot,
|
||||
Badge,
|
||||
BadgeRoot,
|
||||
Breadcrumbs,
|
||||
BreadcrumbsRoot,
|
||||
Button,
|
||||
ButtonRoot,
|
||||
ButtonGroup,
|
||||
ButtonGroupRoot,
|
||||
Calendar,
|
||||
CalendarRoot,
|
||||
Card,
|
||||
CardRoot,
|
||||
Checkbox,
|
||||
CheckboxRoot,
|
||||
Chip,
|
||||
ChipRoot,
|
||||
CloseButton,
|
||||
CloseButtonRoot,
|
||||
ColorArea,
|
||||
ColorAreaRoot,
|
||||
ColorField,
|
||||
ColorFieldRoot,
|
||||
ColorInputGroup,
|
||||
ColorInputGroupRoot,
|
||||
ColorPicker,
|
||||
ColorPickerRoot,
|
||||
ColorSlider,
|
||||
ColorSliderRoot,
|
||||
ColorSwatch,
|
||||
ColorSwatchRoot,
|
||||
ColorSwatchPicker,
|
||||
ColorSwatchPickerRoot,
|
||||
ComboBox,
|
||||
ComboBoxRoot,
|
||||
DateField,
|
||||
DateFieldRoot,
|
||||
DateInputGroup,
|
||||
DateInputGroupRoot,
|
||||
DatePicker,
|
||||
DatePickerRoot,
|
||||
DateRangePicker,
|
||||
DateRangePickerRoot,
|
||||
Description,
|
||||
DescriptionRoot,
|
||||
Disclosure,
|
||||
DisclosureRoot,
|
||||
DisclosureGroup,
|
||||
DisclosureGroupRoot,
|
||||
Drawer,
|
||||
DrawerRoot,
|
||||
Dropdown,
|
||||
DropdownRoot,
|
||||
EmptyState,
|
||||
EmptyStateRoot,
|
||||
ErrorMessage,
|
||||
ErrorMessageRoot,
|
||||
FieldError,
|
||||
FieldErrorRoot,
|
||||
Fieldset,
|
||||
FieldsetRoot,
|
||||
Form,
|
||||
FormRoot,
|
||||
Header,
|
||||
HeaderRoot,
|
||||
Input,
|
||||
InputRoot,
|
||||
InputGroup,
|
||||
InputGroupRoot,
|
||||
InputOTP,
|
||||
InputOTPRoot,
|
||||
Kbd,
|
||||
KbdRoot,
|
||||
Label,
|
||||
LabelRoot,
|
||||
Link,
|
||||
LinkRoot,
|
||||
ListBox,
|
||||
ListBoxRoot,
|
||||
ListBoxItem,
|
||||
ListBoxItemRoot,
|
||||
ListBoxSection,
|
||||
ListBoxSectionRoot,
|
||||
Menu,
|
||||
MenuRoot,
|
||||
MenuItem,
|
||||
MenuItemRoot,
|
||||
MenuSection,
|
||||
MenuSectionRoot,
|
||||
Meter,
|
||||
MeterRoot,
|
||||
Modal,
|
||||
ModalRoot,
|
||||
NumberField,
|
||||
NumberFieldRoot,
|
||||
Pagination,
|
||||
PaginationRoot,
|
||||
Popover,
|
||||
PopoverRoot,
|
||||
ProgressBar,
|
||||
ProgressBarRoot,
|
||||
ProgressCircle,
|
||||
ProgressCircleRoot,
|
||||
Radio,
|
||||
RadioRoot,
|
||||
RadioGroup,
|
||||
RadioGroupRoot,
|
||||
RangeCalendar,
|
||||
RangeCalendarRoot,
|
||||
ScrollShadow,
|
||||
ScrollShadowRoot,
|
||||
SearchField,
|
||||
SearchFieldRoot,
|
||||
Select,
|
||||
SelectRoot,
|
||||
Separator,
|
||||
SeparatorRoot,
|
||||
Skeleton,
|
||||
SkeletonRoot,
|
||||
Slider,
|
||||
SliderRoot,
|
||||
Spinner,
|
||||
SpinnerRoot,
|
||||
Surface,
|
||||
SurfaceRoot,
|
||||
Switch,
|
||||
SwitchRoot,
|
||||
SwitchGroup,
|
||||
SwitchGroupRoot,
|
||||
Table,
|
||||
TableRoot,
|
||||
Tabs,
|
||||
TabsRoot,
|
||||
Tag,
|
||||
TagRoot,
|
||||
TagGroup,
|
||||
TagGroupRoot,
|
||||
TextArea,
|
||||
TextAreaRoot,
|
||||
TextField,
|
||||
TextFieldRoot,
|
||||
TimeField,
|
||||
TimeFieldRoot,
|
||||
ToggleButton,
|
||||
ToggleButtonRoot,
|
||||
ToggleButtonGroup,
|
||||
ToggleButtonGroupRoot,
|
||||
Toolbar,
|
||||
ToolbarRoot,
|
||||
Tooltip,
|
||||
TooltipRoot,
|
||||
Typography,
|
||||
TypographyRoot,
|
||||
} from "@heroui-vue/components";
|
||||
import type { AccordionProps, AccordionRootProps } from "@heroui-vue/components";
|
||||
import type { AlertProps, AlertRootProps } from "@heroui-vue/components";
|
||||
import type { AlertDialogProps, AlertDialogRootProps } from "@heroui-vue/components";
|
||||
import type { AutocompleteProps, AutocompleteRootProps } from "@heroui-vue/components";
|
||||
import type { AvatarProps, AvatarRootProps } from "@heroui-vue/components";
|
||||
import type { AvatarGroupProps, AvatarGroupRootProps } from "@heroui-vue/components";
|
||||
import type { BadgeProps, BadgeRootProps } from "@heroui-vue/components";
|
||||
import type { BreadcrumbsProps, BreadcrumbsRootProps } from "@heroui-vue/components";
|
||||
import type { ButtonProps, ButtonRootProps } from "@heroui-vue/components";
|
||||
import type { ButtonGroupProps, ButtonGroupRootProps } from "@heroui-vue/components";
|
||||
import type { CalendarProps, CalendarRootProps } from "@heroui-vue/components";
|
||||
import type { CardProps, CardRootProps } from "@heroui-vue/components";
|
||||
import type { CheckboxProps, CheckboxRootProps } from "@heroui-vue/components";
|
||||
import type { ChipProps, ChipRootProps } from "@heroui-vue/components";
|
||||
import type { CloseButtonProps, CloseButtonRootProps } from "@heroui-vue/components";
|
||||
import type { ColorAreaProps, ColorAreaRootProps } from "@heroui-vue/components";
|
||||
import type { ColorFieldProps, ColorFieldRootProps } from "@heroui-vue/components";
|
||||
import type { ColorInputGroupProps, ColorInputGroupRootProps } from "@heroui-vue/components";
|
||||
import type { ColorPickerProps, ColorPickerRootProps } from "@heroui-vue/components";
|
||||
import type { ColorSliderProps, ColorSliderRootProps } from "@heroui-vue/components";
|
||||
import type { ColorSwatchProps, ColorSwatchRootProps } from "@heroui-vue/components";
|
||||
import type { ColorSwatchPickerProps, ColorSwatchPickerRootProps } from "@heroui-vue/components";
|
||||
import type { ComboBoxProps, ComboBoxRootProps } from "@heroui-vue/components";
|
||||
import type { DateFieldProps, DateFieldRootProps } from "@heroui-vue/components";
|
||||
import type { DateInputGroupProps, DateInputGroupRootProps } from "@heroui-vue/components";
|
||||
import type { DatePickerProps, DatePickerRootProps } from "@heroui-vue/components";
|
||||
import type { DateRangePickerProps, DateRangePickerRootProps } from "@heroui-vue/components";
|
||||
import type { DescriptionProps, DescriptionRootProps } from "@heroui-vue/components";
|
||||
import type { DisclosureProps, DisclosureRootProps } from "@heroui-vue/components";
|
||||
import type { DisclosureGroupProps, DisclosureGroupRootProps } from "@heroui-vue/components";
|
||||
import type { DrawerProps, DrawerRootProps } from "@heroui-vue/components";
|
||||
import type { DropdownProps, DropdownRootProps } from "@heroui-vue/components";
|
||||
import type { EmptyStateProps, EmptyStateRootProps } from "@heroui-vue/components";
|
||||
import type { ErrorMessageProps, ErrorMessageRootProps } from "@heroui-vue/components";
|
||||
import type { FieldErrorProps, FieldErrorRootProps } from "@heroui-vue/components";
|
||||
import type { FieldsetProps, FieldsetRootProps } from "@heroui-vue/components";
|
||||
import type { FormProps, FormRootProps } from "@heroui-vue/components";
|
||||
import type { HeaderProps, HeaderRootProps } from "@heroui-vue/components";
|
||||
import type { InputProps, InputRootProps } from "@heroui-vue/components";
|
||||
import type { InputGroupProps, InputGroupRootProps } from "@heroui-vue/components";
|
||||
import type { InputOTPProps, InputOTPRootProps } from "@heroui-vue/components";
|
||||
import type { KbdProps, KbdRootProps } from "@heroui-vue/components";
|
||||
import type { LabelProps, LabelRootProps } from "@heroui-vue/components";
|
||||
import type { LinkProps, LinkRootProps } from "@heroui-vue/components";
|
||||
import type { ListBoxProps, ListBoxRootProps } from "@heroui-vue/components";
|
||||
import type { ListBoxItemProps, ListBoxItemRootProps } from "@heroui-vue/components";
|
||||
import type { ListBoxSectionProps, ListBoxSectionRootProps } from "@heroui-vue/components";
|
||||
import type { MenuProps, MenuRootProps } from "@heroui-vue/components";
|
||||
import type { MenuItemProps, MenuItemRootProps } from "@heroui-vue/components";
|
||||
import type { MenuSectionProps, MenuSectionRootProps } from "@heroui-vue/components";
|
||||
import type { MeterProps, MeterRootProps } from "@heroui-vue/components";
|
||||
import type { ModalProps, ModalRootProps } from "@heroui-vue/components";
|
||||
import type { NumberFieldProps, NumberFieldRootProps } from "@heroui-vue/components";
|
||||
import type { PaginationProps, PaginationRootProps } from "@heroui-vue/components";
|
||||
import type { PopoverProps, PopoverRootProps } from "@heroui-vue/components";
|
||||
import type { ProgressBarProps, ProgressBarRootProps } from "@heroui-vue/components";
|
||||
import type { ProgressCircleProps, ProgressCircleRootProps } from "@heroui-vue/components";
|
||||
import type { RadioProps, RadioRootProps } from "@heroui-vue/components";
|
||||
import type { RadioGroupProps, RadioGroupRootProps } from "@heroui-vue/components";
|
||||
import type { RangeCalendarProps, RangeCalendarRootProps } from "@heroui-vue/components";
|
||||
import type { ScrollShadowProps, ScrollShadowRootProps } from "@heroui-vue/components";
|
||||
import type { SearchFieldProps, SearchFieldRootProps } from "@heroui-vue/components";
|
||||
import type { SelectProps, SelectRootProps } from "@heroui-vue/components";
|
||||
import type { SeparatorProps, SeparatorRootProps } from "@heroui-vue/components";
|
||||
import type { SkeletonProps, SkeletonRootProps } from "@heroui-vue/components";
|
||||
import type { SliderProps, SliderRootProps } from "@heroui-vue/components";
|
||||
import type { SpinnerProps, SpinnerRootProps } from "@heroui-vue/components";
|
||||
import type { SurfaceProps, SurfaceRootProps } from "@heroui-vue/components";
|
||||
import type { SwitchProps, SwitchRootProps } from "@heroui-vue/components";
|
||||
import type { SwitchGroupProps, SwitchGroupRootProps } from "@heroui-vue/components";
|
||||
import type { TableProps, TableRootProps } from "@heroui-vue/components";
|
||||
import type { TabsProps, TabsRootProps } from "@heroui-vue/components";
|
||||
import type { TagProps, TagRootProps } from "@heroui-vue/components";
|
||||
import type { TagGroupProps, TagGroupRootProps } from "@heroui-vue/components";
|
||||
import type { TextAreaProps, TextAreaRootProps } from "@heroui-vue/components";
|
||||
import type { TextFieldProps, TextFieldRootProps } from "@heroui-vue/components";
|
||||
import type { TimeFieldProps, TimeFieldRootProps } from "@heroui-vue/components";
|
||||
import type { ToggleButtonProps, ToggleButtonRootProps } from "@heroui-vue/components";
|
||||
import type { ToggleButtonGroupProps, ToggleButtonGroupRootProps } from "@heroui-vue/components";
|
||||
import type { ToolbarProps, ToolbarRootProps } from "@heroui-vue/components";
|
||||
import type { TooltipProps, TooltipRootProps } from "@heroui-vue/components";
|
||||
import type { TypographyProps, TypographyRootProps } from "@heroui-vue/components";
|
||||
|
||||
type Same<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;
|
||||
|
||||
const AccordionRootPropsEq: Same<AccordionProps, AccordionRootProps> = true;
|
||||
const AccordionRootCompEq: Same<typeof Accordion, typeof AccordionRoot> = true;
|
||||
const AccordionRootInstanceEq: Same<InstanceType<typeof Accordion>, InstanceType<typeof AccordionRoot>> = true;
|
||||
const AccordionRootEmitsEq: Same<InstanceType<typeof Accordion>["$emit"], InstanceType<typeof AccordionRoot>["$emit"]> = true;
|
||||
const AccordionRootSlotsEq: Same<InstanceType<typeof Accordion>["$slots"], InstanceType<typeof AccordionRoot>["$slots"]> = true;
|
||||
const AlertRootPropsEq: Same<AlertProps, AlertRootProps> = true;
|
||||
const AlertRootCompEq: Same<typeof Alert, typeof AlertRoot> = true;
|
||||
const AlertRootInstanceEq: Same<InstanceType<typeof Alert>, InstanceType<typeof AlertRoot>> = true;
|
||||
const AlertRootEmitsEq: Same<InstanceType<typeof Alert>["$emit"], InstanceType<typeof AlertRoot>["$emit"]> = true;
|
||||
const AlertRootSlotsEq: Same<InstanceType<typeof Alert>["$slots"], InstanceType<typeof AlertRoot>["$slots"]> = true;
|
||||
const AlertDialogRootPropsEq: Same<AlertDialogProps, AlertDialogRootProps> = true;
|
||||
const AlertDialogRootCompEq: Same<typeof AlertDialog, typeof AlertDialogRoot> = true;
|
||||
const AlertDialogRootInstanceEq: Same<InstanceType<typeof AlertDialog>, InstanceType<typeof AlertDialogRoot>> = true;
|
||||
const AlertDialogRootEmitsEq: Same<InstanceType<typeof AlertDialog>["$emit"], InstanceType<typeof AlertDialogRoot>["$emit"]> = true;
|
||||
const AlertDialogRootSlotsEq: Same<InstanceType<typeof AlertDialog>["$slots"], InstanceType<typeof AlertDialogRoot>["$slots"]> = true;
|
||||
const AutocompleteRootPropsEq: Same<AutocompleteProps, AutocompleteRootProps> = true;
|
||||
const AutocompleteRootCompEq: Same<typeof Autocomplete, typeof AutocompleteRoot> = true;
|
||||
const AutocompleteRootInstanceEq: Same<InstanceType<typeof Autocomplete>, InstanceType<typeof AutocompleteRoot>> = true;
|
||||
const AutocompleteRootEmitsEq: Same<InstanceType<typeof Autocomplete>["$emit"], InstanceType<typeof AutocompleteRoot>["$emit"]> = true;
|
||||
const AutocompleteRootSlotsEq: Same<InstanceType<typeof Autocomplete>["$slots"], InstanceType<typeof AutocompleteRoot>["$slots"]> = true;
|
||||
const AvatarRootPropsEq: Same<AvatarProps, AvatarRootProps> = true;
|
||||
const AvatarRootCompEq: Same<typeof Avatar, typeof AvatarRoot> = true;
|
||||
const AvatarRootInstanceEq: Same<InstanceType<typeof Avatar>, InstanceType<typeof AvatarRoot>> = true;
|
||||
const AvatarRootEmitsEq: Same<InstanceType<typeof Avatar>["$emit"], InstanceType<typeof AvatarRoot>["$emit"]> = true;
|
||||
const AvatarRootSlotsEq: Same<InstanceType<typeof Avatar>["$slots"], InstanceType<typeof AvatarRoot>["$slots"]> = true;
|
||||
const AvatarGroupRootPropsEq: Same<AvatarGroupProps, AvatarGroupRootProps> = true;
|
||||
const AvatarGroupRootCompEq: Same<typeof AvatarGroup, typeof AvatarGroupRoot> = true;
|
||||
const AvatarGroupRootInstanceEq: Same<InstanceType<typeof AvatarGroup>, InstanceType<typeof AvatarGroupRoot>> = true;
|
||||
const AvatarGroupRootEmitsEq: Same<InstanceType<typeof AvatarGroup>["$emit"], InstanceType<typeof AvatarGroupRoot>["$emit"]> = true;
|
||||
const AvatarGroupRootSlotsEq: Same<InstanceType<typeof AvatarGroup>["$slots"], InstanceType<typeof AvatarGroupRoot>["$slots"]> = true;
|
||||
const BadgeRootPropsEq: Same<BadgeProps, BadgeRootProps> = true;
|
||||
const BadgeRootCompEq: Same<typeof Badge, typeof BadgeRoot> = true;
|
||||
const BadgeRootInstanceEq: Same<InstanceType<typeof Badge>, InstanceType<typeof BadgeRoot>> = true;
|
||||
const BadgeRootEmitsEq: Same<InstanceType<typeof Badge>["$emit"], InstanceType<typeof BadgeRoot>["$emit"]> = true;
|
||||
const BadgeRootSlotsEq: Same<InstanceType<typeof Badge>["$slots"], InstanceType<typeof BadgeRoot>["$slots"]> = true;
|
||||
const BreadcrumbsRootPropsEq: Same<BreadcrumbsProps, BreadcrumbsRootProps> = true;
|
||||
const BreadcrumbsRootCompEq: Same<typeof Breadcrumbs, typeof BreadcrumbsRoot> = true;
|
||||
const BreadcrumbsRootInstanceEq: Same<InstanceType<typeof Breadcrumbs>, InstanceType<typeof BreadcrumbsRoot>> = true;
|
||||
const BreadcrumbsRootEmitsEq: Same<InstanceType<typeof Breadcrumbs>["$emit"], InstanceType<typeof BreadcrumbsRoot>["$emit"]> = true;
|
||||
const BreadcrumbsRootSlotsEq: Same<InstanceType<typeof Breadcrumbs>["$slots"], InstanceType<typeof BreadcrumbsRoot>["$slots"]> = true;
|
||||
const ButtonRootPropsEq: Same<ButtonProps, ButtonRootProps> = true;
|
||||
const ButtonRootCompEq: Same<typeof Button, typeof ButtonRoot> = true;
|
||||
const ButtonRootInstanceEq: Same<InstanceType<typeof Button>, InstanceType<typeof ButtonRoot>> = true;
|
||||
const ButtonRootEmitsEq: Same<InstanceType<typeof Button>["$emit"], InstanceType<typeof ButtonRoot>["$emit"]> = true;
|
||||
const ButtonRootSlotsEq: Same<InstanceType<typeof Button>["$slots"], InstanceType<typeof ButtonRoot>["$slots"]> = true;
|
||||
const ButtonGroupRootPropsEq: Same<ButtonGroupProps, ButtonGroupRootProps> = true;
|
||||
const ButtonGroupRootCompEq: Same<typeof ButtonGroup, typeof ButtonGroupRoot> = true;
|
||||
const ButtonGroupRootInstanceEq: Same<InstanceType<typeof ButtonGroup>, InstanceType<typeof ButtonGroupRoot>> = true;
|
||||
const ButtonGroupRootEmitsEq: Same<InstanceType<typeof ButtonGroup>["$emit"], InstanceType<typeof ButtonGroupRoot>["$emit"]> = true;
|
||||
const ButtonGroupRootSlotsEq: Same<InstanceType<typeof ButtonGroup>["$slots"], InstanceType<typeof ButtonGroupRoot>["$slots"]> = true;
|
||||
const CalendarRootPropsEq: Same<CalendarProps, CalendarRootProps> = true;
|
||||
const CalendarRootCompEq: Same<typeof Calendar, typeof CalendarRoot> = true;
|
||||
// Calendar 为泛型函数式组件类型,InstanceType 不适用;组件对象等价已覆盖实例/事件/插槽成员。
|
||||
const CardRootPropsEq: Same<CardProps, CardRootProps> = true;
|
||||
const CardRootCompEq: Same<typeof Card, typeof CardRoot> = true;
|
||||
const CardRootInstanceEq: Same<InstanceType<typeof Card>, InstanceType<typeof CardRoot>> = true;
|
||||
const CardRootEmitsEq: Same<InstanceType<typeof Card>["$emit"], InstanceType<typeof CardRoot>["$emit"]> = true;
|
||||
const CardRootSlotsEq: Same<InstanceType<typeof Card>["$slots"], InstanceType<typeof CardRoot>["$slots"]> = true;
|
||||
const CheckboxRootPropsEq: Same<CheckboxProps, CheckboxRootProps> = true;
|
||||
const CheckboxRootCompEq: Same<typeof Checkbox, typeof CheckboxRoot> = true;
|
||||
const CheckboxRootInstanceEq: Same<InstanceType<typeof Checkbox>, InstanceType<typeof CheckboxRoot>> = true;
|
||||
const CheckboxRootEmitsEq: Same<InstanceType<typeof Checkbox>["$emit"], InstanceType<typeof CheckboxRoot>["$emit"]> = true;
|
||||
const CheckboxRootSlotsEq: Same<InstanceType<typeof Checkbox>["$slots"], InstanceType<typeof CheckboxRoot>["$slots"]> = true;
|
||||
const ChipRootPropsEq: Same<ChipProps, ChipRootProps> = true;
|
||||
const ChipRootCompEq: Same<typeof Chip, typeof ChipRoot> = true;
|
||||
const ChipRootInstanceEq: Same<InstanceType<typeof Chip>, InstanceType<typeof ChipRoot>> = true;
|
||||
const ChipRootEmitsEq: Same<InstanceType<typeof Chip>["$emit"], InstanceType<typeof ChipRoot>["$emit"]> = true;
|
||||
const ChipRootSlotsEq: Same<InstanceType<typeof Chip>["$slots"], InstanceType<typeof ChipRoot>["$slots"]> = true;
|
||||
const CloseButtonRootPropsEq: Same<CloseButtonProps, CloseButtonRootProps> = true;
|
||||
const CloseButtonRootCompEq: Same<typeof CloseButton, typeof CloseButtonRoot> = true;
|
||||
const CloseButtonRootInstanceEq: Same<InstanceType<typeof CloseButton>, InstanceType<typeof CloseButtonRoot>> = true;
|
||||
const CloseButtonRootEmitsEq: Same<InstanceType<typeof CloseButton>["$emit"], InstanceType<typeof CloseButtonRoot>["$emit"]> = true;
|
||||
const CloseButtonRootSlotsEq: Same<InstanceType<typeof CloseButton>["$slots"], InstanceType<typeof CloseButtonRoot>["$slots"]> = true;
|
||||
const ColorAreaRootPropsEq: Same<ColorAreaProps, ColorAreaRootProps> = true;
|
||||
const ColorAreaRootCompEq: Same<typeof ColorArea, typeof ColorAreaRoot> = true;
|
||||
const ColorAreaRootInstanceEq: Same<InstanceType<typeof ColorArea>, InstanceType<typeof ColorAreaRoot>> = true;
|
||||
const ColorAreaRootEmitsEq: Same<InstanceType<typeof ColorArea>["$emit"], InstanceType<typeof ColorAreaRoot>["$emit"]> = true;
|
||||
const ColorAreaRootSlotsEq: Same<InstanceType<typeof ColorArea>["$slots"], InstanceType<typeof ColorAreaRoot>["$slots"]> = true;
|
||||
const ColorFieldRootPropsEq: Same<ColorFieldProps, ColorFieldRootProps> = true;
|
||||
const ColorFieldRootCompEq: Same<typeof ColorField, typeof ColorFieldRoot> = true;
|
||||
const ColorFieldRootInstanceEq: Same<InstanceType<typeof ColorField>, InstanceType<typeof ColorFieldRoot>> = true;
|
||||
const ColorFieldRootEmitsEq: Same<InstanceType<typeof ColorField>["$emit"], InstanceType<typeof ColorFieldRoot>["$emit"]> = true;
|
||||
const ColorFieldRootSlotsEq: Same<InstanceType<typeof ColorField>["$slots"], InstanceType<typeof ColorFieldRoot>["$slots"]> = true;
|
||||
const ColorInputGroupRootPropsEq: Same<ColorInputGroupProps, ColorInputGroupRootProps> = true;
|
||||
const ColorInputGroupRootCompEq: Same<typeof ColorInputGroup, typeof ColorInputGroupRoot> = true;
|
||||
const ColorInputGroupRootInstanceEq: Same<InstanceType<typeof ColorInputGroup>, InstanceType<typeof ColorInputGroupRoot>> = true;
|
||||
const ColorInputGroupRootEmitsEq: Same<InstanceType<typeof ColorInputGroup>["$emit"], InstanceType<typeof ColorInputGroupRoot>["$emit"]> = true;
|
||||
const ColorInputGroupRootSlotsEq: Same<InstanceType<typeof ColorInputGroup>["$slots"], InstanceType<typeof ColorInputGroupRoot>["$slots"]> = true;
|
||||
const ColorPickerRootPropsEq: Same<ColorPickerProps, ColorPickerRootProps> = true;
|
||||
const ColorPickerRootCompEq: Same<typeof ColorPicker, typeof ColorPickerRoot> = true;
|
||||
const ColorPickerRootInstanceEq: Same<InstanceType<typeof ColorPicker>, InstanceType<typeof ColorPickerRoot>> = true;
|
||||
const ColorPickerRootEmitsEq: Same<InstanceType<typeof ColorPicker>["$emit"], InstanceType<typeof ColorPickerRoot>["$emit"]> = true;
|
||||
const ColorPickerRootSlotsEq: Same<InstanceType<typeof ColorPicker>["$slots"], InstanceType<typeof ColorPickerRoot>["$slots"]> = true;
|
||||
const ColorSliderRootPropsEq: Same<ColorSliderProps, ColorSliderRootProps> = true;
|
||||
const ColorSliderRootCompEq: Same<typeof ColorSlider, typeof ColorSliderRoot> = true;
|
||||
const ColorSliderRootInstanceEq: Same<InstanceType<typeof ColorSlider>, InstanceType<typeof ColorSliderRoot>> = true;
|
||||
const ColorSliderRootEmitsEq: Same<InstanceType<typeof ColorSlider>["$emit"], InstanceType<typeof ColorSliderRoot>["$emit"]> = true;
|
||||
const ColorSliderRootSlotsEq: Same<InstanceType<typeof ColorSlider>["$slots"], InstanceType<typeof ColorSliderRoot>["$slots"]> = true;
|
||||
const ColorSwatchRootPropsEq: Same<ColorSwatchProps, ColorSwatchRootProps> = true;
|
||||
const ColorSwatchRootCompEq: Same<typeof ColorSwatch, typeof ColorSwatchRoot> = true;
|
||||
const ColorSwatchRootInstanceEq: Same<InstanceType<typeof ColorSwatch>, InstanceType<typeof ColorSwatchRoot>> = true;
|
||||
const ColorSwatchRootEmitsEq: Same<InstanceType<typeof ColorSwatch>["$emit"], InstanceType<typeof ColorSwatchRoot>["$emit"]> = true;
|
||||
const ColorSwatchRootSlotsEq: Same<InstanceType<typeof ColorSwatch>["$slots"], InstanceType<typeof ColorSwatchRoot>["$slots"]> = true;
|
||||
const ColorSwatchPickerRootPropsEq: Same<ColorSwatchPickerProps, ColorSwatchPickerRootProps> = true;
|
||||
const ColorSwatchPickerRootCompEq: Same<typeof ColorSwatchPicker, typeof ColorSwatchPickerRoot> = true;
|
||||
const ColorSwatchPickerRootInstanceEq: Same<InstanceType<typeof ColorSwatchPicker>, InstanceType<typeof ColorSwatchPickerRoot>> = true;
|
||||
const ColorSwatchPickerRootEmitsEq: Same<InstanceType<typeof ColorSwatchPicker>["$emit"], InstanceType<typeof ColorSwatchPickerRoot>["$emit"]> = true;
|
||||
const ColorSwatchPickerRootSlotsEq: Same<InstanceType<typeof ColorSwatchPicker>["$slots"], InstanceType<typeof ColorSwatchPickerRoot>["$slots"]> = true;
|
||||
const ComboBoxRootPropsEq: Same<ComboBoxProps, ComboBoxRootProps> = true;
|
||||
const ComboBoxRootCompEq: Same<typeof ComboBox, typeof ComboBoxRoot> = true;
|
||||
const ComboBoxRootInstanceEq: Same<InstanceType<typeof ComboBox>, InstanceType<typeof ComboBoxRoot>> = true;
|
||||
const ComboBoxRootEmitsEq: Same<InstanceType<typeof ComboBox>["$emit"], InstanceType<typeof ComboBoxRoot>["$emit"]> = true;
|
||||
const ComboBoxRootSlotsEq: Same<InstanceType<typeof ComboBox>["$slots"], InstanceType<typeof ComboBoxRoot>["$slots"]> = true;
|
||||
const DateFieldRootPropsEq: Same<DateFieldProps, DateFieldRootProps> = true;
|
||||
const DateFieldRootCompEq: Same<typeof DateField, typeof DateFieldRoot> = true;
|
||||
const DateFieldRootInstanceEq: Same<InstanceType<typeof DateField>, InstanceType<typeof DateFieldRoot>> = true;
|
||||
const DateFieldRootEmitsEq: Same<InstanceType<typeof DateField>["$emit"], InstanceType<typeof DateFieldRoot>["$emit"]> = true;
|
||||
const DateFieldRootSlotsEq: Same<InstanceType<typeof DateField>["$slots"], InstanceType<typeof DateFieldRoot>["$slots"]> = true;
|
||||
const DateInputGroupRootPropsEq: Same<DateInputGroupProps, DateInputGroupRootProps> = true;
|
||||
const DateInputGroupRootCompEq: Same<typeof DateInputGroup, typeof DateInputGroupRoot> = true;
|
||||
const DateInputGroupRootInstanceEq: Same<InstanceType<typeof DateInputGroup>, InstanceType<typeof DateInputGroupRoot>> = true;
|
||||
const DateInputGroupRootEmitsEq: Same<InstanceType<typeof DateInputGroup>["$emit"], InstanceType<typeof DateInputGroupRoot>["$emit"]> = true;
|
||||
const DateInputGroupRootSlotsEq: Same<InstanceType<typeof DateInputGroup>["$slots"], InstanceType<typeof DateInputGroupRoot>["$slots"]> = true;
|
||||
const DatePickerRootPropsEq: Same<DatePickerProps, DatePickerRootProps> = true;
|
||||
const DatePickerRootCompEq: Same<typeof DatePicker, typeof DatePickerRoot> = true;
|
||||
const DatePickerRootInstanceEq: Same<InstanceType<typeof DatePicker>, InstanceType<typeof DatePickerRoot>> = true;
|
||||
const DatePickerRootEmitsEq: Same<InstanceType<typeof DatePicker>["$emit"], InstanceType<typeof DatePickerRoot>["$emit"]> = true;
|
||||
const DatePickerRootSlotsEq: Same<InstanceType<typeof DatePicker>["$slots"], InstanceType<typeof DatePickerRoot>["$slots"]> = true;
|
||||
const DateRangePickerRootPropsEq: Same<DateRangePickerProps, DateRangePickerRootProps> = true;
|
||||
const DateRangePickerRootCompEq: Same<typeof DateRangePicker, typeof DateRangePickerRoot> = true;
|
||||
const DateRangePickerRootInstanceEq: Same<InstanceType<typeof DateRangePicker>, InstanceType<typeof DateRangePickerRoot>> = true;
|
||||
const DateRangePickerRootEmitsEq: Same<InstanceType<typeof DateRangePicker>["$emit"], InstanceType<typeof DateRangePickerRoot>["$emit"]> = true;
|
||||
const DateRangePickerRootSlotsEq: Same<InstanceType<typeof DateRangePicker>["$slots"], InstanceType<typeof DateRangePickerRoot>["$slots"]> = true;
|
||||
const DescriptionRootPropsEq: Same<DescriptionProps, DescriptionRootProps> = true;
|
||||
const DescriptionRootCompEq: Same<typeof Description, typeof DescriptionRoot> = true;
|
||||
const DescriptionRootInstanceEq: Same<InstanceType<typeof Description>, InstanceType<typeof DescriptionRoot>> = true;
|
||||
const DescriptionRootEmitsEq: Same<InstanceType<typeof Description>["$emit"], InstanceType<typeof DescriptionRoot>["$emit"]> = true;
|
||||
const DescriptionRootSlotsEq: Same<InstanceType<typeof Description>["$slots"], InstanceType<typeof DescriptionRoot>["$slots"]> = true;
|
||||
const DisclosureRootPropsEq: Same<DisclosureProps, DisclosureRootProps> = true;
|
||||
const DisclosureRootCompEq: Same<typeof Disclosure, typeof DisclosureRoot> = true;
|
||||
const DisclosureRootInstanceEq: Same<InstanceType<typeof Disclosure>, InstanceType<typeof DisclosureRoot>> = true;
|
||||
const DisclosureRootEmitsEq: Same<InstanceType<typeof Disclosure>["$emit"], InstanceType<typeof DisclosureRoot>["$emit"]> = true;
|
||||
const DisclosureRootSlotsEq: Same<InstanceType<typeof Disclosure>["$slots"], InstanceType<typeof DisclosureRoot>["$slots"]> = true;
|
||||
const DisclosureGroupRootPropsEq: Same<DisclosureGroupProps, DisclosureGroupRootProps> = true;
|
||||
const DisclosureGroupRootCompEq: Same<typeof DisclosureGroup, typeof DisclosureGroupRoot> = true;
|
||||
const DisclosureGroupRootInstanceEq: Same<InstanceType<typeof DisclosureGroup>, InstanceType<typeof DisclosureGroupRoot>> = true;
|
||||
const DisclosureGroupRootEmitsEq: Same<InstanceType<typeof DisclosureGroup>["$emit"], InstanceType<typeof DisclosureGroupRoot>["$emit"]> = true;
|
||||
const DisclosureGroupRootSlotsEq: Same<InstanceType<typeof DisclosureGroup>["$slots"], InstanceType<typeof DisclosureGroupRoot>["$slots"]> = true;
|
||||
const DrawerRootPropsEq: Same<DrawerProps, DrawerRootProps> = true;
|
||||
const DrawerRootCompEq: Same<typeof Drawer, typeof DrawerRoot> = true;
|
||||
const DrawerRootInstanceEq: Same<InstanceType<typeof Drawer>, InstanceType<typeof DrawerRoot>> = true;
|
||||
const DrawerRootEmitsEq: Same<InstanceType<typeof Drawer>["$emit"], InstanceType<typeof DrawerRoot>["$emit"]> = true;
|
||||
const DrawerRootSlotsEq: Same<InstanceType<typeof Drawer>["$slots"], InstanceType<typeof DrawerRoot>["$slots"]> = true;
|
||||
const DropdownRootPropsEq: Same<DropdownProps, DropdownRootProps> = true;
|
||||
const DropdownRootCompEq: Same<typeof Dropdown, typeof DropdownRoot> = true;
|
||||
const DropdownRootInstanceEq: Same<InstanceType<typeof Dropdown>, InstanceType<typeof DropdownRoot>> = true;
|
||||
const DropdownRootEmitsEq: Same<InstanceType<typeof Dropdown>["$emit"], InstanceType<typeof DropdownRoot>["$emit"]> = true;
|
||||
const DropdownRootSlotsEq: Same<InstanceType<typeof Dropdown>["$slots"], InstanceType<typeof DropdownRoot>["$slots"]> = true;
|
||||
const EmptyStateRootPropsEq: Same<EmptyStateProps, EmptyStateRootProps> = true;
|
||||
const EmptyStateRootCompEq: Same<typeof EmptyState, typeof EmptyStateRoot> = true;
|
||||
const EmptyStateRootInstanceEq: Same<InstanceType<typeof EmptyState>, InstanceType<typeof EmptyStateRoot>> = true;
|
||||
const EmptyStateRootEmitsEq: Same<InstanceType<typeof EmptyState>["$emit"], InstanceType<typeof EmptyStateRoot>["$emit"]> = true;
|
||||
const EmptyStateRootSlotsEq: Same<InstanceType<typeof EmptyState>["$slots"], InstanceType<typeof EmptyStateRoot>["$slots"]> = true;
|
||||
const ErrorMessageRootPropsEq: Same<ErrorMessageProps, ErrorMessageRootProps> = true;
|
||||
const ErrorMessageRootCompEq: Same<typeof ErrorMessage, typeof ErrorMessageRoot> = true;
|
||||
const ErrorMessageRootInstanceEq: Same<InstanceType<typeof ErrorMessage>, InstanceType<typeof ErrorMessageRoot>> = true;
|
||||
const ErrorMessageRootEmitsEq: Same<InstanceType<typeof ErrorMessage>["$emit"], InstanceType<typeof ErrorMessageRoot>["$emit"]> = true;
|
||||
const ErrorMessageRootSlotsEq: Same<InstanceType<typeof ErrorMessage>["$slots"], InstanceType<typeof ErrorMessageRoot>["$slots"]> = true;
|
||||
const FieldErrorRootPropsEq: Same<FieldErrorProps, FieldErrorRootProps> = true;
|
||||
const FieldErrorRootCompEq: Same<typeof FieldError, typeof FieldErrorRoot> = true;
|
||||
const FieldErrorRootInstanceEq: Same<InstanceType<typeof FieldError>, InstanceType<typeof FieldErrorRoot>> = true;
|
||||
const FieldErrorRootEmitsEq: Same<InstanceType<typeof FieldError>["$emit"], InstanceType<typeof FieldErrorRoot>["$emit"]> = true;
|
||||
const FieldErrorRootSlotsEq: Same<InstanceType<typeof FieldError>["$slots"], InstanceType<typeof FieldErrorRoot>["$slots"]> = true;
|
||||
const FieldsetRootPropsEq: Same<FieldsetProps, FieldsetRootProps> = true;
|
||||
const FieldsetRootCompEq: Same<typeof Fieldset, typeof FieldsetRoot> = true;
|
||||
const FieldsetRootInstanceEq: Same<InstanceType<typeof Fieldset>, InstanceType<typeof FieldsetRoot>> = true;
|
||||
const FieldsetRootEmitsEq: Same<InstanceType<typeof Fieldset>["$emit"], InstanceType<typeof FieldsetRoot>["$emit"]> = true;
|
||||
const FieldsetRootSlotsEq: Same<InstanceType<typeof Fieldset>["$slots"], InstanceType<typeof FieldsetRoot>["$slots"]> = true;
|
||||
const FormRootPropsEq: Same<FormProps, FormRootProps> = true;
|
||||
const FormRootCompEq: Same<typeof Form, typeof FormRoot> = true;
|
||||
const FormRootInstanceEq: Same<InstanceType<typeof Form>, InstanceType<typeof FormRoot>> = true;
|
||||
const FormRootEmitsEq: Same<InstanceType<typeof Form>["$emit"], InstanceType<typeof FormRoot>["$emit"]> = true;
|
||||
const FormRootSlotsEq: Same<InstanceType<typeof Form>["$slots"], InstanceType<typeof FormRoot>["$slots"]> = true;
|
||||
const HeaderRootPropsEq: Same<HeaderProps, HeaderRootProps> = true;
|
||||
const HeaderRootCompEq: Same<typeof Header, typeof HeaderRoot> = true;
|
||||
const HeaderRootInstanceEq: Same<InstanceType<typeof Header>, InstanceType<typeof HeaderRoot>> = true;
|
||||
const HeaderRootEmitsEq: Same<InstanceType<typeof Header>["$emit"], InstanceType<typeof HeaderRoot>["$emit"]> = true;
|
||||
const HeaderRootSlotsEq: Same<InstanceType<typeof Header>["$slots"], InstanceType<typeof HeaderRoot>["$slots"]> = true;
|
||||
const InputRootPropsEq: Same<InputProps, InputRootProps> = true;
|
||||
const InputRootCompEq: Same<typeof Input, typeof InputRoot> = true;
|
||||
const InputRootInstanceEq: Same<InstanceType<typeof Input>, InstanceType<typeof InputRoot>> = true;
|
||||
const InputRootEmitsEq: Same<InstanceType<typeof Input>["$emit"], InstanceType<typeof InputRoot>["$emit"]> = true;
|
||||
const InputRootSlotsEq: Same<InstanceType<typeof Input>["$slots"], InstanceType<typeof InputRoot>["$slots"]> = true;
|
||||
const InputGroupRootPropsEq: Same<InputGroupProps, InputGroupRootProps> = true;
|
||||
const InputGroupRootCompEq: Same<typeof InputGroup, typeof InputGroupRoot> = true;
|
||||
const InputGroupRootInstanceEq: Same<InstanceType<typeof InputGroup>, InstanceType<typeof InputGroupRoot>> = true;
|
||||
const InputGroupRootEmitsEq: Same<InstanceType<typeof InputGroup>["$emit"], InstanceType<typeof InputGroupRoot>["$emit"]> = true;
|
||||
const InputGroupRootSlotsEq: Same<InstanceType<typeof InputGroup>["$slots"], InstanceType<typeof InputGroupRoot>["$slots"]> = true;
|
||||
const InputOTPRootPropsEq: Same<InputOTPProps, InputOTPRootProps> = true;
|
||||
const InputOTPRootCompEq: Same<typeof InputOTP, typeof InputOTPRoot> = true;
|
||||
const InputOTPRootInstanceEq: Same<InstanceType<typeof InputOTP>, InstanceType<typeof InputOTPRoot>> = true;
|
||||
const InputOTPRootEmitsEq: Same<InstanceType<typeof InputOTP>["$emit"], InstanceType<typeof InputOTPRoot>["$emit"]> = true;
|
||||
const InputOTPRootSlotsEq: Same<InstanceType<typeof InputOTP>["$slots"], InstanceType<typeof InputOTPRoot>["$slots"]> = true;
|
||||
const KbdRootPropsEq: Same<KbdProps, KbdRootProps> = true;
|
||||
const KbdRootCompEq: Same<typeof Kbd, typeof KbdRoot> = true;
|
||||
const KbdRootInstanceEq: Same<InstanceType<typeof Kbd>, InstanceType<typeof KbdRoot>> = true;
|
||||
const KbdRootEmitsEq: Same<InstanceType<typeof Kbd>["$emit"], InstanceType<typeof KbdRoot>["$emit"]> = true;
|
||||
const KbdRootSlotsEq: Same<InstanceType<typeof Kbd>["$slots"], InstanceType<typeof KbdRoot>["$slots"]> = true;
|
||||
const LabelRootPropsEq: Same<LabelProps, LabelRootProps> = true;
|
||||
const LabelRootCompEq: Same<typeof Label, typeof LabelRoot> = true;
|
||||
const LabelRootInstanceEq: Same<InstanceType<typeof Label>, InstanceType<typeof LabelRoot>> = true;
|
||||
const LabelRootEmitsEq: Same<InstanceType<typeof Label>["$emit"], InstanceType<typeof LabelRoot>["$emit"]> = true;
|
||||
const LabelRootSlotsEq: Same<InstanceType<typeof Label>["$slots"], InstanceType<typeof LabelRoot>["$slots"]> = true;
|
||||
const LinkRootPropsEq: Same<LinkProps, LinkRootProps> = true;
|
||||
const LinkRootCompEq: Same<typeof Link, typeof LinkRoot> = true;
|
||||
const LinkRootInstanceEq: Same<InstanceType<typeof Link>, InstanceType<typeof LinkRoot>> = true;
|
||||
const LinkRootEmitsEq: Same<InstanceType<typeof Link>["$emit"], InstanceType<typeof LinkRoot>["$emit"]> = true;
|
||||
const LinkRootSlotsEq: Same<InstanceType<typeof Link>["$slots"], InstanceType<typeof LinkRoot>["$slots"]> = true;
|
||||
// ListBox 为泛型函数式组件类型,InstanceType 不适用;Props 与组件对象等价已覆盖实例成员。
|
||||
const ListBoxRootPropsEq: Same<ListBoxProps, ListBoxRootProps> = true;
|
||||
const ListBoxRootCompEq: Same<typeof ListBox, typeof ListBoxRoot> = true;
|
||||
const ListBoxItemRootPropsEq: Same<ListBoxItemProps, ListBoxItemRootProps> = true;
|
||||
const ListBoxItemRootCompEq: Same<typeof ListBoxItem, typeof ListBoxItemRoot> = true;
|
||||
const ListBoxItemRootInstanceEq: Same<InstanceType<typeof ListBoxItem>, InstanceType<typeof ListBoxItemRoot>> = true;
|
||||
const ListBoxItemRootEmitsEq: Same<InstanceType<typeof ListBoxItem>["$emit"], InstanceType<typeof ListBoxItemRoot>["$emit"]> = true;
|
||||
const ListBoxItemRootSlotsEq: Same<InstanceType<typeof ListBoxItem>["$slots"], InstanceType<typeof ListBoxItemRoot>["$slots"]> = true;
|
||||
const ListBoxSectionRootPropsEq: Same<ListBoxSectionProps, ListBoxSectionRootProps> = true;
|
||||
const ListBoxSectionRootCompEq: Same<typeof ListBoxSection, typeof ListBoxSectionRoot> = true;
|
||||
const ListBoxSectionRootInstanceEq: Same<InstanceType<typeof ListBoxSection>, InstanceType<typeof ListBoxSectionRoot>> = true;
|
||||
const ListBoxSectionRootEmitsEq: Same<InstanceType<typeof ListBoxSection>["$emit"], InstanceType<typeof ListBoxSectionRoot>["$emit"]> = true;
|
||||
const ListBoxSectionRootSlotsEq: Same<InstanceType<typeof ListBoxSection>["$slots"], InstanceType<typeof ListBoxSectionRoot>["$slots"]> = true;
|
||||
const MenuRootPropsEq: Same<MenuProps, MenuRootProps> = true;
|
||||
const MenuRootCompEq: Same<typeof Menu, typeof MenuRoot> = true;
|
||||
const MenuRootInstanceEq: Same<InstanceType<typeof Menu>, InstanceType<typeof MenuRoot>> = true;
|
||||
const MenuRootEmitsEq: Same<InstanceType<typeof Menu>["$emit"], InstanceType<typeof MenuRoot>["$emit"]> = true;
|
||||
const MenuRootSlotsEq: Same<InstanceType<typeof Menu>["$slots"], InstanceType<typeof MenuRoot>["$slots"]> = true;
|
||||
const MenuItemRootPropsEq: Same<MenuItemProps, MenuItemRootProps> = true;
|
||||
const MenuItemRootCompEq: Same<typeof MenuItem, typeof MenuItemRoot> = true;
|
||||
const MenuItemRootInstanceEq: Same<InstanceType<typeof MenuItem>, InstanceType<typeof MenuItemRoot>> = true;
|
||||
const MenuItemRootEmitsEq: Same<InstanceType<typeof MenuItem>["$emit"], InstanceType<typeof MenuItemRoot>["$emit"]> = true;
|
||||
const MenuItemRootSlotsEq: Same<InstanceType<typeof MenuItem>["$slots"], InstanceType<typeof MenuItemRoot>["$slots"]> = true;
|
||||
const MenuSectionRootPropsEq: Same<MenuSectionProps, MenuSectionRootProps> = true;
|
||||
const MenuSectionRootCompEq: Same<typeof MenuSection, typeof MenuSectionRoot> = true;
|
||||
const MenuSectionRootInstanceEq: Same<InstanceType<typeof MenuSection>, InstanceType<typeof MenuSectionRoot>> = true;
|
||||
const MenuSectionRootEmitsEq: Same<InstanceType<typeof MenuSection>["$emit"], InstanceType<typeof MenuSectionRoot>["$emit"]> = true;
|
||||
const MenuSectionRootSlotsEq: Same<InstanceType<typeof MenuSection>["$slots"], InstanceType<typeof MenuSectionRoot>["$slots"]> = true;
|
||||
const MeterRootPropsEq: Same<MeterProps, MeterRootProps> = true;
|
||||
const MeterRootCompEq: Same<typeof Meter, typeof MeterRoot> = true;
|
||||
const MeterRootInstanceEq: Same<InstanceType<typeof Meter>, InstanceType<typeof MeterRoot>> = true;
|
||||
const MeterRootEmitsEq: Same<InstanceType<typeof Meter>["$emit"], InstanceType<typeof MeterRoot>["$emit"]> = true;
|
||||
const MeterRootSlotsEq: Same<InstanceType<typeof Meter>["$slots"], InstanceType<typeof MeterRoot>["$slots"]> = true;
|
||||
const ModalRootPropsEq: Same<ModalProps, ModalRootProps> = true;
|
||||
const ModalRootCompEq: Same<typeof Modal, typeof ModalRoot> = true;
|
||||
const ModalRootInstanceEq: Same<InstanceType<typeof Modal>, InstanceType<typeof ModalRoot>> = true;
|
||||
const ModalRootEmitsEq: Same<InstanceType<typeof Modal>["$emit"], InstanceType<typeof ModalRoot>["$emit"]> = true;
|
||||
const ModalRootSlotsEq: Same<InstanceType<typeof Modal>["$slots"], InstanceType<typeof ModalRoot>["$slots"]> = true;
|
||||
const NumberFieldRootPropsEq: Same<NumberFieldProps, NumberFieldRootProps> = true;
|
||||
const NumberFieldRootCompEq: Same<typeof NumberField, typeof NumberFieldRoot> = true;
|
||||
const NumberFieldRootInstanceEq: Same<InstanceType<typeof NumberField>, InstanceType<typeof NumberFieldRoot>> = true;
|
||||
const NumberFieldRootEmitsEq: Same<InstanceType<typeof NumberField>["$emit"], InstanceType<typeof NumberFieldRoot>["$emit"]> = true;
|
||||
const NumberFieldRootSlotsEq: Same<InstanceType<typeof NumberField>["$slots"], InstanceType<typeof NumberFieldRoot>["$slots"]> = true;
|
||||
const PaginationRootPropsEq: Same<PaginationProps, PaginationRootProps> = true;
|
||||
const PaginationRootCompEq: Same<typeof Pagination, typeof PaginationRoot> = true;
|
||||
const PaginationRootInstanceEq: Same<InstanceType<typeof Pagination>, InstanceType<typeof PaginationRoot>> = true;
|
||||
const PaginationRootEmitsEq: Same<InstanceType<typeof Pagination>["$emit"], InstanceType<typeof PaginationRoot>["$emit"]> = true;
|
||||
const PaginationRootSlotsEq: Same<InstanceType<typeof Pagination>["$slots"], InstanceType<typeof PaginationRoot>["$slots"]> = true;
|
||||
const PopoverRootPropsEq: Same<PopoverProps, PopoverRootProps> = true;
|
||||
const PopoverRootCompEq: Same<typeof Popover, typeof PopoverRoot> = true;
|
||||
const PopoverRootInstanceEq: Same<InstanceType<typeof Popover>, InstanceType<typeof PopoverRoot>> = true;
|
||||
const PopoverRootEmitsEq: Same<InstanceType<typeof Popover>["$emit"], InstanceType<typeof PopoverRoot>["$emit"]> = true;
|
||||
const PopoverRootSlotsEq: Same<InstanceType<typeof Popover>["$slots"], InstanceType<typeof PopoverRoot>["$slots"]> = true;
|
||||
const ProgressBarRootPropsEq: Same<ProgressBarProps, ProgressBarRootProps> = true;
|
||||
const ProgressBarRootCompEq: Same<typeof ProgressBar, typeof ProgressBarRoot> = true;
|
||||
const ProgressBarRootInstanceEq: Same<InstanceType<typeof ProgressBar>, InstanceType<typeof ProgressBarRoot>> = true;
|
||||
const ProgressBarRootEmitsEq: Same<InstanceType<typeof ProgressBar>["$emit"], InstanceType<typeof ProgressBarRoot>["$emit"]> = true;
|
||||
const ProgressBarRootSlotsEq: Same<InstanceType<typeof ProgressBar>["$slots"], InstanceType<typeof ProgressBarRoot>["$slots"]> = true;
|
||||
const ProgressCircleRootPropsEq: Same<ProgressCircleProps, ProgressCircleRootProps> = true;
|
||||
const ProgressCircleRootCompEq: Same<typeof ProgressCircle, typeof ProgressCircleRoot> = true;
|
||||
const ProgressCircleRootInstanceEq: Same<InstanceType<typeof ProgressCircle>, InstanceType<typeof ProgressCircleRoot>> = true;
|
||||
const ProgressCircleRootEmitsEq: Same<InstanceType<typeof ProgressCircle>["$emit"], InstanceType<typeof ProgressCircleRoot>["$emit"]> = true;
|
||||
const ProgressCircleRootSlotsEq: Same<InstanceType<typeof ProgressCircle>["$slots"], InstanceType<typeof ProgressCircleRoot>["$slots"]> = true;
|
||||
const RadioRootPropsEq: Same<RadioProps, RadioRootProps> = true;
|
||||
const RadioRootCompEq: Same<typeof Radio, typeof RadioRoot> = true;
|
||||
const RadioRootInstanceEq: Same<InstanceType<typeof Radio>, InstanceType<typeof RadioRoot>> = true;
|
||||
const RadioRootEmitsEq: Same<InstanceType<typeof Radio>["$emit"], InstanceType<typeof RadioRoot>["$emit"]> = true;
|
||||
const RadioRootSlotsEq: Same<InstanceType<typeof Radio>["$slots"], InstanceType<typeof RadioRoot>["$slots"]> = true;
|
||||
const RadioGroupRootPropsEq: Same<RadioGroupProps, RadioGroupRootProps> = true;
|
||||
const RadioGroupRootCompEq: Same<typeof RadioGroup, typeof RadioGroupRoot> = true;
|
||||
const RadioGroupRootInstanceEq: Same<InstanceType<typeof RadioGroup>, InstanceType<typeof RadioGroupRoot>> = true;
|
||||
const RadioGroupRootEmitsEq: Same<InstanceType<typeof RadioGroup>["$emit"], InstanceType<typeof RadioGroupRoot>["$emit"]> = true;
|
||||
const RadioGroupRootSlotsEq: Same<InstanceType<typeof RadioGroup>["$slots"], InstanceType<typeof RadioGroupRoot>["$slots"]> = true;
|
||||
const RangeCalendarRootPropsEq: Same<RangeCalendarProps, RangeCalendarRootProps> = true;
|
||||
const RangeCalendarRootCompEq: Same<typeof RangeCalendar, typeof RangeCalendarRoot> = true;
|
||||
const RangeCalendarRootInstanceEq: Same<InstanceType<typeof RangeCalendar>, InstanceType<typeof RangeCalendarRoot>> = true;
|
||||
const RangeCalendarRootEmitsEq: Same<InstanceType<typeof RangeCalendar>["$emit"], InstanceType<typeof RangeCalendarRoot>["$emit"]> = true;
|
||||
const RangeCalendarRootSlotsEq: Same<InstanceType<typeof RangeCalendar>["$slots"], InstanceType<typeof RangeCalendarRoot>["$slots"]> = true;
|
||||
const ScrollShadowRootPropsEq: Same<ScrollShadowProps, ScrollShadowRootProps> = true;
|
||||
const ScrollShadowRootCompEq: Same<typeof ScrollShadow, typeof ScrollShadowRoot> = true;
|
||||
const ScrollShadowRootInstanceEq: Same<InstanceType<typeof ScrollShadow>, InstanceType<typeof ScrollShadowRoot>> = true;
|
||||
const ScrollShadowRootEmitsEq: Same<InstanceType<typeof ScrollShadow>["$emit"], InstanceType<typeof ScrollShadowRoot>["$emit"]> = true;
|
||||
const ScrollShadowRootSlotsEq: Same<InstanceType<typeof ScrollShadow>["$slots"], InstanceType<typeof ScrollShadowRoot>["$slots"]> = true;
|
||||
const SearchFieldRootPropsEq: Same<SearchFieldProps, SearchFieldRootProps> = true;
|
||||
const SearchFieldRootCompEq: Same<typeof SearchField, typeof SearchFieldRoot> = true;
|
||||
const SearchFieldRootInstanceEq: Same<InstanceType<typeof SearchField>, InstanceType<typeof SearchFieldRoot>> = true;
|
||||
const SearchFieldRootEmitsEq: Same<InstanceType<typeof SearchField>["$emit"], InstanceType<typeof SearchFieldRoot>["$emit"]> = true;
|
||||
const SearchFieldRootSlotsEq: Same<InstanceType<typeof SearchField>["$slots"], InstanceType<typeof SearchFieldRoot>["$slots"]> = true;
|
||||
const SelectRootPropsEq: Same<SelectProps, SelectRootProps> = true;
|
||||
const SelectRootCompEq: Same<typeof Select, typeof SelectRoot> = true;
|
||||
const SelectRootInstanceEq: Same<InstanceType<typeof Select>, InstanceType<typeof SelectRoot>> = true;
|
||||
const SelectRootEmitsEq: Same<InstanceType<typeof Select>["$emit"], InstanceType<typeof SelectRoot>["$emit"]> = true;
|
||||
const SelectRootSlotsEq: Same<InstanceType<typeof Select>["$slots"], InstanceType<typeof SelectRoot>["$slots"]> = true;
|
||||
const SeparatorRootPropsEq: Same<SeparatorProps, SeparatorRootProps> = true;
|
||||
const SeparatorRootCompEq: Same<typeof Separator, typeof SeparatorRoot> = true;
|
||||
const SeparatorRootInstanceEq: Same<InstanceType<typeof Separator>, InstanceType<typeof SeparatorRoot>> = true;
|
||||
const SeparatorRootEmitsEq: Same<InstanceType<typeof Separator>["$emit"], InstanceType<typeof SeparatorRoot>["$emit"]> = true;
|
||||
const SeparatorRootSlotsEq: Same<InstanceType<typeof Separator>["$slots"], InstanceType<typeof SeparatorRoot>["$slots"]> = true;
|
||||
const SkeletonRootPropsEq: Same<SkeletonProps, SkeletonRootProps> = true;
|
||||
const SkeletonRootCompEq: Same<typeof Skeleton, typeof SkeletonRoot> = true;
|
||||
const SkeletonRootInstanceEq: Same<InstanceType<typeof Skeleton>, InstanceType<typeof SkeletonRoot>> = true;
|
||||
const SkeletonRootEmitsEq: Same<InstanceType<typeof Skeleton>["$emit"], InstanceType<typeof SkeletonRoot>["$emit"]> = true;
|
||||
const SkeletonRootSlotsEq: Same<InstanceType<typeof Skeleton>["$slots"], InstanceType<typeof SkeletonRoot>["$slots"]> = true;
|
||||
const SliderRootPropsEq: Same<SliderProps, SliderRootProps> = true;
|
||||
const SliderRootCompEq: Same<typeof Slider, typeof SliderRoot> = true;
|
||||
const SliderRootInstanceEq: Same<InstanceType<typeof Slider>, InstanceType<typeof SliderRoot>> = true;
|
||||
const SliderRootEmitsEq: Same<InstanceType<typeof Slider>["$emit"], InstanceType<typeof SliderRoot>["$emit"]> = true;
|
||||
const SliderRootSlotsEq: Same<InstanceType<typeof Slider>["$slots"], InstanceType<typeof SliderRoot>["$slots"]> = true;
|
||||
const SpinnerRootPropsEq: Same<SpinnerProps, SpinnerRootProps> = true;
|
||||
const SpinnerRootCompEq: Same<typeof Spinner, typeof SpinnerRoot> = true;
|
||||
const SpinnerRootInstanceEq: Same<InstanceType<typeof Spinner>, InstanceType<typeof SpinnerRoot>> = true;
|
||||
const SpinnerRootEmitsEq: Same<InstanceType<typeof Spinner>["$emit"], InstanceType<typeof SpinnerRoot>["$emit"]> = true;
|
||||
const SpinnerRootSlotsEq: Same<InstanceType<typeof Spinner>["$slots"], InstanceType<typeof SpinnerRoot>["$slots"]> = true;
|
||||
const SurfaceRootPropsEq: Same<SurfaceProps, SurfaceRootProps> = true;
|
||||
const SurfaceRootCompEq: Same<typeof Surface, typeof SurfaceRoot> = true;
|
||||
const SurfaceRootInstanceEq: Same<InstanceType<typeof Surface>, InstanceType<typeof SurfaceRoot>> = true;
|
||||
const SurfaceRootEmitsEq: Same<InstanceType<typeof Surface>["$emit"], InstanceType<typeof SurfaceRoot>["$emit"]> = true;
|
||||
const SurfaceRootSlotsEq: Same<InstanceType<typeof Surface>["$slots"], InstanceType<typeof SurfaceRoot>["$slots"]> = true;
|
||||
const SwitchRootPropsEq: Same<SwitchProps, SwitchRootProps> = true;
|
||||
const SwitchRootCompEq: Same<typeof Switch, typeof SwitchRoot> = true;
|
||||
const SwitchRootInstanceEq: Same<InstanceType<typeof Switch>, InstanceType<typeof SwitchRoot>> = true;
|
||||
const SwitchRootEmitsEq: Same<InstanceType<typeof Switch>["$emit"], InstanceType<typeof SwitchRoot>["$emit"]> = true;
|
||||
const SwitchRootSlotsEq: Same<InstanceType<typeof Switch>["$slots"], InstanceType<typeof SwitchRoot>["$slots"]> = true;
|
||||
const SwitchGroupRootPropsEq: Same<SwitchGroupProps, SwitchGroupRootProps> = true;
|
||||
const SwitchGroupRootCompEq: Same<typeof SwitchGroup, typeof SwitchGroupRoot> = true;
|
||||
const SwitchGroupRootInstanceEq: Same<InstanceType<typeof SwitchGroup>, InstanceType<typeof SwitchGroupRoot>> = true;
|
||||
const SwitchGroupRootEmitsEq: Same<InstanceType<typeof SwitchGroup>["$emit"], InstanceType<typeof SwitchGroupRoot>["$emit"]> = true;
|
||||
const SwitchGroupRootSlotsEq: Same<InstanceType<typeof SwitchGroup>["$slots"], InstanceType<typeof SwitchGroupRoot>["$slots"]> = true;
|
||||
const TableRootPropsEq: Same<TableProps, TableRootProps> = true;
|
||||
const TableRootCompEq: Same<typeof Table, typeof TableRoot> = true;
|
||||
const TableRootInstanceEq: Same<InstanceType<typeof Table>, InstanceType<typeof TableRoot>> = true;
|
||||
const TableRootEmitsEq: Same<InstanceType<typeof Table>["$emit"], InstanceType<typeof TableRoot>["$emit"]> = true;
|
||||
const TableRootSlotsEq: Same<InstanceType<typeof Table>["$slots"], InstanceType<typeof TableRoot>["$slots"]> = true;
|
||||
const TabsRootPropsEq: Same<TabsProps, TabsRootProps> = true;
|
||||
const TabsRootCompEq: Same<typeof Tabs, typeof TabsRoot> = true;
|
||||
const TabsRootInstanceEq: Same<InstanceType<typeof Tabs>, InstanceType<typeof TabsRoot>> = true;
|
||||
const TabsRootEmitsEq: Same<InstanceType<typeof Tabs>["$emit"], InstanceType<typeof TabsRoot>["$emit"]> = true;
|
||||
const TabsRootSlotsEq: Same<InstanceType<typeof Tabs>["$slots"], InstanceType<typeof TabsRoot>["$slots"]> = true;
|
||||
const TagRootPropsEq: Same<TagProps, TagRootProps> = true;
|
||||
const TagRootCompEq: Same<typeof Tag, typeof TagRoot> = true;
|
||||
const TagRootInstanceEq: Same<InstanceType<typeof Tag>, InstanceType<typeof TagRoot>> = true;
|
||||
const TagRootEmitsEq: Same<InstanceType<typeof Tag>["$emit"], InstanceType<typeof TagRoot>["$emit"]> = true;
|
||||
const TagRootSlotsEq: Same<InstanceType<typeof Tag>["$slots"], InstanceType<typeof TagRoot>["$slots"]> = true;
|
||||
const TagGroupRootPropsEq: Same<TagGroupProps, TagGroupRootProps> = true;
|
||||
const TagGroupRootCompEq: Same<typeof TagGroup, typeof TagGroupRoot> = true;
|
||||
const TagGroupRootInstanceEq: Same<InstanceType<typeof TagGroup>, InstanceType<typeof TagGroupRoot>> = true;
|
||||
const TagGroupRootEmitsEq: Same<InstanceType<typeof TagGroup>["$emit"], InstanceType<typeof TagGroupRoot>["$emit"]> = true;
|
||||
const TagGroupRootSlotsEq: Same<InstanceType<typeof TagGroup>["$slots"], InstanceType<typeof TagGroupRoot>["$slots"]> = true;
|
||||
const TextAreaRootPropsEq: Same<TextAreaProps, TextAreaRootProps> = true;
|
||||
const TextAreaRootCompEq: Same<typeof TextArea, typeof TextAreaRoot> = true;
|
||||
const TextAreaRootInstanceEq: Same<InstanceType<typeof TextArea>, InstanceType<typeof TextAreaRoot>> = true;
|
||||
const TextAreaRootEmitsEq: Same<InstanceType<typeof TextArea>["$emit"], InstanceType<typeof TextAreaRoot>["$emit"]> = true;
|
||||
const TextAreaRootSlotsEq: Same<InstanceType<typeof TextArea>["$slots"], InstanceType<typeof TextAreaRoot>["$slots"]> = true;
|
||||
const TextFieldRootPropsEq: Same<TextFieldProps, TextFieldRootProps> = true;
|
||||
const TextFieldRootCompEq: Same<typeof TextField, typeof TextFieldRoot> = true;
|
||||
const TextFieldRootInstanceEq: Same<InstanceType<typeof TextField>, InstanceType<typeof TextFieldRoot>> = true;
|
||||
const TextFieldRootEmitsEq: Same<InstanceType<typeof TextField>["$emit"], InstanceType<typeof TextFieldRoot>["$emit"]> = true;
|
||||
const TextFieldRootSlotsEq: Same<InstanceType<typeof TextField>["$slots"], InstanceType<typeof TextFieldRoot>["$slots"]> = true;
|
||||
const TimeFieldRootPropsEq: Same<TimeFieldProps, TimeFieldRootProps> = true;
|
||||
const TimeFieldRootCompEq: Same<typeof TimeField, typeof TimeFieldRoot> = true;
|
||||
const TimeFieldRootInstanceEq: Same<InstanceType<typeof TimeField>, InstanceType<typeof TimeFieldRoot>> = true;
|
||||
const TimeFieldRootEmitsEq: Same<InstanceType<typeof TimeField>["$emit"], InstanceType<typeof TimeFieldRoot>["$emit"]> = true;
|
||||
const TimeFieldRootSlotsEq: Same<InstanceType<typeof TimeField>["$slots"], InstanceType<typeof TimeFieldRoot>["$slots"]> = true;
|
||||
const ToggleButtonRootPropsEq: Same<ToggleButtonProps, ToggleButtonRootProps> = true;
|
||||
const ToggleButtonRootCompEq: Same<typeof ToggleButton, typeof ToggleButtonRoot> = true;
|
||||
const ToggleButtonRootInstanceEq: Same<InstanceType<typeof ToggleButton>, InstanceType<typeof ToggleButtonRoot>> = true;
|
||||
const ToggleButtonRootEmitsEq: Same<InstanceType<typeof ToggleButton>["$emit"], InstanceType<typeof ToggleButtonRoot>["$emit"]> = true;
|
||||
const ToggleButtonRootSlotsEq: Same<InstanceType<typeof ToggleButton>["$slots"], InstanceType<typeof ToggleButtonRoot>["$slots"]> = true;
|
||||
const ToggleButtonGroupRootPropsEq: Same<ToggleButtonGroupProps, ToggleButtonGroupRootProps> = true;
|
||||
const ToggleButtonGroupRootCompEq: Same<typeof ToggleButtonGroup, typeof ToggleButtonGroupRoot> = true;
|
||||
const ToggleButtonGroupRootInstanceEq: Same<InstanceType<typeof ToggleButtonGroup>, InstanceType<typeof ToggleButtonGroupRoot>> = true;
|
||||
const ToggleButtonGroupRootEmitsEq: Same<InstanceType<typeof ToggleButtonGroup>["$emit"], InstanceType<typeof ToggleButtonGroupRoot>["$emit"]> = true;
|
||||
const ToggleButtonGroupRootSlotsEq: Same<InstanceType<typeof ToggleButtonGroup>["$slots"], InstanceType<typeof ToggleButtonGroupRoot>["$slots"]> = true;
|
||||
const ToolbarRootPropsEq: Same<ToolbarProps, ToolbarRootProps> = true;
|
||||
const ToolbarRootCompEq: Same<typeof Toolbar, typeof ToolbarRoot> = true;
|
||||
const ToolbarRootInstanceEq: Same<InstanceType<typeof Toolbar>, InstanceType<typeof ToolbarRoot>> = true;
|
||||
const ToolbarRootEmitsEq: Same<InstanceType<typeof Toolbar>["$emit"], InstanceType<typeof ToolbarRoot>["$emit"]> = true;
|
||||
const ToolbarRootSlotsEq: Same<InstanceType<typeof Toolbar>["$slots"], InstanceType<typeof ToolbarRoot>["$slots"]> = true;
|
||||
const TooltipRootPropsEq: Same<TooltipProps, TooltipRootProps> = true;
|
||||
const TooltipRootCompEq: Same<typeof Tooltip, typeof TooltipRoot> = true;
|
||||
const TooltipRootInstanceEq: Same<InstanceType<typeof Tooltip>, InstanceType<typeof TooltipRoot>> = true;
|
||||
const TooltipRootEmitsEq: Same<InstanceType<typeof Tooltip>["$emit"], InstanceType<typeof TooltipRoot>["$emit"]> = true;
|
||||
const TooltipRootSlotsEq: Same<InstanceType<typeof Tooltip>["$slots"], InstanceType<typeof TooltipRoot>["$slots"]> = true;
|
||||
const TypographyRootPropsEq: Same<TypographyProps, TypographyRootProps> = true;
|
||||
const TypographyRootCompEq: Same<typeof Typography, typeof TypographyRoot> = true;
|
||||
const TypographyRootInstanceEq: Same<InstanceType<typeof Typography>, InstanceType<typeof TypographyRoot>> = true;
|
||||
const TypographyRootEmitsEq: Same<InstanceType<typeof Typography>["$emit"], InstanceType<typeof TypographyRoot>["$emit"]> = true;
|
||||
const TypographyRootSlotsEq: Same<InstanceType<typeof Typography>["$slots"], InstanceType<typeof TypographyRoot>["$slots"]> = true;
|
||||
|
||||
// 实际渲染的属性、事件与插槽随 Root 别名走同一组件。
|
||||
h(ButtonRoot, { type: "submit", onClick: (event: MouseEvent) => event.type }, { default: () => "提交" });
|
||||
h(NumberFieldRoot, { modelValue: 1, "onUpdate:modelValue": (value: number | null) => value, minValue: 0 }, { default: () => null });
|
||||
h(AvatarRoot, { size: "lg" }, { default: () => null });
|
||||
|
||||
// 反例:别名不放宽既有变体与事件负载类型。
|
||||
// @ts-expect-error baseline size only
|
||||
const badSize: AvatarRootProps = { size: "xl" };
|
||||
// @ts-expect-error number field commits numbers or null
|
||||
const badEvent: NumberFieldRootProps = { onChange: (value: string) => value };
|
||||
|
||||
void [
|
||||
Accordion,
|
||||
AccordionRoot,
|
||||
Alert,
|
||||
AlertRoot,
|
||||
AlertDialog,
|
||||
AlertDialogRoot,
|
||||
Autocomplete,
|
||||
AutocompleteRoot,
|
||||
Avatar,
|
||||
AvatarRoot,
|
||||
AvatarGroup,
|
||||
AvatarGroupRoot,
|
||||
Badge,
|
||||
BadgeRoot,
|
||||
Breadcrumbs,
|
||||
BreadcrumbsRoot,
|
||||
Button,
|
||||
ButtonRoot,
|
||||
ButtonGroup,
|
||||
ButtonGroupRoot,
|
||||
Calendar,
|
||||
CalendarRoot,
|
||||
Card,
|
||||
CardRoot,
|
||||
Checkbox,
|
||||
CheckboxRoot,
|
||||
Chip,
|
||||
ChipRoot,
|
||||
CloseButton,
|
||||
CloseButtonRoot,
|
||||
ColorArea,
|
||||
ColorAreaRoot,
|
||||
ColorField,
|
||||
ColorFieldRoot,
|
||||
ColorInputGroup,
|
||||
ColorInputGroupRoot,
|
||||
ColorPicker,
|
||||
ColorPickerRoot,
|
||||
ColorSlider,
|
||||
ColorSliderRoot,
|
||||
ColorSwatch,
|
||||
ColorSwatchRoot,
|
||||
ColorSwatchPicker,
|
||||
ColorSwatchPickerRoot,
|
||||
ComboBox,
|
||||
ComboBoxRoot,
|
||||
DateField,
|
||||
DateFieldRoot,
|
||||
DateInputGroup,
|
||||
DateInputGroupRoot,
|
||||
DatePicker,
|
||||
DatePickerRoot,
|
||||
DateRangePicker,
|
||||
DateRangePickerRoot,
|
||||
Description,
|
||||
DescriptionRoot,
|
||||
Disclosure,
|
||||
DisclosureRoot,
|
||||
DisclosureGroup,
|
||||
DisclosureGroupRoot,
|
||||
Drawer,
|
||||
DrawerRoot,
|
||||
Dropdown,
|
||||
DropdownRoot,
|
||||
EmptyState,
|
||||
EmptyStateRoot,
|
||||
ErrorMessage,
|
||||
ErrorMessageRoot,
|
||||
FieldError,
|
||||
FieldErrorRoot,
|
||||
Fieldset,
|
||||
FieldsetRoot,
|
||||
Form,
|
||||
FormRoot,
|
||||
Header,
|
||||
HeaderRoot,
|
||||
Input,
|
||||
InputRoot,
|
||||
InputGroup,
|
||||
InputGroupRoot,
|
||||
InputOTP,
|
||||
InputOTPRoot,
|
||||
Kbd,
|
||||
KbdRoot,
|
||||
Label,
|
||||
LabelRoot,
|
||||
Link,
|
||||
LinkRoot,
|
||||
ListBox,
|
||||
ListBoxRoot,
|
||||
ListBoxItem,
|
||||
ListBoxItemRoot,
|
||||
ListBoxSection,
|
||||
ListBoxSectionRoot,
|
||||
Menu,
|
||||
MenuRoot,
|
||||
MenuItem,
|
||||
MenuItemRoot,
|
||||
MenuSection,
|
||||
MenuSectionRoot,
|
||||
Meter,
|
||||
MeterRoot,
|
||||
Modal,
|
||||
ModalRoot,
|
||||
NumberField,
|
||||
NumberFieldRoot,
|
||||
Pagination,
|
||||
PaginationRoot,
|
||||
Popover,
|
||||
PopoverRoot,
|
||||
ProgressBar,
|
||||
ProgressBarRoot,
|
||||
ProgressCircle,
|
||||
ProgressCircleRoot,
|
||||
Radio,
|
||||
RadioRoot,
|
||||
RadioGroup,
|
||||
RadioGroupRoot,
|
||||
RangeCalendar,
|
||||
RangeCalendarRoot,
|
||||
ScrollShadow,
|
||||
ScrollShadowRoot,
|
||||
SearchField,
|
||||
SearchFieldRoot,
|
||||
Select,
|
||||
SelectRoot,
|
||||
Separator,
|
||||
SeparatorRoot,
|
||||
Skeleton,
|
||||
SkeletonRoot,
|
||||
Slider,
|
||||
SliderRoot,
|
||||
Spinner,
|
||||
SpinnerRoot,
|
||||
Surface,
|
||||
SurfaceRoot,
|
||||
Switch,
|
||||
SwitchRoot,
|
||||
SwitchGroup,
|
||||
SwitchGroupRoot,
|
||||
Table,
|
||||
TableRoot,
|
||||
Tabs,
|
||||
TabsRoot,
|
||||
Tag,
|
||||
TagRoot,
|
||||
TagGroup,
|
||||
TagGroupRoot,
|
||||
TextArea,
|
||||
TextAreaRoot,
|
||||
TextField,
|
||||
TextFieldRoot,
|
||||
TimeField,
|
||||
TimeFieldRoot,
|
||||
ToggleButton,
|
||||
ToggleButtonRoot,
|
||||
ToggleButtonGroup,
|
||||
ToggleButtonGroupRoot,
|
||||
Toolbar,
|
||||
ToolbarRoot,
|
||||
Tooltip,
|
||||
TooltipRoot,
|
||||
Typography,
|
||||
TypographyRoot,
|
||||
badSize,
|
||||
badEvent,
|
||||
];
|
||||
@@ -334,5 +334,17 @@ for (const id of process.argv.slice(2)) {
|
||||
);
|
||||
assert(lib.errorMessageVariants().includes("hv-error-message"));
|
||||
}
|
||||
if (id === "api-root-aliases") {
|
||||
assert(
|
||||
spec.aliases.length === 82,
|
||||
"Root alias inventory must cover all 82 upstream root pairs",
|
||||
);
|
||||
for (const [plain, root] of spec.aliases) {
|
||||
assert(
|
||||
lib[plain] === lib[root],
|
||||
`${root} must be the same component object as ${plain}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
console.log(`${id}: packed ESM exports and CSS passed (client scope)`);
|
||||
}
|
||||
|
||||
@@ -553,5 +553,258 @@
|
||||
"form": {
|
||||
"exports": ["Form", "FormRoot", "TextField", "Input", "Label", "FieldError", "Button"],
|
||||
"css": [".hv-textfield", ".hv-input", ".hv-field-error", ".hv-button"]
|
||||
},
|
||||
"api-root-aliases": {
|
||||
"exports": [
|
||||
"Accordion",
|
||||
"AccordionRoot",
|
||||
"Alert",
|
||||
"AlertRoot",
|
||||
"AlertDialog",
|
||||
"AlertDialogRoot",
|
||||
"Autocomplete",
|
||||
"AutocompleteRoot",
|
||||
"Avatar",
|
||||
"AvatarRoot",
|
||||
"AvatarGroup",
|
||||
"AvatarGroupRoot",
|
||||
"Badge",
|
||||
"BadgeRoot",
|
||||
"Breadcrumbs",
|
||||
"BreadcrumbsRoot",
|
||||
"Button",
|
||||
"ButtonRoot",
|
||||
"ButtonGroup",
|
||||
"ButtonGroupRoot",
|
||||
"Calendar",
|
||||
"CalendarRoot",
|
||||
"Card",
|
||||
"CardRoot",
|
||||
"Checkbox",
|
||||
"CheckboxRoot",
|
||||
"Chip",
|
||||
"ChipRoot",
|
||||
"CloseButton",
|
||||
"CloseButtonRoot",
|
||||
"ColorArea",
|
||||
"ColorAreaRoot",
|
||||
"ColorField",
|
||||
"ColorFieldRoot",
|
||||
"ColorInputGroup",
|
||||
"ColorInputGroupRoot",
|
||||
"ColorPicker",
|
||||
"ColorPickerRoot",
|
||||
"ColorSlider",
|
||||
"ColorSliderRoot",
|
||||
"ColorSwatch",
|
||||
"ColorSwatchRoot",
|
||||
"ColorSwatchPicker",
|
||||
"ColorSwatchPickerRoot",
|
||||
"ComboBox",
|
||||
"ComboBoxRoot",
|
||||
"DateField",
|
||||
"DateFieldRoot",
|
||||
"DateInputGroup",
|
||||
"DateInputGroupRoot",
|
||||
"DatePicker",
|
||||
"DatePickerRoot",
|
||||
"DateRangePicker",
|
||||
"DateRangePickerRoot",
|
||||
"Description",
|
||||
"DescriptionRoot",
|
||||
"Disclosure",
|
||||
"DisclosureRoot",
|
||||
"DisclosureGroup",
|
||||
"DisclosureGroupRoot",
|
||||
"Drawer",
|
||||
"DrawerRoot",
|
||||
"Dropdown",
|
||||
"DropdownRoot",
|
||||
"EmptyState",
|
||||
"EmptyStateRoot",
|
||||
"ErrorMessage",
|
||||
"ErrorMessageRoot",
|
||||
"FieldError",
|
||||
"FieldErrorRoot",
|
||||
"Fieldset",
|
||||
"FieldsetRoot",
|
||||
"Form",
|
||||
"FormRoot",
|
||||
"Header",
|
||||
"HeaderRoot",
|
||||
"Input",
|
||||
"InputRoot",
|
||||
"InputGroup",
|
||||
"InputGroupRoot",
|
||||
"InputOTP",
|
||||
"InputOTPRoot",
|
||||
"Kbd",
|
||||
"KbdRoot",
|
||||
"Label",
|
||||
"LabelRoot",
|
||||
"Link",
|
||||
"LinkRoot",
|
||||
"ListBox",
|
||||
"ListBoxRoot",
|
||||
"ListBoxItem",
|
||||
"ListBoxItemRoot",
|
||||
"ListBoxSection",
|
||||
"ListBoxSectionRoot",
|
||||
"Menu",
|
||||
"MenuRoot",
|
||||
"MenuItem",
|
||||
"MenuItemRoot",
|
||||
"MenuSection",
|
||||
"MenuSectionRoot",
|
||||
"Meter",
|
||||
"MeterRoot",
|
||||
"Modal",
|
||||
"ModalRoot",
|
||||
"NumberField",
|
||||
"NumberFieldRoot",
|
||||
"Pagination",
|
||||
"PaginationRoot",
|
||||
"Popover",
|
||||
"PopoverRoot",
|
||||
"ProgressBar",
|
||||
"ProgressBarRoot",
|
||||
"ProgressCircle",
|
||||
"ProgressCircleRoot",
|
||||
"Radio",
|
||||
"RadioRoot",
|
||||
"RadioGroup",
|
||||
"RadioGroupRoot",
|
||||
"RangeCalendar",
|
||||
"RangeCalendarRoot",
|
||||
"ScrollShadow",
|
||||
"ScrollShadowRoot",
|
||||
"SearchField",
|
||||
"SearchFieldRoot",
|
||||
"Select",
|
||||
"SelectRoot",
|
||||
"Separator",
|
||||
"SeparatorRoot",
|
||||
"Skeleton",
|
||||
"SkeletonRoot",
|
||||
"Slider",
|
||||
"SliderRoot",
|
||||
"Spinner",
|
||||
"SpinnerRoot",
|
||||
"Surface",
|
||||
"SurfaceRoot",
|
||||
"Switch",
|
||||
"SwitchRoot",
|
||||
"SwitchGroup",
|
||||
"SwitchGroupRoot",
|
||||
"Table",
|
||||
"TableRoot",
|
||||
"Tabs",
|
||||
"TabsRoot",
|
||||
"Tag",
|
||||
"TagRoot",
|
||||
"TagGroup",
|
||||
"TagGroupRoot",
|
||||
"TextArea",
|
||||
"TextAreaRoot",
|
||||
"TextField",
|
||||
"TextFieldRoot",
|
||||
"TimeField",
|
||||
"TimeFieldRoot",
|
||||
"ToggleButton",
|
||||
"ToggleButtonRoot",
|
||||
"ToggleButtonGroup",
|
||||
"ToggleButtonGroupRoot",
|
||||
"Toolbar",
|
||||
"ToolbarRoot",
|
||||
"Tooltip",
|
||||
"TooltipRoot",
|
||||
"Typography",
|
||||
"TypographyRoot"
|
||||
],
|
||||
"aliases": [
|
||||
["Accordion", "AccordionRoot"],
|
||||
["Alert", "AlertRoot"],
|
||||
["AlertDialog", "AlertDialogRoot"],
|
||||
["Autocomplete", "AutocompleteRoot"],
|
||||
["Avatar", "AvatarRoot"],
|
||||
["AvatarGroup", "AvatarGroupRoot"],
|
||||
["Badge", "BadgeRoot"],
|
||||
["Breadcrumbs", "BreadcrumbsRoot"],
|
||||
["Button", "ButtonRoot"],
|
||||
["ButtonGroup", "ButtonGroupRoot"],
|
||||
["Calendar", "CalendarRoot"],
|
||||
["Card", "CardRoot"],
|
||||
["Checkbox", "CheckboxRoot"],
|
||||
["Chip", "ChipRoot"],
|
||||
["CloseButton", "CloseButtonRoot"],
|
||||
["ColorArea", "ColorAreaRoot"],
|
||||
["ColorField", "ColorFieldRoot"],
|
||||
["ColorInputGroup", "ColorInputGroupRoot"],
|
||||
["ColorPicker", "ColorPickerRoot"],
|
||||
["ColorSlider", "ColorSliderRoot"],
|
||||
["ColorSwatch", "ColorSwatchRoot"],
|
||||
["ColorSwatchPicker", "ColorSwatchPickerRoot"],
|
||||
["ComboBox", "ComboBoxRoot"],
|
||||
["DateField", "DateFieldRoot"],
|
||||
["DateInputGroup", "DateInputGroupRoot"],
|
||||
["DatePicker", "DatePickerRoot"],
|
||||
["DateRangePicker", "DateRangePickerRoot"],
|
||||
["Description", "DescriptionRoot"],
|
||||
["Disclosure", "DisclosureRoot"],
|
||||
["DisclosureGroup", "DisclosureGroupRoot"],
|
||||
["Drawer", "DrawerRoot"],
|
||||
["Dropdown", "DropdownRoot"],
|
||||
["EmptyState", "EmptyStateRoot"],
|
||||
["ErrorMessage", "ErrorMessageRoot"],
|
||||
["FieldError", "FieldErrorRoot"],
|
||||
["Fieldset", "FieldsetRoot"],
|
||||
["Form", "FormRoot"],
|
||||
["Header", "HeaderRoot"],
|
||||
["Input", "InputRoot"],
|
||||
["InputGroup", "InputGroupRoot"],
|
||||
["InputOTP", "InputOTPRoot"],
|
||||
["Kbd", "KbdRoot"],
|
||||
["Label", "LabelRoot"],
|
||||
["Link", "LinkRoot"],
|
||||
["ListBox", "ListBoxRoot"],
|
||||
["ListBoxItem", "ListBoxItemRoot"],
|
||||
["ListBoxSection", "ListBoxSectionRoot"],
|
||||
["Menu", "MenuRoot"],
|
||||
["MenuItem", "MenuItemRoot"],
|
||||
["MenuSection", "MenuSectionRoot"],
|
||||
["Meter", "MeterRoot"],
|
||||
["Modal", "ModalRoot"],
|
||||
["NumberField", "NumberFieldRoot"],
|
||||
["Pagination", "PaginationRoot"],
|
||||
["Popover", "PopoverRoot"],
|
||||
["ProgressBar", "ProgressBarRoot"],
|
||||
["ProgressCircle", "ProgressCircleRoot"],
|
||||
["Radio", "RadioRoot"],
|
||||
["RadioGroup", "RadioGroupRoot"],
|
||||
["RangeCalendar", "RangeCalendarRoot"],
|
||||
["ScrollShadow", "ScrollShadowRoot"],
|
||||
["SearchField", "SearchFieldRoot"],
|
||||
["Select", "SelectRoot"],
|
||||
["Separator", "SeparatorRoot"],
|
||||
["Skeleton", "SkeletonRoot"],
|
||||
["Slider", "SliderRoot"],
|
||||
["Spinner", "SpinnerRoot"],
|
||||
["Surface", "SurfaceRoot"],
|
||||
["Switch", "SwitchRoot"],
|
||||
["SwitchGroup", "SwitchGroupRoot"],
|
||||
["Table", "TableRoot"],
|
||||
["Tabs", "TabsRoot"],
|
||||
["Tag", "TagRoot"],
|
||||
["TagGroup", "TagGroupRoot"],
|
||||
["TextArea", "TextAreaRoot"],
|
||||
["TextField", "TextFieldRoot"],
|
||||
["TimeField", "TimeFieldRoot"],
|
||||
["ToggleButton", "ToggleButtonRoot"],
|
||||
["ToggleButtonGroup", "ToggleButtonGroupRoot"],
|
||||
["Toolbar", "ToolbarRoot"],
|
||||
["Tooltip", "TooltipRoot"],
|
||||
["Typography", "TypographyRoot"]
|
||||
],
|
||||
"css": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { componentItems } from "../apps/docs/.vitepress/theme/navigation";
|
||||
import { describe, it, expect, afterEach } from "vitest";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { mount } from "@vue/test-utils";
|
||||
import { flushPromises, mount } from "@vue/test-utils";
|
||||
import { defineComponent, h, nextTick, ref } from "vue";
|
||||
import {
|
||||
Label,
|
||||
@@ -761,3 +761,193 @@ it("isolates indicator labels from both surrounding and nested field scopes", as
|
||||
);
|
||||
w.unmount();
|
||||
});
|
||||
|
||||
describe("progress-bar custom-value demo with public NumberField/Select", () => {
|
||||
async function setup() {
|
||||
const mod = await import("../apps/docs/demos/progress-bar-custom-value.vue");
|
||||
const w = mount(mod.default as never, { attachTo: document.body });
|
||||
await flushPromises();
|
||||
return w;
|
||||
}
|
||||
const field = (w: ReturnType<typeof mount>, index: number) =>
|
||||
w.findAll('[data-slot="number-field"]')[index];
|
||||
const inputOf = (w: ReturnType<typeof mount>, index: number) =>
|
||||
field(w, index).get("input[role=spinbutton]");
|
||||
const progress = (w: ReturnType<typeof mount>) =>
|
||||
w.get("[data-slot=progress-bar]");
|
||||
const output = (w: ReturnType<typeof mount>) =>
|
||||
w.get("[data-slot=progress-bar-output]");
|
||||
const fill = (w: ReturnType<typeof mount>) =>
|
||||
w.get("[data-slot=progress-bar-fill]").element as HTMLElement;
|
||||
const text = (options: Intl.NumberFormatOptions, value: number) =>
|
||||
new Intl.NumberFormat(undefined, options).format(value);
|
||||
const percent = (value: number, min: number, max: number) =>
|
||||
text({ style: "percent" }, (value - min) / (max - min));
|
||||
|
||||
it("keeps the fixed source values and renders NumberField/Select parts", async () => {
|
||||
const w = await setup();
|
||||
expect(w.findAll('[data-slot="number-field"]')).toHaveLength(3);
|
||||
expect(w.findAll("input[role=spinbutton]")).toHaveLength(3);
|
||||
expect(w.findAll('[data-slot="select-trigger"]')).toHaveLength(1);
|
||||
expect(
|
||||
w.findAll('[data-slot="number-field-increment-button"]'),
|
||||
).toHaveLength(3);
|
||||
const bar = progress(w);
|
||||
expect(bar.attributes("aria-label")).toBe("收入");
|
||||
expect(bar.attributes("aria-valuenow")).toBe("750");
|
||||
expect(bar.attributes("aria-valuemin")).toBe("0");
|
||||
expect(bar.attributes("aria-valuemax")).toBe("1000");
|
||||
expect(output(w).text()).toBe("75%");
|
||||
expect(fill(w).style.width).toBe("75%");
|
||||
const labels = w.findAll("[data-slot=label]").map((n) => n.text());
|
||||
expect(labels).toEqual(["进度", "选项", "值", "最小值", "最大值", "格式"]);
|
||||
w.unmount();
|
||||
});
|
||||
|
||||
it("synchronizes typed input, stepping and bounds with progress text and fill", async () => {
|
||||
const w = await setup();
|
||||
const valueInput = inputOf(w, 0);
|
||||
await valueInput.setValue("500");
|
||||
await valueInput.trigger("blur");
|
||||
await flushPromises();
|
||||
expect(progress(w).attributes("aria-valuenow")).toBe("500");
|
||||
expect(output(w).text()).toBe("50%");
|
||||
expect(fill(w).style.width).toBe("50%");
|
||||
|
||||
await field(w, 0)
|
||||
.get('[data-slot="number-field-increment-button"]')
|
||||
.trigger("click");
|
||||
await flushPromises();
|
||||
expect(progress(w).attributes("aria-valuenow")).toBe("501");
|
||||
expect(output(w).text()).toBe(percent(501, 0, 1000));
|
||||
expect(fill(w).style.width).toBe("50.1%");
|
||||
await field(w, 0)
|
||||
.get('[data-slot="number-field-decrement-button"]')
|
||||
.trigger("click");
|
||||
await flushPromises();
|
||||
expect(progress(w).attributes("aria-valuenow")).toBe("500");
|
||||
|
||||
await valueInput.setValue("1000");
|
||||
await valueInput.trigger("blur");
|
||||
await flushPromises();
|
||||
expect(
|
||||
(
|
||||
field(w, 0)
|
||||
.get('[data-slot="number-field-increment-button"]')
|
||||
.element as HTMLButtonElement
|
||||
).disabled,
|
||||
).toBe(true);
|
||||
expect(output(w).text()).toBe("100%");
|
||||
w.unmount();
|
||||
});
|
||||
|
||||
it("rejects cleared and invalid drafts without NaN or display mismatch", async () => {
|
||||
const w = await setup();
|
||||
const valueInput = inputOf(w, 0);
|
||||
for (const draft of ["", "abc", "-"]) {
|
||||
await valueInput.setValue(draft);
|
||||
await valueInput.trigger("blur");
|
||||
await flushPromises();
|
||||
expect(progress(w).attributes("aria-valuenow")).toBe("750");
|
||||
expect(output(w).text()).toBe("75%");
|
||||
expect(fill(w).style.width).toBe("75%");
|
||||
expect((valueInput.element as HTMLInputElement).value).not.toBe("");
|
||||
expect(w.text()).not.toContain("NaN");
|
||||
}
|
||||
w.unmount();
|
||||
});
|
||||
|
||||
it("clamps out-of-range commits into the current range", async () => {
|
||||
const w = await setup();
|
||||
const valueInput = inputOf(w, 0);
|
||||
await valueInput.setValue("5000");
|
||||
await valueInput.trigger("blur");
|
||||
await flushPromises();
|
||||
expect(progress(w).attributes("aria-valuenow")).toBe("1000");
|
||||
expect(output(w).text()).toBe("100%");
|
||||
expect(fill(w).style.width).toBe("100%");
|
||||
await valueInput.setValue("-20");
|
||||
await valueInput.trigger("blur");
|
||||
await flushPromises();
|
||||
expect(progress(w).attributes("aria-valuenow")).toBe("0");
|
||||
expect(output(w).text()).toBe("0%");
|
||||
expect(fill(w).style.width).toBe("0%");
|
||||
w.unmount();
|
||||
});
|
||||
|
||||
it("re-syncs value when the dynamic bounds change", async () => {
|
||||
const w = await setup();
|
||||
const minInput = inputOf(w, 1);
|
||||
await minInput.setValue("800");
|
||||
await minInput.trigger("blur");
|
||||
await flushPromises();
|
||||
expect(progress(w).attributes("aria-valuemin")).toBe("800");
|
||||
expect(progress(w).attributes("aria-valuenow")).toBe("800");
|
||||
expect(output(w).text()).toBe("0%");
|
||||
|
||||
await minInput.setValue("2000");
|
||||
await minInput.trigger("blur");
|
||||
await flushPromises();
|
||||
expect(progress(w).attributes("aria-valuemin")).toBe("999");
|
||||
expect(progress(w).attributes("aria-valuenow")).toBe("999");
|
||||
|
||||
const maxInput = inputOf(w, 2);
|
||||
await maxInput.setValue("400");
|
||||
await maxInput.trigger("blur");
|
||||
await flushPromises();
|
||||
expect(progress(w).attributes("aria-valuemax")).toBe("1000");
|
||||
expect(progress(w).attributes("aria-valuenow")).toBe("999");
|
||||
w.unmount();
|
||||
|
||||
const fresh = await setup();
|
||||
const freshMax = inputOf(fresh, 2);
|
||||
await freshMax.setValue("600");
|
||||
await freshMax.trigger("blur");
|
||||
await flushPromises();
|
||||
expect(progress(fresh).attributes("aria-valuemax")).toBe("600");
|
||||
expect(progress(fresh).attributes("aria-valuenow")).toBe("600");
|
||||
expect(output(fresh).text()).toBe("100%");
|
||||
await freshMax.setValue("0");
|
||||
await freshMax.trigger("blur");
|
||||
await flushPromises();
|
||||
expect(progress(fresh).attributes("aria-valuemax")).toBe("1");
|
||||
expect(progress(fresh).attributes("aria-valuenow")).toBe("1");
|
||||
fresh.unmount();
|
||||
});
|
||||
|
||||
it("switches all four formats through the Select panel", async () => {
|
||||
const w = await setup();
|
||||
const cases: [string, Intl.NumberFormatOptions, number, number][] = [
|
||||
["货币", { currency: "USD", style: "currency" }, 750, 1000],
|
||||
["小数", { style: "decimal" }, 750, 1000],
|
||||
["单位", { style: "unit", unit: "mile" }, 750, 1000],
|
||||
["百分比", { style: "percent" }, 750, 1000],
|
||||
];
|
||||
for (const [label, options, value, max] of cases) {
|
||||
await w.get('[data-slot="select-trigger"]').trigger("keydown", {
|
||||
key: "ArrowDown",
|
||||
});
|
||||
await flushPromises();
|
||||
const panelOptions = [
|
||||
...document.querySelectorAll<HTMLElement>('[role="option"]'),
|
||||
];
|
||||
expect(panelOptions.map((n) => n.textContent?.trim())).toEqual([
|
||||
"货币",
|
||||
"百分比",
|
||||
"小数",
|
||||
"单位",
|
||||
]);
|
||||
const target = panelOptions.find((n) => n.textContent?.trim() === label)!;
|
||||
target.click();
|
||||
await flushPromises();
|
||||
expect(document.querySelector('[role="listbox"]')).toBeNull();
|
||||
expect(w.get('[data-slot="select-value"]').text()).toContain(label);
|
||||
const expected =
|
||||
options.style === "percent"
|
||||
? percent(value, 0, max)
|
||||
: text(options, value);
|
||||
expect(output(w).text()).toBe(expected);
|
||||
}
|
||||
w.unmount();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user