Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/typos-config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
default.check-filename = true

[default.extend-words]
"BA" = "BA"
"PA" = "PA"

[files]
extend-exclude = ["project.pbxproj","aop_flutter_sdk.patch"]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ build/
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3

.codebuddy/
.fvm/

/tdesign-component/local_dependency_override.yaml
Expand Down
6 changes: 2 additions & 4 deletions tdesign-component/demo_tool/all_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ dart run tdesign_flutter_tools:main generate --folder "$PARENT_DIR/lib/src/compo

# checkbox
dart run tdesign_flutter_tools:main generate --folder "$PARENT_DIR/lib/src/components/checkbox" --name TCheckbox,TCheckboxGroup --folder-name checkbox --output "$PARENT_DIR/example/assets/api/" --only-api
# date_picker
dart run tdesign_flutter_tools:main generate --folder "$PARENT_DIR/lib/src/components/picker" --name TPicker,TDatePicker --folder-name date-time-picker --output "$PARENT_DIR/example/assets/api/" --only-api
# picker
dart run tdesign_flutter_tools:main generate --folder "$PARENT_DIR/lib/src/components/picker" --name TPicker,TPickerOption,TPickerValue,TPickerScrollPhysics --folder-name picker --output "$PARENT_DIR/example/assets/api/" --only-api
# form
dart run tdesign_flutter_tools:main generate --folder "$PARENT_DIR/lib/src/components/form" --name TForm,TFormItem,TFormItemType,TFormValidation --folder-name form --output "$PARENT_DIR/example/assets/api/" --only-api
# input
dart run tdesign_flutter_tools:main generate --file "$PARENT_DIR/lib/src/components/input/t_input.dart" --name TInput, TInputSpacer --folder-name input --output "$PARENT_DIR/example/assets/api/" --only-api
# picker
dart run tdesign_flutter_tools:main generate --folder "$PARENT_DIR/lib/src/components/picker" --name TPicker,TMultiPicker,TMultiLinkedPicker,MultiLinkedPickerModel --folder-name picker --output "$PARENT_DIR/example/assets/api/" --only-api
# radio
dart run tdesign_flutter_tools:main generate --file "$PARENT_DIR/lib/src/components/radio/t_radio.dart" --name TRadioStyle,TRadio,TRadioGroup --folder-name radio --output "$PARENT_DIR/example/assets/api/" --only-api --get-comments
# rate
Expand Down
47 changes: 8 additions & 39 deletions tdesign-component/example/assets/api/date-time-picker_api.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,15 @@
## API
### TPicker

#### 静态方法

| 名称 | 返回类型 | 参数 | 说明 |
| --- | --- | --- | --- |
| showDatePicker | | required null context, String? title, double? titleHeight, Color? titleDividerColor, required DatePickerCallback? onConfirm, DatePickerCallback? onCancel, DatePickerCallback? onChange, Function(int wheelIndex, int index)? onSelectedItemChanged, String? leftText, TextStyle? leftTextStyle, TextStyle? centerTextStyle, String? rightText, TextStyle? rightTextStyle, EdgeInsets? padding, double? leftPadding, double? topPadding, double? rightPadding, double? topRadius, Color? backgroundColor, Widget? customSelectWidget, bool useYear, bool useMonth, bool useDay, bool useHour, bool useMinute, bool useSecond, bool useWeekDay, List<int> dateStart, List<int>? dateEnd, List<int>? initialDate, List<int> Function(DateTypeKey key, List<int> nums)? filterItems, double pickerHeight, int pickerItemCount, bool isTimeUnit, ItemBuilderType? itemBuilder, Color? barrierColor, Duration duration, | 显示时间选择器 |
| showMultiLinkedPicker | | required null context, String? title, required MultiPickerCallback? onConfirm, MultiPickerCallback? onCancel, required List initialData, required Map data, required int columnNum, double pickerHeight, int pickerItemCount, Widget? customSelectWidget, String? rightText, String? leftText, TextStyle? leftTextStyle, TextStyle? centerTextStyle, TextStyle? rightTextStyle, double? titleHeight, double? topPadding, double? leftPadding, double? rightPadding, Color? titleDividerColor, Color? backgroundColor, double? topRadius, EdgeInsets? padding, ItemBuilderType? itemBuilder, bool keepSameSelection, Color? barrierColor, Duration duration, | 显示多级联动选择器 |
| showMultiPicker | | required null context, String? title, required MultiPickerCallback? onConfirm, MultiPickerCallback? onCancel, required List<List<String>> data, double pickerHeight, int pickerItemCount, List<int>? initialIndexes, String? rightText, String? leftText, TextStyle? leftTextStyle, TextStyle? centerTextStyle, TextStyle? rightTextStyle, double? titleHeight, double? topPadding, double? leftPadding, double? rightPadding, Color? titleDividerColor, Color? backgroundColor, double? topRadius, EdgeInsets? padding, Widget? customSelectWidget, ItemBuilderType? itemBuilder, Duration duration, Color? barrierColor, | 显示多级选择器 |

```
```

