Skip to content
Merged
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
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { TdFormProps, TdFormItemProps } from './type';

export const formDefaultProps: TdFormProps = {
colon: false,
contentAlign: 'left',
disabled: undefined,
id: undefined,
labelAlign: 'right',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ name | type | default | description | required
className | String | - | className of component | N
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N
colon | Boolean | false | \- | N
contentAlign | String | left | options: left/right | N
disabled | Boolean | undefined | \- | N
errorMessage | Object | - | Typescript:`FormErrorMessage` | N
id | String | undefined | native id attribute of the form,which supports being used in conjunction with non-form buttons through the form attribute to trigger form events | N
Expand Down Expand Up @@ -49,6 +50,7 @@ name | type | default | description | required
className | String | - | className of component | N
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N
arrow | Boolean | false | \- | N
contentAlign | String | - | options: left/right | N
for | String | - | \- | N
help | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
label | TNode | '' | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
Expand Down
2 changes: 2 additions & 0 deletions packages/products/tdesign-mobile-react/src/form/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
colon | Boolean | false | 是否在表单标签字段右侧显示冒号 | N
contentAlign | String | left | 表单内容对齐方式:左对齐、右对齐。可选项:left/right | N
disabled | Boolean | undefined | 是否禁用整个表单 | N
errorMessage | Object | - | 表单错误信息配置,示例:`{ idcard: '请输入正确的身份证号码', max: '字符长度不能超过 ${max}' }`。TS 类型:`FormErrorMessage` | N
id | String | undefined | 表单原生的id属性,支持用于配合非表单内的按钮通过form属性来触发表单事件 | N
Expand Down Expand Up @@ -49,6 +50,7 @@ validateOnly | `(params?: Pick<FormValidateParams, 'fields' \| 'trigger'>)` | `P
className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
arrow | Boolean | false | 是否显示右侧箭头 | N
contentAlign | String | - | 表单内容对齐方式,优先级高于 Form.contentAlign。可选项:left/right | N
for | String | - | label 原生属性 | N
help | TNode | - | 表单项说明内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
label | TNode | '' | 字段标签名称。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
Expand Down
9 changes: 9 additions & 0 deletions packages/products/tdesign-mobile-react/src/form/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ export interface TdFormProps<FormData extends Data = Data> {
* @default false
*/
colon?: boolean;
/**
* 表单内容对齐方式:左对齐、右对齐
* @default left
*/
contentAlign?: 'left' | 'right';
/**
* 是否禁用整个表单
*/
Expand Down Expand Up @@ -128,6 +133,10 @@ export interface TdFormItemProps {
* @default false
*/
arrow?: boolean;
/**
* 表单内容对齐方式,优先级高于 Form.contentAlign
*/
contentAlign?: 'left' | 'right';
/**
* label 原生属性
* @default ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import { PropType } from 'vue';
export default {
/** 是否显示右侧箭头 */
arrow: Boolean,
/** 表单内容对齐方式:左对齐、右对齐 */
/** 表单内容对齐方式,优先级高于 Form.contentAlign */
contentAlign: {
type: String as PropType<TdFormItemProps['contentAlign']>,
default: 'left' as TdFormItemProps['contentAlign'],
validator(val: TdFormItemProps['contentAlign']): boolean {
if (!val) return true;
return ['left', 'right'].includes(val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ validateOnly | `(params?: Pick<FormValidateParams, 'fields' \| 'trigger'>)` | `P
name | type | default | description | required
-- | -- | -- | -- | --
arrow | Boolean | false | \- | N
contentAlign | String | left | options: left/right | N
contentAlign | String | - | options: left/right | N
for | String | - | \- | N
help | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
label | String / Slot / Function | '' | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-mobile-vue/src/form/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ validateOnly | `(params?: Pick<FormValidateParams, 'fields' \| 'trigger'>)` | `P
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
arrow | Boolean | false | 是否显示右侧箭头 | N
contentAlign | String | left | 表单内容对齐方式:左对齐、右对齐。可选项:left/right | N
contentAlign | String | - | 表单内容对齐方式,优先级高于 Form.contentAlign。可选项:left/right | N
for | String | - | label 原生属性 | N
help | String / Slot / Function | - | 表单项说明内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
label | String / Slot / Function | '' | 字段标签名称。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
Expand Down
3 changes: 1 addition & 2 deletions packages/products/tdesign-mobile-vue/src/form/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ export interface TdFormItemProps {
*/
arrow?: boolean;
/**
* 表单内容对齐方式:左对齐、右对齐
* @default left
* 表单内容对齐方式,优先级高于 Form.contentAlign
*/
contentAlign?: 'left' | 'right';
/**
Expand Down
16 changes: 10 additions & 6 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -54571,7 +54571,8 @@
{
"id": 1712574615,
"platform_framework": [
"8"
"8",
"16"
],
"component": "Form",
"field_category": 1,
Expand Down Expand Up @@ -54599,7 +54600,8 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)"
"Vue(Mobile)",
"React(Mobile)"
],
"field_type_text": [
"String"
Expand Down Expand Up @@ -57202,17 +57204,18 @@
{
"id": 1712574874,
"platform_framework": [
"8"
"8",
"16"
],
"component": "FormItem",
"field_category": 1,
"field_name": "contentAlign",
"field_type": [
"1"
],
"field_default_value": "left",
"field_default_value": "",
"field_enum": "left/right",
"field_desc_zh": "表单内容对齐方式:左对齐、右对齐",
"field_desc_zh": "表单内容对齐方式,优先级高于 Form.contentAlign",
"field_desc_en": null,
"field_required": 0,
"event_input": "",
Expand All @@ -57230,7 +57233,8 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)"
"Vue(Mobile)",
"React(Mobile)"
],
"field_type_text": [
"String"
Expand Down