Skip to content

Commit

Permalink
fix: 修复 input-number status 默认值缺失 (#1790)
Browse files Browse the repository at this point in the history
* fix: 修复 input-number status 默认值缺失

* fix: 修复 input-number status 默认值缺失
  • Loading branch information
honkinglin authored Dec 8, 2022
1 parent 9a3ddb3 commit c3de6b1
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 184 deletions.
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

0 comments on commit c3de6b1

Please sign in to comment.