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 35b0877fa..4046c90ef 100644 --- a/tdesign-component/example/assets/api/calendar_api.md +++ b/tdesign-component/example/assets/api/calendar_api.md @@ -1,4 +1,18 @@ ## API +### TDCalendarPopup +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| autoClose | bool? | true | 自动关闭;在点击关闭按钮、确认按钮、遮罩层时自动关闭 | +| builder | CalendarBuilder? | - | 控件构建器,优先级高于[child] | +| child | TDCalendar? | - | 日历控件 | +| confirmBtn | Widget? | - | 自定义确认按钮 | +| context | BuildContext | context | 上下文 | +| onClose | VoidCallback? | - | 关闭时触发 | +| onConfirm | void Function(List value)? | - | 点击确认按钮时触发 | +| top | double? | - | 距离顶部的距离 | +| visible | bool? | - | 默认是否显示日历 | ### TDCalendarDataSource ``` ``` @@ -89,17 +103,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/dialog_api.md b/tdesign-component/example/assets/api/dialog_api.md index 99f110130..320c2b645 100644 --- a/tdesign-component/example/assets/api/dialog_api.md +++ b/tdesign-component/example/assets/api/dialog_api.md @@ -1,40 +1,72 @@ ## API + +### TDDialogScaffold +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| backgroundColor | Color? | - | 背景色 | +| body | Widget | - | Dialog主体 | +| key | | - | | +| radius | double | 12.0 | 圆角 | +| showCloseButton | bool? | - | 显示右上角关闭按钮 | +| width | double? | - | 弹窗宽度 | + +``` +``` + +### TDDialogTitle +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| key | | - | | +| title | String? | - | 标题文字 | +| titleColor | Color? | - | 标题颜色 | + +``` +``` + +### TDDialogContent +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| content | String? | - | 标题文字 | +| contentColor | Color? | - | 标题颜色 | +| key | | - | | + +``` +``` + +### TDDialogInfoWidget ### TDAlertDialog #### 默认构造方法 | 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| 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] | - ``` ``` + +### HorizontalNormalButtons +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| key | | - | | +| leftBtn | TDDialogButtonOptions | - | 左按钮 | +| rightBtn | TDDialogButtonOptions | - | 右按钮 | ### TDInputDialog #### 默认构造方法 @@ -61,56 +93,76 @@ ``` ``` -### 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? | - | 标题颜色 | @@ -118,45 +170,91 @@ ``` ``` -### 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 | | - | | +| 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] | | onPressed | Function() | - | 点击 | | width | double? | - | 按钮宽度 | diff --git a/tdesign-component/example/assets/api/form_api.md b/tdesign-component/example/assets/api/form_api.md index 08c08b03e..e7b1033db 100644 --- a/tdesign-component/example/assets/api/form_api.md +++ b/tdesign-component/example/assets/api/form_api.md @@ -1,4 +1,49 @@ ## API + +### TDFormItem +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| additionInfo | String? | - | TDInput的辅助信息 | +| backgroundColor | Color? | - | 背景色 | +| child | Widget? | - | 表单子组件 | +| contentAlign | TextAlign? | - | 表单显示内容对齐方式: | +| formItemNotifier | | - | | +| formRules | List? | - | 整个表单的校验规则 | +| help | String? | - | TDInput 默认显示文字 | +| hintText | null | '' | 提示内容 | +| indicator | bool? | - | TDTextarea 的属性,指示器 | +| itemRule | List? | - | 表单项验证规则 | +| key | | - | | +| label | String? | - | 表单项标签左侧展示的内容 | +| labelAlign | TextAlign? | - | TODO: item 标签对齐方式 | +| labelWidget | Widget? | - | 自定义标签 | +| labelWidth | double? | - | 标签宽度,如果提供则覆盖Form的labelWidth | +| name | String? | - | 表单字段名称 | +| radios | | - | | +| requiredMark | bool? | true | 是否显示必填标记(*) | +| select | String | '' | 选择器 适用于日期选择器等 | +| selectFn | Function? | - | 选择器方法 适用于日期选择器等 | +| showErrorMessage | bool | true | 是否显示错误信息 | +| tipAlign | TextAlign? | - | 组件提示内容对齐方式 | +| type | TDFormItemType | - | 表格单元需要使用的组件类型 | + +``` +``` + +### TDFormValidation +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| errorMessage | String | - | 错误提示信息 | +| type | TDFormItemType | - | 校验对象的类型 | +| validate | String? Function(dynamic) | - | 校验方法 | + +``` +``` + ### TDForm #### 默认构造方法 @@ -25,6 +70,7 @@ | scrollToFirstError | String? | - | 表单校验不通过时,是否自动滚动到第一个校验不通过的字段,平滑滚动或是瞬间直达。 | | submitWithWarningMessage | bool? | false | 【讨论中】当校验结果只有告警信息时,是否触发 submit 提交事件 | + ``` ``` diff --git a/tdesign-component/example/assets/api/indexes_api.md b/tdesign-component/example/assets/api/indexes_api.md index a29a7e2e8..5449e8d43 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 #### 简介 索引锚点 @@ -15,7 +39,6 @@ ``` ``` - ### TDIndexes #### 简介 索引 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/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 0f927571c..598fce4e0 100644 --- a/tdesign-component/example/assets/api/table_api.md +++ b/tdesign-component/example/assets/api/table_api.md @@ -1,4 +1,29 @@ ## API + +### TDTable +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| backgroundColor | Color? | - | 表格背景色 | +| bordered | bool? | - | 是否显示表格边框 | +| columns | List | - | 列配置 | +| data | List? | - | 数据源 | +| defaultSort | String? | - | 默认排序 | +| empty | TDTableEmpty? | - | 空表格呈现样式 | +| footerWidget | Widget? | - | 自定义表尾 | +| height | double? | - | 表格高度,超出后会出现滚动条 | +| key | | - | | +| loading | bool? | false | 加载中状态 | +| loadingWidget | Widget? | - | 自定义加载中状态 | +| onCellTap | OnCellTap? | - | 单元格点击事件 | +| onRowSelect | OnRowSelect? | - | 行选择事件 | +| onScroll | OnScroll? | - | 表格滚动事件 | +| onSelect | OnSelect? | - | 选中行事件 | +| rowHeight | double? | - | 行高 | +| showHeader | bool? | true | 是否显示表头 | +| stripe | bool? | false | 斑马纹 | +| width | double? | - | 表格宽度 | ### TDTableEmpty #### 默认构造方法 @@ -31,6 +56,13 @@ ``` ``` +### TDTableEmpty +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| assetUrl | String? | - | 空状态图片 | +| text | String? | - | 空状态文字 | ### TDTable #### 默认构造方法 diff --git a/tdesign-component/example/assets/api/tabs_api.md b/tdesign-component/example/assets/api/tabs_api.md index 82a5ae722..d03282c4f 100644 --- a/tdesign-component/example/assets/api/tabs_api.md +++ b/tdesign-component/example/assets/api/tabs_api.md @@ -35,6 +35,19 @@ ``` ``` +### TDTabBarView +#### 默认构造方法 + +| 参数 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| children | List | - | 子widget列表 | +| controller | TabController? | - | 控制器 | +| isSlideSwitch | bool | false | 是否可以滑动切换 | +| key | | - | | + +``` +``` + ### TDTab #### 默认构造方法 diff --git a/tdesign-component/example/assets/api/time-counter_api.md b/tdesign-component/example/assets/api/time-counter_api.md index 382a2b250..da6634465 100644 --- a/tdesign-component/example/assets/api/time-counter_api.md +++ b/tdesign-component/example/assets/api/time-counter_api.md @@ -1,4 +1,5 @@ ## API + ### TDTimeCounterController #### 简介 倒计时组件控制器,可控制开始(`start()`)/暂停(`pause()`)/继续(`resume()`)/重置(`reset([int? time])`) @@ -30,6 +31,12 @@ ``` ``` +### TDTimeCounterController +#### 简介 +倒计时组件控制器,可控制开始(`start()`)/暂停(`pause()`)/继续(`resume()`)/重置(`reset([int? time])`) +``` +``` + ### TDTimeCounterStyle #### 简介 计时组件样式 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; },