diff --git a/db/TDesign.db b/db/TDesign.db index ff7d2823..28c51be5 100644 Binary files a/db/TDesign.db and b/db/TDesign.db differ diff --git a/packages/products/tdesign-mobile-react/src/steps/defaultProps.ts b/packages/products/tdesign-mobile-react/src/steps/defaultProps.ts new file mode 100644 index 00000000..f4e602a9 --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/steps/defaultProps.ts @@ -0,0 +1,15 @@ +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdStepsProps, TdStepItemProps } from './type'; + +export const stepsDefaultProps: TdStepsProps = { + currentStatus: 'process', + layout: 'horizontal', + readonly: false, + sequence: 'positive', + theme: 'default', +}; + +export const stepItemDefaultProps: TdStepItemProps = { content: '', status: 'default', title: '', titleRight: '' }; diff --git a/packages/products/tdesign-mobile-react/src/steps/steps.en-US.md b/packages/products/tdesign-mobile-react/src/steps/steps.en-US.md new file mode 100644 index 00000000..c2a24394 --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/steps/steps.en-US.md @@ -0,0 +1,33 @@ +:: BASE_DOC :: + +## API + +### Steps Props + +name | type | default | description | required +-- | -- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N +current | String / Number | - | \- | N +defaultCurrent | String / Number | - | uncontrolled property | N +currentStatus | String | process | options: default/process/finish/error | N +layout | String | horizontal | options: horizontal/vertical | N +readonly | Boolean | false | \- | N +sequence | String | positive | options: positive/reverse | N +theme | String | default | options: default/dot | N +onChange | Function | | Typescript:`(current: string \| number, previous: string \| number, context?: { e?: MouseEvent }) => void`
| N + + +### StepItem Props + +name | type | default | description | required +-- | -- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N +children | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +content | TNode | '' | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +extra | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +icon | TNode | - | Typescript:`boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +status | String | default | options: default/process/finish/error。Typescript:`StepStatus` `type StepStatus = 'default' \| 'process' \| 'finish' \| 'error'`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/steps/type.ts) | N +title | TNode | '' | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +titleRight | TNode | '' | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N diff --git a/packages/products/tdesign-mobile-react/src/steps/steps.md b/packages/products/tdesign-mobile-react/src/steps/steps.md new file mode 100644 index 00000000..79b77824 --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/steps/steps.md @@ -0,0 +1,33 @@ +:: BASE_DOC :: + +## API + +### Steps Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +current | String / Number | - | 当前步骤,即整个步骤条进度。默认根据步骤下标判断步骤的完成状态,当前步骤为进行中,当前步骤之前的步骤为已完成,当前步骤之后的步骤为未开始。如果每个步骤没有设置 value,current 值为步骤长度则表示所有步骤已完成。如果每个步骤设置了自定义 value,则 current = 'FINISH' 表示所有状态完成 | N +defaultCurrent | String / Number | - | 当前步骤,即整个步骤条进度。默认根据步骤下标判断步骤的完成状态,当前步骤为进行中,当前步骤之前的步骤为已完成,当前步骤之后的步骤为未开始。如果每个步骤没有设置 value,current 值为步骤长度则表示所有步骤已完成。如果每个步骤设置了自定义 value,则 current = 'FINISH' 表示所有状态完成。非受控属性 | N +currentStatus | String | process | 用于控制 current 指向的步骤条的状态。可选项:default/process/finish/error | N +layout | String | horizontal | 步骤条方向,有两种:横向和纵向。可选项:horizontal/vertical | N +readonly | Boolean | false | 只读状态 | N +sequence | String | positive | 步骤条顺序。可选项:positive/reverse | N +theme | String | default | 步骤条风格。可选项:default/dot | N +onChange | Function | | TS 类型:`(current: string \| number, previous: string \| number, context?: { e?: MouseEvent }) => void`
当前步骤发生变化时触发 | N + + +### StepItem Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +children | TNode | - | 步骤描述,同 content。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +content | TNode | '' | 步骤描述。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +extra | TNode | - | 显示在步骤描述下方的额外内容,比如:操作项。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +icon | TNode | - | 图标,默认显示内置图标,也可以自定义图标,值为 false 则不显示图标。优先级大于 `status` 定义的图标。TS 类型:`boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +status | String | default | 当前步骤的状态:默认状态(未开始)、进行中状态、完成状态、错误状态。可选项:default/process/finish/error。TS 类型:`StepStatus` `type StepStatus = 'default' \| 'process' \| 'finish' \| 'error'`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/steps/type.ts) | N +title | TNode | '' | 标题。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +titleRight | TNode | '' | 标题右侧数据 仅支持 layout = 'vertical' 时。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N diff --git a/packages/products/tdesign-mobile-react/src/steps/type.ts b/packages/products/tdesign-mobile-react/src/steps/type.ts new file mode 100644 index 00000000..68435e74 --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/steps/type.ts @@ -0,0 +1,89 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TNode } from '../common'; +import { MouseEvent } from 'react'; + +export interface TdStepsProps { + /** + * 当前步骤,即整个步骤条进度。默认根据步骤下标判断步骤的完成状态,当前步骤为进行中,当前步骤之前的步骤为已完成,当前步骤之后的步骤为未开始。如果每个步骤没有设置 value,current 值为步骤长度则表示所有步骤已完成。如果每个步骤设置了自定义 value,则 current = 'FINISH' 表示所有状态完成 + */ + current?: string | number; + /** + * 当前步骤,即整个步骤条进度。默认根据步骤下标判断步骤的完成状态,当前步骤为进行中,当前步骤之前的步骤为已完成,当前步骤之后的步骤为未开始。如果每个步骤没有设置 value,current 值为步骤长度则表示所有步骤已完成。如果每个步骤设置了自定义 value,则 current = 'FINISH' 表示所有状态完成,非受控属性 + */ + defaultCurrent?: string | number; + /** + * 用于控制 current 指向的步骤条的状态 + * @default process + */ + currentStatus?: 'default' | 'process' | 'finish' | 'error'; + /** + * 步骤条方向,有两种:横向和纵向 + * @default horizontal + */ + layout?: 'horizontal' | 'vertical'; + /** + * 只读状态 + * @default false + */ + readonly?: boolean; + /** + * 步骤条顺序 + * @default positive + */ + sequence?: 'positive' | 'reverse'; + /** + * 步骤条风格 + * @default default + */ + theme?: 'default' | 'dot'; + /** + * 当前步骤发生变化时触发 + */ + onChange?: ( + current: string | number, + previous: string | number, + context?: { e?: MouseEvent }, + ) => void; +} + +export interface TdStepItemProps { + /** + * 步骤描述,同 content + */ + children?: TNode; + /** + * 步骤描述 + * @default '' + */ + content?: TNode; + /** + * 显示在步骤描述下方的额外内容,比如:操作项 + */ + extra?: TNode; + /** + * 图标,默认显示内置图标,也可以自定义图标,值为 false 则不显示图标。优先级大于 `status` 定义的图标 + */ + icon?: TNode; + /** + * 当前步骤的状态:默认状态(未开始)、进行中状态、完成状态、错误状态 + * @default default + */ + status?: StepStatus; + /** + * 标题 + * @default '' + */ + title?: TNode; + /** + * 标题右侧数据 仅支持 layout = 'vertical' 时 + * @default '' + */ + titleRight?: TNode; +} + +export type StepStatus = 'default' | 'process' | 'finish' | 'error'; diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 09fa5058..2cc10c5c 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -103513,7 +103513,9 @@ "platform_framework": [ "1", "2", - "4" + "4", + "8", + "16" ], "component": "StepItem", "field_category": 1, @@ -103544,7 +103546,9 @@ "platform_framework_text": [ "Vue(PC)", "React(PC)", - "Angular(PC)" + "Angular(PC)", + "Vue(Mobile)", + "React(Mobile)" ], "field_type_text": [ "String", @@ -103556,10 +103560,7 @@ "platform_framework": [ "1", "2", - "4", - "8", - "16", - "32" + "4" ], "component": "StepItem", "field_category": 1, @@ -103590,10 +103591,7 @@ "platform_framework_text": [ "Vue(PC)", "React(PC)", - "Angular(PC)", - "Vue(Mobile)", - "React(Mobile)", - "Angular(Mobile)" + "Angular(PC)" ], "field_type_text": [ "Boolean", @@ -103639,6 +103637,49 @@ "TNode" ] }, + { + "id": 1727232179, + "platform_framework": [ + "8", + "16", + "32" + ], + "component": "StepItem", + "field_category": 1, + "field_name": "icon", + "field_type": [ + "4", + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "图标,默认显示内置图标,也可以自定义图标,值为 false 则不显示图标。优先级大于 `status` 定义的图标", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2024-09-25 02:42:59", + "update_time": "2024-09-25 02:42:59", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(Mobile)", + "React(Mobile)", + "Angular(Mobile)" + ], + "field_type_text": [ + "Boolean", + "TNode" + ] + }, { "id": 614, "platform_framework": [ @@ -103783,7 +103824,8 @@ { "id": 1712570381, "platform_framework": [ - "8" + "8", + "16" ], "component": "StepItem", "field_category": 1, @@ -103812,7 +103854,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)" + "Vue(Mobile)", + "React(Mobile)" ], "field_type_text": [ "String", @@ -105132,7 +105175,6 @@ "1", "2", "4", - "16", "32" ], "component": "Steps", @@ -105164,7 +105206,6 @@ "Vue(PC)", "React(PC)", "Angular(PC)", - "React(Mobile)", "Angular(Mobile)" ], "field_type_text": [