Skip to content

Commit 233358f

Browse files
authored
docs(Input): update api docs (#822)
1 parent c83c791 commit 233358f

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/input/input.en-US.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
name | type | default | description | required
88
-- | -- | -- | -- | --
99
className | String | - | className of component | N
10-
style | Object | - | CSS(Cascading Style Sheets),Typescript`React.CSSProperties` | N
10+
style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N
1111
align | String | left | text align type。options: left/center/right | N
1212
allowInputOverMax | Boolean | false | allow to continue input on value length is over `maxlength` or `maxcharacter` | N
1313
autocomplete | String | undefined | attribute of input element, [see here](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) | N
@@ -19,35 +19,35 @@ cursorColor | String | #0052d9 | \- | N
1919
disabled | Boolean | undefined | make input to be disabled | N
2020
enterkeyhint | String | - | attribute of input element, [see here](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint)。options: enter/done/go/next/previous/search/send | N
2121
errorMessage | String | - | `deprecated` | N
22-
extra | TElement | - | Typescript`TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
23-
format | Function | - | input value formatter, `type=number` does not work. if you need to format number, `InputNumber` Component might be better。Typescript`InputFormatType` `type InputFormatType = (value: InputValue) => string`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/input/type.ts) | N
24-
label | TNode | - | text on the left of input。Typescript`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
22+
extra | TElement | - | Typescript: `TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
23+
format | Function | - | input value formatter, `type=number` does not work. if you need to format number, `InputNumber` Component might be better。Typescript: `InputFormatType` `type InputFormatType = (value: InputValue) => string`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/input/type.ts) | N
24+
label | TNode | - | text on the left of input。Typescript: `string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
2525
layout | String | horizontal | options: vertical/horizontal | N
2626
maxcharacter | Number | - | \- | N
2727
maxlength | String / Number | - | \- | N
2828
name | String | - | \- | N
2929
placeholder | String | undefined | \- | N
30-
prefixIcon | TElement | - | Typescript`TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
30+
prefixIcon | TElement | - | Typescript: `TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
3131
readonly | Boolean | undefined | \- | N
32-
size | String | medium | `deprecated`。options: small/medium。Typescript`'medium' \| 'small'` | N
32+
size | String | medium | `deprecated`。options: small/medium。Typescript: `'medium' \| 'small'` | N
3333
spellcheck | Boolean | false | attribute of input element, [see here](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/spellcheck) | N
3434
status | String | default | options: default/success/warning/error | N
35-
suffix | TNode | - | suffix content before suffixIcon。Typescript`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
36-
suffixIcon | TElement | - | suffix icon of input。Typescript`TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
37-
tips | TNode | - | tips on the bottom of input, different `status` can make tips to be different color。Typescript`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
35+
suffix | TNode | - | suffix content before suffixIcon。Typescript: `string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
36+
suffixIcon | TElement | - | suffix icon of input。Typescript: `TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
37+
tips | TNode | - | tips on the bottom of input, different `status` can make tips to be different color。Typescript: `string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
3838
type | String | text | type attribute of input element. if you are using `type=number`, `InputNumber` Component might be better。options: text/number/url/tel/password/search/submit/hidden | N
39-
value | String / Number | - | input value。Typescript`InputValue` `type InputValue = string \| number`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/input/type.ts) | N
40-
defaultValue | String / Number | - | input value。uncontrolled property。Typescript`InputValue` `type InputValue = string \| number`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/input/type.ts) | N
41-
onBlur | Function | | Typescript`(value: InputValue, context: { e: FocusEvent }) => void`<br/> | N
42-
onChange | Function | | Typescript`(value: InputValue, context?: { e?: InputEvent \| MouseEvent \| CompositionEvent; trigger: 'input' \| 'initial' \| 'clear' \| 'blur' }) => void`<br/>trigger on input value changed | N
43-
onClear | Function | | Typescript`(context: { e: TouchEvent }) => void`<br/> | N
44-
onFocus | Function | | Typescript`(value: InputValue, context: { e: FocusEvent }) => void`<br/> | N
45-
onValidate | Function | | Typescript`(context: { error?: 'exceed-maximum' \| 'below-minimum' }) => void`<br/>trigger on text length being over max length or max character | N
39+
value | String / Number | - | input value。Typescript: `InputValue` `type InputValue = string \| number`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/input/type.ts) | N
40+
defaultValue | String / Number | - | input value。uncontrolled property。Typescript: `InputValue` `type InputValue = string \| number`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/input/type.ts) | N
41+
onBlur | Function | | Typescript: `(value: InputValue, context: { e: FocusEvent }) => void`<br/> | N
42+
onChange | Function | | Typescript: `(value: InputValue, context?: { e?: InputEvent \| MouseEvent \| CompositionEvent; trigger: 'input' \| 'initial' \| 'clear' \| 'blur'}) => void`<br/>trigger on input value changed | N
43+
onClear | Function | | Typescript: `(context: { e: TouchEvent }) => void`<br/> | N
44+
onFocus | Function | | Typescript: `(value: InputValue, context: { e: FocusEvent }) => void`<br/> | N
45+
onValidate | Function | | Typescript: `(context: { error?: 'exceed-maximum' \| 'below-minimum' }) => void`<br/>trigger on text length being over max length or max character | N
4646

