Skip to content

Commit

Permalink
Merge branch 'develop' into feature/TDSlider_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Luozf12345 authored Sep 25, 2024
2 parents 67851ec + b7ad64d commit 17faee2
Show file tree
Hide file tree
Showing 86 changed files with 6,347 additions and 1,935 deletions.
7 changes: 5 additions & 2 deletions tdesign-component/demo_tool/all_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# drawer
./bin/demo_tool generate --folder ../lib/src/components/drawer --name TDDrawer,TDDrawerItem,TDDrawerStyle --folder-name drawer --output ../example/assets/api/ --only-api --get-comments
# indexes
./bin/demo_tool generate --folder ../lib/src/components/indexes --name TDIndexes,TDIndexesAnchor,TDIndexesList --folder-name indexes --output ../example/assets/api/ --only-api --get-comments
# navbar
./bin/demo_tool generate --file ../lib/src/components/navbar/td_nav_bar.dart --name TDNavBar,TDNavBarItem, --folder-name navbar --output ../example/assets/api/ --only-api
# sidebar
Expand All @@ -33,6 +34,7 @@

# 输入
# calendar
./bin/demo_tool generate --folder ../lib/src/components/calendar --name TDCalendar,TDCalendarPopup,TDCalendarStyle --folder-name calendar --output ../example/assets/api/ --only-api
# cascader
./bin/demo_tool generate --folder ../lib/src/components/cascader --name TDMultiCascader --folder-name cascader --output ../example/assets/api/ --only-api

Expand Down Expand Up @@ -70,8 +72,8 @@
./bin/demo_tool generate --file ../lib/src/components/badge/td_badge.dart --name TDBadge --folder-name badge --output ../example/assets/api/ --only-api
# cell
./bin/demo_tool generate --folder ../lib/src/components/cell --name TDCell,TDCellGroup,TDCellStyle --folder-name cell --output ../example/assets/api/ --only-api --get-comments
# countDown
./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
# timeCounter
./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
# collapse
./bin/demo_tool generate --folder ../lib/src/components/collapse --name TDCollapse --folder-name collapse --output ../example/assets/api/ --only-api --get-comments

Expand Down Expand Up @@ -104,6 +106,7 @@
./bin/demo_tool generate --file ../lib/src/components/loading/td_loading.dart --name TDLoading --folder-name loading --output ../example/assets/api/ --only-api
# message
# noticeBar
./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
# overlay
# popup
./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
Expand Down
68 changes: 68 additions & 0 deletions tdesign-component/example/assets/api/calendar_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
## API
### TDCalendarStyle
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| decoration | | - | |
| titleStyle | TextStyle? | - | header区域 [TDCalendar.title]的样式 |
| titleMaxLine | int? | - | header区域 [TDCalendar.title]的行数 |
| titleCloseColor | Color? | - | header区域 关闭图标的颜色 |
| weekdayStyle | TextStyle? | - | header区域 周 文字样式 |
| monthTitleStyle | TextStyle? | - | body区域 年月文字样式 |
| cellStyle | TextStyle? | - | 日期样式 |
| centreColor | Color? | - | 日期范围内背景样式 |
| cellDecoration | BoxDecoration? | - | 日期decoration |
| cellPrefixStyle | TextStyle? | - | 日期前面的字符串的样式 |
| cellSuffixStyle | TextStyle? | - | 日期后面的字符串的样式 |


#### 工厂构造方法

| 名称 | 说明 |
| --- | --- |
| TDCalendarStyle.generateStyle | 生成默认样式 |
| TDCalendarStyle.cellStyle | 日期样式 |