### TDatePicker
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| backgroundColor | Color? | - | 背景颜色 |
| centerTextStyle | TextStyle? | - | 自定义中间文案样式 |
| customSelectWidget | Widget? | - | 自定义选择框样式 |
| header | bool | true | 是否显示头部内容 |
| isTimeUnit | bool? | - | 是否时间显示 |
| itemBuilder | ItemBuilderType? | - | 自定义item构建 |
| itemDistanceCalculator | ItemDistanceCalculator? | - | 根据距离计算字体颜色、透明度、粗细 |
| disabled | bool | false | 是否禁用整个选择器(禁止滚动和操作),默认 false |
| height | double | 200 | 视窗高度,默认 200 |
| initialValue | List? | - | 初始选中值列表(按 value 匹配) |
| itemCount | int | 5 | 每屏显示 item 数,默认 5 |
| items | dynamic | - | 数据源(必填) |
| key | | - | |
| leftPadding | double? | - | 左边填充 |
| leftText | String? | - | 左侧按钮文案 |
| leftTextStyle | TextStyle? | - | 自定义左侧文案样式 |
| model | DatePickerModel | - | 数据模型 |
| onCancel | DatePickerCallback? | - | 选择器取消按钮回调 |
| onChange | DatePickerCallback? | - | 选择器值改变回调 |
| onConfirm | DatePickerCallback? | - | 选择器确认按钮回调 |
| onSelectedItemChanged | void Function(int wheelIndex, int index)? | - | 选择器选中项改变回调 |
| padding | EdgeInsets? | - | 适配padding |
| pickerHeight | double | 200 | 选择器List的视窗高度,默认200 |
| pickerItemCount | int | 5 | 选择器List视窗中item个数,pickerHeight / pickerItemCount,即item高度 |
| rightPadding | double? | - | 右边填充 |
| rightText | String? | - | 右侧按钮文案 |
| rightTextStyle | TextStyle? | - | 自定义右侧文案样式 |
| title | String? | - | 选择器标题 |
| titleDividerColor | Color? | - | 标题分割线颜色 |
| titleHeight | double? | - | 标题高度 |
| topPadding | double? | - | 顶部填充 |
| topRadius | double? | - | 顶部圆角 |
| onChange | void Function(TPickerValue)? | - | 值改变回调 |
| onLoad | void Function(TPickerLoadEvent)? | - | 接近底部时加载回调 |
| preloadThreshold | int | 5 | 预加载阈值(距底部剩余 N 项时触发),默认 5 |
89 changes: 21 additions & 68 deletions tdesign-component/example/assets/api/picker_api.md
Original file line number Diff line number Diff line change
@@ -1,95 +1,48 @@
## API
### TMultiPicker
### TPickerOption
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| backgroundColor | Color? | - | 背景颜色 |
| centerTextStyle | TextStyle? | - | 自定义中间文案样式 |
| customSelectWidget | Widget? | - | 自定义选择框样式 |
| data | Map | - | 总的数据 |
| header | bool | true | 是否显示头部内容 |
| initialIndexes | List<int>? | - | 若为null表示全部从零开始 |
| itemBuilder | ItemBuilderType? | - | 自定义item构建 |
| itemDistanceCalculator | ItemDistanceCalculator? | - | 不同距离自选项计算策略 |
| key | | - | |
| leftPadding | double? | - | 左边填充 |
| leftText | String? | - | 左侧按钮文案 |
| leftTextStyle | TextStyle? | - | 自定义左侧文案样式 |
| onCancel | MultiPickerCallback? | - | 选择器取消按钮回调 |
| onChange | MultiPickerCallback? | - | todo 选择器数据改变时回调 |
| onConfirm | MultiPickerCallback? | - | 选择器确认按钮回调 |
| padding | EdgeInsets? | - | 适配padding |
| pickerHeight | double | 200 | |
| pickerItemCount | int | 5 | 选择器List视窗中item个数,pickerHeight / pickerItemCount,即item高度 |
| rightPadding | double? | - | 右边填充 |
| rightText | String? | - | 右侧按钮文案 |
| rightTextStyle | TextStyle? | - | 自定义右侧文案样式 |
| title | String? | - | 选择器标题 |
| titleDividerColor | Color? | - | 标题分割线颜色 |
| titleHeight | double? | - | 标题高度 |
| topPadding | double? | - | 顶部填充 |
| topRadius | double? | - | 顶部圆角 |
| disabled | bool | false | 是否禁用(不可选中/置灰显示),默认 false |
| label | String | - | 显示文字(可包含 emoji、单位、国际化等) |
| value | dynamic | - | 实际值(onChange 回调返回此字段) |

```
```

