diff --git a/packages/products/tdesign-mobile-react/src/stepper/defaultProps.ts b/packages/products/tdesign-mobile-react/src/stepper/defaultProps.ts new file mode 100644 index 00000000..a546c5c5 --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/stepper/defaultProps.ts @@ -0,0 +1,17 @@ +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdStepperProps } from './type'; + +export const stepperDefaultProps: TdStepperProps = { + disableInput: false, + disabled: undefined, + integer: true, + max: 100, + min: 0, + size: 'medium', + step: 1, + theme: 'normal', + defaultValue: 0, +}; diff --git a/packages/products/tdesign-mobile-react/src/stepper/stepper.en-US.md b/packages/products/tdesign-mobile-react/src/stepper/stepper.en-US.md new file mode 100644 index 00000000..fa0ee5ce --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/stepper/stepper.en-US.md @@ -0,0 +1,26 @@ +:: BASE_DOC :: + +## API + + +### Stepper Props + +name | type | default | description | required +-- | -- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N +disableInput | Boolean | false | \- | N +disabled | Boolean | undefined | \- | N +inputWidth | Number | - | \- | N +integer | Boolean | true | \- | N +max | Number | 100 | \- | N +min | Number | 0 | \- | N +size | String | medium | options: small/medium/large。Typescript:`SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +step | Number | 1 | \- | N +theme | String | normal | stylish。options: normal/filled/outline | N +value | String / Number | 0 | \- | N +defaultValue | String / Number | 0 | uncontrolled property | N +onBlur | Function | | Typescript:`(value: string \| number) => void`
| N +onChange | Function | | Typescript:`(value: string \| number) => void`
| N +onFocus | Function | | Typescript:`(value: string \| number) => void`
| N +onOverlimit | Function | | Typescript:`(type: 'minus' \| 'plus') => void`
| N diff --git a/packages/products/tdesign-mobile-react/src/stepper/stepper.md b/packages/products/tdesign-mobile-react/src/stepper/stepper.md new file mode 100644 index 00000000..19904016 --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/stepper/stepper.md @@ -0,0 +1,26 @@ +:: BASE_DOC :: + +## API + + +### Stepper Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +disableInput | Boolean | false | 禁用输入框 | N +disabled | Boolean | undefined | 禁用全部操作 | N +inputWidth | Number | - | 输入框宽度 | N +integer | Boolean | true | 是否整型 | N +max | Number | 100 | 最大值 | N +min | Number | 0 | 最小值 | N +size | String | medium | 组件尺寸。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +step | Number | 1 | 步长 | N +theme | String | normal | 组件风格。可选项:normal/filled/outline | N +value | String / Number | 0 | 值 | N +defaultValue | String / Number | 0 | 值。非受控属性 | N +onBlur | Function | | TS 类型:`(value: string \| number) => void`
输入框失去焦点时触发 | N +onChange | Function | | TS 类型:`(value: string \| number) => void`
数值发生变更时触发 | N +onFocus | Function | | TS 类型:`(value: string \| number) => void`
输入框聚焦时触发 | N +onOverlimit | Function | | TS 类型:`(type: 'minus' \| 'plus') => void`
数值超出限制时触发 | N diff --git a/packages/products/tdesign-mobile-react/src/stepper/type.ts b/packages/products/tdesign-mobile-react/src/stepper/type.ts new file mode 100644 index 00000000..b6f869a1 --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/stepper/type.ts @@ -0,0 +1,79 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { SizeEnum } from '../common'; + +export interface TdStepperProps { + /** + * 禁用输入框 + * @default false + */ + disableInput?: boolean; + /** + * 禁用全部操作 + */ + disabled?: boolean; + /** + * 输入框宽度 + */ + inputWidth?: number; + /** + * 是否整型 + * @default true + */ + integer?: boolean; + /** + * 最大值 + * @default 100 + */ + max?: number; + /** + * 最小值 + * @default 0 + */ + min?: number; + /** + * 组件尺寸 + * @default medium + */ + size?: SizeEnum; + /** + * 步长 + * @default 1 + */ + step?: number; + /** + * 组件风格 + * @default normal + */ + theme?: 'normal' | 'filled' | 'outline'; + /** + * 值 + * @default 0 + */ + value?: string | number; + /** + * 值,非受控属性 + * @default 0 + */ + defaultValue?: string | number; + /** + * 输入框失去焦点时触发 + */ + onBlur?: (value: string | number) => void; + /** + * 数值发生变更时触发 + */ + onChange?: (value: string | number) => void; + /** + * 输入框聚焦时触发 + */ + onFocus?: (value: string | number) => void; + /** + * 数值超出限制时触发 + */ + onOverlimit?: (type: 'minus' | 'plus') => void; +}