Skip to content

Commit 9612640

Browse files
authored
Merge pull request #518 from Tencent/release/0.1.9
Release/0.1.9
2 parents dd30c37 + 72ce1b4 commit 9612640

File tree

93 files changed

+8702
-2913
lines changed

Some content is hidden

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

93 files changed

+8702
-2913
lines changed

tdesign-component/demo_tool/all_build.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,20 @@
8282
# empty
8383
./bin/api_tool_linux generate --file ../lib/src/components/empty/td_empty.dart --name TDEmpty --folder-name empty --output ../example/assets/api/ --only-api
8484
# footer
85+
./bin/api_tool_linux generate --file ../lib/src/components/footer/td_footer.dart --name TDFooter,TDFooterType --folder-name footer --output ../example/assets/api/ --only-api
86+
8587
# grid
8688
# image
8789
./bin/api_tool_linux generate --file ../lib/src/components/image/td_image.dart --name TDImage --folder-name image --output ../example/assets/api/ --only-api
8890
# imageViewer
8991
./bin/api_tool_linux generate --folder ../lib/src/components/image_viewer --name TDImageViewer,TDImageViewerWidget, --folder-name image-viewer --output ../example/assets/api/ --only-api
9092
# progress
91-
./bin/demo_tool generate --file ../lib/src/components/image/td_progress.dart --name TDProgress --folder-name progress --output ../example/assets/api/ --only-api
93+
./bin/api_tool_linux generate --file ../lib/src/components/progress/td_progress.dart --name TDProgress --folder-name progress --output ../example/assets/api/ --only-api
9294
# result
95+
./bin/api_tool_linux generate --file ../lib/src/components/result/td_result.dart --name TDResult --folder-name result --output ../example/assets/api/ --only-api
9396
# skeleton
97+
./bin/api_tool_linux generate --folder ../lib/src/components/skeleton --name TDSkeleton,TDSkeletonRowColStyle,TDSkeletonRowCol,TDSkeletonRowColObjStyle,TDSkeletonRowColObj --folder-name skeleton --output ../example/assets/api/ --only-api
98+
9499
# sticky
95100
# swiper
96101
./bin/api_tool_linux generate --folder ../lib/src/components/swiper --name TDSwiperPagination,TDPageTransformer --folder-name swiper --output ../example/assets/api/ --only-api --get-comments
@@ -111,6 +116,7 @@
111116
# loading
112117
./bin/api_tool_linux generate --file ../lib/src/components/loading/td_loading.dart --name TDLoading --folder-name loading --output ../example/assets/api/ --only-api
113118
# message
119+
./bin/api_tool_linux generate --file ../lib/src/components/message/td_message.dart --name TDMessage,MessageTheme,MessageMarquee,MessageLink --folder-name message --output ../example/assets/api/ --only-api
114120
# noticeBar
115121
./bin/api_tool_linux generate --folder ../lib/src/components/notice_bar --name TDNoticeBar,TDNoticeBarStyle --folder-name notice-bar --output ../example/assets/api/ --only-api --get-comments
116122
# overlay
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
## API
2-
### TDButton
2+
### TDButtonStyle
3+
#### 默认构造方法
4+
5+
| 参数 | 类型 | 默认值 | 说明 |
6+
| --- | --- | --- | --- |
7+
| backgroundColor | Color? | - | 背景颜色 |
8+
| frameColor | Color? | - | 边框颜色 |
9+
| textColor | Color? | - | 文字颜色 |
10+
| frameWidth | double? | - | 边框宽度 |
11+
| radius | BorderRadiusGeometry? | - | 自定义圆角 |
12+
13+
14+
#### 工厂构造方法
15+
16+
| 名称 | 说明 |
17+
| --- | --- |
18+
| TDButtonStyle.generateFillStyleByTheme | 生成不同主题的填充按钮样式 |
19+
| TDButtonStyle.generateOutlineStyleByTheme | 生成不同主题的描边按钮样式 |
20+
| TDButtonStyle.generateTextStyleByTheme | 生成不同主题的文本按钮样式 |
21+
| TDButtonStyle.generateGhostStyleByTheme | 生成不同主题的幽灵按钮样式 |
22+
23+
```
24+
```
25+
### TDButton
326
#### 默认构造方法
427