```
```
### TDCalendar
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| key | | - | |
| firstDayOfWeek | int? | 0 | 第一天从星期几开始,默认 0 = 周日 |
| format | CalendarFormat? | - | 用于格式化日期的函数,可定义日期前后的显示内容和日期样式 |
| maxDate | int? | - | 最大可选的日期(fromMillisecondsSinceEpoch),不传则默认半年后 |
| minDate | int? | - | 最小可选的日期(fromMillisecondsSinceEpoch),不传则默认今天 |
| title | String? | - | 标题 |
| titleWidget | Widget? | - | 标题组件 |
| type | CalendarType? | CalendarType.single | 日历的选择类型,single = 单选;multiple = 多选; range = 区间选择 |
| value | List<int>? | - | 当前选择的日期(fromMillisecondsSinceEpoch),不传则默认今天,当 type = single 时数组长度为1 |
| displayFormat | String? | 'year month' | 年月显示格式,`year`表示年,`month`表示月,如`year month`表示年在前、月在后、中间隔一个空格 |
| cellHeight | double? | 60 | 日期高度 |
| height | double? | - | 高度 |
| width | double? | - | 宽度 |
| style | TDCalendarStyle? | - | 自定义样式 |
| onChange | void Function(List<int> value)? | - | 选中值变化时触发 |
| 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)? | - | 点击周时触发 |

```
```
### TDCalendarPopup
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| context | BuildContext | context | 上下文 |
| top | double? | - | 距离顶部的距离 |
| autoClose | bool? | true | 自动关闭;在点击关闭按钮、确认按钮、遮罩层时自动关闭 |
| confirmBtn | Widget? | - | 自定义确认按钮 |
| visible | bool? | - | 默认是否显示日历 |
| onClose | VoidCallback? | - | 关闭时触发 |
| onConfirm | void Function(List<int> value)? | - | 点击确认按钮时触发 |
| builder | CalendarBuilder? | - | 控件构建器,优先级高于[child] |
| child | TDCalendar? | - | 日历控件 |
9 changes: 8 additions & 1 deletion tdesign-component/example/assets/api/dropdown-menu_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,26 @@
| showOverlay | bool? | true | 是否显示遮罩层 |
| isScrollable | bool | false | 是否开启滚动列表 |
| arrowIcon | IconData? | - | 自定义箭头图标 |
| labelBuilder | LabelBuilder? | - | 自定义标签内容 |
| onMenuOpened | ValueChanged<int>? | - | 展开菜单事件 |
| onMenuClosed | ValueChanged<int>? | - | 关闭菜单事件 |
| width | double? | - | menu的宽度 |
| height | double? | 48 | menu的高度 |
| tabBarAlign | MainAxisAlignment? | MainAxisAlignment.center | [TDDropdownItem.label][arrowIcon]/[TDDropdownItem.arrowIcon]的对齐方式 |

```
```
### TDDropdownItem
#### 简介
下拉菜单
下拉菜单内容
#### 默认构造方法

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

```
```
Expand Down
53 changes: 53 additions & 0 deletions tdesign-component/example/assets/api/indexes_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
## API
### TDIndexes
#### 简介
索引
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| key | | - | |
| indexList | List<String>? | - | 索引字符列表。不传默认 A-Z |
| indexListMaxHeight | double? | 0.8 | 索引列表最大高度(父容器高度的百分比,默认0.8) |
| sticky | bool? | true | 锚点是否吸顶 |
| stickyOffset | double? | 0 | 锚点吸顶时与顶部的距离 |
| capsuleTheme | bool? | false | 锚点是否为胶囊式样式 |
| reverse | bool? | false | 反方向滚动置顶 |
| scrollController | ScrollController? | - | 滚动控制器 |
| onChange | void Function(String index)? | - | 索引发生变更时触发事件 |
| onSelect | void Function(String index)? | - | 点击侧边栏时触发事件 |
| builderContent | Widget? Function(BuildContext context, String index) | - | 内容自定义构建 |
| builderAnchor | Widget? Function(BuildContext context, String index, bool isPinnedToTop)? | - | 锚点自定义构建 |
| builderIndex | Widget Function(BuildContext context, String index, bool isActive)? | - | 索引文本自定义构建,包括索引激活左侧提示 |

