Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(stepper): add stepper files #421

Merged
merged 1 commit into from
Sep 18, 2024
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
Original file line number Diff line number Diff line change
@@ -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,
};
Original file line number Diff line number Diff line change
@@ -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`<br/> | N
onChange | Function | | Typescript:`(value: string \| number) => void`<br/> | N
onFocus | Function | | Typescript:`(value: string \| number) => void`<br/> | N
onOverlimit | Function | | Typescript:`(type: 'minus' \| 'plus') => void`<br/> | N
26 changes: 26 additions & 0 deletions packages/products/tdesign-mobile-react/src/stepper/stepper.md
Original file line number Diff line number Diff line change
@@ -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`<br/>输入框失去焦点时触发 | N
onChange | Function | | TS 类型:`(value: string \| number) => void`<br/>数值发生变更时触发 | N
onFocus | Function | | TS 类型:`(value: string \| number) => void`<br/>输入框聚焦时触发 | N
onOverlimit | Function | | TS 类型:`(type: 'minus' \| 'plus') => void`<br/>数值超出限制时触发 | N
79 changes: 79 additions & 0 deletions packages/products/tdesign-mobile-react/src/stepper/type.ts
Original file line number Diff line number Diff line change
@@ -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;
}
Loading