diff --git a/tdesign-component/example/assets/api/action-sheet_api.md b/tdesign-component/example/assets/api/action-sheet_api.md index 180994817..bc4c9c6b7 100644 --- a/tdesign-component/example/assets/api/action-sheet_api.md +++ b/tdesign-component/example/assets/api/action-sheet_api.md @@ -1,23 +1,4 @@ ## API -### TDActionSheetItem -#### 简介 -动作面板项目 -#### 默认构造方法 - -| 参数 | 类型 | 默认值 | 说明 | -| --- | --- | --- | --- | -| badge | TDBadge? | - | 角标 | -| description | String? | - | 描述信息 | -| disabled | bool | false | 是否禁用 | -| group | String? | - | 分组,用于带描述多行滚动宫格 | -| icon | Widget? | - | 图标 | -| iconSize | double? | - | 图标大小 | -| label | String | - | 标题 | -| textStyle | TextStyle? | - | 标题样式 | - -``` -``` - ### TDActionSheet #### 简介 动作面板 @@ -54,3 +35,22 @@ | showGridActionSheet | | required BuildContext context, required List items, TDActionSheetAlign align, String? cancelText, bool showCancel, TDActionSheetItemCallback? onSelected, bool showOverlay, bool closeOnOverlayClick, int count, int rows, double itemHeight, double itemMinWidth, bool scrollable, bool showPagination, VoidCallback? onCancel, String? description, VoidCallback? onClose, bool useSafeArea, | 显示宫格类型面板 | | showGroupActionSheet | | required BuildContext context, required List items, TDActionSheetAlign align, String? cancelText, bool showCancel, TDActionSheetItemCallback? onSelected, bool showOverlay, bool closeOnOverlayClick, double itemHeight, double itemMinWidth, VoidCallback? onCancel, VoidCallback? onClose, bool useSafeArea, | 显示分组类型面板 | | showListActionSheet | | required BuildContext context, required List items, TDActionSheetAlign align, String? cancelText, bool showCancel, VoidCallback? onCancel, TDActionSheetItemCallback? onSelected, bool showOverlay, bool closeOnOverlayClick, VoidCallback? onClose, bool useSafeArea, | 显示列表类型面板 | + +``` +``` + +### TDActionSheetItem +#### 简介 +动作面板项目 +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| badge | TDBadge? | - | 角标 | +| description | String? | - | 描述信息 | +| disabled | bool | false | 是否禁用 | +| group | String? | - | 分组,用于带描述多行滚动宫格 | +| icon | Widget? | - | 图标 | +| iconSize | double? | - | 图标大小 | +| label | String | - | 标题 | +| textStyle | TextStyle? | - | 标题样式 | diff --git a/tdesign-component/example/assets/api/calendar_api.md b/tdesign-component/example/assets/api/calendar_api.md index 83f624079..9a6de09ae 100644 --- a/tdesign-component/example/assets/api/calendar_api.md +++ b/tdesign-component/example/assets/api/calendar_api.md @@ -1,39 +1,18 @@ ## API -### TDCalendar +### TDCalendarPopup #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| anchorDate | DateTime? | - | 锚点日期 | -| animateTo | bool? | false | 动画滚动到指定位置 | -| cellHeight | double? | 60 | 日期高度 | -| cellWidget | Widget? Function(BuildContext context, TDate tdate, DateSelectType selectType)? | - | 自定义日期单元格组件 | -| displayFormat | String? | 'year month' | 年月显示格式,`year`表示年,`month`表示月,如`year month`表示年在前、月在后、中间隔一个空格 | -| firstDayOfWeek | int? | 0 | 第一天从星期几开始,默认 0 = 周日 | -| format | CalendarFormat? | - | 用于格式化日期的函数,可定义日期前后的显示内容和日期样式 | -| height | double? | - | 高度 | -| isTimeUnit | bool? | true | 是否显示时间单位 | -| key | | - | | -| maxDate | int? | - | 最大可选的日期(fromMillisecondsSinceEpoch),不传则默认半年后 | -| minDate | int? | - | 最小可选的日期(fromMillisecondsSinceEpoch),不传则默认今天 | -| monthTitleBuilder | Widget Function(BuildContext context, DateTime monthDate)? | - | 月标题构建器 | -| monthTitleHeight | double? | 22 | 月标题高度 | -| onCellClick | void Function(int value, DateSelectType type, TDate tdate)? | - | 点击日期时触发 | -| onCellLongPress | void Function(int value, DateSelectType type, TDate tdate)? | - | 长安日期时触发 | -| onChange | void Function(List value)? | - | 选中值变化时触发 | -| onHeaderClick | void Function(int index, String week)? | - | 点击周时触发 | -| onMonthChange | ValueChanged? | - | 月份变化时触发 | -| pickerHeight | double? | 178 | 时间选择器List的视窗高度 | -| pickerItemCount | int? | 3 | 选择器List视窗中item个数,pickerHeight / pickerItemCount即item高度 | -| style | TDCalendarStyle? | - | 自定义样式 | -| timePickerModel | List? | - | 自定义时间选择器 | -| title | String? | - | 标题 | -| titleWidget | Widget? | - | 标题组件 | -| type | CalendarType? | CalendarType.single | 日历的选择类型,single = 单选;multiple = 多选;range = 区间选择 | -| useSafeArea | bool? | true | 是否使用安全区域,默认true | -| useTimePicker | bool? | false | 是否显示时间选择器 | -| value | List? | - | 当前选择的日期(fromMillisecondsSinceEpoch),不传则默认今天,当 type = single 时数组长度为1 | -| width | double? | - | 宽度 | +| autoClose | bool? | true | 自动关闭;在点击关闭按钮、确认按钮、遮罩层时自动关闭 | +| builder | CalendarBuilder? | - | 控件构建器,优先级高于[child] | +| child | TDCalendar? | - | 日历控件 | +| confirmBtn | Widget? | - | 自定义确认按钮 | +| context | BuildContext | context | 上下文 | +| onClose | VoidCallback? | - | 关闭时触发 | +| onConfirm | void Function(List value)? | - | 点击确认按钮时触发 | +| top | double? | - | 距离顶部的距离 | +| visible | bool? | - | 默认是否显示日历 | ``` ``` @@ -66,17 +45,38 @@ ``` ``` -### TDCalendarPopup +### TDCalendar #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| autoClose | bool? | true | 自动关闭;在点击关闭按钮、确认按钮、遮罩层时自动关闭 | -| builder | CalendarBuilder? | - | 控件构建器,优先级高于[child] | -| child | TDCalendar? | - | 日历控件 | -| confirmBtn | Widget? | - | 自定义确认按钮 | -| context | BuildContext | context | 上下文 | -| onClose | VoidCallback? | - | 关闭时触发 | -| onConfirm | void Function(List value)? | - | 点击确认按钮时触发 | -| top | double? | - | 距离顶部的距离 | -| visible | bool? | - | 默认是否显示日历 | +| anchorDate | DateTime? | - | 锚点日期 | +| animateTo | bool? | false | 动画滚动到指定位置 | +| cellHeight | double? | 60 | 日期高度 | +| cellWidget | Widget? Function(BuildContext context, TDate tdate, DateSelectType selectType)? | - | 自定义日期单元格组件 | +| displayFormat | String? | 'year month' | 年月显示格式,`year`表示年,`month`表示月,如`year month`表示年在前、月在后、中间隔一个空格 | +| firstDayOfWeek | int? | 0 | 第一天从星期几开始,默认 0 = 周日 | +| format | CalendarFormat? | - | 用于格式化日期的函数,可定义日期前后的显示内容和日期样式 | +| height | double? | - | 高度 | +| isTimeUnit | bool? | true | 是否显示时间单位 | +| key | | - | | +| maxDate | int? | - | 最大可选的日期(fromMillisecondsSinceEpoch),不传则默认半年后 | +| minDate | int? | - | 最小可选的日期(fromMillisecondsSinceEpoch),不传则默认今天 | +| monthTitleBuilder | Widget Function(BuildContext context, DateTime monthDate)? | - | 月标题构建器 | +| monthTitleHeight | double? | 22 | 月标题高度 | +| onCellClick | void Function(int value, DateSelectType type, TDate tdate)? | - | 点击日期时触发 | +| onCellLongPress | void Function(int value, DateSelectType type, TDate tdate)? | - | 长安日期时触发 | +| onChange | void Function(List value)? | - | 选中值变化时触发 | +| onHeaderClick | void Function(int index, String week)? | - | 点击周时触发 | +| onMonthChange | ValueChanged? | - | 月份变化时触发 | +| pickerHeight | double? | 178 | 时间选择器List的视窗高度 | +| pickerItemCount | int? | 3 | 选择器List视窗中item个数,pickerHeight / pickerItemCount即item高度 | +| style | TDCalendarStyle? | - | 自定义样式 | +| timePickerModel | List? | - | 自定义时间选择器 | +| title | String? | - | 标题 | +| titleWidget | Widget? | - | 标题组件 | +| type | CalendarType? | CalendarType.single | 日历的选择类型,single = 单选;multiple = 多选;range = 区间选择 | +| useSafeArea | bool? | true | 是否使用安全区域,默认true | +| useTimePicker | bool? | false | 是否显示时间选择器 | +| value | List? | - | 当前选择的日期(fromMillisecondsSinceEpoch),不传则默认今天,当 type = single 时数组长度为1 | +| width | double? | - | 宽度 | diff --git a/tdesign-component/example/assets/api/checkbox_api.md b/tdesign-component/example/assets/api/checkbox_api.md index 16c7e7e5a..85f6ea3cb 100644 --- a/tdesign-component/example/assets/api/checkbox_api.md +++ b/tdesign-component/example/assets/api/checkbox_api.md @@ -1,4 +1,26 @@ ## API +### TDCheckboxGroup +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| checkedIds | List? | - | 勾选的CheckBox id列表 | +| child | | - | | +| contentDirection | TDContentDirection? | - | 文字相对icon的方位 | +| controller | TDCheckboxGroupController? | - | 可以通过控制器操作勾选状态 | +| customContentBuilder | ContentBuilder? | - | CheckBox完全自定义内容 | +| customIconBuilder | IconBuilder? | - | 自定义选择icon的样式 | +| key | | - | | +| maxChecked | int? | - | 最多可以勾选多少 | +| onChangeGroup | OnGroupChange? | - | 状态变化监听器 | +| onOverloadChecked | VoidCallback? | - | 超过最大可勾选的个数 | +| spacing | double? | - | CheckBoxicon和文字的距离 | +| style | TDCheckboxStyle? | - | CheckBox复选框样式:圆形或方形 | +| titleMaxLine | int? | - | CheckBox标题的行数 | + +``` +``` + ### TDCheckbox #### 默认构造方法 @@ -31,25 +53,3 @@ | titleColor | Color? | - | 标题文字颜色 | | titleFont | Font? | - | 标题字体大小 | | titleMaxLine | int? | - | 标题的行数 | - -``` -``` - -### TDCheckboxGroup -#### 默认构造方法 - -| 参数 | 类型 | 默认值 | 说明 | -| --- | --- | --- | --- | -| checkedIds | List? | - | 勾选的CheckBox id列表 | -| child | | - | | -| contentDirection | TDContentDirection? | - | 文字相对icon的方位 | -| controller | TDCheckboxGroupController? | - | 可以通过控制器操作勾选状态 | -| customContentBuilder | ContentBuilder? | - | CheckBox完全自定义内容 | -| customIconBuilder | IconBuilder? | - | 自定义选择icon的样式 | -| key | | - | | -| maxChecked | int? | - | 最多可以勾选多少 | -| onChangeGroup | OnGroupChange? | - | 状态变化监听器 | -| onOverloadChecked | VoidCallback? | - | 超过最大可勾选的个数 | -| spacing | double? | - | CheckBoxicon和文字的距离 | -| style | TDCheckboxStyle? | - | CheckBox复选框样式:圆形或方形 | -| titleMaxLine | int? | - | CheckBox标题的行数 | diff --git a/tdesign-component/example/assets/api/date-time-picker_api.md b/tdesign-component/example/assets/api/date-time-picker_api.md index 2e1cecd86..475c9c978 100644 --- a/tdesign-component/example/assets/api/date-time-picker_api.md +++ b/tdesign-component/example/assets/api/date-time-picker_api.md @@ -1,4 +1,17 @@ ## API +### TDPicker + +#### 静态方法 + +| 名称 | 返回类型 | 参数 | 说明 | +| --- | --- | --- | --- | +| 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 dateStart, List? dateEnd, List? initialDate, List Function(DateTypeKey key, List 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> data, double pickerHeight, int pickerItemCount, List? 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, | 显示多级选择器 | + +``` +``` + ### TDDatePicker #### 默认构造方法 @@ -31,16 +44,3 @@ | titleHeight | double? | - | 标题高度 | | topPadding | double? | - | 顶部填充 | | topRadius | double? | - | 顶部圆角 | - -``` -``` - -### TDPicker - -#### 静态方法 - -| 名称 | 返回类型 | 参数 | 说明 | -| --- | --- | --- | --- | -| 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 dateStart, List? dateEnd, List? initialDate, List Function(DateTypeKey key, List 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> data, double pickerHeight, int pickerItemCount, List? 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, | 显示多级选择器 | diff --git a/tdesign-component/example/assets/api/dialog_api.md b/tdesign-component/example/assets/api/dialog_api.md index 899245d9a..b86471300 100644 --- a/tdesign-component/example/assets/api/dialog_api.md +++ b/tdesign-component/example/assets/api/dialog_api.md @@ -1,187 +1,143 @@ ## API -### TDInputDialog +### TDDialogScaffold #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| backgroundColor | Color? | - | 背景颜色 | -| buttonWidget | Widget? | - | 自定义按钮 | -| content | String? | - | 内容 | -| contentColor | Color? | - | 内容颜色 | -| contentWidget | Widget? | - | 内容Widget | -| customInputWidget | Widget? | - | 自定义输入框 | -| hintText | String? | '' | 输入提示 | +| backgroundColor | Color? | - | 背景色 | +| body | Widget | - | Dialog主体 | | key | | - | | -| leftBtn | TDDialogButtonOptions? | - | 左侧按钮配置 | -| padding | EdgeInsets? | const EdgeInsets.fromLTRB(24, 32, 24, 0) | 内容内边距 | | radius | double | 12.0 | 圆角 | -| rightBtn | TDDialogButtonOptions? | - | 右侧按钮配置 | | showCloseButton | bool? | - | 显示右上角关闭按钮 | -| textEditingController | TextEditingController | - | 输入controller | -| title | String? | - | 标题 | -| titleAlignment | AlignmentGeometry? | - | 标题对齐模式 | -| titleColor | Color? | - | 标题颜色 | +| width | double? | - | 弹窗宽度 | ``` ``` -### TDDialogButtonOptions +### TDDialogTitle #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| action | Function()? | - | 点击操作 | -| fontWeight | FontWeight? | - | 字体粗细 | -| height | double? | - | 按钮高度 | -| style | TDButtonStyle? | - | 按钮样式 | -| theme | TDButtonTheme? | - | 按钮类型 | -| title | String | - | 标题内容 | +| key | | - | | +| title | String? | - | 标题文字 | | titleColor | Color? | - | 标题颜色 | -| titleSize | double? | - | 字体大小 | -| type | TDButtonType? | - | 按钮类型 | ``` ``` -### TDImageDialog +### TDDialogContent #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| backgroundColor | Color? | - | 背景颜色 | -| buttonWidget | Widget? | - | 自定义按钮 | -| content | String? | - | 内容 | -| contentColor | Color? | - | 内容颜色 | -| contentWidget | Widget? | - | 内容Widget | -| image | Image | - | 图片 | -| imagePosition | TDDialogImagePosition? | TDDialogImagePosition.top | 图片位置 | +| content | String? | - | 标题文字 | +| contentColor | Color? | - | 标题颜色 | | key | | - | | -| leftBtn | TDDialogButtonOptions? | - | 左侧按钮配置 | -| padding | EdgeInsets? | - | 内容内边距 | -| radius | double | 12.0 | 圆角 | -| rightBtn | TDDialogButtonOptions? | - | 右侧按钮配置 | -| showCloseButton | bool? | - | 显示右上角关闭按钮 | -| title | String? | - | 标题 | -| titleAlignment | AlignmentGeometry? | - | 标题对齐模式 | -| titleColor | Color? | - | 标题颜色 | ``` ``` -### TDAlertDialog +### TDDialogInfoWidget #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| backgroundColor | Color? | - | 背景颜色 | -| buttonStyle | | TDDialogButtonStyle.normal | | -| buttonWidget | Widget? | - | 自定义按钮 | | content | String? | - | 内容 | | contentColor | Color? | - | 内容颜色 | | contentMaxHeight | double | 0 | 内容的最大高度,默认为0,也就是不限制高度 | | contentWidget | Widget? | - | 内容Widget | | key | | - | | -| leftBtn | TDDialogButtonOptions? | - | 左侧按钮配置 | -| leftBtnAction | Function()? | - | 左侧按钮默认点击 | -| padding | EdgeInsets? | const EdgeInsets.fromLTRB(24, 32, 24, 0) | 内容内边距 | -| radius | double | 12.0 | 圆角 | -| rightBtn | TDDialogButtonOptions? | - | 右侧按钮配置 | -| rightBtnAction | Function()? | - | 右侧按钮默认点击 | -| showCloseButton | bool? | - | 显示右上角关闭按钮 | +| padding | EdgeInsetsGeometry? | const EdgeInsets.fromLTRB(24, 32, 24, 0) | 内容的内边距 | | title | String? | - | 标题 | | titleAlignment | AlignmentGeometry? | - | 标题对齐模式 | | titleColor | Color? | - | 标题颜色 | - -#### 工厂构造方法 - -| 名称 | 说明 | -| --- | --- | -| TDAlertDialog.vertical | 纵向按钮排列的对话框 - - [buttons]参数是必须的,纵向按钮默认样式都是[TDButtonTheme.primary] | - ``` ``` -### TDConfirmDialog +### HorizontalNormalButtons #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| action | Function()? | - | 点击 | -| backgroundColor | Color? | - | 背景颜色 | -| buttonStyle | TDDialogButtonStyle | TDDialogButtonStyle.normal | 按钮样式 | -| buttonStyleCustom | TDButtonStyle? | - | 按钮自定义样式属性,背景色、边框... | -| buttonText | String? | - | 按钮文字 | -| buttonTextColor | Color? | - | 按钮文字颜色 | -| buttonWidget | Widget? | - | 自定义按钮 | -| content | String? | - | 内容 | -| contentColor | Color? | - | 内容颜色 | -| contentMaxHeight | double | 0 | 内容的最大高度,默认为0,也就是不限制高度 | -| contentWidget | Widget? | - | 内容Widget | | key | | - | | -| padding | EdgeInsets? | const EdgeInsets.fromLTRB(24, 32, 24, 0) | 内容内边距 | -| radius | double | 12.0 | 圆角 | -| showCloseButton | bool? | - | 右上角关闭按钮 | -| title | String? | - | 标题 | -| titleAlignment | AlignmentGeometry? | - | 标题对齐模式 | -| titleColor | Color? | - | 标题颜色 | -| width | | - | | +| leftBtn | TDDialogButtonOptions | - | 左按钮 | +| rightBtn | TDDialogButtonOptions | - | 右按钮 | ``` ``` -### TDDialogScaffold +### HorizontalTextButtons #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| backgroundColor | Color? | - | 背景色 | -| body | Widget | - | Dialog主体 | | key | | - | | -| radius | double | 12.0 | 圆角 | -| showCloseButton | bool? | - | 显示右上角关闭按钮 | -| width | double? | - | 弹窗宽度 | +| leftBtn | TDDialogButtonOptions | - | 左按钮 | +| rightBtn | TDDialogButtonOptions | - | 右按钮 | ``` ``` -### TDDialogTitle +### TDDialogButton #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | +| buttonStyle | TDButtonStyle? | - | 按钮样式 | +| buttonText | String? | - | 按钮文字 | +| buttonTextColor | Color? | - | 按钮文字颜色 | +| buttonTextFontWeight | FontWeight? | FontWeight.w600 | 按钮文字粗细 | +| buttonTextSize | double? | - | 按钮文字大小 | +| buttonTheme | TDButtonTheme? | - | 按钮主题 | +| buttonType | TDButtonType? | - | 按钮类型 | +| height | double? | 40.0 | 按钮高度 | +| isBlock | bool | true | 按钮高度 | | key | | - | | -| title | String? | - | 标题文字 | -| titleColor | Color? | - | 标题颜色 | +| onPressed | Function() | - | 点击 | +| width | double? | - | 按钮宽度 | ``` ``` -### TDDialogContent +### TDDialogButtonOptions #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| content | String? | - | 标题文字 | -| contentColor | Color? | - | 标题颜色 | -| key | | - | | +| action | Function()? | - | 点击操作 | +| fontWeight | FontWeight? | - | 字体粗细 | +| height | double? | - | 按钮高度 | +| style | TDButtonStyle? | - | 按钮样式 | +| theme | TDButtonTheme? | - | 按钮类型 | +| title | String | - | 标题内容 | +| titleColor | Color? | - | 标题颜色 | +| titleSize | double? | - | 字体大小 | +| type | TDButtonType? | - | 按钮类型 | ``` ``` -### TDDialogInfoWidget +### TDInputDialog #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | +| backgroundColor | Color? | - | 背景颜色 | +| buttonWidget | Widget? | - | 自定义按钮 | | content | String? | - | 内容 | | contentColor | Color? | - | 内容颜色 | -| contentMaxHeight | double | 0 | 内容的最大高度,默认为0,也就是不限制高度 | | contentWidget | Widget? | - | 内容Widget | +| customInputWidget | Widget? | - | 自定义输入框 | +| hintText | String? | '' | 输入提示 | | key | | - | | -| padding | EdgeInsetsGeometry? | const EdgeInsets.fromLTRB(24, 32, 24, 0) | 内容的内边距 | +| leftBtn | TDDialogButtonOptions? | - | 左侧按钮配置 | +| padding | EdgeInsets? | const EdgeInsets.fromLTRB(24, 32, 24, 0) | 内容内边距 | +| radius | double | 12.0 | 圆角 | +| rightBtn | TDDialogButtonOptions? | - | 右侧按钮配置 | +| showCloseButton | bool? | - | 显示右上角关闭按钮 | +| textEditingController | TextEditingController | - | 输入controller | | title | String? | - | 标题 | | titleAlignment | AlignmentGeometry? | - | 标题对齐模式 | | titleColor | Color? | - | 标题颜色 | @@ -189,44 +145,88 @@ ``` ``` -### HorizontalNormalButtons +### TDConfirmDialog #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | +| action | Function()? | - | 点击 | +| backgroundColor | Color? | - | 背景颜色 | +| buttonStyle | TDDialogButtonStyle | TDDialogButtonStyle.normal | 按钮样式 | +| buttonStyleCustom | TDButtonStyle? | - | 按钮自定义样式属性,背景色、边框... | +| buttonText | String? | - | 按钮文字 | +| buttonTextColor | Color? | - | 按钮文字颜色 | +| buttonWidget | Widget? | - | 自定义按钮 | +| content | String? | - | 内容 | +| contentColor | Color? | - | 内容颜色 | +| contentMaxHeight | double | 0 | 内容的最大高度,默认为0,也就是不限制高度 | +| contentWidget | Widget? | - | 内容Widget | | key | | - | | -| leftBtn | TDDialogButtonOptions | - | 左按钮 | -| rightBtn | TDDialogButtonOptions | - | 右按钮 | +| padding | EdgeInsets? | const EdgeInsets.fromLTRB(24, 32, 24, 0) | 内容内边距 | +| radius | double | 12.0 | 圆角 | +| showCloseButton | bool? | - | 右上角关闭按钮 | +| title | String? | - | 标题 | +| titleAlignment | AlignmentGeometry? | - | 标题对齐模式 | +| titleColor | Color? | - | 标题颜色 | +| width | | - | | ``` ``` -### HorizontalTextButtons +### TDImageDialog #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | +| backgroundColor | Color? | - | 背景颜色 | +| buttonWidget | Widget? | - | 自定义按钮 | +| content | String? | - | 内容 | +| contentColor | Color? | - | 内容颜色 | +| contentWidget | Widget? | - | 内容Widget | +| image | Image | - | 图片 | +| imagePosition | TDDialogImagePosition? | TDDialogImagePosition.top | 图片位置 | | key | | - | | -| leftBtn | TDDialogButtonOptions | - | 左按钮 | -| rightBtn | TDDialogButtonOptions | - | 右按钮 | +| leftBtn | TDDialogButtonOptions? | - | 左侧按钮配置 | +| padding | EdgeInsets? | - | 内容内边距 | +| radius | double | 12.0 | 圆角 | +| rightBtn | TDDialogButtonOptions? | - | 右侧按钮配置 | +| showCloseButton | bool? | - | 显示右上角关闭按钮 | +| title | String? | - | 标题 | +| titleAlignment | AlignmentGeometry? | - | 标题对齐模式 | +| titleColor | Color? | - | 标题颜色 | ``` ``` -### TDDialogButton +### TDAlertDialog #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| buttonStyle | TDButtonStyle? | - | 按钮样式 | -| buttonText | String? | - | 按钮文字 | -| buttonTextColor | Color? | - | 按钮文字颜色 | -| buttonTextFontWeight | FontWeight? | FontWeight.w600 | 按钮文字粗细 | -| buttonTextSize | double? | - | 按钮文字大小 | -| buttonTheme | TDButtonTheme? | - | 按钮主题 | -| buttonType | TDButtonType? | - | 按钮类型 | -| height | double? | 40.0 | 按钮高度 | -| isBlock | bool | true | 按钮高度 | +| backgroundColor | Color? | - | 背景颜色 | +| buttonStyle | | TDDialogButtonStyle.normal | | +| buttonWidget | Widget? | - | 自定义按钮 | +| content | String? | - | 内容 | +| contentColor | Color? | - | 内容颜色 | +| contentMaxHeight | double | 0 | 内容的最大高度,默认为0,也就是不限制高度 | +| contentWidget | Widget? | - | 内容Widget | | key | | - | | -| onPressed | Function() | - | 点击 | -| width | double? | - | 按钮宽度 | +| leftBtn | TDDialogButtonOptions? | - | 左侧按钮配置 | +| leftBtnAction | Function()? | - | 左侧按钮默认点击 | +| padding | EdgeInsets? | const EdgeInsets.fromLTRB(24, 32, 24, 0) | 内容内边距 | +| radius | double | 12.0 | 圆角 | +| rightBtn | TDDialogButtonOptions? | - | 右侧按钮配置 | +| rightBtnAction | Function()? | - | 右侧按钮默认点击 | +| showCloseButton | bool? | - | 显示右上角关闭按钮 | +| title | String? | - | 标题 | +| titleAlignment | AlignmentGeometry? | - | 标题对齐模式 | +| titleColor | Color? | - | 标题颜色 | + + +#### 工厂构造方法 + +| 名称 | 说明 | +| --- | --- | +| TDAlertDialog.vertical | 纵向按钮排列的对话框 + + [buttons]参数是必须的,纵向按钮默认样式都是[TDButtonTheme.primary] | diff --git a/tdesign-component/example/assets/api/form_api.md b/tdesign-component/example/assets/api/form_api.md index 3c44e6cef..71d791a7e 100644 --- a/tdesign-component/example/assets/api/form_api.md +++ b/tdesign-component/example/assets/api/form_api.md @@ -31,6 +31,18 @@ ``` ``` +### TDFormValidation +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| errorMessage | String | - | 错误提示信息 | +| type | TDFormItemType | - | 校验对象的类型 | +| validate | String? Function(dynamic) | - | 校验方法 | + +``` +``` + ### TDForm #### 默认构造方法 @@ -56,15 +68,3 @@ | rules | Map | - | 整个表单字段校验规则 | | scrollToFirstError | String? | - | 表单校验不通过时,是否自动滚动到第一个校验不通过的字段,平滑滚动或是瞬间直达。 | | submitWithWarningMessage | bool? | false | 【讨论中】当校验结果只有告警信息时,是否触发 submit 提交事件 | - -``` -``` - -### TDFormValidation -#### 默认构造方法 - -| 参数 | 类型 | 默认值 | 说明 | -| --- | --- | --- | --- | -| errorMessage | String | - | 错误提示信息 | -| type | TDFormItemType | - | 校验对象的类型 | -| validate | String? Function(dynamic) | - | 校验方法 | diff --git a/tdesign-component/example/assets/api/image-viewer_api.md b/tdesign-component/example/assets/api/image-viewer_api.md index 95c5ffeab..b62d0965f 100644 --- a/tdesign-component/example/assets/api/image-viewer_api.md +++ b/tdesign-component/example/assets/api/image-viewer_api.md @@ -1,15 +1,4 @@ ## API -### TDImageViewer - -#### 静态方法 - -| 名称 | 返回类型 | 参数 | 说明 | -| --- | --- | --- | --- | -| showImageViewer | | required BuildContext context, required List images, List? labels, bool? closeBtn, bool? deleteBtn, bool? showIndex, bool? loop, bool? autoplay, int? duration, Color? bgColor, Color? navBarBgColor, Color? iconColor, TextStyle? labelStyle, TextStyle? indexStyle, Color? modalBarrierColor, bool? barrierDismissible, int? defaultIndex, double? width, double? height, OnIndexChange? onIndexChange, OnClose? onClose, OnDelete? onDelete, bool? ignoreDeleteError, OnImageTap? onTap, OnLongPress? onLongPress, LeftItemBuilder? leftItemBuilder, RightItemBuilder? rightItemBuilder, | 显示图片预览 | - -``` -``` - ### TDImageViewerWidget #### 默认构造方法 @@ -40,3 +29,14 @@ | rightItemBuilder | RightItemBuilder? | - | 右侧自定义操作 | | showIndex | bool? | - | 是否显示页码 | | width | double? | - | 图片宽度 | + +``` +``` + +### TDImageViewer + +#### 静态方法 + +| 名称 | 返回类型 | 参数 | 说明 | +| --- | --- | --- | --- | +| showImageViewer | | required BuildContext context, required List images, List? labels, bool? closeBtn, bool? deleteBtn, bool? showIndex, bool? loop, bool? autoplay, int? duration, Color? bgColor, Color? navBarBgColor, Color? iconColor, TextStyle? labelStyle, TextStyle? indexStyle, Color? modalBarrierColor, bool? barrierDismissible, int? defaultIndex, double? width, double? height, OnIndexChange? onIndexChange, OnClose? onClose, OnDelete? onDelete, bool? ignoreDeleteError, OnImageTap? onTap, OnLongPress? onLongPress, LeftItemBuilder? leftItemBuilder, RightItemBuilder? rightItemBuilder, | 显示图片预览 | diff --git a/tdesign-component/example/assets/api/indexes_api.md b/tdesign-component/example/assets/api/indexes_api.md index 12c8e5472..6b3038a4d 100644 --- a/tdesign-component/example/assets/api/indexes_api.md +++ b/tdesign-component/example/assets/api/indexes_api.md @@ -1,4 +1,28 @@ ## API +### TDIndexes +#### 简介 +索引 +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| builderAnchor | Widget? Function(BuildContext context, String index, bool isPinnedToTop)? | - | 锚点自定义构建 | +| builderContent | Widget? Function(BuildContext context, String index) | - | 内容自定义构建 | +| builderIndex | Widget Function(BuildContext context, String index, bool isActive)? | - | 索引文本自定义构建,包括索引激活左侧提示 | +| capsuleTheme | bool? | false | 锚点是否为胶囊式样式 | +| indexList | List? | - | 索引字符列表。不传默认 A-Z | +| indexListMaxHeight | double? | 0.8 | 索引列表最大高度(父容器高度的百分比,默认 0.8) | +| key | | - | | +| onChange | void Function(String index)? | - | 索引发生变更时触发事件 | +| onSelect | void Function(String index)? | - | 点击侧边栏时触发事件 | +| reverse | bool? | false | 反方向滚动置顶 | +| scrollController | ScrollController? | - | 滚动控制器 | +| sticky | bool? | true | 锚点是否吸顶 | +| stickyOffset | double? | 0 | 锚点吸顶时与顶部的距离 | + +``` +``` + ### TDIndexesAnchor #### 简介 索引锚点 @@ -29,27 +53,3 @@ | indexListMaxHeight | double | 0.8 | 索引列表最大高度(父容器高度的百分比,默认0.8) | | key | | - | | | onSelect | void Function(String newIndex, String oldIndex) | - | 点击侧边栏时触发事件 | - -``` -``` - -### TDIndexes -#### 简介 -索引 -#### 默认构造方法 - -| 参数 | 类型 | 默认值 | 说明 | -| --- | --- | --- | --- | -| builderAnchor | Widget? Function(BuildContext context, String index, bool isPinnedToTop)? | - | 锚点自定义构建 | -| builderContent | Widget? Function(BuildContext context, String index) | - | 内容自定义构建 | -| builderIndex | Widget Function(BuildContext context, String index, bool isActive)? | - | 索引文本自定义构建,包括索引激活左侧提示 | -| capsuleTheme | bool? | false | 锚点是否为胶囊式样式 | -| indexList | List? | - | 索引字符列表。不传默认 A-Z | -| indexListMaxHeight | double? | 0.8 | 索引列表最大高度(父容器高度的百分比,默认 0.8) | -| key | | - | | -| onChange | void Function(String index)? | - | 索引发生变更时触发事件 | -| onSelect | void Function(String index)? | - | 点击侧边栏时触发事件 | -| reverse | bool? | false | 反方向滚动置顶 | -| scrollController | ScrollController? | - | 滚动控制器 | -| sticky | bool? | true | 锚点是否吸顶 | -| stickyOffset | double? | 0 | 锚点吸顶时与顶部的距离 | diff --git a/tdesign-component/example/assets/api/navbar_api.md b/tdesign-component/example/assets/api/navbar_api.md index 9bae72cef..bcc5b5fbc 100644 --- a/tdesign-component/example/assets/api/navbar_api.md +++ b/tdesign-component/example/assets/api/navbar_api.md @@ -42,5 +42,5 @@ | icon | IconData? | - | 图标 | | iconColor | Color? | - | 图标颜色 | | iconSize | double? | 24.0 | 图标尺寸 | -| ~~iconWidget~~ | Widget? | - | 已废弃,请使用 customWidget 代替 | +| iconWidget | Widget? | - | 图标组件,优先级高于 icon | | padding | EdgeInsetsGeometry? | - | | diff --git a/tdesign-component/example/assets/api/picker_api.md b/tdesign-component/example/assets/api/picker_api.md index 4fbb59d2d..d7f435069 100644 --- a/tdesign-component/example/assets/api/picker_api.md +++ b/tdesign-component/example/assets/api/picker_api.md @@ -1,4 +1,17 @@ ## API +### TDPicker + +#### 静态方法 + +| 名称 | 返回类型 | 参数 | 说明 | +| --- | --- | --- | --- | +| 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 dateStart, List? dateEnd, List? initialDate, List Function(DateTypeKey key, List 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> data, double pickerHeight, int pickerItemCount, List? 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, | 显示多级选择器 | + +``` +``` + ### TDMultiPicker #### 默认构造方法 @@ -80,16 +93,3 @@ | data | Map | - | 总的数据 | | initialData | | - | | | keepSameSelection | bool | false | 是否保留相同选项 | - -``` -``` - -### TDPicker - -#### 静态方法 - -| 名称 | 返回类型 | 参数 | 说明 | -| --- | --- | --- | --- | -| 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 dateStart, List? dateEnd, List? initialDate, List Function(DateTypeKey key, List 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> data, double pickerHeight, int pickerItemCount, List? 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, | 显示多级选择器 | diff --git a/tdesign-component/example/assets/api/popover_api.md b/tdesign-component/example/assets/api/popover_api.md index d1d03cd72..f828da27c 100644 --- a/tdesign-component/example/assets/api/popover_api.md +++ b/tdesign-component/example/assets/api/popover_api.md @@ -1,17 +1,4 @@ ## API -### TDPopover -#### 简介 - - -#### 静态方法 - -| 名称 | 返回类型 | 参数 | 说明 | -| --- | --- | --- | --- | -| showPopover | | required BuildContext context, String? content, Widget? contentWidget, double offset, TDPopoverTheme? theme, bool closeOnClickOutside, TDPopoverPlacement? placement, bool? showArrow, double arrowSize, EdgeInsetsGeometry? padding, double? width, double? height, Color? overlayColor, OnTap? onTap, OnLongTap? onLongTap, BorderRadius? radius, | | - -``` -``` - ### TDPopoverWidget #### 简介 @@ -34,3 +21,16 @@ | showArrow | bool? | true | 是否显示浮层箭头 | | theme | TDPopoverTheme? | - | 弹出气泡主题 | | width | double? | - | 内容宽度(包含padding,实际高度:height - paddingLeft - paddingRight) | + +``` +``` + +### TDPopover +#### 简介 + + +#### 静态方法 + +| 名称 | 返回类型 | 参数 | 说明 | +| --- | --- | --- | --- | +| showPopover | | required BuildContext context, String? content, Widget? contentWidget, double offset, TDPopoverTheme? theme, bool closeOnClickOutside, TDPopoverPlacement? placement, bool? showArrow, double arrowSize, EdgeInsetsGeometry? padding, double? width, double? height, Color? overlayColor, OnTap? onTap, OnLongTap? onLongTap, BorderRadius? radius, | | diff --git a/tdesign-component/example/assets/api/popup_api.md b/tdesign-component/example/assets/api/popup_api.md index 09b484641..16b6f331b 100644 --- a/tdesign-component/example/assets/api/popup_api.md +++ b/tdesign-component/example/assets/api/popup_api.md @@ -1,4 +1,30 @@ ## API +### TDSlidePopupRoute +#### 简介 +从屏幕的某个方向滑动弹出的Dialog框的路由,比如从顶部、底部、左、右滑出页面 +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| barrierClick | VoidCallback? | - | 蒙层点击事件,仅在[modalBarrierFull]为false时触发 | +| barrierLabel | | - | | +| builder | WidgetBuilder | - | 控件构建器 | +| close | VoidCallback? | - | 关闭前事件 | +| focusMove | bool | false | 是否有输入框获取焦点时整体平移避免输入框被遮挡 | +| isDismissible | bool | true | 点击蒙层能否关闭 | +| modalBarrierColor | Color? | Colors.black54 | 蒙层颜色 | +| modalBarrierFull | bool | false | 是否全屏显示蒙层 | +| modalHeight | double? | - | 弹出框高度 | +| modalLeft | double? | 0 | 弹出框左侧距离 | +| modalTop | double? | 0 | 弹出框顶部距离 | +| modalWidth | double? | - | 弹出框宽度 | +| open | VoidCallback? | - | 打开前事件 | +| opened | VoidCallback? | - | 打开后事件 | +| slideTransitionFrom | SlideTransitionFrom | SlideTransitionFrom.bottom | 设置从屏幕的哪个方向滑出 | + +``` +``` + ### TDPopupBottomDisplayPanel #### 简介 右上角带关闭的底部浮层面板 @@ -69,29 +95,3 @@ | closeUnderBottom | bool | false | 关闭按钮是否在视图框下方 | | key | | - | | | radius | double? | - | 圆角 | - -``` -``` - -### TDSlidePopupRoute -#### 简介 -从屏幕的某个方向滑动弹出的Dialog框的路由,比如从顶部、底部、左、右滑出页面 -#### 默认构造方法 - -| 参数 | 类型 | 默认值 | 说明 | -| --- | --- | --- | --- | -| barrierClick | VoidCallback? | - | 蒙层点击事件,仅在[modalBarrierFull]为false时触发 | -| barrierLabel | | - | | -| builder | WidgetBuilder | - | 控件构建器 | -| close | VoidCallback? | - | 关闭前事件 | -| focusMove | bool | false | 是否有输入框获取焦点时整体平移避免输入框被遮挡 | -| isDismissible | bool | true | 点击蒙层能否关闭 | -| modalBarrierColor | Color? | Colors.black54 | 蒙层颜色 | -| modalBarrierFull | bool | false | 是否全屏显示蒙层 | -| modalHeight | double? | - | 弹出框高度 | -| modalLeft | double? | 0 | 弹出框左侧距离 | -| modalTop | double? | 0 | 弹出框顶部距离 | -| modalWidth | double? | - | 弹出框宽度 | -| open | VoidCallback? | - | 打开前事件 | -| opened | VoidCallback? | - | 打开后事件 | -| slideTransitionFrom | SlideTransitionFrom | SlideTransitionFrom.bottom | 设置从屏幕的哪个方向滑出 | diff --git a/tdesign-component/example/assets/api/side-bar_api.md b/tdesign-component/example/assets/api/side-bar_api.md index f4cd3ae5f..fa2ae628a 100644 --- a/tdesign-component/example/assets/api/side-bar_api.md +++ b/tdesign-component/example/assets/api/side-bar_api.md @@ -1,20 +1,4 @@ ## API -### TDSideBarItem -#### 默认构造方法 - -| 参数 | 类型 | 默认值 | 说明 | -| --- | --- | --- | --- | -| badge | TDBadge? | - | 徽标 | -| disabled | bool | false | 是否禁用 | -| icon | IconData? | - | 图标 | -| key | | - | | -| label | String | '' | 标签 | -| textStyle | TextStyle? | - | 标签样式 | -| value | int | -1 | 值 | - -``` -``` - ### TDSideBar #### 默认构造方法 @@ -37,3 +21,19 @@ | unSelectedBgColor | Color? | - | 未选择的背景颜色 | | unSelectedColor | Color? | - | 未选中颜色 | | value | int? | - | 选项值 | + +``` +``` + +### TDSideBarItem +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| badge | TDBadge? | - | 徽标 | +| disabled | bool | false | 是否禁用 | +| icon | IconData? | - | 图标 | +| key | | - | | +| label | String | '' | 标签 | +| textStyle | TextStyle? | - | 标签样式 | +| value | int | -1 | 值 | diff --git a/tdesign-component/example/assets/api/skeleton_api.md b/tdesign-component/example/assets/api/skeleton_api.md index fff0eab99..ce7638140 100644 --- a/tdesign-component/example/assets/api/skeleton_api.md +++ b/tdesign-component/example/assets/api/skeleton_api.md @@ -1,4 +1,24 @@ ## API +### TDSkeleton +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| animation | TDSkeletonAnimation? | - | 动画效果 | +| delay | int | 0 | 延迟显示加载时间 | +| key | | - | | +| theme | | TDSkeletonTheme.text | | + + +#### 工厂构造方法 + +| 名称 | 说明 | +| --- | --- | +| TDSkeleton.fromRowCol | 从行列框架创建骨架屏 | + +``` +``` + ### TDSkeletonRowColStyle #### 默认构造方法 @@ -61,23 +81,3 @@ | TDSkeletonRowColObj.rect | 矩形 | | TDSkeletonRowColObj.spacer | 空白占位符 | | TDSkeletonRowColObj.text | 文本 | - -``` -``` - -### TDSkeleton -#### 默认构造方法 - -| 参数 | 类型 | 默认值 | 说明 | -| --- | --- | --- | --- | -| animation | TDSkeletonAnimation? | - | 动画效果 | -| delay | int | 0 | 延迟显示加载时间 | -| key | | - | | -| theme | | TDSkeletonTheme.text | | - - -#### 工厂构造方法 - -| 名称 | 说明 | -| --- | --- | -| TDSkeleton.fromRowCol | 从行列框架创建骨架屏 | diff --git a/tdesign-component/example/assets/api/swiper_api.md b/tdesign-component/example/assets/api/swiper_api.md index f63dc7d31..8937c8f81 100644 --- a/tdesign-component/example/assets/api/swiper_api.md +++ b/tdesign-component/example/assets/api/swiper_api.md @@ -1,19 +1,4 @@ ## API -### TDSwiperPagination -#### 简介 -TDesign风格的Swiper指示器样式,与flutter_swiper的Swiper结合使用 -#### 默认构造方法 - -| 参数 | 类型 | 默认值 | 说明 | -| --- | --- | --- | --- | -| alignment | Alignment? | - | 当 scrollDirection== Axis.horizontal 时,默认Alignment.bottomCenter | -| builder | SwiperPlugin | TDSwiperPagination.dots | 具体样式 | -| key | Key? | - | | -| margin | EdgeInsetsGeometry | const EdgeInsets.all(10.0) | 指示器和container之间的距离 | - -``` -``` - ### TDPageTransformer #### 简介 TD默认PageTransformer @@ -32,3 +17,18 @@ TD默认PageTransformer | --- | --- | | TDPageTransformer.margin | 普通margin的卡片式 | | TDPageTransformer.scaleAndFade | 缩放或透明的卡片式 | + +``` +``` + +### TDSwiperPagination +#### 简介 +TDesign风格的Swiper指示器样式,与flutter_swiper的Swiper结合使用 +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| alignment | Alignment? | - | 当 scrollDirection== Axis.horizontal 时,默认Alignment.bottomCenter | +| builder | SwiperPlugin | TDSwiperPagination.dots | 具体样式 | +| key | Key? | - | | +| margin | EdgeInsetsGeometry | const EdgeInsets.all(10.0) | 指示器和container之间的距离 | diff --git a/tdesign-component/example/assets/api/tab-bar_api.md b/tdesign-component/example/assets/api/tab-bar_api.md index 6a825c0f8..2931ec179 100644 --- a/tdesign-component/example/assets/api/tab-bar_api.md +++ b/tdesign-component/example/assets/api/tab-bar_api.md @@ -52,6 +52,7 @@ | navigationTabs | List | - | tabs配置 | | needInkWell | bool | false | 是否需要水波纹效果 | | outlineType | TDBottomTabBarOutlineType? | TDBottomTabBarOutlineType.filled | 标签栏样式 默认filled | +| placeholder | bool | true | 是否添加安全区域占位 | | selectedBgColor | Color? | - | 选中时背景颜色 | | showTopBorder | bool? | true | 是否展示bar上边线(设置为true 但是topBorder样式未设置,则使用默认值,非胶囊型才生效) | | topBorder | BorderSide? | - | 上边线样式 | diff --git a/tdesign-component/example/assets/api/table_api.md b/tdesign-component/example/assets/api/table_api.md index ae1ca9994..aed67b72d 100644 --- a/tdesign-component/example/assets/api/table_api.md +++ b/tdesign-component/example/assets/api/table_api.md @@ -27,17 +27,6 @@ ``` ``` -### TDTableEmpty -#### 默认构造方法 - -| 参数 | 类型 | 默认值 | 说明 | -| --- | --- | --- | --- | -| assetUrl | String? | - | 空状态图片 | -| text | String? | - | 空状态文字 | - -``` -``` - ### TDTableCol #### 默认构造方法 @@ -55,3 +44,14 @@ | sortable | bool? | false | 是否可排序 | | title | String? | - | 表头标题 | | width | double? | - | 列宽 | + +``` +``` + +### TDTableEmpty +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| assetUrl | String? | - | 空状态图片 | +| text | String? | - | 空状态文字 | diff --git a/tdesign-component/example/assets/api/tabs_api.md b/tdesign-component/example/assets/api/tabs_api.md index 4ef3a372d..2d7b3631a 100644 --- a/tdesign-component/example/assets/api/tabs_api.md +++ b/tdesign-component/example/assets/api/tabs_api.md @@ -1,17 +1,4 @@ ## API -### TDTabBarView -#### 默认构造方法 - -| 参数 | 类型 | 默认值 | 说明 | -| --- | --- | --- | --- | -| children | List | - | 子widget列表 | -| controller | TabController? | - | 控制器 | -| isSlideSwitch | bool | false | 是否可以滑动切换 | -| key | | - | | - -``` -``` - ### TDTabBar #### 默认构造方法 @@ -48,6 +35,19 @@ ``` ``` +### TDTabBarView +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| children | List | - | 子widget列表 | +| controller | TabController? | - | 控制器 | +| isSlideSwitch | bool | false | 是否可以滑动切换 | +| key | | - | | + +``` +``` + ### TDTab #### 默认构造方法 diff --git a/tdesign-component/example/assets/api/tag_api.md b/tdesign-component/example/assets/api/tag_api.md index 53aa0065b..b5ac05c49 100644 --- a/tdesign-component/example/assets/api/tag_api.md +++ b/tdesign-component/example/assets/api/tag_api.md @@ -1,30 +1,26 @@ ## API -### TDTag +### TDTagStyle #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| backgroundColor | Color? | - | 背景颜色,优先级高于style的backgroundColor | -| disable | bool | false | 是否为禁用状态 | -| fixedWidth | double? | - | 标签的固定宽度 | -| font | Font? | - | 字体尺寸,优先级高于style的font | -| fontWeight | FontWeight? | - | 字体粗细,优先级高于style的fontWeight | -| forceVerticalCenter | bool | true | 是否强制中文文字居中 | -| icon | IconData? | - | 图标内容,可随状态改变颜色 | -| iconWidget | Widget? | - | 自定义图标内容,需自处理颜色 | -| isLight | bool | false | 是否为浅色 | -| isOutline | bool | false | 是否为描边类型,默认不是 | -| key | | - | | -| needCloseIcon | bool | false | 关闭图标 | -| onCloseTap | GestureTapCallback? | - | 关闭图标点击事件 | -| overflow | TextOverflow? | - | 文字溢出处理 | -| padding | EdgeInsets? | - | 自定义模式下的间距 | -| shape | TDTagShape | TDTagShape.square | 标签形状 | -| size | TDTagSize | TDTagSize.medium | 标签大小 | -| style | TDTagStyle? | - | 标签样式 | -| text | String | text | 标签内容 | -| textColor | Color? | - | 文字颜色,优先级高于style的textColor | -| theme | TDTagTheme? | - | 主题 | +| backgroundColor | Color? | - | 背景颜色 | +| border | double | 0 | 线框粗细 | +| borderColor | Color? | - | 边框颜色 | +| borderRadius | BorderRadiusGeometry? | - | 圆角 | +| context | BuildContext? | - | 上下文,方便获取主题内容 | +| font | Font? | - | 字体尺寸 | +| fontWeight | FontWeight? | - | 字体粗细 | +| textColor | Color? | - | 文字颜色 | + + +#### 工厂构造方法 + +| 名称 | 说明 | +| --- | --- | +| TDTagStyle.generateDisableSelectStyle | 根据主题生成禁用Tag样式 | +| TDTagStyle.generateFillStyleByTheme | 根据主题生成填充Tag样式 | +| TDTagStyle.generateOutlineStyleByTheme | 根据主题生成描边Tag样式 | ``` ``` @@ -58,25 +54,29 @@ ``` ``` -### TDTagStyle +### TDTag #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| backgroundColor | Color? | - | 背景颜色 | -| border | double | 0 | 线框粗细 | -| borderColor | Color? | - | 边框颜色 | -| borderRadius | BorderRadiusGeometry? | - | 圆角 | -| context | BuildContext? | - | 上下文,方便获取主题内容 | -| font | Font? | - | 字体尺寸 | -| fontWeight | FontWeight? | - | 字体粗细 | -| textColor | Color? | - | 文字颜色 | - - -#### 工厂构造方法 - -| 名称 | 说明 | -| --- | --- | -| TDTagStyle.generateDisableSelectStyle | 根据主题生成禁用Tag样式 | -| TDTagStyle.generateFillStyleByTheme | 根据主题生成填充Tag样式 | -| TDTagStyle.generateOutlineStyleByTheme | 根据主题生成描边Tag样式 | +| backgroundColor | Color? | - | 背景颜色,优先级高于style的backgroundColor | +| disable | bool | false | 是否为禁用状态 | +| fixedWidth | double? | - | 标签的固定宽度 | +| font | Font? | - | 字体尺寸,优先级高于style的font | +| fontWeight | FontWeight? | - | 字体粗细,优先级高于style的fontWeight | +| forceVerticalCenter | bool | true | 是否强制中文文字居中 | +| icon | IconData? | - | 图标内容,可随状态改变颜色 | +| iconWidget | Widget? | - | 自定义图标内容,需自处理颜色 | +| isLight | bool | false | 是否为浅色 | +| isOutline | bool | false | 是否为描边类型,默认不是 | +| key | | - | | +| needCloseIcon | bool | false | 关闭图标 | +| onCloseTap | GestureTapCallback? | - | 关闭图标点击事件 | +| overflow | TextOverflow? | - | 文字溢出处理 | +| padding | EdgeInsets? | - | 自定义模式下的间距 | +| shape | TDTagShape | TDTagShape.square | 标签形状 | +| size | TDTagSize | TDTagSize.medium | 标签大小 | +| style | TDTagStyle? | - | 标签样式 | +| text | String | text | 标签内容 | +| textColor | Color? | - | 文字颜色,优先级高于style的textColor | +| theme | TDTagTheme? | - | 主题 | diff --git a/tdesign-component/example/assets/api/time-counter_api.md b/tdesign-component/example/assets/api/time-counter_api.md index fe5f16706..64ca2af8a 100644 --- a/tdesign-component/example/assets/api/time-counter_api.md +++ b/tdesign-component/example/assets/api/time-counter_api.md @@ -1,4 +1,35 @@ ## API +### TDTimeCounter +#### 简介 +计时组件 +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| autoStart | bool | true | 是否自动开始倒计时 | +| content | dynamic | 'default' | 'default' / Widget Function(int time) / Widget | +| controller | TDTimeCounterController? | - | 控制器,可控制开始/暂停/继续/重置 | +| direction | TDTimeCounterDirection | TDTimeCounterDirection.down | 计时方向,默认倒计时 | +| format | String | 'HH:mm:ss' | 时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒(分隔符必须为长度为1的非空格的字符) | +| key | | - | | +| millisecond | bool | false | 是否开启毫秒级渲染 | +| onChange | Function(int time)? | - | 时间变化时触发回调 | +| onFinish | VoidCallback? | - | 计时结束时触发回调 | +| size | TDTimeCounterSize | TDTimeCounterSize.medium | 尺寸 | +| splitWithUnit | bool | false | 使用时间单位分割 | +| style | TDTimeCounterStyle? | - | 自定义样式,有则优先用它,没有则根据size和theme选取 | +| theme | TDTimeCounterTheme | TDTimeCounterTheme.defaultTheme | 风格 | +| time | int | - | 必需;计时时长,单位毫秒 | + +``` +``` + +### TDTimeCounterController +#### 简介 +倒计时组件控制器,可控制开始(`start()`)/暂停(`pause()`)/继续(`resume()`)/重置(`reset([int? time])`) +``` +``` + ### TDTimeCounterStyle #### 简介 计时组件样式 @@ -28,34 +59,3 @@ | 名称 | 说明 | | --- | --- | | TDTimeCounterStyle.generateStyle | 生成默认样式 | - -``` -``` - -### TDTimeCounterController -#### 简介 -倒计时组件控制器,可控制开始(`start()`)/暂停(`pause()`)/继续(`resume()`)/重置(`reset([int? time])`) -``` -``` - -### TDTimeCounter -#### 简介 -计时组件 -#### 默认构造方法 - -| 参数 | 类型 | 默认值 | 说明 | -| --- | --- | --- | --- | -| autoStart | bool | true | 是否自动开始倒计时 | -| content | dynamic | 'default' | 'default' / Widget Function(int time) / Widget | -| controller | TDTimeCounterController? | - | 控制器,可控制开始/暂停/继续/重置 | -| direction | TDTimeCounterDirection | TDTimeCounterDirection.down | 计时方向,默认倒计时 | -| format | String | 'HH:mm:ss' | 时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒(分隔符必须为长度为1的非空格的字符) | -| key | | - | | -| millisecond | bool | false | 是否开启毫秒级渲染 | -| onChange | Function(int time)? | - | 时间变化时触发回调 | -| onFinish | VoidCallback? | - | 计时结束时触发回调 | -| size | TDTimeCounterSize | TDTimeCounterSize.medium | 尺寸 | -| splitWithUnit | bool | false | 使用时间单位分割 | -| style | TDTimeCounterStyle? | - | 自定义样式,有则优先用它,没有则根据size和theme选取 | -| theme | TDTimeCounterTheme | TDTimeCounterTheme.defaultTheme | 风格 | -| time | int | - | 必需;计时时长,单位毫秒 | diff --git a/tdesign-component/example/assets/api/tree-select_api.md b/tdesign-component/example/assets/api/tree-select_api.md index ead62be0a..40b5bd1d9 100644 --- a/tdesign-component/example/assets/api/tree-select_api.md +++ b/tdesign-component/example/assets/api/tree-select_api.md @@ -25,5 +25,5 @@ | multiple | bool | false | 支持多选 | | onChange | TDTreeSelectChangeEvent? | - | 选中值发生变化 | | options | List | const [] | 展示的选项列表 | -| outwardCornerRadius | double | 9 | 一级菜单选中项的外弯折圆角半径 | +| outwardCornerRadius | double | 9 | 一级菜单选中项的外弯折圆角半径,默认为 9 | | style | TDTreeSelectStyle | TDTreeSelectStyle.normal | 一级菜单样式 | diff --git a/tdesign-component/lib/src/components/tabbar/td_bottom_tab_bar.dart b/tdesign-component/lib/src/components/tabbar/td_bottom_tab_bar.dart index fb6cb922d..74dcbf1fd 100644 --- a/tdesign-component/lib/src/components/tabbar/td_bottom_tab_bar.dart +++ b/tdesign-component/lib/src/components/tabbar/td_bottom_tab_bar.dart @@ -155,6 +155,7 @@ class TDBottomTabBar extends StatefulWidget { this.showTopBorder = true, this.topBorder, this.useSafeArea = true, + this.placeholder = true, this.selectedBgColor, this.unselectedBgColor, this.backgroundColor, @@ -241,6 +242,9 @@ class TDBottomTabBar extends StatefulWidget { /// 使用安全区域 final bool useSafeArea; + /// 是否添加安全区域占位 + final bool placeholder; + /// 选中时背景颜色 final Color? selectedBgColor; @@ -322,6 +326,7 @@ class _TDBottomTabBarState extends State Widget build(BuildContext context) { var isCapsuleOutlineType = widget.outlineType == TDBottomTabBarOutlineType.capsule; + var safeAreaBottomHeight = MediaQuery.of(context).padding.bottom; return AnimatedBuilder( animation: _animationController, @@ -374,7 +379,15 @@ class _TDBottomTabBarState extends State _verticalDivider(), ])); if (widget.useSafeArea) { - result = SafeArea(child: result); + if (widget.placeholder) { + result = Container( + padding: EdgeInsets.only(bottom: safeAreaBottomHeight), + color: widget.backgroundColor ?? TDTheme.of(context).bgColorContainer, + child: result, + ); + } else { + result = SafeArea(child: result); + } } return result; },