Skip to content

Commit 489cf1e

Browse files
committed
Merge remote-tracking branch 'upstream/rhino-bird' into feature/td_progress
merge最新分支
2 parents 63e7ec8 + f53c9a6 commit 489cf1e

112 files changed

Lines changed: 6414 additions & 2929 deletions

File tree

Some content is hidden

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

tdesign-component/demo_tool/all_build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
# 输入
3535
# calendar
36+
./bin/demo_tool generate --folder ../lib/src/components/calendar --name TDCalendar,TDCalendarPopup,TDCalendarStyle --folder-name calendar --output ../example/assets/api/ --only-api
3637
# cascader
3738
./bin/demo_tool generate --folder ../lib/src/components/cascader --name TDMultiCascader --folder-name cascader --output ../example/assets/api/ --only-api
3839

@@ -70,8 +71,8 @@
7071
./bin/demo_tool generate --file ../lib/src/components/badge/td_badge.dart --name TDBadge --folder-name badge --output ../example/assets/api/ --only-api
7172
# cell
7273
./bin/demo_tool generate --folder ../lib/src/components/cell --name TDCell,TDCellGroup,TDCellStyle --folder-name cell --output ../example/assets/api/ --only-api --get-comments
73-
# countDown
74-
./bin/demo_tool generate --folder ../lib/src/components/count_down --name TDCountDown,TDCountDownController,TDCountDownStyle --folder-name count-down --output ../example/assets/api/ --only-api --get-comments
74+
# timeCounter
75+
./bin/demo_tool generate --folder ../lib/src/components/time_counter --name TDTimeCounter,TDTimeCounterController,TDTimeCounterStyle --folder-name time-counter --output ../example/assets/api/ --only-api --get-comments
7576
# collapse
7677
./bin/demo_tool generate --folder ../lib/src/components/collapse --name TDCollapse --folder-name collapse --output ../example/assets/api/ --only-api --get-comments
7778

@@ -104,6 +105,7 @@
104105
./bin/demo_tool generate --file ../lib/src/components/loading/td_loading.dart --name TDLoading --folder-name loading --output ../example/assets/api/ --only-api
105106
# message
106107
# noticeBar
108+
./bin/demo_tool generate --file ../lib/src/components/notice_bar --name TDNoticeBar,TDNoticeBarStyle --folder-name notice-bar --output ../example/assets/api/ --only-api --get-comments
107109
# overlay
108110
# popup
109111
./bin/demo_tool generate --folder ../lib/src/components/popup --name TDSlidePopupRoute,TDPopupBottomDisplayPanel,TDPopupBottomConfirmPanel,TDPopupCenterPanel --folder-name popup --output ../example/assets/api/ --only-api --get-comments
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
## API
2+
### TDCalendarStyle
3+
#### 默认构造方法
4+
5+
| 参数 | 类型 | 默认值 | 说明 |
6+
| --- | --- | --- | --- |
7+
| decoration | | - | |
8+
| titleStyle | TextStyle? | - | header区域 [TDCalendar.title]的样式 |
9+
| titleMaxLine | int? | - | header区域 [TDCalendar.title]的行数 |
10+
| titleCloseColor | Color? | - | header区域 关闭图标的颜色 |
11+
| weekdayStyle | TextStyle? | - | header区域 周 文字样式 |
12+
| monthTitleStyle | TextStyle? | - | body区域 年月文字样式 |
13+
| cellStyle | TextStyle? | - | 日期样式 |
14+
| centreColor | Color? | - | 日期范围内背景样式 |
15+
| cellDecoration | BoxDecoration? | - | 日期decoration |
16+
| cellPrefixStyle | TextStyle? | - | 日期前面的字符串的样式 |
17+
| cellSuffixStyle | TextStyle? | - | 日期后面的字符串的样式 |
18+
19+
20+
#### 工厂构造方法
21+
22+
| 名称 | 说明 |
23+
| --- | --- |
24+
| TDCalendarStyle.generateStyle | 生成默认样式 |
25+
| TDCalendarStyle.cellStyle | 日期样式 |
26+
27+
```
28+
```
29+
### TDCalendar
30+
#### 默认构造方法
31+
32+
| 参数 | 类型 | 默认值 | 说明 |
33+
| --- | --- | --- | --- |
34+
| key | | - | |
35+
| firstDayOfWeek | int? | 0 | 第一天从星期几开始,默认 0 = 周日 |
36+
| format | CalendarFormat? | - | 用于格式化日期的函数,可定义日期前后的显示内容和日期样式 |
37+
| maxDate | int? | - | 最大可选的日期(fromMillisecondsSinceEpoch),不传则默认半年后 |
38+
| minDate | int? | - | 最小可选的日期(fromMillisecondsSinceEpoch),不传则默认今天 |
39+
| title | String? | - | 标题 |
40+
| titleWidget | Widget? | - | 标题组件 |
41+
| type | CalendarType? | CalendarType.single | 日历的选择类型,single = 单选;multiple = 多选; range = 区间选择 |
42+
| value | List<int>? | - | 当前选择的日期(fromMillisecondsSinceEpoch),不传则默认今天,当 type = single 时数组长度为1 |
43+
| displayFormat | String? | 'year month' | 年月显示格式,`year`表示年,`month`表示月,如`year month`表示年在前、月在后、中间隔一个空格 |
44+
| cellHeight | double? | 60 | 日期高度 |
45+
| height | double? | - | 高度 |
46+
| width | double? | - | 宽度 |
47+
| style | TDCalendarStyle? | - | 自定义样式 |
48+
| onChange | void Function(List<int> value)? | - | 选中值变化时触发 |
49+
| onCellClick | void Function(int value, DateSelectType type, TDate tdate)? | - | 点击日期时触发 |
50+
| onCellLongPress | void Function(int value, DateSelectType type, TDate tdate)? | - | 长安日期时触发 |
51+
| onHeanderClick | void Function(int index, String week)? | - | 点击周时触发 |
52+
53+
```
54+
```
55+
### TDCalendarPopup
56+
#### 默认构造方法
57+
58+
| 参数 | 类型 | 默认值 | 说明 |
59+
| --- | --- | --- | --- |
60+
| context | BuildContext | context | 上下文 |
61+
| top | double? | - | 距离顶部的距离 |
62+
| autoClose | bool? | true | 自动关闭;在点击关闭按钮、确认按钮、遮罩层时自动关闭 |
63+
| confirmBtn | Widget? | - | 自定义确认按钮 |
64+
| visible | bool? | - | 默认是否显示日历 |
65+
| onClose | VoidCallback? | - | 关闭时触发 |
66+
| onConfirm | void Function(List<int> value)? | - | 点击确认按钮时触发 |
67+
| builder | CalendarBuilder? | - | 控件构建器,优先级高于[child] |
68+
| child | TDCalendar? | - | 日历控件 |