```
```
### TDIndexesList
#### 简介
索引
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| key | | - | |
| indexList | List<String> | - | 索引字符列表。不传默认 A-Z |
| indexListMaxHeight | double | 0.8 | 索引列表最大高度(父容器高度的百分比,默认0.8) |
| activeIndex | ValueNotifier<String> | - | 选中索引 |
| onSelect | void Function(String index, bool isUp) | - | 点击侧边栏时触发事件 |
| builderIndex | Widget Function(BuildContext context, String index, bool isActive)? | - | 索引文本自定义构建,包括索引激活左侧提示 |

```
```
### TDIndexesAnchor
#### 简介
索引锚点
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| key | | - | |
| sticky | bool | - | 索引是否吸顶 |
| text | String | - | 锚点文本 |
| capsuleTheme | bool | - | 是否为胶囊式样式 |
| builderAnchor | Widget? Function(BuildContext context, String index, bool isPinnedToTop)? | - | 索引锚点构建 |
| activeIndex | ValueNotifier<String> | - | 选中索引 |
34 changes: 34 additions & 0 deletions tdesign-component/example/assets/api/notice-bar_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## API
### TDNoticeBar
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| key | | - | |
| context | dynamic | - | 文本内容 |
| style | TDNoticeBarStyle? | - | 公告栏样式 |
| left | Widget? | - | 左侧内容(自定义左侧内容,优先级高于prefixIcon) |
| right | Widget? | - | 侧内容(自定义右侧内容,优先级高于suffixIcon) |
| marquee | bool? | false | 跑马灯效果 |
| speed | double? | 50 | 滚动速度 |
| interval | int? | 3000 | 步进滚动间隔时间(毫秒) |
| direction | Axis? | Axis.horizontal | 滚动方向 |
| theme | TDNoticeBarThemez? | TDNoticeBarThemez.info | 主题 |
| prefixIcon | IconData? | - | 左侧图标 |
| suffixIcon | IconData? | - | 右侧图标 |
| onTap | ValueChanged<dynamic>? | - | 点击事件 |

```
```
### TDNoticeBarStyle
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| context | BuildContext? | - | 上下文 |
| backgroundColor | Color? | - | 公告栏的背景色 |
| leftIconColor | Color? | - | 公告栏左侧图标的颜色 |
| rightIconColor | Color? | - | 公告栏右侧图标的颜色 |
| padding | EdgeInsetsGeometry? | EdgeInsets.only(top: 13, bottom: 13, left: 16, right: 12) | 公告栏的内边距 |
| textStyle | TextStyle? | TextStyle(color: TDTheme.of(context).fontGyColor1, fontSize: 16, height: 1) | 公告栏内容的文本样式 |

1 change: 1 addition & 0 deletions tdesign-component/example/assets/api/search_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
| onActionClick | TDSearchBarEvent? | - | 右侧操作按钮点击回调 |
| controller | TextEditingController? | - | 控制器 |
| backgroundColor | Color? | Colors.white | 背景颜色 |

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

```
```
### TDCountDownStyle
### TDTimeCounterStyle
#### 简介
倒计时组件样式
#### 默认构造方法
Expand Down Expand Up @@ -50,10 +51,10 @@

| 名称 | 说明 |
| --- | --- |
| TDCountDownStyle.generateStyle | 生成默认样式 |
| TDTimeCounterStyle.generateStyle | 生成默认样式 |

```
```
### TDCountDownController
### TDTimeCounterController
#### 简介
倒计时组件控制器,可控制开始(`start()`)/暂停(`pause()`)/继续(`resume()`)/重置(`reset([int? time])`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Widget _buildFocusSearchBarWithAction(BuildContext context) {
return TDSearchBar(
placeHolder: '搜索预设文案',
action: '搜索',
needCancel: true,
controller: inputController,
onActionClick: () {
showGeneralDialog(
context: context,
pageBuilder: (BuildContext buildContext, Animation<double> animation,
Animation<double> secondaryAnimation) {
return TDConfirmDialog(
content: inputController.text.isNotEmpty
? '搜索关键词:${inputController.text}'
: '搜索关键词为空',
);
},
);
},
);
}
Loading

0 comments on commit 17faee2

Please sign in to comment.