diff --git a/components/input-item/CustomInput.tsx b/components/input-item/CustomInput.tsx index e55eb8dafbe..28007a910d2 100644 --- a/components/input-item/CustomInput.tsx +++ b/components/input-item/CustomInput.tsx @@ -20,6 +20,8 @@ export interface NumberInputProps { onFocus?: InputEventHandler; onBlur?: InputEventHandler; confirmLabel: any; + backspaceLabel: any; + cancelKeyboardLabel: any; maxLength?: number; type?: string; style?: React.CSSProperties; @@ -88,13 +90,21 @@ class NumberInput extends React.Component { } getComponent() { - const { keyboardPrefixCls, confirmLabel } = this.props; + const { + confirmLabel, + backspaceLabel, + keyboardPrefixCls, + cancelKeyboardLabel, + } = this.props; + return ( ); } @@ -294,6 +304,8 @@ class NumberInput extends React.Component {
{placeholder}
)}
(this.inputRef = el)} onClick={preventKeyboard ? () => {} : this.onFakeInputClick} diff --git a/components/input-item/CustomKeyboard.tsx b/components/input-item/CustomKeyboard.tsx index 9f91f3a30dd..7959b373352 100644 --- a/components/input-item/CustomKeyboard.tsx +++ b/components/input-item/CustomKeyboard.tsx @@ -96,7 +96,12 @@ class CustomKeyboard extends React.Component { ); } render() { - const { prefixCls, confirmLabel } = this.props; + const { + prefixCls, + confirmLabel, + backspaceLabel, + cancelKeyboardLabel, + } = this.props; const wrapperCls = classnames( `${prefixCls}-wrapper`, @@ -113,6 +118,8 @@ class CustomKeyboard extends React.Component { this.renderKeyboardItem(item, index), )} { this.renderKeyboardItem(item, index), )} diff --git a/components/input-item/index.tsx b/components/input-item/index.tsx index 8b6c53f5caa..daf1679493a 100644 --- a/components/input-item/index.tsx +++ b/components/input-item/index.tsx @@ -224,9 +224,16 @@ class InputItem extends React.Component { () => require('./locale/zh_CN'), ); - const { confirmLabel } = _locale; + const { + focus, + placeholder, + } = this.state; - const { placeholder, focus } = this.state; + const { + confirmLabel, + backspaceLabel, + cancelKeyboardLabel, + } = _locale; const wrapCls = classnames( `${prefixListCls}-item`, @@ -297,6 +304,8 @@ class InputItem extends React.Component { prefixCls={prefixCls} style={style} confirmLabel={confirmLabel} + backspaceLabel={backspaceLabel} + cancelKeyboardLabel={cancelKeyboardLabel} moneyKeyboardAlign={moneyKeyboardAlign} /> ) : ( diff --git a/components/input-item/locale/en_US.tsx b/components/input-item/locale/en_US.tsx index 3481600007a..d965453cb52 100644 --- a/components/input-item/locale/en_US.tsx +++ b/components/input-item/locale/en_US.tsx @@ -1,3 +1,5 @@ export default { confirmLabel: 'Done', + backspaceLabel: 'Backspace', + cancelKeyboardLabel: 'CancelKeyboard', }; diff --git a/components/input-item/locale/ru_RU.tsx b/components/input-item/locale/ru_RU.tsx index 2339823d719..a2640eb91f9 100644 --- a/components/input-item/locale/ru_RU.tsx +++ b/components/input-item/locale/ru_RU.tsx @@ -1,3 +1,5 @@ export default { confirmLabel: 'сделанный', + backspaceLabel: 'возврат на одну позицию', + cancelKeyboardLabel: 'Отменить клавиатуру', }; diff --git a/components/input-item/locale/sv_SE.tsx b/components/input-item/locale/sv_SE.tsx index 500952517dd..7ea54356324 100644 --- a/components/input-item/locale/sv_SE.tsx +++ b/components/input-item/locale/sv_SE.tsx @@ -1,3 +1,5 @@ export default { confirmLabel: 'Ok', + backspaceLabel: 'Backspace', + cancelKeyboardLabel: 'CancelKeyboard', }; diff --git a/components/input-item/locale/zh_CN.tsx b/components/input-item/locale/zh_CN.tsx index 2fe615734f0..4d064e8bf45 100644 --- a/components/input-item/locale/zh_CN.tsx +++ b/components/input-item/locale/zh_CN.tsx @@ -1,3 +1,5 @@ export default { confirmLabel: '确定', + backspaceLabel: '退格', + cancelKeyboardLabel: '撤销键盘', };