528
| 参数 | 类型 | 默认值 | 说明 |
@@ -28,26 +51,3 @@
2851
| margin | EdgeInsetsGeometry? | - | 自定义margin |
2952
| padding | EdgeInsetsGeometry? | - | 自定义padding |
3053
| iconPosition | TDButtonIconPosition? | TDButtonIconPosition.left | 图标位置 |
31-
32-
```
33-
```
34-
### TDButtonStyle
35-
#### 默认构造方法
36-
37-
| 参数 | 类型 | 默认值 | 说明 |
38-
| --- | --- | --- | --- |
39-
| backgroundColor | Color? | - | 背景颜色 |
40-
| frameColor | Color? | - | 边框颜色 |
41-
| textColor | Color? | - | 文字颜色 |
42-
| frameWidth | double? | - | 边框宽度 |
43-
| radius | BorderRadiusGeometry? | - | 自定义圆角 |
44-
45-
46-
#### 工厂构造方法
47-
48-
| 名称 | 说明 |
49-
| --- | --- |
50-
| TDButtonStyle.generateFillStyleByTheme | 生成不同主题的填充按钮样式 |
51-
| TDButtonStyle.generateOutlineStyleByTheme | 生成不同主题的描边按钮样式 |
52-
| TDButtonStyle.generateTextStyleByTheme | 生成不同主题的文本按钮样式 |
53-
| TDButtonStyle.generateGhostStyleByTheme | 生成不同主题的幽灵按钮样式 |
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
## API
2+
### TDCalendar
3+
#### 默认构造方法
4+
5+
| 参数 | 类型 | 默认值 | 说明 |
6+
| --- | --- | --- | --- |
7+
| key | | - | |
8+
| firstDayOfWeek | int? | 0 | 第一天从星期几开始,默认 0 = 周日 |
9+
| format | CalendarFormat? | - | 用于格式化日期的函数,可定义日期前后的显示内容和日期样式 |
10+
| maxDate | int? | - | 最大可选的日期(fromMillisecondsSinceEpoch),不传则默认半年后 |
11+
| minDate | int? | - | 最小可选的日期(fromMillisecondsSinceEpoch),不传则默认今天 |
12+
| title | String? | - | 标题 |
13+
| titleWidget | Widget? | - | 标题组件 |
14+
| type | CalendarType? | CalendarType.single | 日历的选择类型,single = 单选;multiple = 多选; range = 区间选择 |
15+
| value | List<int>? | - | 当前选择的日期(fromMillisecondsSinceEpoch),不传则默认今天,当 type = single 时数组长度为1 |
16+
| displayFormat | String? | 'year month' | 年月显示格式,`year`表示年,`month`表示月,如`year month`表示年在前、月在后、中间隔一个空格 |
17+
| cellHeight | double? | 60 | 日期高度 |
18+
| height | double? | - | 高度 |
19+
| width | double? | - | 宽度 |
20+
| style | TDCalendarStyle? | - | 自定义样式 |
21+
| onChange | void Function(List<int> value)? | - | 选中值变化时触发 |
22+
| onCellClick | void Function(int value, DateSelectType type, TDate tdate)? | - | 点击日期时触发 |
23+
| onCellLongPress | void Function(int value, DateSelectType type, TDate tdate)? | - | 长安日期时触发 |
24+
| onHeaderClick | void Function(int index, String week)? | - | 点击周时触发 |
25+
| useTimePicker | bool? | false | 是否显示时间选择器 |
26+
| timePickerModel | List<DatePickerModel>? | - | 自定义时间选择器 |
27+
| monthTitleHeight | double? | 22 | 月标题高度 |
28+
| monthTitleBuilder | Widget Function(BuildContext context, DateTime monthDate)? | - | 月标题构建器 |
29+
| pickerHeight | double? | 178 | 时间选择器List的视窗高度 |
30+
| pickerItemCount | int? | 3 | 选择器List视窗中item个数,pickerHeight / pickerItemCount即item高度 |
31+
| isTimeUnit | bool? | true | 是否显示时间单位 |
32+
| animateTo | bool? | false | 动画滚动到指定位置 |
33+
34+
```
35+
```
36+
### TDCalendarPopup
37+
#### 默认构造方法
38+
39+
| 参数 | 类型 | 默认值 | 说明 |
40+
| --- | --- | --- | --- |
41+
| context | BuildContext | context | 上下文 |
42+
| top | double? | - | 距离顶部的距离 |
43+
| autoClose | bool? | true | 自动关闭;在点击关闭按钮、确认按钮、遮罩层时自动关闭 |
44+
| confirmBtn | Widget? | - | 自定义确认按钮 |
45+
| visible | bool? | - | 默认是否显示日历 |
46+
| onClose | VoidCallback? | - | 关闭时触发 |
47+
| onConfirm | void Function(List<int> value)? | - | 点击确认按钮时触发 |
48+
| builder | CalendarBuilder? | - | 控件构建器,优先级高于[child] |
49+
| child | TDCalendar? | - | 日历控件 |
50+
51+
```
52+
```
53+
### TDCalendarStyle
54+
#### 默认构造方法
55+
56+
| 参数 | 类型 | 默认值 | 说明 |
57+
| --- | --- | --- | --- |
58+
| decoration | | - | |
59+
| titleStyle | TextStyle? | - | header区域 [TDCalendar.title]的样式 |
60+
| titleMaxLine | int? | - | header区域 [TDCalendar.title]的行数 |
61+
| titleCloseColor | Color? | - | header区域 关闭图标的颜色 |
62+
| weekdayStyle | TextStyle? | - | header区域 周 文字样式 |
63+
| monthTitleStyle | TextStyle? | - | body区域 年月文字样式 |
64+
| cellStyle | TextStyle? | - | 日期样式 |
65+
| centreColor | Color? | - | 日期范围内背景样式 |
66+
| cellDecoration | BoxDecoration? | - | 日期decoration |
67+
| cellPrefixStyle | TextStyle? | - | 日期前面的字符串的样式 |
68+
| cellSuffixStyle | TextStyle? | - | 日期后面的字符串的样式 |
69+
70+
71+
#### 工厂构造方法
72+
73+
| 名称 | 说明 |
74+
| --- | --- |
75+
| TDCalendarStyle.generateStyle | 生成默认样式 |
76+
| TDCalendarStyle.cellStyle | 日期样式 |
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
## API
2+
### TDCellGroup
3+
#### 简介
4+
单元格组组件
5+
#### 默认构造方法
6+
7+
| 参数 | 类型 | 默认值 | 说明 |
8+
| --- | --- | --- | --- |
9+
| key | | - | |
10+
| bordered | bool? | false | 是否显示组边框 |
11+
| theme | TDCellGroupTheme? | TDCellGroupTheme.defaultTheme | 单元格组风格。可选项:default/card |
12+
| title | String? | - | 单元格组标题 |
13+
| cells | List<TDCell> | - | 单元格列表 |
14+
| builder | CellBuilder? | - | cell构建器,可自定义cell父组件,如Dismissible |
15+
| style | TDCellStyle? | - | 自定义样式 |
16+
| titleWidget | Widget? | - | 单元格组标题组件 |
17+
| scrollable | bool? | false | 可滚动 |
18+
| isShowLastBordered | bool? | false | 是否显示最后一个cell的下边框 |
19+
20+
```
21+
```
22+
### TDCellStyle
23+
#### 简介
24+
单元格组件样式
25+
#### 默认构造方法
26+
27+
| 参数 | 类型 | 默认值 | 说明 |
28+
| --- | --- | --- | --- |
29+
| context | BuildContext? | - | 传递context,会生成默认样式 |
30+
| leftIconColor | Color? | - | 左侧图标颜色 |
31+
| rightIconColor | Color? | - | 右侧图标颜色 |
32+
| titleStyle | TextStyle? | - | 标题文字样式 |
33+
| requiredStyle | TextStyle? | - | 必填星号文字样式 |
34+
| descriptionStyle | TextStyle? | - | 内容描述文字样式 |
35+
| noteStyle | TextStyle? | - | 说明文字样式 |
36+
| arrowColor | Color? | - | 箭头颜色 |
37+
| borderedColor | Color? | - | 单元格边框颜色 |
38+
| groupBorderedColor | Color? | - | 单元格组边框颜色 |
39+
| backgroundColor | Color? | - | 默认状态背景颜色 |
40+
| clickBackgroundColor | Color? | - | 点击状态背景颜色 |
41+
| groupTitleStyle | TextStyle? | - | 单元组标题文字样式 |
42+
| padding | EdgeInsets? | - | 单元格内边距 |
43+
| cardBorderRadius | BorderRadius? | - | 卡片模式边框圆角 |
44+
| cardPadding | EdgeInsets? | - | 卡片模式内边距 |
45+
| titlePadding | EdgeInsets? | - | 单元格组标题内边距 |
46+
47+
48+
#### 工厂构造方法
49+
50+
| 名称 | 说明 |
51+
| --- | --- |
52+
| TDCellStyle.cellStyle | 生成单元格默认样式 |
53+
54+
```
55+
```
56+
### TDCell
57+
#### 简介
58+
单元格组件
59+
#### 默认构造方法
60+
61+
| 参数 | 类型 | 默认值 | 说明 |
62+
| --- | --- | --- | --- |
63+
| key | | - | |
64+
| align | TDCellAlign? | TDCellAlign.middle | 内容的对齐方式,默认居中对齐。可选项:top/middle/bottom |
65+
| arrow | bool? | false | 是否显示右侧箭头 |
66+
| bordered | bool? | true | 是否显示下边框,仅在TDCellGroup组件下起作用 |
67+
| description | String? | - | 下方内容描述文字 |
68+
| descriptionWidget | Widget? | - | 下方内容描述组件 |
69+
| hover | bool? | true | 是否开启点击反馈 |
70+
| image | ImageProvider? | - | 主图 |
71+
| imageSize | double? | - | 主图尺寸 |
72+
| imageWidget | Widget? | - | 主图组件 |
73+
| leftIcon | IconData? | - | 左侧图标,出现在单元格标题的左侧 |
74+
| leftIconWidget | Widget? | - | 左侧图标组件 |
75+
| note | String? | - | 和标题同行的说明文字 |
76+
| noteWidget | Widget? | - | 说明文字组件 |
77+
| required | bool? | false | 是否显示表单必填星号 |
78+
| title | String? | - | 标题 |
79+
| titleWidget | Widget? | - | 标题组件 |
80+
| onClick | TDCellClick? | - | 点击事件 |
81+
| onLongPress | TDCellClick? | - | 长按事件 |
82+
| style | TDCellStyle? | - | 自定义样式 |
83+
| rightIcon | IconData? | - | 最右侧图标 |
84+
| rightIconWidget | Widget? | - | 最右侧图标组件 |
85+
| disabled | bool? | false | 禁用 |
86+
| imageCircle | double? | 50 | 主图圆角,默认50(圆形) |

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,5 @@
11
## API
2-
### TDCheckboxGroup
3-
#### 默认构造方法
4-
5-
| 参数 | 类型 | 默认值 | 说明 |
6-
| --- | --- | --- | --- |
7-
| child | | - | |
8-
| key | | - | |
9-
| onChangeGroup | OnGroupChange? | - | 状态变化监听器 |
10-
| controller | TDCheckboxGroupController? | - | 可以通过控制器操作勾选状态 |
11-
| checkedIds | List<String>? | - | 勾选的CheckBox id列表 |
12-
| maxChecked | int? | - | 最多可以勾选多少 |
13-
| titleMaxLine | int? | - | CheckBox标题的行数 |
14-
| customContentBuilder | ContentBuilder? | - | CheckBox完全自定义内容 |
15-
| contentDirection | TDContentDirection? | - | 文字相对icon的方位 |
16-
| style | TDCheckboxStyle? | - | CheckBox复选框样式:圆形或方形 |
17-
| spacing | double? | - | CheckBoxicon和文字的距离 |
18-
| customIconBuilder | IconBuilder? | - | 自定义选择icon的样式 |
19-
| onOverloadChecked | VoidCallback? | - | 超过最大可勾选的个数 |
20-
21-
```
22-
```
23-
### TDCheckbox
2+
### TDCheckbox
243
#### 默认构造方法
254

