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

fix: 修复 input-number status 默认值缺失 #1790

Merged
merged 2 commits into from
Dec 8, 2022
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
8 changes: 4 additions & 4 deletions src/input-number/_example/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ export default function Status() {
{type === 'align-input' && (
<>
<FormItem label="正常提示">
<InputNumber style={{ width: 300 }} inputProps={{ tips: '这是普通文本提示' }} />
<InputNumber style={{ width: 300 }} tips="这是普通文本提示" />
</FormItem>
<FormItem label="成功提示">
<InputNumber style={{ width: 300 }} status="success" inputProps={{ tips: '校验通过文本提示' }} />
<InputNumber style={{ width: 300 }} status="success" tips="校验通过文本提示" />
</FormItem>
<FormItem label="警告提示">
<InputNumber style={{ width: 300 }} status="warning" inputProps={{ tips: '校验不通过文本提示' }} />
<InputNumber style={{ width: 300 }} status="warning" tips="校验不通过文本提示" />
</FormItem>
<FormItem label="错误提示">
<InputNumber style={{ width: 300 }} status="error" inputProps={{ tips: '校验存在严重问题文本提示' }} />
<InputNumber style={{ width: 300 }} status="error" tips="校验存在严重问题文本提示" />
</FormItem>
</>
)}
Expand Down
1 change: 1 addition & 0 deletions src/input-number/defaultProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const inputNumberDefaultProps: TdInputNumberProps = {
placeholder: undefined,
readonly: false,
size: 'medium',
status: 'default',
step: 1,
theme: 'row',
};
2 changes: 1 addition & 1 deletion src/input-number/input-number.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ min | String / Number | -Infinity | Typescript:`InputNumberValue` | N
placeholder | String | undefined | \- | N
readonly | Boolean | false | \- | N
size | String | medium | options:small/medium/large | N
status | String | - | options:default/success/warning/error | N
status | String | default | options:default/success/warning/error | N
step | String / Number | 1 | Typescript:`InputNumberValue` | N
suffix | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
theme | String | row | options:column/row/normal | N
Expand Down
2 changes: 1 addition & 1 deletion src/input-number/input-number.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ min | String / Number | -Infinity | 最小值。如果是大数,请传入字
placeholder | String | undefined | 占位符 | N
readonly | Boolean | false | 只读状态 | N
size | String | medium | 组件尺寸。可选项:small/medium/large | N
status | String | - | 文本框状态。可选项:default/success/warning/error | N
status | String | default | 文本框状态。可选项:default/success/warning/error | N
step | String / Number | 1 | 数值改变步数,可以是小数。如果是大数,请保证数据类型为字符串。TS 类型:`InputNumberValue` | N
suffix | TNode | - | 后置内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
theme | String | row | 按钮布局。可选项:column/row/normal | N
Expand Down
1 change: 1 addition & 0 deletions src/input-number/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export interface TdInputNumberProps<T = InputNumberValue> {
size?: 'small' | 'medium' | 'large';
/**
* 文本框状态
* @default default
*/
status?: 'default' | 'success' | 'warning' | 'error';
/**
Expand Down
Loading