4747
### CSS Variables
4848

4949
The component provides the following CSS variables, which can be used to customize styles.
50-
Name | Default Value | Description
50+
Name | Default Value | Description
5151
-- | -- | --
5252
--td-input-align-items | center | -
5353
--td-input-bg-color | @bg-color-container | -

src/input/input.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ type | String | text | 输入框类型。可选项:text/number/url/tel/passwor
3939
value | String / Number | - | 输入框的值。TS 类型:`InputValue` `type InputValue = string \| number`[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/input/type.ts) | N
4040
defaultValue | String / Number | - | 输入框的值。非受控属性。TS 类型:`InputValue` `type InputValue = string \| number`[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/input/type.ts) | N
4141
onBlur | Function | | TS 类型:`(value: InputValue, context: { e: FocusEvent }) => void`<br/>失去焦点时触发 | N
42-
onChange | Function | | TS 类型:`(value: InputValue, context?: { e?: InputEvent \| MouseEvent \| CompositionEvent; trigger: 'input' \| 'initial' \| 'clear' \| 'blur' }) => void`<br/>输入框值发生变化时触发。`trigger=initial` 表示传入的数据不符合预期,组件自动处理后触发 change 告知父组件。如:初始值长度超过 `maxlength` 限制 | N
42+
onChange | Function | | TS 类型:`(value: InputValue, context?: { e?: InputEvent \| MouseEvent \| CompositionEvent; trigger: 'input' \| 'initial' \| 'clear' \| 'blur'}) => void`<br/>输入框值发生变化时触发。`trigger=initial` 表示传入的数据不符合预期,组件自动处理后触发 change 告知父组件。如:初始值长度超过 `maxlength` 限制 | N
4343
onClear | Function | | TS 类型:`(context: { e: TouchEvent }) => void`<br/>清空按钮点击时触发 | N
4444
onFocus | Function | | TS 类型:`(value: InputValue, context: { e: FocusEvent }) => void`<br/>获得焦点时触发 | N
4545
onValidate | Function | | TS 类型:`(context: { error?: 'exceed-maximum' \| 'below-minimum' }) => void`<br/>字数超出限制时触发 | N
4646

4747
### CSS Variables
4848

4949
组件提供了下列 CSS 变量,可用于自定义样式。
50-
名称 | 默认值 | 描述
50+
名称 | 默认值 | 描述
5151
-- | -- | --
5252
--td-input-align-items | center | -
5353
--td-input-bg-color | @bg-color-container | -

0 commit comments

Comments
 (0)