Skip to content

Commit 7ffd502

Browse files
RSS1102Luozf12345runoob-coder
authored
chore: 更新官网文档 (Tencent#794)
* 更新api * 修改AOP生成代码逻辑 * 增加演示代码 * Revert "fix:TDCell的note过长时溢出问题 (Tencent#769)" This reverts commit 00ee780. * 更新官网文档 * 默认打开AOP开关 * 更新Toast的API * 修改api_tool的执行权限 * 生成官网文档 * 修改默认暗色模式能生效 * 调整暗色模式使用方法,优化自定义主题生成脚本 * 暗色模式不存在的字段,使用对应的亮色模式值来映射 * chore(example): 注释掉示例组件中的文本颜色属性 (Tencent#788) - 注释掉了标题文本的颜色属性 - 注释掉了描述文本的颜色属性 - 注释掉了列表项文本的颜色属性 - 添加了待办注释提醒后续处理BuildContext相关问题 * 修改Cell布局溢出问题 * 调整暗色模式色值,修复NoticeBar在暗示模式下的显示问题 * 修改暗色模式禁用色失效的问题 * 修改默认主题暗色模式名称 * 改造设置页 * shared_preferences降级,兼容3.16.9版本SDK * 修复暗色模式切换时,示例desc不跟随的问题 * 更新API文件 * 更新官网API文档 * 添加暗色模式相关文档 * 更新版本号 * 解决冲突 * fix(pubspec): 回退版本号至 0.2.5 * Revert "修改api_tool的执行权限" This reverts commit 2843695. --------- Co-authored-by: zflyluo <zflyluo@tencent.com> Co-authored-by: 驴割肠 <noob-coder@qq.com>
1 parent 6e1a35a commit 7ffd502

File tree

556 files changed

+10704
-12963
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

556 files changed

+10704
-12963
lines changed

tdesign-component/example/assets/api/button_api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
| backgroundColor | Color? | - | 背景颜色 |
88
| frameColor | Color? | - | 边框颜色 |
99
| frameWidth | double? | - | 边框宽度 |
10+
| gradient | Gradient? | - | 渐变背景色 |
1011
| radius | BorderRadiusGeometry? | - | 自定义圆角 |
1112
| textColor | Color? | - | 文字颜色 |
1213

@@ -32,6 +33,7 @@
3233
| disabled | bool | false | 禁止点击 |
3334
| disableStyle | TDButtonStyle? | - | 自定义禁用样式,有则优先用它,没有则根据 type 和 theme 选取 |
3435
| disableTextStyle | TextStyle? | - | 自定义不可点击状态文本样式 |
36+
| gradient | Gradient? | - | 渐变背景色,优先级高于backgroundColor |
3537
| height | double? | - | 自定义高度 |
3638
| icon | IconData? | - | 图标icon |
3739
| iconPosition | TDButtonIconPosition? | TDButtonIconPosition.left | 图标位置 |

tdesign-component/example/assets/api/cell_api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
| leftIcon | IconData? | - | 左侧图标,出现在单元格标题的左侧 |
5858
| leftIconWidget | Widget? | - | 左侧图标组件 |
5959
| note | String? | - | 和标题同行的说明文字 |
60+
| noteMaxLine | int | 1 | 说明文字组件 最大行数 |
61+
| noteMaxWidth | double? | - | 说明文字组件 最大宽度,超过部分显示省略号,防止文字溢出 |
6062
| noteWidget | Widget? | - | 说明文字组件 |
6163
| onClick | TDCellClick? | - | 点击事件 |
6264
| onLongPress | TDCellClick? | - | 长按事件 |

tdesign-component/example/assets/api/search_api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
| onEditComplete | TDSearchBarCallBack? | - | 编辑完成回调 |
2323
| onInputClick | GestureTapCallback? | - | 输入框点击事件 |
2424
| onSubmitted | TDSearchBarEvent? | - | 提交回调 |
25-
| onTapOutside | | - | |
25+
| onTapOutside | TapRegionCallback? | - | 点击输入框外部回调 |
2626
| onTextChanged | TDSearchBarEvent? | - | 文字改变回调 |
27-
| padding | EdgeInsets | const EdgeInsets.fromLTRB(16, 8, 16, 8) | 内部填充 |
27+
| padding | EdgeInsets | const EdgeInsets.symmetric(horizontal: 16, vertical: 8) | 内部填充 |
2828
| placeHolder | String? | - | 预设文案 |
2929
| readOnly | bool? | - | 是否只读 |
3030
| style | TDSearchStyle? | TDSearchStyle.square | 样式 |

tdesign-component/example/assets/api/table_api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
| data | List<dynamic>? | - | 数据源 |
1111
| defaultSort | String? | - | 默认排序 |
1212
| empty | TDTableEmpty? | - | 空表格呈现样式 |
13+
| footerWidget | Widget? | - | 自定义表尾 |
1314
| height | double? | - | 表格高度,超出后会出现滚动条 |
1415
| key | | - | |
1516
| loading | bool? | false | 加载中状态 |

tdesign-component/example/assets/api/theme_api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@
4343
| 名称 | 返回类型 | 参数 | 说明 |
4444
| --- | --- | --- | --- |
4545
| defaultData | | TDExtraThemeData? extraThemeData, | 获取默认Data,一个App里只有一个,用于没有context的地方 |
46-
| fromJson | | required String name, required String themeJson, null recoverDefault, TDExtraThemeData? extraThemeData, | 解析配置的json文件为主题数据 |
46+
| fromJson | | required String name, required String themeJson, String? darkName, null recoverDefault, TDExtraThemeData? extraThemeData, | 解析配置的json文件为主题数据 [name] 主题名称,目前只支持一级键 [themeJson] 主题json字符串,要求json配置必须正确 [recoverDefault] 是否恢复为默认主题数据 [extraThemeData] 额外扩展的主题数据 |
47+
| parseThemeData | | required String name, required null themeConfig, required TDExtraThemeData? extraThemeData, | |

tdesign-component/example/assets/api/toast_api.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55

66
| 名称 | 返回类型 | 参数 | 说明 |
77
| --- | --- | --- | --- |
8-
| dismissLoading | | | 关闭加载Toast |
9-
| showFail | | required String? text, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, Color? backgroundColor, int? maxLines, | 失败提示Toast |
10-
| showIconText | | required String? text, IconData? icon, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, Color? backgroundColor, int? maxLines, | 带图标的Toast |
11-
| showLoading | | required BuildContext context, String? text, Duration duration, bool? preventTap, Widget? customWidget, Color? backgroundColor, | 带文案的加载Toast |
12-
| showLoadingWithoutText | | required BuildContext context, String? text, Duration duration, bool? preventTap, Color? backgroundColor, | 不带文案的加载Toast |
13-
| showSuccess | | required String? text, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, Color? backgroundColor, int? maxLines, | 成功提示Toast |
14-
| showText | | required String? text, required BuildContext context, Duration duration, int? maxLines, BoxConstraints? constraints, bool? preventTap, Widget? customWidget, Color? backgroundColor, | 普通文本Toast |
15-
| showWarning | | required String? text, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, Color? backgroundColor, int? maxLines, | 警告Toast |
8+
| dismissAll | | | 关闭所有Toast |
9+
| dismissLoading | | | 关闭加载Toast(向后兼容) |
10+
| dismissToast | | required String toastId, | 关闭指定的Toast |
11+
| showFail | | required String? text, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, Color? backgroundColor, int? maxLines, TextStyle? textStyle, double? iconSize, Color? iconColor, String? toastId, | 失败提示Toast |
12+
| showIconText | | required String? text, IconData? icon, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, Color? backgroundColor, int? maxLines, TextStyle? textStyle, double? iconSize, Color? iconColor, String? toastId, | 带图标的Toast |
13+
| showLoading | | required BuildContext context, String? text, Duration duration, bool? preventTap, Widget? customWidget, Color? backgroundColor, TextStyle? textStyle, double? iconSize, Color? iconColor, String? toastId, | 带文案的加载Toast |
14+
| showLoadingWithoutText | | required BuildContext context, Duration duration, bool? preventTap, Color? backgroundColor, double? iconSize, Color? iconColor, String? toastId, | 不带文案的加载Toast |
15+
| showSuccess | | required String? text, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, Color? backgroundColor, int? maxLines, TextStyle? textStyle, double? iconSize, Color? iconColor, String? toastId, | 成功提示Toast |
16+
| showText | | required String? text, required BuildContext context, Duration duration, int? maxLines, BoxConstraints? constraints, bool? preventTap, Widget? customWidget, Color? backgroundColor, TextStyle? textStyle, String? toastId, | 普通文本Toast |
17+
| showWarning | | required String? text, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, Color? backgroundColor, int? maxLines, TextStyle? textStyle, double? iconSize, Color? iconColor, String? toastId, | 警告Toast |

tdesign-component/example/assets/api/upload_api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
| onClick | TDUploadClickEvent? | - | 监听点击图片位 |
1818
| onError | TDUploadErrorEvent? | - | 监听获取资源错误 |
1919
| onMaxLimitReached | VoidCallback? | - | 监听文件超过最大数量 |
20+
| onUploadTap | VoidCallback? | - | 自定义upload按钮事件 |
2021
| onValidate | TDUploadValidatorEvent? | - | 监听文件校验出错 |
2122
| sizeLimit | double? | - | 图片大小限制,单位为KB |
2223
| type | TDUploadBoxType | TDUploadBoxType.roundedSquare | Box类型 |
2324
| width | double? | 80.0 | 图片宽度 |
24-
| wrapAlignment | WrapAlignment? | - | 多图对其方式 |
25+
| wrapAlignment | WrapAlignment? | - | 多图对齐方式 |
2526
| wrapRunSpacing | double? | - | 多图布局时的 runSpacing |
2627
| wrapSpacing | double? | - | 多图布局时的 spacing |

tdesign-component/example/assets/code/action_sheet._buildBadgeGridActionSheet.txt

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,30 @@ Widget _buildBadgeGridActionSheet(BuildContext context) {
88
size: TDButtonSize.large,
99
onTap: () {
1010
TDActionSheet.showGridActionSheet(context, items: [
11-
TDActionSheetItem(label: '微信', icon: Image.asset('assets/img/td_action_sheet_1.png'), badge: const TDBadge(TDBadgeType.message, count: 'NEW')),
12-
TDActionSheetItem(label: '朋友圈', icon: Image.asset('assets/img/td_action_sheet_2.png')),
13-
TDActionSheetItem(label: 'QQ', icon: Image.asset('assets/img/td_action_sheet_3.png')),
14-
TDActionSheetItem(label: '企业微信', icon: Image.asset('assets/img/td_action_sheet_4.png')),
15-
TDActionSheetItem(label: '收藏', icon: const IconWithBackground(icon: TDIcons.star), badge: const TDBadge(TDBadgeType.redPoint)),
16-
TDActionSheetItem(label: '刷新', icon: const IconWithBackground(icon: TDIcons.refresh)),
17-
TDActionSheetItem(label: '下载', icon: const IconWithBackground(icon: TDIcons.download), badge: const TDBadge(TDBadgeType.message, count: '8')),
18-
TDActionSheetItem(label: '复制', icon: const IconWithBackground(icon: TDIcons.queue)),
11+
TDActionSheetItem(
12+
label: '微信',
13+
icon: Image.asset('assets/img/td_action_sheet_1.png'),
14+
badge: const TDBadge(TDBadgeType.message, count: 'NEW')),
15+
TDActionSheetItem(
16+
label: '朋友圈',
17+
icon: Image.asset('assets/img/td_action_sheet_2.png')),
18+
TDActionSheetItem(
19+
label: 'QQ', icon: Image.asset('assets/img/td_action_sheet_3.png')),
20+
TDActionSheetItem(
21+
label: '企业微信',
22+
icon: Image.asset('assets/img/td_action_sheet_4.png')),
23+
TDActionSheetItem(
24+
label: '收藏',
25+
icon: const IconWithBackground(icon: TDIcons.star),
26+
badge: const TDBadge(TDBadgeType.redPoint)),
27+
TDActionSheetItem(
28+
label: '刷新', icon: const IconWithBackground(icon: TDIcons.refresh)),
29+
TDActionSheetItem(
30+
label: '下载',
31+
icon: const IconWithBackground(icon: TDIcons.download),
32+
badge: const TDBadge(TDBadgeType.message, count: '8')),
33+
TDActionSheetItem(
34+
label: '复制', icon: const IconWithBackground(icon: TDIcons.queue)),
1935
]);
2036
},
2137
);

tdesign-component/example/assets/code/action_sheet._buildBadgeListCenterActionSheet.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,17 @@ Widget _buildBadgeListCenterActionSheet(BuildContext context) {
1818
),
1919
TDActionSheetItem(
2020
label: '选项二',
21-
badge: const TDBadge(TDBadgeType.message, count: '8',),
21+
badge: const TDBadge(
22+
TDBadgeType.message,
23+
count: '8',
24+
),
2225
),
2326
TDActionSheetItem(
2427
label: '选项三',
25-
badge: const TDBadge(TDBadgeType.message, count: '99',),
28+
badge: const TDBadge(
29+
TDBadgeType.message,
30+
count: '99',
31+
),
2632
),
2733
],
2834
);

tdesign-component/example/assets/code/action_sheet._buildScrollGridActionSheet.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ Widget _buildScrollGridActionSheet(BuildContext context) {
3232
icon: const IconWithBackground(icon: TDIcons.logo_github),
3333
),
3434
TDActionSheetItem(
35-
label: 'Github',
36-
icon: const IconWithBackground(icon: TDIcons.logo_github),
35+
label: 'Twitter',
36+
icon: const IconWithBackground(icon: TDIcons.logo_twitter),
3737
),
3838
],
3939
);

0 commit comments

Comments
 (0)