fix: 修复 API 生成和文档注释解析问题#11
Open
RSS1102 wants to merge 6 commits into
Open
Conversation
- 移除多余生成的分隔线,改为双空行分隔多个组件 - 修复语法分析模式下 documentationComment 解析错误
- 从 AST 正确提取构造参数类型与默认值,过滤 this.xxx 误识别 - 合并类字段到 API 表,隔离目标类解析作用域 - abstract 类实例方法写入文档;Markdown 表格转义与参数格式化 - super.key 无显式类型时统一展示为 Key? - 补充 README 工具职责边界说明与本地测试脚本 Co-authored-by: Cursor <cursoragent@cursor.com>
文档变更tdesign-component/example/assets/api/avatar_api.mddiff --git a/tdesign-component/example/assets/api/avatar_api.md b/tdesign-component/example/assets/api/avatar_api.md
index 9f1dd77..e43dcc1 100644
--- a/tdesign-component/example/assets/api/avatar_api.md
+++ b/tdesign-component/example/assets/api/avatar_api.md
@@ -11,14 +11,48 @@
| avatarSize | double? | - | 自定义头像大小 |
| avatarUrl | String? | - | 头像地址 |
| backgroundColor | Color? | - | 自定义文案时背景色 |
-| defaultUrl | String | '' | 默认图片(本地) |
+| defaultUrl | String | - | 默认图片(本地) |
| displayText | String? | - | 纯展示类型末尾文字 |
| fit | BoxFit? | - | 自定义图片对齐方式 |
| icon | IconData? | - | 自定义图标 |
-| key | | - | |
-| onTap | Function()? | - | 操作点击事件 |
+| key | Key? | - | - |
+| onTap | Function()? | - | 操作点击事件 |
| radius | double? | - | 自定义圆角 |
| shape | TAvatarShape | TAvatarShape.circle | 头像形状 |
| size | TAvatarSize | TAvatarSize.medium | 头像尺寸 |
| text | String? | - | 自定义文字 |
| type | TAvatarType | TAvatarType.normal | 头像类型 |
+
+
+### TAvatarSize
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| large | - |
+| medium | - |
+| small | - |
+
+
+### TAvatarType
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| icon | - |
+| normal | - |
+| customText | - |
+| display | - |
+| operation | - |
+
+
+### TAvatarShape
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| circle | - |
+| square | - |tdesign-component/example/assets/api/badge_api.mddiff --git a/tdesign-component/example/assets/api/badge_api.md b/tdesign-component/example/assets/api/badge_api.md
index 620ac2a..b623ce7 100644
--- a/tdesign-component/example/assets/api/badge_api.md
+++ b/tdesign-component/example/assets/api/badge_api.md
@@ -4,16 +4,49 @@
| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
+| type | TBadgeType | - | 红点样式 |
| border | TBadgeBorder | TBadgeBorder.large | 红点圆角大小 |
| color | Color? | - | 红点颜色 |
| count | String? | - | 红点数量 |
-| key | | - | |
-| maxCount | String? | '99' | 最大红点数量 |
+| key | Key? | - | - |
+| maxCount | String? | 99 | 最大红点数量 |
| message | String? | - | 消息内容 |
| padding | EdgeInsetsGeometry? | - | 角标自定义padding |
| showZero | bool | true | 值为0是否显示 |
| size | TBadgeSize | TBadgeSize.small | 红点尺寸 |
| textColor | Color? | - | 文字颜色 |
-| type | TBadgeType | type | 红点样式 |
| widthLarge | double | 32 | 角标大三角形宽 |
| widthSmall | double | 12 | 角标小三角形宽 |
+
+
+### TBadgeType
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| redPoint | 红点样式 |
+| message | 消息样式 |
+| bubble | 气泡样式 |
+| square | 方形样式 |
+| subscript | 角标样式 |
+
+
+### TBadgeBorder
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| large | 大圆角 8px |
+| small | 小圆角 2px |
+
+
+### TBadgeSize
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| large | 宽 20px |
+| small | 宽 16px |tdesign-component/example/assets/api/button_api.mddiff --git a/tdesign-component/example/assets/api/button_api.md b/tdesign-component/example/assets/api/button_api.md
index be9eb36..12e84d9 100644
--- a/tdesign-component/example/assets/api/button_api.md
+++ b/tdesign-component/example/assets/api/button_api.md
@@ -16,7 +16,7 @@
| iconTextSpacing | double? | - | 自定义图标与文本之间距离 |
| iconWidget | Widget? | - | 自定义图标 icon 控件 |
| isBlock | bool | false | 是否为通栏按钮 |
-| key | | - | |
+| key | Key? | - | - |
| margin | EdgeInsetsGeometry? | - | 自定义 margin |
| onLongPress | TButtonEvent? | - | 长按事件 |
| onTap | TButtonEvent? | - | 点击事件 |
@@ -30,27 +30,80 @@
| type | TButtonType | TButtonType.fill | 类型:填充,描边,文字 |
| width | double? | - | 自定义宽度 |
-```
-```
-### TButtonStyle
-#### 默认构造方法
+### TButtonSize
+#### 枚举值
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| backgroundColor | Color? | - | 背景颜色 |
-| frameColor | Color? | - | 边框颜色 |
-| frameWidth | double? | - | 边框宽度 |
-| gradient | Gradient? | - | 渐变背景色 |
-| radius | BorderRadiusGeometry? | - | 自定义圆角 |
-| textColor | Color? | - | 文字颜色 |
-
-
-#### 工厂构造方法
-
-| 名称 | 说明 |
-| --- | --- |
-| TButtonStyle.generateFillStyleByTheme | 生成不同主题的填充按钮样式 |
-| TButtonStyle.generateGhostStyleByTheme | 生成不同主题的幽灵按钮样式 |
-| TButtonStyle.generateOutlineStyleByTheme | 生成不同主题的描边按钮样式 |
-| TButtonStyle.generateTextStyleByTheme | 生成不同主题的文本按钮样式 |
+
+| 名称 | 说明 |
+| --- | --- |
+| large | - |
+| medium | - |
+| small | - |
+| extraSmall | - |
+
+
+### TButtonType
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| fill | - |
+| outline | - |
+| text | - |
+| ghost | - |
+
+
+### TButtonShape
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| rectangle | - |
+| round | - |
+| square | - |
+| circle | - |
+| filled | - |
+
+
+### TButtonTheme
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| defaultTheme | - |
+| primary | - |
+| danger | - |
+| light | - |
+
+
+### TButtonStatus
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| defaultState | - |
+| active | - |
+| disable | - |
+
+
+### TButtonIconPosition
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| left | - |
+| right | - |
+
+
+### TButtonEvent
+#### 类型定义
+
+```dart
+typedef TButtonEvent = void Function();
+```tdesign-component/example/assets/api/calendar_api.mddiff --git a/tdesign-component/example/assets/api/calendar_api.md b/tdesign-component/example/assets/api/calendar_api.md
index b5bd375..6877127 100644
--- a/tdesign-component/example/assets/api/calendar_api.md
+++ b/tdesign-component/example/assets/api/calendar_api.md
@@ -10,12 +10,12 @@
| cellWidget | Widget? Function(BuildContext context, TDate tdate, DateSelectType selectType)? | - | 自定义日期单元格组件 |
| dataSource | TCalendarDataSource? | - | 外部数据源,用于提供农历转换等功能 |
| dateType | TCalendarDateType | TCalendarDateType.solar | 日历类型:阳历或农历 |
-| displayFormat | String? | 'year month' | 年月显示格式,`year`表示年,`month`表示月,如`year month`表示年在前、月在后、中间隔一个空格 |
+| displayFormat | String? | year month | 年月显示格式,`year`表示年,`month`表示月,如`year month`表示年在前、月在后、中间隔一个空格 |
| firstDayOfWeek | int? | 0 | 第一天从星期几开始,默认 0 = 周日 |
| format | CalendarFormat? | - | 用于格式化日期的函数,可定义日期前后的显示内容和日期样式 |
| height | double? | - | 高度 |
| isTimeUnit | bool? | true | 是否显示时间单位 |
-| key | | - | |
+| key | Key? | - | - |
| maxDate | int? | - | 最大可选的日期(fromMillisecondsSinceEpoch),不传则默认半年后 |
| minDate | int? | - | 最小可选的日期(fromMillisecondsSinceEpoch),不传则默认今天 |
| monthTitleBuilder | Widget Function(BuildContext context, DateTime monthDate)? | - | 月标题构建器 |
@@ -38,68 +38,46 @@
| value | List<int>? | - | 当前选择的日期(fromMillisecondsSinceEpoch),不传则默认今天,当 type = single 时数组长度为1 |
| width | double? | - | 宽度 |
-```
-```
-### TCalendarPopup
-#### 默认构造方法
+### CalendarType
+#### 枚举值
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| autoClose | bool? | true | 自动关闭;在点击关闭按钮、确认按钮、遮罩层时自动关闭 |
-| builder | CalendarBuilder? | - | 控件构建器,优先级高于[child] |
-| child | TCalendar? | - | 日历控件 |
-| confirmBtn | Widget? | - | 自定义确认按钮 |
-| context | BuildContext | context | 上下文 |
-| onClose | VoidCallback? | - | 关闭时触发 |
-| onConfirm | void Function(List<int> value)? | - | 点击确认按钮时触发 |
-| top | double? | - | 距离顶部的距离 |
-| visible | bool? | - | 默认是否显示日历 |
-```
-```
+| 名称 | 说明 |
+| --- | --- |
+| single | - |
+| multiple | - |
+| range | - |
-### TCalendarStyle
-#### 默认构造方法
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| cellDecoration | BoxDecoration? | - | 日期decoration |
-| cellPrefixStyle | TextStyle? | - | 日期前面的字符串的样式 |
-| cellStyle | TextStyle? | - | 日期样式 |
-| cellSuffixStyle | TextStyle? | - | 日期后面的字符串的样式 |
-| centreColor | Color? | - | 日期范围内背景样式 |
-| decoration | | - | |
-| monthTitleStyle | TextStyle? | - | body区域 年月文字样式 |
-| titleCloseColor | Color? | - | header区域 关闭图标的颜色 |
-| titleMaxLine | int? | - | header区域 [TCalendar.title]的行数 |
-| titleStyle | TextStyle? | - | header区域 [TCalendar.title]的样式 |
-| weekdayStyle | TextStyle? | - | header区域 周 文字样式 |
-
-
-#### 工厂构造方法
-
-| 名称 | 说明 |
-| --- | --- |
-| TCalendarStyle.cellStyle | 日期样式 |
-| TCalendarStyle.generateStyle | 生成默认样式 |
+### CalendarTrigger
+#### 枚举值
-```
-```
-### TCalendarDataSource
-```
-```
+| 名称 | 说明 |
+| --- | --- |
+| closeBtn | - |
+| confirmBtn | - |
+| overlay | - |
-### TLunarInfo
-#### 默认构造方法
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| day | int | - | 农历日期(数字,1-30) |
-| dayText | String | - | 日期文本(如:初七) |
-| isLeapMonth | bool | false | 是否是闰月 |
-| month | int | - | 农历月份(数字,1-12) |
-| monthText | String | - | 月份文本(如:三月、闰三月) |
-| year | int | - | 农历年份(数字) |
-| yearText | String | - | 年份文本(如:二〇二五) |
+### DateSelectType
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| selected | - |
+| disabled | - |
+| start | - |
+| centre | - |
+| end | - |
+| empty | - |
+
+
+### CalendarFormat
+#### 类型定义
+
+```dart
+typedef CalendarFormat = TDate? Function(TDate? day);
+```tdesign-component/example/assets/api/cascader_api.mddiff --git a/tdesign-component/example/assets/api/cascader_api.md b/tdesign-component/example/assets/api/cascader_api.md
index 7906e35..0596006 100644
--- a/tdesign-component/example/assets/api/cascader_api.md
+++ b/tdesign-component/example/assets/api/cascader_api.md
@@ -1,22 +1,8 @@
## API
-### TMultiCascader
-#### 默认构造方法
+### TCascader
-| 参数 | 类型 | 默认值 | 说明 |
+#### 静态方法
+
+| 名称 | 返回类型 | 参数 | 说明 |
| --- | --- | --- | --- |
-| action | TCascaderAction? | - | 自定义选择器右上角按钮 |
-| backgroundColor | Color? | - | 背景颜色 |
-| cascaderHeight | double | - | 选择器List的视窗高度,默认200 |
-| closeText | String? | - | 关闭按钮文本 |
-| data | List<Map> | - | 选择器的数据源 |
-| initialData | String? | - | 初始化数据 |
-| initialIndexes | List<int>? | - | 若为null表示全部从零开始 |
-| isLetterSort | bool | false | 是否开启字母排序 |
-| key | | - | |
-| onChange | MultiCascaderCallback | - | 值发生变更时触发 |
-| onClose | Function? | - | 选择器关闭按钮回调 |
-| subTitles | List<String>? | - | 每级展示的次标题 |
-| theme | String? | - | 展示风格 可选项:step/tab |
-| title | String? | - | 选择器标题 |
-| titleStyle | TextStyle? | - | 标题样式 |
-| topRadius | double? | - | 顶部圆角 |
+| showMultiCascader | void | required context, String? title, required List<Map> data, List<int>? initialIndexes, String? theme, required onChange, Duration duration, Color? barrierColor, double cascaderHeight, String? initialData, String? closeText, bool isLetterSort, List<String>? subTitles, TCascaderAction? action, Function? onClose | 显示多级选择器 |tdesign-component/example/assets/api/cell_api.mddiff --git a/tdesign-component/example/assets/api/cell_api.md b/tdesign-component/example/assets/api/cell_api.md
index b668156..7876885 100644
--- a/tdesign-component/example/assets/api/cell_api.md
+++ b/tdesign-component/example/assets/api/cell_api.md
@@ -1,7 +1,5 @@
## API
### TCell
-#### 简介
-单元格组件
#### 默认构造方法
| 参数 | 类型 | 默认值 | 说明 |
@@ -18,7 +16,7 @@
| imageCircle | double? | 50 | 主图圆角,默认50(圆形) |
| imageSize | double? | - | 主图尺寸 |
| imageWidget | Widget? | - | 主图组件 |
-| key | | - | |
+| key | Key? | - | - |
| leftIcon | IconData? | - | 左侧图标,出现在单元格标题的左侧 |
| leftIconWidget | Widget? | - | 左侧图标组件 |
| note | String? | - | 和标题同行的说明文字 |
@@ -35,59 +33,21 @@
| title | String? | - | 标题 |
| titleWidget | Widget? | - | 标题组件 |
-```
-```
-
-### TCellGroup
-#### 简介
-单元格组组件
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| bordered | bool? | false | 是否显示组边框 |
-| builder | CellBuilder? | - | cell构建器,可自定义cell父组件,如Dismissible |
-| cells | List<TCell> | - | 单元格列表 |
-| isShowLastBordered | bool? | false | 是否显示最后一个cell的下边框 |
-| key | | - | |
-| scrollable | bool? | false | 可滚动 |
-| style | TCellStyle? | - | 自定义样式 |
-| theme | TCellGroupTheme? | TCellGroupTheme.defaultTheme | 单元格组风格。可选项:default/card |
-| title | String? | - | 单元格组标题 |
-| titleWidget | Widget? | - | 单元格组标题组件 |
-```
-```
+### TCellAlign
+#### 枚举值
-### TCellStyle
-#### 简介
-单元格组件样式
-#### 默认构造方法
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| arrowColor | Color? | - | 箭头颜色 |
-| backgroundColor | Color? | - | 默认状态背景颜色 |
-| borderedColor | Color? | - | 单元格边框颜色 |
-| cardBorderRadius | BorderRadius? | - | 卡片模式边框圆角 |
-| cardPadding | EdgeInsets? | - | 卡片模式内边距 |
-| clickBackgroundColor | Color? | - | 点击状态背景颜色 |
-| context | BuildContext? | - | 传递context,会生成默认样式 |
-| descriptionStyle | TextStyle? | - | 内容描述文字样式 |
-| groupBorderedColor | Color? | - | 单元格组边框颜色 |
-| groupTitleStyle | TextStyle? | - | 单元组标题文字样式 |
-| leftIconColor | Color? | - | 左侧图标颜色 |
-| noteStyle | TextStyle? | - | 说明文字样式 |
-| padding | EdgeInsets? | - | 单元格内边距 |
-| requiredStyle | TextStyle? | - | 必填星号文字样式 |
-| rightIconColor | Color? | - | 右侧图标颜色 |
-| titleBackgroundColor | Color? | - | 单元格组标题背景颜色 |
-| titlePadding | EdgeInsets? | - | 单元格组标题内边距 |
-| titleStyle | TextStyle? | - | 标题文字样式 |
+| 名称 | 说明 |
+| --- | --- |
+| top | - |
+| middle | - |
+| bottom | - |
-#### 工厂构造方法
+### TCellClick
+#### 类型定义
-| 名称 | 说明 |
-| --- | --- |
-| TCellStyle.cellStyle | 生成单元格默认样式 |
+```dart
+typedef TCellClick = void Function(TCell cell);
+```tdesign-component/example/assets/api/collapse_api.mddiff --git a/tdesign-component/example/assets/api/collapse_api.md b/tdesign-component/example/assets/api/collapse_api.md
index 28e0ebb..8bc214f 100644
--- a/tdesign-component/example/assets/api/collapse_api.md
+++ b/tdesign-component/example/assets/api/collapse_api.md
@@ -1,7 +1,5 @@
## API
### TCollapse
-#### 简介
-折叠面板列表组件,需配合 [TCollapsePanel] 使用
#### 默认构造方法
| 参数 | 类型 | 默认值 | 说明 |
@@ -9,13 +7,39 @@
| animationDuration | Duration | kThemeAnimationDuration | 折叠面板列表的动画时长 |
| children | List<TCollapsePanel> | - | 折叠面板列表的子组件 |
| elevation | double | 0 | 折叠面板列表的阴影 |
-| expansionCallback | ExpansionPanelCallback? | - | 折叠面板列表的回调函数; |
-| key | | - | |
-| style | TCollapseStyle | TCollapseStyle.block | 折叠面板列表的样式 |
+| expansionCallback | ExpansionPanelCallback? | - | 折叠面板列表的回调函数; 回调时,入参为当前点击的折叠面板的索引 index 和是否展开的状态 isExpanded |
+| key | Key? | - | - |
+| style | TCollapseStyle | TCollapseStyle.block | 折叠面板列表的样式 - [TCollapseStyle.block] 通栏风格 - [TCollapseStyle.card] 卡片风格 |
+
+#### 公开属性
+
+| 属性 | 类型 | 默认值 | 说明 |
+| --- | --- | --- | --- |
+| initialOpenPanelValue | Object? | - | 折叠面板列表的默认展开面板的值; 当使用 [TCollapse.accordion] 时,此值生效 |
#### 工厂构造方法
-| 名称 | 说明 |
-| --- | --- |
-| TCollapse.accordion | |
+##### TCollapse.accordion
+
+| 参数 | 类型 | 默认值 | 说明 |
+| --- | --- | --- | --- |
+| children | List<TCollapsePanel> | - | 折叠面板列表的子组件 |
+| style | TCollapseStyle | TCollapseStyle.block | 折叠面板列表的样式 - [TCollapseStyle.block] 通栏风格 - [TCollapseStyle.card] 卡片风格 |
+| expansionCallback | ExpansionPanelCallback? | - | 折叠面板列表的回调函数; 回调时,入参为当前点击的折叠面板的索引 index 和是否展开的状态 isExpanded |
+| animationDuration | Duration | kThemeAnimationDuration | 折叠面板列表的动画时长 |
+| elevation | double | 0 | 折叠面板列表的阴影 |
+| initialOpenPanelValue | Object? | - | 折叠面板列表的默认展开面板的值; 当使用 [TCollapse.accordion] 时,此值生效 |
+| key | Key? | - | - |
+
+
+### TCollapseStyle
+#### 简介
+折叠面板的组件样式
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| block | Block 通栏风格 |
+| card | Card 卡片风格 |tdesign-component/example/assets/api/dialog_api.mddiff --git a/tdesign-component/example/assets/api/dialog_api.md b/tdesign-component/example/assets/api/dialog_api.md
index 9dd8499..ac083b0 100644
--- a/tdesign-component/example/assets/api/dialog_api.md
+++ b/tdesign-component/example/assets/api/dialog_api.md
@@ -1,232 +1 @@
## API
-### TAlertDialog
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| backgroundColor | Color? | - | 背景颜色 |
-| buttonStyle | | TDialogButtonStyle.normal | |
-| buttonWidget | Widget? | - | 自定义按钮 |
-| content | String? | - | 内容 |
-| contentColor | Color? | - | 内容颜色 |
-| contentMaxHeight | double | 0 | 内容的最大高度,默认为0,也就是不限制高度 |
-| contentWidget | Widget? | - | 内容Widget |
-| key | | - | |
-| leftBtn | TDialogButtonOptions? | - | 左侧按钮配置 |
-| leftBtnAction | Function()? | - | 左侧按钮默认点击 |
-| padding | EdgeInsets? | const EdgeInsets.fromLTRB(24, 32, 24, 0) | 内容内边距 |
-| radius | double | 12.0 | 圆角 |
-| rightBtn | TDialogButtonOptions? | - | 右侧按钮配置 |
-| rightBtnAction | Function()? | - | 右侧按钮默认点击 |
-| showCloseButton | bool? | - | 显示右上角关闭按钮 |
-| title | String? | - | 标题 |
-| titleAlignment | AlignmentGeometry? | - | 标题对齐模式 |
-| titleColor | Color? | - | 标题颜色 |
-
-
-#### 工厂构造方法
-
-| 名称 | 说明 |
-| --- | --- |
-| TAlertDialog.vertical | 纵向按钮排列的对话框
-
- [buttons]参数是必须的,纵向按钮默认样式都是[TButtonTheme.primary] |
-
-```
-```
-
-### TConfirmDialog
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| action | Function()? | - | 点击 |
-| backgroundColor | Color? | - | 背景颜色 |
-| buttonStyle | TDialogButtonStyle | TDialogButtonStyle.normal | 按钮样式 |
-| buttonStyleCustom | TButtonStyle? | - | 按钮自定义样式属性,背景色、边框... |
-| buttonText | String? | - | 按钮文字 |
-| buttonTextColor | Color? | - | 按钮文字颜色 |
-| buttonWidget | Widget? | - | 自定义按钮 |
-| content | String? | - | 内容 |
-| contentColor | Color? | - | 内容颜色 |
-| contentMaxHeight | double | 0 | 内容的最大高度,默认为0,也就是不限制高度 |
-| contentWidget | Widget? | - | 内容Widget |
-| key | | - | |
-| padding | EdgeInsets? | const EdgeInsets.fromLTRB(24, 32, 24, 0) | 内容内边距 |
-| radius | double | 12.0 | 圆角 |
-| showCloseButton | bool? | - | 右上角关闭按钮 |
-| title | String? | - | 标题 |
-| titleAlignment | AlignmentGeometry? | - | 标题对齐模式 |
-| titleColor | Color? | - | 标题颜色 |
-| width | | - | |
-
-```
-```
-
-### TDialogButtonOptions
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| action | Function()? | - | 点击操作 |
-| fontWeight | FontWeight? | - | 字体粗细 |
-| height | double? | - | 按钮高度 |
-| style | TButtonStyle? | - | 按钮样式 |
-| theme | TButtonTheme? | - | 按钮类型 |
-| title | String | - | 标题内容 |
-| titleColor | Color? | - | 标题颜色 |
-| titleSize | double? | - | 字体大小 |
-| type | TButtonType? | - | 按钮类型 |
-
-```
-```
-
-### TDialogScaffold
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| backgroundColor | Color? | - | 背景色 |
-| body | Widget | - | Dialog主体 |
-| key | | - | |
-| radius | double | 12.0 | 圆角 |
-| showCloseButton | bool? | - | 显示右上角关闭按钮 |
-| width | double? | - | 弹窗宽度 |
-
-```
-```
-
-### TDialogTitle
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| key | | - | |
-| title | String? | - | 标题文字 |
-| titleColor | Color? | - | 标题颜色 |
-
-```
-```
-
-### TDialogContent
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| content | String? | - | 标题文字 |
-| contentColor | Color? | - | 标题颜色 |
-| key | | - | |
-
-```
-```
-
-### TDialogInfoWidget
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| content | String? | - | 内容 |
-| contentColor | Color? | - | 内容颜色 |
-| contentMaxHeight | double | 0 | 内容的最大高度,默认为0,也就是不限制高度 |
-| contentWidget | Widget? | - | 内容Widget |
-| key | | - | |
-| padding | EdgeInsetsGeometry? | const EdgeInsets.fromLTRB(24, 32, 24, 0) | 内容的内边距 |
-| title | String? | - | 标题 |
-| titleAlignment | AlignmentGeometry? | - | 标题对齐模式 |
-| titleColor | Color? | - | 标题颜色 |
-
-```
-```
-
-### HorizontalNormalButtons
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
...(共 237 行)tdesign-component/example/assets/api/divider_api.mddiff --git a/tdesign-component/example/assets/api/divider_api.md b/tdesign-component/example/assets/api/divider_api.md
index 19030af..da43acd 100644
--- a/tdesign-component/example/assets/api/divider_api.md
+++ b/tdesign-component/example/assets/api/divider_api.md
@@ -11,9 +11,20 @@
| height | double | 0.5 | 高度,横向线条使用 |
| hideLine | bool | false | 隐藏线条,使用纯文本分割 |
| isDashed | bool | false | 是否为虚线 |
-| key | | - | |
+| key | Key? | - | - |
| margin | EdgeInsetsGeometry? | - | 外部填充 |
| text | String? | - | 文本字符串,使用默认样式 |
| textStyle | TextStyle? | - | 自定义文本样式 |
| widget | Widget? | - | 中间控件,可自定义样式 |
| width | double? | - | 宽度,需要竖向线条时使用 |
+
+
+### TextAlignment
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| left | - |
+| center | - |
+| right | - |tdesign-component/example/assets/api/drawer_api.mddiff --git a/tdesign-component/example/assets/api/drawer_api.md b/tdesign-component/example/assets/api/drawer_api.md
index 6dcef5b..224e369 100644
--- a/tdesign-component/example/assets/api/drawer_api.md
+++ b/tdesign-component/example/assets/api/drawer_api.md
@@ -1,16 +1,14 @@
## API
### TDrawer
-#### 简介
-抽屉组件
#### 默认构造方法
| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
+| context | BuildContext | - | 上下文 |
| backgroundColor | Color? | - | 组件背景颜色 |
| bordered | bool? | true | 是否显示边框 |
| closeOnOverlayClick | bool? | true | 点击蒙层时是否关闭抽屉 |
| contentWidget | Widget? | - | 自定义内容,优先级高于[items]/[footer]/[title] |
-| context | BuildContext | context | 上下文 |
| drawerTop | double? | - | 距离顶部的距离 |
| footer | Widget? | - | 抽屉的底部 |
| hover | bool? | true | 是否开启点击反馈 |
@@ -26,41 +24,14 @@
| visible | bool? | - | 组件是否可见 |
| width | double? | 280 | 宽度 |
-```
-```
-### TDrawerWidget
+### TDrawerPlacement
#### 简介
-抽屉内容组件
- 可用于 Scaffold 中的 drawer 属性
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| backgroundColor | Color? | - | 组件背景颜色 |
-| bordered | bool? | true | 是否显示边框 |
-| contentWidget | Widget? | - | 自定义内容,优先级高于[items]/[footer]/[title] |
-| footer | Widget? | - | 抽屉的底部 |
-| hover | bool? | true | 是否开启点击反馈 |
-| isShowLastBordered | bool? | true | 是否显示最后一行分割线 |
-| items | List<TDrawerItem>? | - | 抽屉里的列表项 |
-| key | | - | |
-| onItemClick | TDrawerItemClickCallback? | - | 点击抽屉里的列表项触发 |
-| style | TCellStyle? | - | 列表自定义样式 |
-| title | String? | - | 抽屉的标题 |
-| titleWidget | Widget? | - | 抽屉的标题组件 |
-| width | double? | 280 | 宽度 |
+抽屉方向
+#### 枚举值
-```
-```
-### TDrawerItem
-#### 简介
-抽屉里的列表项
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| content | Widget? | - | 完全自定义 |
-| icon | Widget? | - | 每列图标 |
-| title | String? | - | 每列标题 |
+| 名称 | 说明 |
+| --- | --- |
+| left | - |
+| right | - |tdesign-component/example/assets/api/empty_api.mddiff --git a/tdesign-component/example/assets/api/empty_api.md b/tdesign-component/example/assets/api/empty_api.md
index e39301b..cd34bc5 100644
--- a/tdesign-component/example/assets/api/empty_api.md
+++ b/tdesign-component/example/assets/api/empty_api.md
@@ -10,8 +10,26 @@
| emptyTextFont | Font? | - | 描述文字大小 |
| icon | IconData? | TIcons.info_circle_filled | 图标 |
| image | Widget? | - | 展示图片 |
-| key | | - | |
+| key | Key? | - | - |
| onTapEvent | TTapEvent? | - | 点击事件 |
| operationText | String? | - | 操作按钮文案 |
| operationTheme | TButtonTheme? | - | 操作按钮文案主题色 |
| type | TEmptyType | TEmptyType.plain | 类型,为operation有操作按钮,plain无按钮 |
+
+
+### TEmptyType
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| plain | - |
+| operation | - |
+
+
+### TTapEvent
+#### 类型定义
+
+```dart
+typedef TTapEvent = void Function();
+```tdesign-component/example/assets/api/fab_api.mddiff --git a/tdesign-component/example/assets/api/fab_api.md b/tdesign-component/example/assets/api/fab_api.md
index 641de81..a58b687 100644
--- a/tdesign-component/example/assets/api/fab_api.md
+++ b/tdesign-component/example/assets/api/fab_api.md
@@ -5,9 +5,43 @@
| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| icon | Icon? | - | 图标 |
-| key | | - | |
+| key | Key? | - | - |
| onClick | VoidCallback? | - | 点击事件 |
| shape | TFabShape | TFabShape.circle | 形状 |
| size | TFabSize | TFabSize.large | 大小 |
| text | String? | - | 文本 |
| theme | TFabTheme | TFabTheme.defaultTheme | 主题 |
+
+
+### TFabTheme
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| primary | - |
+| defaultTheme | - |
+| light | - |
+| danger | - |
+
+
+### TFabShape
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| circle | - |
+| square | - |
+
+
+### TFabSize
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| large | - |
+| medium | - |
+| small | - |
+| extraSmall | - |tdesign-component/example/assets/api/footer_api.mddiff --git a/tdesign-component/example/assets/api/footer_api.md b/tdesign-component/example/assets/api/footer_api.md
index 17deb01..5ae8ef4 100644
--- a/tdesign-component/example/assets/api/footer_api.md
+++ b/tdesign-component/example/assets/api/footer_api.md
@@ -4,10 +4,21 @@
| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
+| type | TFooterType | - | 样式 |
| height | double? | - | 自定义图片高 |
-| key | | - | |
+| key | Key? | - | - |
| links | List<TLink> | const [] | 链接 |
| logo | String? | - | 品牌图片 |
-| text | String | '' | 文字 |
-| type | TFooterType | type | 样式 |
+| text | String | - | 文字 |
| width | double? | - | 自定义图片宽 |
+
+
+### TFooterType
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| text | 文字样式 |
+| link | 链接样式 |
+| brand | 品牌样式 |tdesign-component/example/assets/api/form_api.mddiff --git a/tdesign-component/example/assets/api/form_api.md b/tdesign-component/example/assets/api/form_api.md
index 6192277..75781d0 100644
--- a/tdesign-component/example/assets/api/form_api.md
+++ b/tdesign-component/example/assets/api/form_api.md
@@ -9,62 +9,18 @@
| data | Map<String, dynamic> | - | 表单数据 |
| disabled | bool | false | 是否禁用整个表单 |
| errorMessage | Object? | - | 表单信息错误信息配置 |
-| formContentAlign | TextAlign | TextAlign.left | 表单内容对齐方式: 左对齐、右对齐、居中对齐 |
+| formContentAlign | TextAlign | TextAlign.left | 表单内容对齐方式: 左对齐、右对齐、居中对齐 可选项: left/right/center 默认为左对齐 优先级低于 TFormItem 的对齐 API TODO: TStepper TRate 等组件没用实现通用性 |
| formController | FormController? | - | 表单控制器 |
-| formLabelAlign | TextAlign? | TextAlign.left | 表单字段标签的对齐方式: |
-| formShowErrorMessage | bool? | true | 校验不通过时,是否显示错误提示信息,统一控制全部表单项 |
+| formLabelAlign | TextAlign? | TextAlign.left | 表单字段标签的对齐方式: 左对齐、右对齐、顶部对齐 可选项: left/right/top TODO: 表单总体标签对齐方式 |
+| formShowErrorMessage | bool? | true | 校验不通过时,是否显示错误提示信息,统一控制全部表单项 如果希望控制单个表单项,请给 FormItem 设置该属性 |
| isHorizontal | bool | true | 表单排列方式是否为 水平方向 |
| items | List<TFormItem> | - | 表单内容 items |
-| key | | - | |
+| key | Key? | - | - |
| labelWidth | double? | 20.0 | 可以整体设置 label 标签宽度 |
| onReset | Function? | - | 表单重置时触发 |
| onSubmit | Function | - | 表单提交时触发 |
-| preventSubmitDefault | bool? | true | 是否阻止表单提交默认事件(表单提交默认事件会刷新页面) |
+| preventSubmitDefault | bool? | true | 是否阻止表单提交默认事件(表单提交默认事件会刷新页面) 设置为 true 可以避免刷新 |
| requiredMark | bool? | true | 是否显示必填符号(*),默认显示 |
| rules | Map<String, TFormValidation> | - | 整个表单字段校验规则 |
-| scrollToFirstError | String? | - | 表单校验不通过时,是否自动滚动到第一个校验不通过的字段,平滑滚动或是瞬间直达。 |
+| scrollToFirstError | String? | - | 表单校验不通过时,是否自动滚动到第一个校验不通过的字段,平滑滚动或是瞬间直达。 值为空则表示不滚动。可选项:''/smooth/auto |
| submitWithWarningMessage | bool? | false | 【讨论中】当校验结果只有告警信息时,是否触发 submit 提交事件 |
-
-```
-```
-
-### TFormItem
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| additionInfo | String? | - | TInput的辅助信息 |
-| backgroundColor | Color? | - | 背景色 |
-| child | Widget? | - | 表单子组件 |
-| contentAlign | TextAlign? | - | 表单显示内容对齐方式: |
-| formItemNotifier | | - | |
-| formRules | List<TFormValidation>? | - | 整个表单的校验规则 |
-| help | String? | - | TInput 默认显示文字 |
-| hintText | null | '' | 提示内容 |
-| indicator | bool? | - | TTextarea 的属性,指示器 |
-| itemRule | List? | - | 表单项验证规则 |
-| key | | - | |
-| label | String? | - | 表单项标签左侧展示的内容 |
-| labelAlign | TextAlign? | - | TODO: item 标签对齐方式 |
-| labelWidget | Widget? | - | 自定义标签 |
-| labelWidth | double? | - | 标签宽度,如果提供则覆盖Form的labelWidth |
-| name | String? | - | 表单字段名称 |
-| radios | | - | |
-| requiredMark | bool? | true | 是否显示必填标记(*) |
-| select | String | '' | 选择器 适用于日期选择器等 |
-| selectFn | Function? | - | 选择器方法 适用于日期选择器等 |
-| showErrorMessage | bool | true | 是否显示错误信息 |
-| tipAlign | TextAlign? | - | 组件提示内容对齐方式 |
-| type | TFormItemType | - | 表格单元需要使用的组件类型 |
-
-```
-```
-
-### TFormValidation
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| errorMessage | String | - | 错误提示信息 |
-| type | TFormItemType | - | 校验对象的类型 |
-| validate | String? Function(dynamic) | - | 校验方法 |tdesign-component/example/assets/api/image_api.mddiff --git a/tdesign-component/example/assets/api/image_api.md b/tdesign-component/example/assets/api/image_api.md
index 133ef6a..cac1a39 100644
--- a/tdesign-component/example/assets/api/image_api.md
+++ b/tdesign-component/example/assets/api/image_api.md
@@ -4,30 +4,45 @@
| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
-| alignment | | Alignment.center | |
+| alignment | AlignmentGeometry | Alignment.center | - |
| assetUrl | String? | - | 本地素材地址 |
-| cacheHeight | | - | |
-| cacheWidth | | - | |
-| centerSlice | | - | |
-| color | | - | |
-| colorBlendMode | | - | |
-| errorBuilder | | - | |
+| cacheHeight | int? | - | - |
+| cacheWidth | int? | - | - |
+| centerSlice | Rect? | - | - |
+| color | Color? | - | - |
+| colorBlendMode | BlendMode? | - | - |
+| errorBuilder | ImageErrorWidgetBuilder? | - | - |
| errorWidget | Widget? | - | 失败自定义提示 |
-| excludeFromSemantics | | false | |
-| filterQuality | | FilterQuality.low | |
+| excludeFromSemantics | bool | false | - |
+| filterQuality | FilterQuality | FilterQuality.low | - |
| fit | BoxFit? | - | 适配样式 |
| frameBuilder | ImageFrameBuilder? | - | 以下系统Image属性,释义请参考系统[Image]中注释 |
-| gaplessPlayback | | false | |
+| gaplessPlayback | bool | false | - |
| height | double? | - | 自定义高 |
| imageFile | File? | - | 图片文件路径 |
| imgUrl | String? | - | 图片地址 |
-| isAntiAlias | | false | |
-| key | | - | |
-| loadingBuilder | | - | |
+| isAntiAlias | bool | false | - |
+| key | Key? | - | - |
+| loadingBuilder | ImageLoadingBuilder? | - | - |
| loadingWidget | Widget? | - | 加载自定义提示 |
-| matchTextDirection | | false | |
-| opacity | | - | |
-| repeat | | ImageRepeat.noRepeat | |
-| semanticLabel | | - | |
+| matchTextDirection | bool | false | - |
+| opacity | Animation<double>? | - | - |
+| repeat | ImageRepeat | ImageRepeat.noRepeat | - |
+| semanticLabel | String? | - | - |
| type | TImageType | TImageType.roundedSquare | 图片类型 |
| width | double? | - | 自定义宽 |
+
+
+### TImageType
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| clip | 裁剪 |
+| fitHeight | 适应高 |
+| fitWidth | 适应宽 |
+| stretch | 拉伸 |
+| square | 方形, |
+| roundedSquare | 圆角方形 |
+| circle | 圆形 |tdesign-component/example/assets/api/indexes_api.mddiff --git a/tdesign-component/example/assets/api/indexes_api.md b/tdesign-component/example/assets/api/indexes_api.md
index eeb9a72..d5092d9 100644
--- a/tdesign-component/example/assets/api/indexes_api.md
+++ b/tdesign-component/example/assets/api/indexes_api.md
@@ -1,7 +1,5 @@
## API
### TIndexes
-#### 简介
-索引
#### 默认构造方法
| 参数 | 类型 | 默认值 | 说明 |
@@ -12,44 +10,10 @@
| capsuleTheme | bool? | false | 锚点是否为胶囊式样式 |
| indexList | List<String>? | - | 索引字符列表。不传默认 A-Z |
| indexListMaxHeight | double? | 0.8 | 索引列表最大高度(父容器高度的百分比,默认 0.8) |
-| key | | - | |
+| key | Key? | - | - |
| onChange | void Function(String index)? | - | 索引发生变更时触发事件 |
| onSelect | void Function(String index)? | - | 点击侧边栏时触发事件 |
| reverse | bool? | false | 反方向滚动置顶 |
| scrollController | ScrollController? | - | 滚动控制器 |
| sticky | bool? | true | 锚点是否吸顶 |
| stickyOffset | double? | 0 | 锚点吸顶时与顶部的距离 |
-
-```
-```
-
-### TIndexesAnchor
-#### 简介
-索引锚点
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| activeIndex | ValueNotifier<String> | - | 选中索引 |
-| builderAnchor | Widget? Function(BuildContext context, String index, bool isPinnedToTop)? | - | 索引锚点构建 |
-| capsuleTheme | bool | - | 是否为胶囊式样式 |
-| key | | - | |
-| sticky | bool | - | 索引是否吸顶 |
-| text | String | - | 锚点文本 |
-
-```
-```
-
-### TIndexesList
-#### 简介
-索引
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| activeIndex | ValueNotifier<String> | - | 选中索引 |
-| builderIndex | Widget Function(BuildContext context, String index, bool isActive)? | - | 索引文本自定义构建,包括索引激活左侧提示 |
-| indexList | List<String> | - | 索引字符列表。不传默认 A-Z |
-| indexListMaxHeight | double | 0.8 | 索引列表最大高度(父容器高度的百分比,默认0.8) |
-| key | | - | |
-| onSelect | void Function(String newIndex, String oldIndex) | - | 点击侧边栏时触发事件 |tdesign-component/example/assets/api/input_api.mddiff --git a/tdesign-component/example/assets/api/input_api.md b/tdesign-component/example/assets/api/input_api.md
index 7d6f2cc..53ae5bf 100644
--- a/tdesign-component/example/assets/api/input_api.md
+++ b/tdesign-component/example/assets/api/input_api.md
@@ -4,7 +4,7 @@
| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
-| additionInfo | String? | '' | 错误提示信息 |
+| additionInfo | String? | - | 错误提示信息 |
| additionInfoColor | Color? | - | 错误提示颜色 |
| autofocus | bool | false | 是否自动获取焦点 |
| backgroundColor | Color? | - | 输入框背景色 |
@@ -27,7 +27,7 @@
| inputDecoration | InputDecoration? | - | 自定义输入框样式,默认圆角 |
| inputFormatters | List<TextInputFormatter>? | - | 显示输入内容,如限制长度(LengthLimitingTextInputFormatter(6)) |
| inputType | TextInputType? | - | 键盘类型,数字、字母 |
-| key | | - | |
+| key | Key? | - | - |
| labelWidget | Widget? | - | leftLabel右侧组件,支持自定义 |
| leftContentSpace | double? | - | 输入框内容左侧间距 |
| leftIcon | Widget? | - | 带图标的输入框 |
@@ -52,9 +52,44 @@
| selectionControls | TextSelectionControls? | - | 自定义选择控制器 |
| showBottomDivider | bool | true | 是否展示底部分割线 |
| size | TInputSize | TInputSize.large | 输入框规格 |
-| spacer | TInputSpacer | - | 组件各模块间间距 |
+| spacer | TInputSpacer? | - | 组件各模块间间距 |
| textAlign | TextAlign? | - | 文字对齐方向 |
| textInputBackgroundColor | Color? | - | 文本框背景色 |
| textStyle | TextStyle? | - | 文本颜色 |
| type | TInputType | TInputType.normal | 输入框类型 |
| width | double? | - | 输入框宽度(TCardStyle时必须设置该参数) |
+
+
+### TInputType
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| normal | - |
+| twoLine | - |
+| longText | - |
+| special | - |
+| normalMaxTwoLine | - |
+| cardStyle | - |
+
+
+### TInputSize
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| small | - |
+| large | - |
+
+
+### TCardStyle
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| topText | - |
+| topTextWithBlueBorder | - |
+| errorStyle | - |tdesign-component/example/assets/api/link_api.mddiff --git a/tdesign-component/example/assets/api/link_api.md b/tdesign-component/example/assets/api/link_api.md
index 7324abe..c86a0cf 100644
--- a/tdesign-component/example/assets/api/link_api.md
+++ b/tdesign-component/example/assets/api/link_api.md
@@ -7,7 +7,7 @@
| color | Color? | - | link 文本的颜色,如果不设置则根据状态和风格进行计算 |
| fontSize | double? | - | link 文本的字体大小,如果不设置则根据状态和风格进行计算 |
| iconSize | double? | - | link icon 大小,如果不设置则根据状态和风格进行计算 |
-| key | | - | |
+| key | Key? | - | - |
| label | String | - | link 展示的文本 |
| leftGapWithIcon | double? | - | 前置icon和文本之间的间隔,如果不设置则根据状态和风格进行计算 |
| linkClick | LinkClick? | - | link 被点击之后所采取的动作,会将uri当做参数传入到该方法当中 |
@@ -19,3 +19,60 @@
| suffixIcon | Icon? | - | 后置 icon |
| type | TLinkType | TLinkType.basic | link 类型 |
| uri | Uri? | - | link 跳转的uri |
+
+
+### TLinkType
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| basic | - |
+| withUnderline | - |
+| withPrefixIcon | - |
+| withSuffixIcon | - |
+
+
+### TLinkStyle
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| primary | - |
+| defaultStyle | - |
+| danger | - |
+| warning | - |
+| success | - |
+
+
+### TLinkState
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| normal | - |
+| active | - |
+| disabled | - |
+
+
+### TLinkSize
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| small | - |
+| medium | - |
+| large | - |
+
+
+### LinkClick
+#### 简介
+限制Function类型,防止传递错误的Function,导致参数对不上
+#### 类型定义
+
+```dart
+typedef LinkClick = Function(Uri? uri);
+```tdesign-component/example/assets/api/loading_api.mddiff --git a/tdesign-component/example/assets/api/loading_api.md b/tdesign-component/example/assets/api/loading_api.md
index 6bf7be7..1f8dc9c 100644
--- a/tdesign-component/example/assets/api/loading_api.md
+++ b/tdesign-component/example/assets/api/loading_api.md
@@ -9,8 +9,34 @@
| duration | int | 2000 | 一次刷新的时间,控制动画速度 |
| icon | TLoadingIcon? | TLoadingIcon.circle | 图标,支持圆形、点状、菊花状 |
| iconColor | Color? | - | 图标颜色 |
-| key | | - | |
+| key | Key? | - | - |
| refreshWidget | Widget? | - | 失败刷新组件 |
| size | TLoadingSize | - | 尺寸 |
| text | String? | - | 文案 |
| textColor | Color? | - | 文案颜色 |
+
+
+### TLoadingSize
+#### 简介
+Loading 尺寸
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| small | 小尺寸 |
+| medium | 中尺寸 |
+| large | 大尺寸 |
+
+
+### TLoadingIcon
+#### 简介
+Loading图标
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| circle | 圆形 |
+| point | 点状 |
+| activity | 菊花状 |tdesign-component/example/assets/api/message_api.mddiff --git a/tdesign-component/example/assets/api/message_api.md b/tdesign-component/example/assets/api/message_api.md
index a327735..25156a7 100644
--- a/tdesign-component/example/assets/api/message_api.md
+++ b/tdesign-component/example/assets/api/message_api.md
@@ -8,7 +8,7 @@
| content | String? | - | 通知内容 |
| duration | int? | 3000 | 消息内置计时器 |
| icon | dynamic | true | 自定义消息前面的图标 |
-| key | | - | |
+| key | Key? | - | - |
| link | dynamic | - | 链接名称 |
| marquee | MessageMarquee? | - | 跑马灯效果 |
| offset | List<double>? | - | 相对于 placement 的偏移量 |
@@ -23,28 +23,18 @@
| 名称 | 返回类型 | 参数 | 说明 |
| --- | --- | --- | --- |
-| showMessage | | required BuildContext context, String? content, bool? visible, int? duration, dynamic closeBtn, dynamic icon, dynamic link, MessageMarquee? marquee, List<double>? offset, MessageTheme? theme, VoidCallback? onCloseBtnClick, VoidCallback? onDurationEnd, VoidCallback? onLinkClick, | |
+| showMessage | void | required BuildContext context, String? content, bool? visible, int? duration, dynamic closeBtn, dynamic icon, dynamic link, MessageMarquee? marquee, List<double>? offset, MessageTheme? theme, VoidCallback? onCloseBtnClick, VoidCallback? onDurationEnd, VoidCallback? onLinkClick | - |
-```
-```
-### MessageMarquee
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| delay | int? | - | 延迟时间(毫秒) |
-| loop | int? | - | 循环次数 |
-| speed | int? | - | 速度 |
+### MessageTheme
+#### 简介
+定义消息主题枚举
+#### 枚举值
-```
-```
-### MessageLink
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| color | Color? | - | 颜色 |
-| name | String | - | 名称 |
-| uri | Uri? | - | 资源链接 |
+| 名称 | 说明 |
+| --- | --- |
+| info | 普通通知 |
+| success | 成功通知 |
+| warning | 警示通知 |
+| error | 错误通知 |tdesign-component/example/assets/api/picker_api.mddiff --git a/tdesign-component/example/assets/api/picker_api.md b/tdesign-component/example/assets/api/picker_api.md
index d09bcdf..6f8c7f9 100644
--- a/tdesign-component/example/assets/api/picker_api.md
+++ b/tdesign-component/example/assets/api/picker_api.md
@@ -4,120 +4,19 @@
| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
-| cancel | Widget? | - | 工具栏左侧自定义插槽,默认使用 [TResourceDelegate.cancel] |
-| confirm | Widget? | - | 工具栏右侧自定义插槽,默认使用 [TResourceDelegate.confirm] |
+| cancel | Widget? | - | 工具栏左侧自定义插槽,默认使用 [TResourceDelegate.cancel] 可用于渲染图标、图标+文字组合等。点击事件依然由外层 [GestureDetector] 处理,触发 [onCancel] 回调——所以插槽内的 Widget 不需要自己处理点击。 ```dart // 简单改文字 TPicker( cancel: const Text('关闭'), onCancel: () => Navigator.of(context).pop(), ) // 带图标 TPicker( cancel: const Icon(Icons.close, size: 22), onCancel: () => Navigator.of(context).pop(), ) ``` |
+| confirm | Widget? | - | 工具栏右侧自定义插槽,默认使用 [TResourceDelegate.confirm] 可用于渲染图标、图标+文字组合等。点击事件依然由外层 [GestureDetector] 处理,触发 [onConfirm] 回调——所以插槽内的 Widget 不需要自己处理点击。 ```dart // 简单改文字 TPicker( confirm: const Text('确定'), onConfirm: (v) => Navigator.of(context).pop(v), ) // 带图标 TPicker( confirm: const Icon(Icons.check, size: 22), onConfirm: (v) => Navigator.of(context).pop(v), ) ``` |
| disabled | bool | false | 是否禁用整个选择器(禁止滚动和操作),默认 false |
| height | double | 200 | 视窗高度,默认 200 |
| initialValue | List<dynamic>? | - | 初始选中值列表(按 value 匹配) |
| itemBuilder | ItemBuilderType? | - | 自定义子项构建器(disabled 项仍由内部统一渲染,不会走此 builder) |
| itemCount | int | 5 | 每屏显示 item 数,默认 5 |
| itemDistanceCalculator | ItemDistanceCalculator? | - | 自定义距离计算器(控制颜色/字重/字号随"离中心距离"的变化) |
-| items | TPickerItems | - | 数据源(必填) |
-| key | | - | |
-| onCancel | VoidCallback? | - | 点击「取消」按钮回调 |
-| onChange | void Function(TPickerValue)? | - | 值改变回调(滚动时实时触发) |
-| onConfirm | void Function(TPickerValue)? | - | 点击「确认」按钮回调 |
-| onLoad | void Function(TPickerLoadEvent)? | - | 列选中项变化的事件回调 |
-| title | String? | - | 工具栏中部标题(可选,不传时中部留白) |
-| titleWidget | Widget? | - | 工具栏中部自定义标题插槽 |
-
-```
-```
-
-### TPickerOption
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| disabled | bool | false | 是否禁用(不可选中/置灰显示),默认 false |
-| label | String | - | 展示文字(可包含 emoji、单位、国际化等) |
-| value | dynamic | - | 业务值(onChange 回调返回此字段) |
-
-```
-```
-
-### TPickerValue
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| indexes | List<int> | - | 每列选中项的索引 |
-| selectedOptions | List<TPickerOption> | - | 每列选中的完整 option |
-
-```
-```
-
-### TPickerLoadEvent
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| column | int | - | 触发事件的列索引(0 表示第一列) |
-| displayedCount | int | - | 当前列已展示的选项总数 |
-| parentValue | dynamic | - | 当前列的父级选中值(联动模式下使用) |
-| remaining | int | - | 距底部剩余的选项数(业务可用此值做"接近底部时加载"判断) |
-
-```
-```
-
-### TPickerColumns
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| columns | List<List<TPickerOption>> | columns | 每列的选项列表 |
-
-
-#### 工厂构造方法
-
-| 名称 | 说明 |
-| --- | --- |
-| TPickerColumns.fromRaw | 从自由结构的 raw 数据创建,自动归一化
-
- ```dart
- TPickerColumns.fromRaw(
- [['北京', '上海', '广州']],
- keys: const TPickerKeys(label: 'name', value: 'code'),
- )
- ``` |
-
-```
-```
-
-### TPickerLinked
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| tree | Map<TPickerOption, dynamic> | tree | 联动树结构:`Map<TPickerOption, dynamic>` |
-
-
-#### 工厂构造方法
-
-| 名称 | 说明 |
-| --- | --- |
-| TPickerLinked.fromRaw | 从自由结构的 raw Map 数据创建,自动归一化
-
- ```dart
- TPickerLinked.fromRaw({
- '广东': {'深圳': ['南山', '福田'], '广州': ['天河']},
- '浙江': {'杭州': ['西湖']},
- })
- ``` |
-
-```
-```
-
-### TPickerItems
-```
-```
-
-### TPickerKeys
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| children | String | 'children' | 联动模式下子级数据对应的字段名,默认 `children` |
-| disabled | String | 'disabled' | 禁用标记对应的字段名,默认 `disabled` |
-| label | String | 'label' | 展示文案对应的字段名,默认 `label` |
-| value | String | 'value' | 业务值对应的字段名,默认 `value` |
+| items | TPickerItems | - | 数据源(必填) 使用密封类 [TPickerItems] 编译期强制二选一: - [TPickerColumns] → 多列独立选择 - [TPickerLinked] → 联动选择 自由结构数据通过 `.fromRaw()` 工厂构造归一化。 |
+| key | Key? | - | - |
+| onCancel | VoidCallback? | - | 点击「取消」按钮回调 仅作为点击事件通知,不携带任何参数。组件本身不会做任何 popup 操作,业务层可在此自行决定是否关闭弹窗、重置状态等。 |
+| onChange | void Function(TPickerValue)? | - | 值改变回调(滚动时实时触发) 触发时机: - 用户滚动经过某个 enabled 项并稳定时 - disabled 修正动画完成后,回调最终落点 **注意**:此回调代表"滚动时实时变化",不代表"用户已确认选择"。 如需"已确认"语义,请使用 [onConfirm]。 如需做网络请求/埋点等去抖处理,请在业务层自行 debounce。 |
+| onConfirm | void Function(TPickerValue)? | - | 点击「确认」按钮回调 携带当前选中的完整 [TPickerValue],包含: - `selectedOptions`: 当前选中的所有 [TPickerOption] - `values`: 各列选中项的 value 列表 - `labels`: 各列选中项的 label 列表 - `indexes`: 各列选中项的索引 与 [onChange] 不同——只有用户点击「确认」时才触发,代表"已确认选择"。 组件本身不会做任何 popup 操作,业务层可在此自行决定是否关闭弹窗、 提交表单等。 |
+| onLoad | void Function(TPickerLoadEvent)? | - | 列选中项变化的事件回调 **触发时机**:每次用户滚动到一个 enabled 项后都会触发(联动模式下还会 在新展开的列就位后触发)。组件本身不做"距底部多少项"的阈值判断——把 决策权交给业务层。 **事件参数**包含: - [TPickerLoadEvent.column]:触发列索引 - [TPickerLoadEvent.remaining]:当前列距底部剩余项数 - [TPickerLoadEvent.displayedCount]:当前列总项数 - [TPickerLoadEvent.parentValue]:联动模式下父级选中值(首列为 null) **典型用法**:业务层根据 [TPickerLoadEvent.remaining] 自行判断是否加载更多。 ```dart onLoad: (e) async { if (e.remaining > 5 \|\| _isLoading) return; // 距底部还远 / 已在加载,跳过 _isLoading = true; final more = await fetchMore(parent: e.parentValue); setState(() { _data.addAll(more); _isLoading = false; }); } ``` |
+| title | String? | - | 工具栏中部标题(可选,不传时中部留白) 顶部工具栏永远显示,包含「取消」「标题」「确认」三块。 用户点击「取消」触发 [onCancel],点击「确认」触发 [onConfirm]。 选择器与弹窗(popup)完全解耦——关闭/打开弹窗的逻辑由业务层在 这两个回调中自行控制。 典型用法(与 popup 弹窗组合): ```dart TPicker( items: items, title: '请选择地区', onCancel: () => setState(() => visible = false), onConfirm: (value) { setState(() { selected = value; visible = false; }); }, ) ``` |
+| titleWidget | Widget? | - | 工具栏中部自定义标题插槽 传入后会**完全替换**默认的 [title] 文字,可用于渲染更复杂的标题(副标题、图标+文字等)。 标题区域不响应点击。 |tdesign-component/example/assets/api/popover_api.mddiff --git a/tdesign-component/example/assets/api/popover_api.md b/tdesign-component/example/assets/api/popover_api.md
index 0a44f13..890d51d 100644
--- a/tdesign-component/example/assets/api/popover_api.md
+++ b/tdesign-component/example/assets/api/popover_api.md
@@ -1,36 +1,8 @@
## API
### TPopover
-#### 简介
-
#### 静态方法
| 名称 | 返回类型 | 参数 | 说明 |
| --- | --- | --- | --- |
-| showPopover | | required BuildContext context, String? content, Widget? contentWidget, double offset, TPopoverTheme? theme, bool closeOnClickOutside, TPopoverPlacement? placement, bool? showArrow, double arrowSize, EdgeInsetsGeometry? padding, double? width, double? height, Color? overlayColor, OnTap? onTap, OnLongTap? onLongTap, BorderRadius? radius, | |
-
-```
-```
-
-### TPopoverWidget
-#### 简介
-
-#### 默认构造方法
-
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| arrowSize | double | 8 | 箭头大小 |
-| content | String? | - | 显示内容 |
-| contentWidget | Widget? | - | 自定义内容 |
-| context | BuildContext | - | 上下文 |
-| height | double? | - | 内容高度(包含padding,实际高度:height - paddingTop - paddingBottom) |
-| key | | - | |
-| offset | double | 4 | 偏移 |
-| onLongTap | OnLongTap? | - | 长按事件 |
-| onTap | OnTap? | - | 点击事件 |
-| padding | EdgeInsetsGeometry? | - | 内容内边距 |
-| placement | TPopoverPlacement? | - | 浮层出现位置 |
-| radius | BorderRadius? | - | 圆角 |
-| showArrow | bool? | true | 是否显示浮层箭头 |
-| theme | TPopoverTheme? | - | 弹出气泡主题 |
-| width | double? | - | 内容宽度(包含padding,实际高度:height - paddingLeft - paddingRight) |
+| showPopover | Future | required BuildContext context, String? content, Widget? contentWidget, double offset, TPopoverTheme? theme, bool closeOnClickOutside, TPopoverPlacement? placement, bool? showArrow, double arrowSize, EdgeInsetsGeometry? padding, double? width, double? height, Color? overlayColor, OnTap? onTap, OnLongTap? onLongTap, BorderRadius? radius | - |tdesign-component/example/assets/api/progress_api.mddiff --git a/tdesign-component/example/assets/api/progress_api.md b/tdesign-component/example/assets/api/progress_api.md
index 44b2617..7c41f4b 100644
--- a/tdesign-component/example/assets/api/progress_api.md
+++ b/tdesign-component/example/assets/api/progress_api.md
@@ -4,12 +4,12 @@
| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
-| animationDuration | int? | 300 | 动画持续时间(正整数,单位为毫秒) |
+| animationDuration | int | 300 | 动画持续时间(正整数,单位为毫秒) |
| backgroundColor | Color? | - | 进度条背景颜色 |
| circleRadius | double? | - | 环形进度条半径(正数) |
| color | Color? | - | 进度条颜色 |
| customProgressLabel | Widget? | - | 自定义标签 |
-| key | | - | |
+| key | Key? | - | - |
| label | TLabelWidget? | - | 进度条标签 |
| labelWidgetAlignment | Alignment? | - | 自定义标签对齐方式 |
| labelWidgetWidth | double? | - | 自定义标签宽度 |
@@ -22,3 +22,38 @@
| strokeWidth | double? | - | 进度条粗细(正数) |
| type | TProgressType | - | 进度条类型 |
| value | double? | - | 进度值(0.0 到 1.0 之间的正数) |
+
+
+### TProgressType
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| linear | - |
+| circular | - |
+| micro | - |
+| button | - |
+
+
+### TProgressLabelPosition
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| inside | - |
+| left | - |
+| right | - |
+
+
+### TProgressStatus
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| primary | - |
+| warning | - |
+| danger | - |
+| success | - |tdesign-component/example/assets/api/radio_api.mddiff --git a/tdesign-component/example/assets/api/radio_api.md b/tdesign-component/example/assets/api/radio_api.md
index 74529e4..dbf901d 100644
--- a/tdesign-component/example/assets/api/radio_api.md
+++ b/tdesign-component/example/assets/api/radio_api.md
@@ -1,67 +1,51 @@
## API
### TRadio
-#### 简介
-单选框按钮,继承自TCheckbox,字段含义与父类一致
#### 默认构造方法
| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
-| backgroundColor | | - | |
-| cardMode | | - | |
-| checkBoxLeftSpace | | - | |
-| contentDirection | | TContentDirection.right | |
-| customContentBuilder | | - | |
-| customIconBuilder | | - | |
-| customSpace | | - | |
-| disableColor | | - | |
-| enable | | true | |
-| id | | - | |
-| insetSpacing | | - | |
-| key | | - | |
+| backgroundColor | Color? | - | - |
+| cardMode | bool? | - | - |
+| checkBoxLeftSpace | double? | - | - |
+| contentDirection | TContentDirection | TContentDirection.right | - |
+| customContentBuilder | ContentBuilder? | - | - |
+| customIconBuilder | IconBuilder? | - | - |
+| customSpace | EdgeInsetsGeometry? | - | - |
+| disableColor | Color? | - | - |
+| enable | bool | true | - |
+| id | String? | - | - |
+| insetSpacing | double? | - | - |
+| key | Key? | - | - |
| radioStyle | TRadioStyle | TRadioStyle.circle | 单选框按钮样式 |
-| selectColor | | - | |
-| showDivider | bool | - | 是否显示下划线 |
-| size | | TCheckBoxSize.small | |
-| spacing | | - | |
-| subTitle | | - | |
-| subTitleColor | | - | |
-| subTitleFont | | - | |
-| subTitleMaxLine | | 1 | |
-| title | | - | |
-| titleColor | | - | |
-| titleFont | | - | |
-| titleMaxLine | | 1 | |
+| selectColor | Color? | - | - |
+| showDivider | bool? | - | - |
+| size | TCheckBoxSize | TCheckBoxSize.small | - |
+| spacing | double? | - | - |
+| subTitle | String? | - | - |
+| subTitleColor | Color? | - | - |
+| subTitleFont | Font? | - | - |
+| subTitleMaxLine | int | 1 | - |
+| title | String? | - | - |
+| titleColor | Color? | - | - |
+| titleFont | Font? | - | - |
+| titleMaxLine | int | 1 | - |
-```
-```
-### TRadioGroup
-#### 简介
-RadioGroup分组对象,继承自TCheckboxGroup,字段含义与父类一致
- RadioGroup应该嵌套在RadioGroup内,所有在RadioGroup的RadioButton只能有一个被选中
+### TRadioStyle
+#### 枚举值
- cardMode: 使用卡片样式,需要配合direction 和 directionalTdRadios 使用,
- 组合为横向、纵向卡片,同时需要在每个TRadio上设置cardMode参数。
-#### 默认构造方法
-| 参数 | 类型 | 默认值 | 说明 |
-| --- | --- | --- | --- |
-| cardMode | | false | |
-| child | | - | |
-| contentDirection | | - | |
-| controller | | - | |
-| customContentBuilder | | - | |
-| customIconBuilder | | - | |
-| direction | | - | |
-| directionalTdRadios | | - | |
-| divider | Widget? | - | 自定义下划线 |
-| key | | - | |
-| onRadioGroupChange | | - | |
-| passThrough | | - | |
-| radioCheckStyle | TRadioStyle? | - | 勾选样式 |
-| rowCount | int | 1 | 每行几列 |
-| selectId | | - | |
-| showDivider | bool | false | 是否显示下划线 |
-| spacing | | - | |
-| strictMode | bool | true | 严格模式下,用户不能取消勾选,只能切换选择项, |
-| titleMaxLine | | - | |
+| 名称 | 说明 |
+| --- | --- |
+| circle | - |
+| square | - |
+| check | - |
+| hollowCircle | - |
+
+
+### OnRadioGroupChange
+#### 类型定义
+
+```dart
+typedef OnRadioGroupChange = void Function(String? selectedId);
+```tdesign-component/example/assets/api/rate_api.mddiff --git a/tdesign-component/example/assets/api/rate_api.md b/tdesign-component/example/assets/api/rate_api.md
index d3089c2..418a99a 100644
--- a/tdesign-component/example/assets/api/rate_api.md
+++ b/tdesign-component/example/assets/api/rate_api.md
@@ -5,7 +5,7 @@
| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| allowHalf | bool? | false | 是否允许半选 |
-| builderText | Widget Function(BuildContext context, double value)? | - | 评分等级对应的辅助文字自定义构建,优先级高于[texts] |
+| builderText | Widget Function(BuildContext context, double value)? | - | 评分等级对应的辅助文字自定义构建,优先级高于[texts] 配置后,会忽略[texts],[textWidth],[iconTextGap] |
| color | List<Color>? | - | 评分图标的颜色,示例:[选中颜色] / [选中颜色,未选中颜色],默认:[TTheme.of(context).warningColor5, TTheme.of(context).grayColor4] |
| count | int? | 5 | 评分的数量 |
| crossAxisAlignment | CrossAxisAlignment? | CrossAxisAlignment.center | 评分图标与辅助文字的交叉轴对齐方式 |
@@ -14,13 +14,24 @@
| gap | double? | - | 评分图标的间距,默认:TTheme.of(context).spacer8 |
| icon | List<IconData>? | - | 自定义评分图标,[选中和未选中图标] / [选中图标,未选中图标],默认:[TIcons.star_filled] |
| iconTextGap | double? | - | 评分图标与辅助文字的间距,默认:[TTheme.of(context).spacer16] |
-| key | | - | |
+| key | Key? | - | - |
| mainAxisAlignment | MainAxisAlignment? | MainAxisAlignment.start | 评分图标与辅助文字的主轴对齐方式 |
| mainAxisSize | MainAxisSize? | MainAxisSize.min | 评分图标与辅助文字主轴方向上如何占用空间 |
| onChange | void Function(double value)? | - | 评分数改变时触发 |
| placement | PlacementEnum? | PlacementEnum.top | 选择评分弹框的位置,值为[PlacementEnum.none]表示不显示评分弹框。 |
| showText | bool? | false | 是否显示对应的辅助文字 |
| size | double? | 24.0 | 评分图标的大小 |
-| texts | List<String>? | const ['极差', '失望', '一般', '满意', '惊喜'] | 评分等级对应的辅助文字, |
+| texts | List<String>? | const ['极差', '失望', '一般', '满意', '惊喜'] | 评分等级对应的辅助文字, 当[allowHalf]为false时长度应与[count]一致, 当[allowHalf]为true时长度应为[count]的两倍, 自定义值示例:['1分', '2分', '3分', '4分', '5分']。 |
| textWidth | double? | 48.0 | 评分等级对应的辅助文字宽度 |
| value | double? | 0 | 选择评分的值 |
+
+
+### PlacementEnum
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| none | - |
+| top | - |
+| bottom | - |tdesign-component/example/assets/api/result_api.mddiff --git a/tdesign-component/example/assets/api/result_api.md b/tdesign-component/example/assets/api/result_api.md
index 836cd2d..db6062a 100644
--- a/tdesign-component/example/assets/api/result_api.md
+++ b/tdesign-component/example/assets/api/result_api.md
@@ -6,7 +6,19 @@
| --- | --- | --- | --- |
| description | String? | - | 描述文本,用于提供额外信息 |
| icon | Widget? | - | 图标组件,用于在结果中显示一个图标 |
-| key | | - | |
+| key | Key? | - | - |
| theme | TResultTheme | TResultTheme.defaultTheme | 主题样式,默认主题样式为defaultTheme |
-| title | String | '' | 标题文本,显示结果的主要信息,默认标题为空字符串 |
+| title | String | - | 标题文本,显示结果的主要信息,默认标题为空字符串 |
| titleStyle | TextStyle? | - | 自定义字体样式,用于设置标题文本的样式 |
+
+
+### TResultTheme
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| defaultTheme | - |
+| success | - |
+| warning | - |
+| error | - |tdesign-component/example/assets/api/stepper_api.mddiff --git a/tdesign-component/example/assets/api/stepper_api.md b/tdesign-component/example/assets/api/stepper_api.md
index 0ebfa60..98cd018 100644
--- a/tdesign-component/example/assets/api/stepper_api.md
+++ b/tdesign-component/example/assets/api/stepper_api.md
@@ -10,7 +10,7 @@
| disableInput | bool | false | 禁用输入框 |
| eventController | StreamController<TStepperEventType>? | - | 事件控制器 |
| inputWidth | double? | - | 禁用全部操作 |
-| key | | - | |
+| key | Key? | - | - |
| max | int | 100 | 最大值 |
| min | int | 0 | 最小值 |
| onBlur | VoidCallback? | - | 输入框失去焦点时触发 |
@@ -20,3 +20,70 @@
| step | int | 1 | 步长 |
| theme | TStepperTheme | TStepperTheme.normal | 组件风格 |
| value | int? | 0 | 值 |
+
+
+### TStepperSize
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| small | - |
+| medium | - |
+| large | - |
+
+
+### TStepperTheme
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| normal | - |
+| filled | - |
+| outline | - |
+
+
+### TStepperIconType
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| remove | - |
+| add | - |
+
+
+### TStepperOverlimitType
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| minus | - |
+| plus | - |
+
+
+### TStepperEventType
+#### 枚举值
+
+
+| 名称 | 说明 |
+| --- | --- |
+| cleanValue | - |
+
+
+### TStepperOverlimitFunction
+#### 类型定义
+
+```dart
+typedef TStepperOverlimitFunction = void Function(TStepperOverlimitType type);
+```
+
+
+### TTapFunction
+#### 类型定义
+
+```dart
+typedef TTapFunction = void Function();
+```
|
|
✅ 编译完成,产物如下:
在 Actions 运行页 Artifacts 区域按平台名称下载。 |
工厂构造参数从 fieldMap 补全类型,enum 成员支持 /// 注释,positional 参数保持顺序;新增 validate 命令与 AST 完备性检测,CI 通过 tdesign_api.yaml 统一配置。
CI 上 8 个测试失败因硬编码本地绝对路径;统一通过环境变量解析 tdesign-component 路径。
There was a problem hiding this comment.
Pull request overview
该 PR 旨在修复 API 文档生成过程中 AST 解析与文档注释提取的问题,并补齐一套“只读校验”的完备性检测能力(validate 命令 + CI),以便在不修改组件源码的前提下持续发现文档缺失/重复定义等问题。
Changes:
- 重构 AST 解析与 Markdown 渲染:支持 enum/typedef 条目、实例方法(abstract class)、更可靠的参数类型/默认值提取与表格转义。
- 新增 API 文档完备性检测:
validate命令 + YAML 清单解析 + GitHub Actions 工作流落地。 - 新增多组单元测试与本地验证脚本,覆盖 positional 参数、factory ctor 参数类型回填、enum 成员注释等场景。
Reviewed changes
Copilot reviewed 18 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/support/component_paths.dart | 提供 CI/本地可用的 tdesign-component 根目录定位逻辑 |
| test/positional_ctor_test.dart | 覆盖默认构造函数 positional 参数解析(BuildContext) |
| test/factory_ctor_test.dart | 覆盖 factory ctor 参数类型从 fieldMap 回填 |
| test/enum_members_test.dart | 覆盖 enum 成员的 /// 注释解析与输出 |
| test/duplicate_source_test.dart | 覆盖跨文件重复 enum/typedef 的告警输出 |
| test/ctor_defaults_test.dart | 覆盖构造参数默认值与 super 参数默认值继承 |
| test/aux_types_test.dart | 覆盖同文件内自动收录 enum/typedef 的行为 |
| scripts/local_test.sh | 增加本地生成验证脚本(通过 --packages 跳过联网校验) |
| README.md | 补充工具职责边界与本地开发/测试说明 |
| pubspec.yaml | 增加 test dev_dependency,调整依赖声明 |
| pubspec.lock | 锁文件随依赖变更更新 |
| lib/util.dart | 增加参数类型/默认值提取、表格转义、重复定义告警等通用工具函数 |
| lib/smart_update.dart | 清理调试输出与计时日志 |
| lib/smart_create.dart | 抽出 parseOnly/收集文件/统一解析排序/Markdown 输出改造 |
| lib/model.dart | 扩展模型:kind、enumMembers/typedefDefinition/sourceFile、extra/static 列表等 |
| lib/component_rule.dart | AST Visitor 重构:解析 enum/typedef、super 参数类型/默认值、实例方法等 |
| lib/api_completeness.dart | 新增完备性审计:配置加载、Markdown section 解析、AST vs 文档对比 |
| bin/main.dart | 新增 validate 子命令并接入完备性审计 |
| .gitignore | 忽略本地编译产物与可执行文件 |
| .github/workflows/api-compliance.yml | 新增 API 合规性校验工作流(analyze + tests + validate) |
| .github/config/tdesign_api.yaml | 新增 CI 审计清单(5 个重点组件) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
354
to
+363
| node.visitChildren(this); | ||
| String tmp = ''; | ||
| if (node.childEntities.isNotEmpty) { | ||
| tmp = node.childEntities.map((e) => e.toString()).toList().join('|'); | ||
| } | ||
| List<String> strList = []; | ||
| strList.add(node.childEntities.length.toString()); | ||
| strList.add(tmp); | ||
| strList.add(node.beginToken.toString()); | ||
| strList.add(node.toSource()); | ||
| strList.add('type:' + node.fields.type.toString()); | ||
| strList.add('fields:' + node.fields.variables.join(',').toString()); | ||
| Debug.blue('成员变量[$folderName]: ${strList.join(', ')}'); | ||
| String fieldName = node.fields.variables.join(','); | ||
| if(fieldName.contains("=")){ | ||
| fieldName = fieldName.split("=")[0].trim(); | ||
| if (fieldName.contains('=')) { | ||
| fieldName = fieldName.split('=')[0].trim(); | ||
| } | ||
| PropertyInfo? item = propertyList.firstWhereOrNull((element) => element.name == fieldName); | ||
| if (item == null) { | ||
| item = PropertyInfo(); | ||
| fieldMap[fieldName] = item; | ||
| if (fieldName.startsWith('_')) { | ||
| return; | ||
| } | ||
| item.type = node.fields.type.toString(); | ||
| if (node.beginToken.toString().startsWith('///')) { | ||
| PropertyInfo? item = fieldMap[fieldName]; | ||
| item ??= PropertyInfo()..name = fieldName; |
Comment on lines
+72
to
99
| /// 规范化 API 文档中的默认值展示 | ||
| String formatDefaultValueForDoc( | ||
| String? raw, { | ||
| required String paramName, | ||
| required bool isRequired, | ||
| }) { | ||
| if (raw == null || raw.trim().isEmpty) { | ||
| return '-'; | ||
| } | ||
| var value = raw.trim(); | ||
| // `this.fieldName` 会被误识别为默认值 | ||
| if (value == paramName || value == 'this.$paramName') { | ||
| return '-'; | ||
| } | ||
| if ((value.startsWith("'") && value.endsWith("'")) || | ||
| (value.startsWith('"') && value.endsWith('"'))) { | ||
| if (value.length >= 2) { | ||
| value = value.substring(1, value.length - 1); | ||
| } | ||
| } | ||
| return value; | ||
| } | ||
|
|
||
| Debug.yellow(String msg) { | ||
| if (isEnable) { | ||
| AnsiPen pen = AnsiPen()..yellow(bold: true); | ||
| print(pen(msg)); | ||
| } | ||
| /// 清理 Markdown 表格单元格,避免破坏表格结构 | ||
| String sanitizeTableCell(String? text) { | ||
| if (text == null || text.isEmpty) { | ||
| return '-'; | ||
| } |
Comment on lines
+105
to
+112
| if (!quiet) { | ||
| final String? sdkPath = await _detectSdkPath(); | ||
| if (sdkPath != null && sdkPath.isNotEmpty) { | ||
| AnsiPen pen = AnsiPen()..green(bold: true); | ||
| print(pen('Detected Dart SDK: $sdkPath')); | ||
| } | ||
| } | ||
| final String? sdkPath = await _detectSdkPath(); |
| } | ||
| parsedComponentInfoList.addAll(issuesInFile.analyse()); | ||
| } | ||
| reportDuplicateAuxiliaryDefinitions(parsedComponentInfoList); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

移除多余生成的分隔线,改为双空行分隔多个组件
修复语法分析模式下 documentationComment 解析错误