tdesign-component/example/assets/api/dropdown-menu_api.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,26 @@
1515
| showOverlay | bool? | true | 是否显示遮罩层 |
1616
| isScrollable | bool | false | 是否开启滚动列表 |
1717
| arrowIcon | IconData? | - | 自定义箭头图标 |
18+
| labelBuilder | LabelBuilder? | - | 自定义标签内容 |
1819
| onMenuOpened | ValueChanged<int>? | - | 展开菜单事件 |
1920
| onMenuClosed | ValueChanged<int>? | - | 关闭菜单事件 |
21+
| width | double? | - | menu的宽度 |
22+
| height | double? | 48 | menu的高度 |
23+
| tabBarAlign | MainAxisAlignment? | MainAxisAlignment.center | [TDDropdownItem.label][arrowIcon]/[TDDropdownItem.arrowIcon]的对齐方式 |
2024

2125
```
2226
```
2327
### TDDropdownItem
2428
#### 简介
25-
下拉菜单
29+
下拉菜单内容
2630
#### 默认构造方法
2731

2832
| 参数 | 类型 | 默认值 | 说明 |
2933
| --- | --- | --- | --- |
3034
| key | | - | |
3135
| disabled | bool? | false | 是否禁用 |
3236
| label | String? | - | 标题 |
37+
| arrowIcon | IconData? | - | 自定义箭头图标 |
3338
| multiple | bool? | false | 是否多选 |
3439
| options | List<TDDropdownItemOption>? | const [] | 选项数据 |
3540
| builder | TDDropdownItemContentBuilder? | - | 完全自定义展示内容 |
@@ -39,6 +44,8 @@
3944
| onReset | VoidCallback? | - | 点击重置时触发 |
4045
| minHeight | double? | - | 内容最小高度 |
4146
| maxHeight | double? | - | 内容最大高度 |
47+
| tabBarWidth | double? | - | 该item在menu上的宽度,仅在[TDDropdownMenu.isScrollable]为true时有效 |
48+
| tabBarAlign | MainAxisAlignment? | - | [label][arrowIcon]/[TDDropdownMenu.arrowIcon]的对齐方式 |
4249