### TMultiLinkedPicker
### TPickerValue
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| backgroundColor | Color? | - | 背景颜色 |
| centerTextStyle | TextStyle? | - | 自定义中间文案样式 |
| columnNum | int | - | 总列数 |
| customSelectWidget | Widget? | - | 自定义选择框样式 |
| data | Map | - | 总的数据 |
| header | bool | true | 是否显示头部内容 |
| itemBuilder | ItemBuilderType? | - | 自定义item构建 |
| itemDistanceCalculator | ItemDistanceCalculator? | - | 不同距离自选项计算策略 |
| keepSameSelection | bool | false | 是否保留相同选项 |
| key | | - | |
| leftPadding | double? | - | 左边填充 |
| leftText | String? | - | 左侧按钮文案 |
| leftTextStyle | TextStyle? | - | 自定义左侧文案样式 |
| onCancel | MultiPickerCallback? | - | 选择器取消按钮回调 |
| onChange | MultiPickerCallback? | - | todo 选择器数据改变时回调 |
| onConfirm | MultiPickerCallback? | - | 选择器确认按钮回调 |
| padding | EdgeInsets? | - | 适配padding |
| pickerHeight | double | 200 | |
| pickerItemCount | int | 5 | 选择器List视窗中item个数,pickerHeight / pickerItemCount,即item高度 |
| rightPadding | double? | - | 右边填充 |
| rightText | String? | - | 右侧按钮文案 |
| rightTextStyle | TextStyle? | - | 自定义右侧文案样式 |
| selectedData | List | - | 选中数据 |
| title | String? | - | 选择器标题 |
| titleDividerColor | Color? | - | 标题分割线颜色 |
| titleHeight | double? | - | 标题高度 |
| topPadding | double? | - | 顶部填充 |
| topRadius | double? | - | 顶部圆角 |
| indexes | List<int> | - | 每列在当前数据列表中的索引(便捷访问) |
| selectedOptions | List<TPickerOption> | - | 每列选中的完整 option(顺序对应列号) |

```
```

### MultiLinkedPickerModel
### TPicker
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| columnNum | int | - | 总列数 |
| data | Map | - | 总的数据 |
| initialData | | - | |
| keepSameSelection | bool | false | 是否保留相同选项 |
| disabled | bool | false | 是否禁用整个选择器(禁止滚动和操作),默认 false |
| height | double | 200 | 视窗高度,默认 200 |
| initialValue | List? | - | 初始选中值列表(按 value 匹配) |
| itemCount | int | 5 | 每屏显示 item 数,默认 5 |
| items | dynamic | - | 数据源(必填) |
| key | | - | |
| onChange | void Function(TPickerValue)? | - | 值改变回调 |
| onLoad | void Function(TPickerLoadEvent)? | - | 接近底部时加载回调 |
| preloadThreshold | int | 5 | 预加载阈值(距底部剩余 N 项时触发),默认 5 |

```
```

### TPicker

#### 静态方法
### TPickerScrollPhysics
#### 默认构造方法

| 名称 | 返回类型 | 参数 | 说明 |
| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| showDatePicker | | required null context, String? title, double? titleHeight, Color? titleDividerColor, required DatePickerCallback? onConfirm, DatePickerCallback? onCancel, DatePickerCallback? onChange, Function(int wheelIndex, int index)? onSelectedItemChanged, String? leftText, TextStyle? leftTextStyle, TextStyle? centerTextStyle, String? rightText, TextStyle? rightTextStyle, EdgeInsets? padding, double? leftPadding, double? topPadding, double? rightPadding, double? topRadius, Color? backgroundColor, Widget? customSelectWidget, bool useYear, bool useMonth, bool useDay, bool useHour, bool useMinute, bool useSecond, bool useWeekDay, List<int> dateStart, List<int>? dateEnd, List<int>? initialDate, List<int> Function(DateTypeKey key, List<int> nums)? filterItems, double pickerHeight, int pickerItemCount, bool isTimeUnit, ItemBuilderType? itemBuilder, Color? barrierColor, Duration duration, | 显示时间选择器 |
| showMultiLinkedPicker | | required null context, String? title, required MultiPickerCallback? onConfirm, MultiPickerCallback? onCancel, required List initialData, required Map data, required int columnNum, double pickerHeight, int pickerItemCount, Widget? customSelectWidget, String? rightText, String? leftText, TextStyle? leftTextStyle, TextStyle? centerTextStyle, TextStyle? rightTextStyle, double? titleHeight, double? topPadding, double? leftPadding, double? rightPadding, Color? titleDividerColor, Color? backgroundColor, double? topRadius, EdgeInsets? padding, ItemBuilderType? itemBuilder, bool keepSameSelection, Color? barrierColor, Duration duration, | 显示多级联动选择器 |
| showMultiPicker | | required null context, String? title, required MultiPickerCallback? onConfirm, MultiPickerCallback? onCancel, required List<List<String>> data, double pickerHeight, int pickerItemCount, List<int>? initialIndexes, String? rightText, String? leftText, TextStyle? leftTextStyle, TextStyle? centerTextStyle, TextStyle? rightTextStyle, double? titleHeight, double? topPadding, double? leftPadding, double? rightPadding, Color? titleDividerColor, Color? backgroundColor, double? topRadius, EdgeInsets? padding, Widget? customSelectWidget, ItemBuilderType? itemBuilder, Duration duration, Color? barrierColor, | 显示多级选择器 |
| parent | | - | |

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading