Skip to content

Commit

Permalink
Merge pull request #348 from Tencent/feature/0.1.7
Browse files Browse the repository at this point in the history
Feature/0.1.7
  • Loading branch information
Luozf12345 authored Oct 15, 2024
2 parents 3098e40 + 0cc2e22 commit 1192fe3
Show file tree
Hide file tree
Showing 215 changed files with 5,841 additions and 424 deletions.
1 change: 1 addition & 0 deletions tdesign-component/demo_tool/all_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
# radio
./bin/demo_tool generate --file ../lib/src/components/radio/td_radio.dart --name TDRadioStyle,TDRadio,TDRadioGroup --folder-name radio --output ../example/assets/api/ --only-api --get-comments
# rate
./bin/demo_tool generate --file ../lib/src/components/rate/td_rate.dart --name TDRate --folder-name rate --output ../example/assets/api/ --only-api
# search
./bin/demo_tool generate --file ../lib/src/components/search/td_search_bar.dart --name TDSearchBar --folder-name search --output ../example/assets/api/ --only-api
# slider
Expand Down
1 change: 1 addition & 0 deletions tdesign-component/example/assets/api/button_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
| onTap | TDButtonEvent? | - | 点击事件 |
| icon | IconData? | - | 图标icon |
| iconWidget | Widget? | - | 自定义图标icon控件 |
| iconTextSpacing | double? | - | 自定义图标与文本之间距离 |
| onLongPress | TDButtonEvent? | - | 长按事件 |
| margin | EdgeInsetsGeometry? | - | 自定义margin |
| padding | EdgeInsetsGeometry? | - | 自定义padding |
2 changes: 2 additions & 0 deletions tdesign-component/example/assets/api/calendar_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
| onCellClick | void Function(int value, DateSelectType type, TDate tdate)? | - | 点击日期时触发 |
| onCellLongPress | void Function(int value, DateSelectType type, TDate tdate)? | - | 长安日期时触发 |
| onHeanderClick | void Function(int index, String week)? | - | 点击周时触发 |
| useTimePicker | bool? | false | 是否显示时间选择器 |
| timePickerModel | List<DatePickerModel>? | - | 自定义时间选择器 |

```
```
Expand Down
1 change: 1 addition & 0 deletions tdesign-component/example/assets/api/cascader_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
| backgroundColor | Color? | - | 背景颜色 |
| topRadius | double? | - | 顶部圆角 |
| closeText | String? | - | 关闭按钮文本 |
| isLetterSort | bool | false | 是否开启字母排序 |
| onClose | Function? | - | 选择器关闭按钮回调 |
| onChange | MultiCascaderCallback | - | 值发生变更时触发 |
1 change: 1 addition & 0 deletions tdesign-component/example/assets/api/cell_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
| borderedColor | Color? | - | 单元格边框颜色 |
| groupBorderedColor | Color? | - | 单元格组边框颜色 |
| backgroundColor | Color? | - | 默认状态背景颜色 |
| padding | EdgeInsets? | - | 单元格内边距 |


#### 工厂构造方法
Expand Down
7 changes: 4 additions & 3 deletions tdesign-component/example/assets/api/date-time-picker_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
| showTitle | bool | true | 是否展示标题 |
| pickerHeight | double | 200 | 选择器List的视窗高度,默认200 |
| pickerItemCount | int | - | 选择器List视窗中item个数,pickerHeight / pickerItemCount即item高度 |
| onSelectedItemChanged | void Function(int index)? | - | 选择器选中项改变回调 |
| key | | - | |

```
Expand All @@ -35,6 +36,6 @@

| 名称 | 返回类型 | 参数 | 说明 |
| --- | --- | --- | --- |
| 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, Duration duration, double pickerHeight, int pickerItemCount, | 显示时间选择器 |
| 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, int pickerItemCount, | 显示多级选择器 |
| showMultiLinkedPicker | | required null context, String? title, required MultiPickerCallback? onConfirm, MultiPickerCallback? onCancel, required Map data, required int columnNum, required List initialData, Duration duration, Color? barrierColor, double pickerHeight, int pickerItemCount, | 显示多级联动选择器 |
| 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, Duration duration, double pickerHeight, int pickerItemCount, | 显示时间选择器 |
| 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, | 显示多级选择器 |
| 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, double? topPadding, int pickerItemCount, | 显示多级联动选择器 |
9 changes: 9 additions & 0 deletions tdesign-component/example/assets/api/dialog_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
| leftBtn | TDDialogButtonOptions? | - | 左侧按钮配置 |
| rightBtn | TDDialogButtonOptions? | - | 右侧按钮配置 |
| showCloseButton | bool? | - | 显示右上角关闭按钮 |
| padding | EdgeInsets? | - | 内容内边距 |
| buttonWidget | Widget? | - | 自定义按钮 |

```
```
Expand Down Expand Up @@ -57,6 +59,8 @@
| buttonTextColor | Color? | - | 按钮文字颜色 |
| buttonStyle | TDDialogButtonStyle | TDDialogButtonStyle.normal | 按钮样式 |
| showCloseButton | bool? | - | 右上角关闭按钮 |
| padding | EdgeInsets? | const EdgeInsets.fromLTRB(24, 32, 24, 0) | 内容内边距 |
| buttonWidget | Widget? | - | 自定义按钮 |

```
```
Expand All @@ -79,6 +83,9 @@
| leftBtn | TDDialogButtonOptions? | - | 左侧按钮配置 |
| rightBtn | TDDialogButtonOptions? | - | 右侧按钮配置 |
| showCloseButton | bool? | - | 显示右上角关闭按钮 |
| padding | EdgeInsets? | const EdgeInsets.fromLTRB(24, 32, 24, 0) | 内容内边距 |
| buttonWidget | Widget? | - | 自定义按钮 |
| customInputWidget | Widget? | - | 自定义输入框 |

```
```
Expand All @@ -103,6 +110,8 @@
| rightBtnAction | Function()? | - | 右侧按钮默认点击 |
| showCloseButton | bool? | - | 显示右上角关闭按钮 |
| buttonStyle | | TDDialogButtonStyle.normal | |
| padding | EdgeInsets? | const EdgeInsets.fromLTRB(24, 32, 24, 0) | 内容内边距 |
| buttonWidget | Widget? | - | 自定义按钮 |


#### 工厂构造方法
Expand Down
3 changes: 3 additions & 0 deletions tdesign-component/example/assets/api/drawer_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
| drawerTop | double? | - | 距离顶部的距离 |
| style | TDCellStyle? | - | 列表自定义样式 |
| hover | bool? | true | 是否开启点击反馈 |
| backgroundColor | Color? | - | 组件背景颜色 |
| bordered | bool? | true | 是否显示边框 |
| isShowLastBordered | bool? | true | 是否显示最后一行分割线 |

```
```
Expand Down
1 change: 1 addition & 0 deletions tdesign-component/example/assets/api/dropdown-menu_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
| maxHeight | double? | - | 内容最大高度 |
| tabBarWidth | double? | - | 该item在menu上的宽度,仅在[TDDropdownMenu.isScrollable]为true时有效 |
| tabBarAlign | MainAxisAlignment? | - | [label][arrowIcon]/[TDDropdownMenu.arrowIcon]的对齐方式 |
| tabBarFlex | int? | 1 | 该item在menu上的宽度占比,仅在[TDDropdownMenu.isScrollable]为false时有效 |

```
```
Expand Down
2 changes: 1 addition & 1 deletion tdesign-component/example/assets/api/indexes_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
| indexList | List<String> | - | 索引字符列表。不传默认 A-Z |
| indexListMaxHeight | double | 0.8 | 索引列表最大高度(父容器高度的百分比,默认0.8) |
| activeIndex | ValueNotifier<String> | - | 选中索引 |
| onSelect | void Function(String index, bool isUp) | - | 点击侧边栏时触发事件 |
| onSelect | void Function(String newIndex, String oldIndex) | - | 点击侧边栏时触发事件 |
| builderIndex | Widget Function(BuildContext context, String index, bool isActive)? | - | 索引文本自定义构建,包括索引激活左侧提示 |

```
Expand Down
3 changes: 2 additions & 1 deletion tdesign-component/example/assets/api/input_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
| decoration | Decoration? | - | 输入框样式 |
| leftIcon | Widget? | - | 带图标的输入框 |
| leftLabel | String? | - | 输入框左侧文案 |
| leftLabelStyle | TextStyle? | - | 左侧标签样式 |
| leftLabelStyle | TextStyle? | - | 左侧标签样式 设置该值是若出现像素溢出,请设置letterSpacing: 0 |
| leftLabelSpace | double? | - | 输入框左侧文案间距 |
| required | bool? | - | 是否必填标志(红色*|
| readOnly | bool | false | 是否只读 |
Expand Down Expand Up @@ -53,3 +53,4 @@
| inputAction | TextInputAction? | - | 键盘动作类型 |
| spacer | TDInputSpacer | - | 组件各模块间间距 |
| cardStyleBottomText | String? | - | 卡片模式下方文字 |
| onTapOutside | TapRegionCallback? | - | 点击输入框外部区域回调 |
2 changes: 1 addition & 1 deletion tdesign-component/example/assets/api/loading_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| --- | --- | --- | --- |
| key | | - | |
| size | TDLoadingSize | - | 尺寸 |
| icon | TDLoadingIcon? | - | 图标,支持圆形、点状、菊花状 |
| icon | TDLoadingIcon? | TDLoadingIcon.circle | 图标,支持圆形、点状、菊花状 |
| iconColor | Color? | - | 图标颜色 |
| axis | Axis | Axis.vertical | 文案和图标相对方向 |
| text | String? | - | 文案 |
Expand Down
2 changes: 2 additions & 0 deletions tdesign-component/example/assets/api/navbar_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
| useBorderStyle | bool | false | 是否使用边框模式 |
| border | TDNavBarItemBorder? | - | 边框 |
| belowTitleWidget | Widget? | - | belowTitleWidget navbar 下方的widget |
| boxShadow | List<BoxShadow>? | - | 底部阴影 |
| flexibleSpace | Widget? | - | 固定背景 |

```
```
Expand Down
10 changes: 7 additions & 3 deletions tdesign-component/example/assets/api/picker_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
| pickerHeight | double | - | |
| pickerItemCount | int | - | 选择器List视窗中item个数,pickerHeight / pickerItemCount即item高度 |
| initialIndexes | List<int>? | - | 若为null表示全部从零开始 |
| rightText | String? | - | 右侧按钮文案 |
| leftText | String? | - | 左侧按钮文案 |
| leftTextStyle | TextStyle? | - | 自定义左侧文案样式 |
| rightTextStyle | TextStyle? | - | 自定义右侧文案样式 |
| centerTextStyle | TextStyle? | - | 自定义中间文案样式 |
Expand Down Expand Up @@ -42,6 +44,8 @@
| pickerHeight | double | 200 | |
| pickerItemCount | int | 5 | 选择器List视窗中item个数,pickerHeight / pickerItemCount即item高度 |
| customSelectWidget | Widget? | - | 自定义选择框样式 |
| rightText | String? | - | 右侧按钮文案 |
| leftText | String? | - | 左侧按钮文案 |
| leftTextStyle | TextStyle? | - | 自定义左侧文案样式 |
| rightTextStyle | TextStyle? | - | 自定义右侧文案样式 |
| centerTextStyle | TextStyle? | - | 自定义中间文案样式 |
Expand Down Expand Up @@ -75,6 +79,6 @@

| 名称 | 返回类型 | 参数 | 说明 |
| --- | --- | --- | --- |
| 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, Duration duration, double pickerHeight, int pickerItemCount, | 显示时间选择器 |
| 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, int pickerItemCount, | 显示多级选择器 |
| showMultiLinkedPicker | | required null context, String? title, required MultiPickerCallback? onConfirm, MultiPickerCallback? onCancel, required Map data, required int columnNum, required List initialData, Duration duration, Color? barrierColor, double pickerHeight, int pickerItemCount, | 显示多级联动选择器 |
| 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, Duration duration, double pickerHeight, int pickerItemCount, | 显示时间选择器 |
| 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, | 显示多级选择器 |
| 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, double? topPadding, int pickerItemCount, | 显示多级联动选择器 |
2 changes: 2 additions & 0 deletions tdesign-component/example/assets/api/popup_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
| modalLeft | double? | 0 | 弹出框左侧距离 |
| open | VoidCallback? | - | 打开前事件 |
| opened | VoidCallback? | - | 打开后事件 |
| close | VoidCallback? | - | 关闭前事件 |
| barrierClick | VoidCallback? | - | 蒙层点击事件,仅在[modalBarrierFull]为false时触发 |

```
```
Expand Down
1 change: 1 addition & 0 deletions tdesign-component/example/assets/api/radio_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ RadioGroup分组对象,继承自TDCheckboxGroup,字段含义与父类一致
| customIconBuilder | | - | |
| customContentBuilder | | - | |
| spacing | | - | |
| rowCount | int | 1 | 每行几列 |
| contentDirection | | - | |
| onRadioGroupChange | | - | |
| showDivider | bool | false | 是否显示下划线 |
Expand Down
26 changes: 26 additions & 0 deletions tdesign-component/example/assets/api/rate_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## API
### TDRate
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| key | | - | |
| allowHalf | bool? | false | 是否允许半选 |
| color | List<Color>? | - | 评分图标的颜色,示例:[选中颜色] / [选中颜色,未选中颜色],默认:[TDTheme.of(context).warningColor5, TDTheme.of(context).grayColor4] |
| count | int? | 5 | 评分的数量 |
| disabled | bool? | false | 是否禁用评分 |
| gap | double? | - | 评分图标的间距,默认:TDTheme.of(context).spacer8 |
| icon | List<IconData>? | - | 自定义评分图标,[选中和未选中图标] / [选中图标,未选中图标],默认:[TDIcons.star_filled] |
| placement | PlacementEnum? | PlacementEnum.top | 选择评分弹框的位置,值为[PlacementEnum.none]表示不显示评分弹框。 |
| showText | bool? | false | 是否显示对应的辅助文字 |
| size | double? | 24.0 | 评分图标的大小 |
| texts | List<String>? | const ['极差', '失望', '一般', '满意', '惊喜'] | 评分等级对应的辅助文字, |
| textWidth | double? | 48.0 | 评分等级对应的辅助文字宽度 |
| builderText | Widget Function(BuildContext context, double value)? | - | 评分等级对应的辅助文字自定义构建,优先级高于[texts] |
| value | double? | 0 | 选择评分的值 |
| onChange | void Function(double value)? | - | 评分数改变时触发 |
| direction | Axis? | Axis.horizontal | 评分图标与辅助文字的布局方向 |
| mainAxisAlignment | MainAxisAlignment? | MainAxisAlignment.start | 评分图标与辅助文字的主轴对齐方式 |
| crossAxisAlignment | CrossAxisAlignment? | CrossAxisAlignment.center | 评分图标与辅助文字的交叉轴对齐方式 |
| mainAxisSize | MainAxisSize? | MainAxisSize.min | 评分图标与辅助文字主轴方向上如何占用空间 |
| iconTextGap | double? | - | 评分图标与辅助文字的间距,默认:[TDTheme.of(context).spacer16] |
40 changes: 21 additions & 19 deletions tdesign-component/example/assets/api/search_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
### TDSearchBar
#### 默认构造方法

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

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| key | | - | |
| placeHolder | String? | - | 预设文案 |
| style | TDSearchStyle? | TDSearchStyle.square | 样式 |
| alignment | TDSearchAlignment? | TDSearchAlignment.left | 对齐方式,居中或这头部对齐 |
| onTextChanged | TDSearchBarEvent? | - | 文字改变回调 |
| onSubmitted | TDSearchBarEvent? | - | 提交回调 |
| onEditComplete | TDSearchBarCallBack? | - | 编辑完成回调 |
| autoHeight | bool | false | 是否自动计算高度 |
| padding | EdgeInsets | const EdgeInsets.fromLTRB(16, 8, 16, 8) | 内部填充 |
| autoFocus | bool | false | 是否自动获取焦点 |
| mediumStyle | bool | false | 是否在导航栏中的样式 |
| cursorHeight | double? | - | 光标的高 |
| needCancel | bool | false | 是否需要取消按钮 |
| controller | TextEditingController? | - | 控制器 |
| backgroundColor | Color? | Colors.white | 背景颜色 |
| action | String | '' | 自定义操作文字 |
| onActionClick | TDSearchBarEvent? | - | 自定义操作回调 |
| onClearClick | TDSearchBarClearEvent? | - | 自定义操作回调 |
| focusNode | FocusNode? | - | 自定义焦点 |
2 changes: 2 additions & 0 deletions tdesign-component/example/assets/api/side-bar_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@
| contentPadding | EdgeInsetsGeometry? | - | 自定义文本框内边距 |
| selectedTextStyle | TextStyle? | - | 选中样式 |
| style | TDSideBarStyle | TDSideBarStyle.normal | 样式 |
| loading | bool? | - | 加载效果 |
| loadingWidget | Widget? | - | 自定义加载动画 |
Loading

0 comments on commit 1192fe3

Please sign in to comment.