4350
```
4451
```
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## API
2+
### TDNoticeBar
3+
#### 默认构造方法
4+
5+
| 参数 | 类型 | 默认值 | 说明 |
6+
| --- | --- | --- | --- |
7+
| key | | - | |
8+
| context | dynamic | - | 文本内容 |
9+
| style | TDNoticeBarStyle? | - | 公告栏样式 |
10+
| left | Widget? | - | 左侧内容(自定义左侧内容,优先级高于prefixIcon) |
11+
| right | Widget? | - | 侧内容(自定义右侧内容,优先级高于suffixIcon) |
12+
| marquee | bool? | false | 跑马灯效果 |
13+
| speed | double? | 50 | 滚动速度 |
14+
| interval | int? | 3000 | 步进滚动间隔时间(毫秒) |
15+
| direction | Axis? | Axis.horizontal | 滚动方向 |
16+
| theme | TDNoticeBarThemez? | TDNoticeBarThemez.info | 主题 |
17+
| prefixIcon | IconData? | - | 左侧图标 |
18+
| suffixIcon | IconData? | - | 右侧图标 |
19+
| onTap | ValueChanged<dynamic>? | - | 点击事件 |
20+
21+
```
22+
```
23+
### TDNoticeBarStyle
24+
#### 默认构造方法
25+
26+
| 参数 | 类型 | 默认值 | 说明 |
27+
| --- | --- | --- | --- |
28+
| context | BuildContext? | - | 上下文 |
29+
| backgroundColor | Color? | - | 公告栏的背景色 |
30+
| leftIconColor | Color? | - | 公告栏左侧图标的颜色 |
31+
| rightIconColor | Color? | - | 公告栏右侧图标的颜色 |
32+
| padding | EdgeInsetsGeometry? | EdgeInsets.only(top: 13, bottom: 13, left: 16, right: 12) | 公告栏的内边距 |
33+
| textStyle | TextStyle? | TextStyle(color: TDTheme.of(context).fontGyColor1, fontSize: 16, height: 1) | 公告栏内容的文本样式 |
34+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## API
2+
### TDResult
3+
#### 默认构造方法
4+
5+
| 参数 | 类型 | 默认值 | 说明 |
6+
| --- | --- | --- | --- |
7+
| description | String? | - | 描述文本,用于提供额外信息 |
8+
| icon | Widget? | - | 图标组件,用于在结果中显示一个图标 |
9+
| titleStyle | TextStyle? | - | 自定义字体样式,用于设置标题文本的样式 |
10+
| theme | TDResultTheme | - | 主题样式,定义了结果组件的视觉风格 |
11+
| title | String | - | 标题文本,显示结果的主要信息 |

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

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@
22
### TDSearchBar
33
#### 默认构造方法
44

5-
| 参数 | 类型 | 默认值 | 说明 |
6-
| --- | --- | --- | --- |
7-
| key | | - | |
8-
| placeHolder | String? | - | 预设文案 |
9-
| style | TDSearchStyle? | TDSearchStyle.square | 样式 |
10-
| alignment | TDSearchAlignment? | TDSearchAlignment.left | 对齐方式,居中或这头部对齐 |
11-
| onTextChanged | TDSearchBarEvent? | - | 文字改变回调 |
12-
| onSubmitted | TDSearchBarEvent? | - | 提交回调 |
13-
| onEditComplete | TDSearchBarCallBack? | - | 编辑完成回调 |
14-
| autoHeight | bool | false | 是否自动计算高度 |
15-
| padding | EdgeInsets | const EdgeInsets.fromLTRB(16, 8, 16, 8) | 内部填充 |
16-
| autoFocus | bool | false | 是否自动获取焦点 |
17-
| mediumStyle | bool | false | 是否在导航栏中的样式 |
18-
| needCancel | bool | false | 是否需要取消按钮 |
19-
| controller | TextEditingController? | - | 控制器 |
20-
| backgroundColor | Color? | Colors.white | 背景颜色 |
5+
| 参数 | 类型 | 默认值 | 说明 |
6+
|-----------------|------------------------|-----------------------------------------|---------------|
7+
| key | | - | |
8+
| placeHolder | String? | - | 预设文案 |
9+
| style | TDSearchStyle? | TDSearchStyle.square | 样式 |
10+
| alignment | TDSearchAlignment? | TDSearchAlignment.left | 对齐方式,居中或这头部对齐 |
11+
| onTextChanged | TDSearchBarEvent? | - | 文字改变回调 |
12+
| onSubmitted | TDSearchBarEvent? | - | 提交回调 |
13+
| onEditComplete | TDSearchBarCallBack? | - | 编辑完成回调 |
14+
| autoHeight | bool | false | 是否自动计算高度 |
15+
| padding | EdgeInsets | const EdgeInsets.fromLTRB(16, 8, 16, 8) | 内部填充 |
16+
| autoFocus | bool | false | 是否自动获取焦点 |
17+
| mediumStyle | bool | false | 是否在导航栏中的样式 |
18+
| needCancel | bool | false | 是否需要取消按钮 |
19+
| action | String | ‘’ | 右侧操作按钮文字 |
20+
| onActionClick | TDSearchBarEvent? | - | 右侧操作按钮点击回调 |
21+
| controller | TextEditingController? | - | 控制器 |
22+
| backgroundColor | Color? | Colors.white | 背景颜色 |

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
## API
2+
23
### TDStepsItemData
34
#### 默认构造方法
45