265
| 参数 | 类型 | 默认值 | 说明 |
@@ -51,3 +30,24 @@
5130
| titleColor | Color? | - | 标题文字颜色 |
5231
| subTitleColor | Color? | - | 副标题文字颜色 |
5332
| checkBoxLeftSpace | double? | - | 选项框左侧间距 |
33+
34+
```
35+
```
36+
### TDCheckboxGroup
37+
#### 默认构造方法
38+
39+
| 参数 | 类型 | 默认值 | 说明 |
40+
| --- | --- | --- | --- |
41+
| child | | - | |
42+
| key | | - | |
43+
| onChangeGroup | OnGroupChange? | - | 状态变化监听器 |
44+
| controller | TDCheckboxGroupController? | - | 可以通过控制器操作勾选状态 |
45+
| checkedIds | List<String>? | - | 勾选的CheckBox id列表 |
46+
| maxChecked | int? | - | 最多可以勾选多少 |
47+
| titleMaxLine | int? | - | CheckBox标题的行数 |
48+
| customContentBuilder | ContentBuilder? | - | CheckBox完全自定义内容 |
49+
| contentDirection | TDContentDirection? | - | 文字相对icon的方位 |
50+
| style | TDCheckboxStyle? | - | CheckBox复选框样式:圆形或方形 |
51+
| spacing | double? | - | CheckBoxicon和文字的距离 |
52+
| customIconBuilder | IconBuilder? | - | 自定义选择icon的样式 |
53+
| onOverloadChecked | VoidCallback? | - | 超过最大可勾选的个数 |
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## API
2+
### TDDatePicker
3+
#### 默认构造方法
4+
5+
| 参数 | 类型 | 默认值 | 说明 |
6+
| --- | --- | --- | --- |
7+
| title | String | - | 选择器标题 |
8+
| onConfirm | DatePickerCallback? | - | 选择器确认按钮回调 |
9+
| rightText | String? | - | 右侧按钮文案 |
10+
| leftText | String? | - | 左侧按钮文案 |
11+
| onCancel | DatePickerCallback? | - | 选择器取消按钮回调 |
12+
| backgroundColor | Color? | - | 背景颜色 |
13+
| titleDividerColor | Color? | - | 标题分割线颜色 |
14+
| topRadius | double? | - | 顶部圆角 |
15+
| titleHeight | double? | - | 标题高度 |
16+
| padding | EdgeInsets? | - | 适配padding |
17+
| leftPadding | double? | - | 左边填充 |
18+
| rightPadding | double? | - | 右边填充 |
19+
| leftTextStyle | TextStyle? | - | 自定义左侧文案样式 |
20+
| rightTextStyle | TextStyle? | - | 自定义右侧文案样式 |
21+
| centerTextStyle | TextStyle? | - | 自定义中间文案样式 |
22+
| customSelectWidget | Widget? | - | 自定义选择框样式 |
23+
| itemDistanceCalculator | ItemDistanceCalculator? | - | 根据距离计算字体颜色、透明度、粗细 |
24+
| model | DatePickerModel | - | 数据模型 |
25+
| showTitle | bool | true | 是否展示标题 |
26+
| pickerHeight | double | 200 | 选择器List的视窗高度,默认200 |
27+
| pickerItemCount | int | - | 选择器List视窗中item个数,pickerHeight / pickerItemCount即item高度 |
28+
| isTimeUnit | bool? | - | 是否时间显示 |
29+
| onSelectedItemChanged | void Function(int wheelIndex, int index)? | - | 选择器选中项改变回调 |
30+
| itemBuilder | ItemBuilderType? | - | 自定义item构建 |
31+
| key | | - | |
32+
33+
```
34+
```
35+
### TDPicker
36+
37+
#### 静态方法
38+
39+
| 名称 | 返回类型 | 参数 | 说明 |
40+
| --- | --- | --- | --- |
41+
| showDatePicker | | required null context, required String title, required DatePickerCallback? onConfirm, DatePickerCallback? onCancel, bool useYear, bool useMonth, bool useDay, bool useHour, bool useMinute, bool useSecond, bool useWeekDay, Color? barrierColor, List<int> dateStart, List<int>? dateEnd, List<int>? initialDate, String? rightText, String? leftText, TextStyle? leftTextStyle, TextStyle? centerTextStyle, TextStyle? rightTextStyle, Color? titleDividerColor, Widget? customSelectWidget, Duration duration, double pickerHeight, bool isTimeUnit, Function(int wheelIndex, int index)? onSelectedItemChanged, int pickerItemCount, List<int> Function(DateTypeKey key, List<int> nums)? filterItems, ItemBuilderType? itemBuilder, | 显示时间选择器 |
42+
| showMultiPicker | | required null context, String? title, required MultiPickerCallback? onConfirm, MultiPickerCallback? onCancel, required List<List<String>> data, List<int>? initialIndexes, Duration duration, Color? barrierColor, double pickerHeight, String? rightText, String? leftText, TextStyle? leftTextStyle, TextStyle? centerTextStyle, TextStyle? rightTextStyle, Color? titleDividerColor, double? topPadding, int pickerItemCount, Widget? customSelectWidget, ItemBuilderType? itemBuilder, | 显示多级选择器 |
43+
| showMultiLinkedPicker | | required null context, String? title, required MultiPickerCallback? onConfirm, MultiPickerCallback? onCancel, required Map data, required int columnNum, required List initialData, Duration duration, Color? barrierColor, String? rightText, String? leftText, TextStyle? leftTextStyle, TextStyle? centerTextStyle, TextStyle? rightTextStyle, double pickerHeight, Color? titleDividerColor, Widget? customSelectWidget, double? topPadding, int pickerItemCount, | 显示多级联动选择器 |

0 commit comments

Comments
 (0)