@@ -24,4 +25,4 @@
2425
| status | TDStepsStatus | TDStepsStatus.success | 步骤条状态 |
2526
| simple | bool | false | 步骤条simple模式 |
2627
| readOnly | bool | false | 步骤条readOnly模式 |
27-
| verticalSelect | bool | false | 步骤条垂直自定义步骤条选择模式 |
28+
| verticalSelect | bool | false | 步骤条垂直自定义步骤条选择模式 |

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
| trackOffColor | Color? | - | 关闭时轨道颜色 |
1414
| thumbContentOnColor | Color? | - | 开启时ThumbView的颜色 |
1515
| thumbContentOffColor | Color? | - | 关闭时ThumbView的颜色 |
16+
| thumbContentOnFont | TextStyle? | - | 开启时ThumbView的字体样式 |
17+
| thumbContentOffFont | TextStyle? | - | 关闭时ThumbView的字体样式 |
1618
| onChanged | OnSwitchChanged? | - | 改变事件 |
1719
| openText | String? | - | 打开文案 |
1820
| closeText | String? | - | 关闭文案 |

tdesign-component/example/assets/api/count-down_api.md renamed to tdesign-component/example/assets/api/time-counter_api.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## API
2-
### TDCountDown
2+
### TDTimeCounter
33
#### 简介
44
倒计时组件
55
#### 默认构造方法
@@ -9,20 +9,21 @@
99
| key | | - | |
1010
| autoStart | bool | true | 是否自动开始倒计时 |
1111
| content | dynamic | 'default' | 'default' / Widget Function(int time) / Widget |
12-
| format | String | 'HH:mm:ss' | 时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒 |
12+
| format | String | 'HH:mm:ss' | 时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒(分隔符必须为长度为1的非空格的字符) |
1313
| millisecond | bool | false | 是否开启毫秒级渲染 |
14-
| size | TDCountDownSize | TDCountDownSize.medium | 倒计时尺寸 |
14+
| size | TDTimeCounterSize | TDTimeCounterSize.medium | 倒计时尺寸 |
1515
| splitWithUnit | bool | false | 使用时间单位分割 |
16-
| theme | TDCountDownTheme | TDCountDownTheme.defaultTheme | 倒计时风格 |
16+
| theme | TDTimeCounterTheme | TDTimeCounterTheme.defaultTheme | 倒计时风格 |
1717
| time | int | - | 必需;倒计时时长,单位毫秒 |
18-
| style | TDCountDownStyle? | - | 自定义样式,有则优先用它,没有则根据size和theme选取 |
18+
| style | TDTimeCounterStyle? | - | 自定义样式,有则优先用它,没有则根据size和theme选取 |
1919
| onChange | Function(int time)? | - | 时间变化时触发回调 |
2020
| onFinish | VoidCallback? | - | 倒计时结束时触发回调 |
21-
| controller | TDCountDownController? | - | 控制器,可控制开始/暂停/继续/重置 |
21+
| direction | TDTimeCounterDirection | TDTimeCounterDirection.down | 计时方向,默认倒计时 |
22+
| controller | TDTimeCounterController? | - | 控制器,可控制开始/暂停/继续/重置 |
2223

2324
```
2425
```
25-
### TDCountDownStyle
26+
### TDTimeCounterStyle
2627
#### 简介
2728
倒计时组件样式
2829
#### 默认构造方法
@@ -50,10 +51,10 @@
5051

5152
| 名称 | 说明 |
5253
| --- | --- |
53-
| TDCountDownStyle.generateStyle | 生成默认样式 |
54+
| TDTimeCounterStyle.generateStyle | 生成默认样式 |
5455

5556
```
5657
```
57-
### TDCountDownController
58+
### TDTimeCounterController
5859
#### 简介
5960
倒计时组件控制器,可控制开始(`start()`)/暂停(`pause()`)/继续(`resume()`)/重置(`reset([int? time])`)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const TDImage(
2+
imgUrl: 'error',
3+
errorWidget: TDText(
4+
'加载失败',
5+
forceVerticalCenter: true,
6+
font: TDTheme.of(context).fontBodyExtraSmall,
7+
fontWeight: FontWeight.w500,
8+
textColor: TDTheme.of(context).fontGyColor3,
9+
),
10+
type: TDImageType.roundedSquare,
11+
)

0 commit comments

Comments
 (0)