Skip to content

Commit

Permalink
feat(module:input-number): support inputmode (#5423)
Browse files Browse the repository at this point in the history
close #5341
  • Loading branch information
Yadong Xie authored Jun 15, 2020
1 parent eac9b08 commit cdca7bc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/input-number/doc/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
| `[nzPrecisionMode]` | The method for calculating the precision of input value | `'cut' \| 'toFixed' \| ((value: number \| string, precision?: number) => number)` | `'toFixed'` |
| `[nzSize]` | width of input box | `'large' \| 'small' \| 'default'` | `'default'` |
| `[nzStep]` | The number to which the current value is increased or decreased. It can be an integer or decimal. | `number \| string` | `1` |
| `[nzInputMode]` | enumerated attribute that hints at the type of data that might be entered by the user, [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode) | `string` | `decimal` |
| `[nzPlaceHolder]` | Placeholder of select | `string` | - |
| `[nzId]` | input id attribute inside the component| `string` | - |
| `(ngModelChange)` | The callback triggered when the value is changed | `EventEmitter<number>` | - |
Expand Down
1 change: 1 addition & 0 deletions components/input-number/doc/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
| `[nzPrecisionMode]` | 数值精度的取值方式 | `'cut' \| 'toFixed' \| ((value: number \| string, precision?: number) => number)` | `'toFixed'` |
| `[nzSize]` | 输入框大小 | `'large' \| 'small' \| 'default'` | `'default'` |
| `[nzStep]` | 每次改变步数,可以为小数 | `number \| string` | `1` |
| `[nzInputMode]` | 提供了用户在编辑元素或其内容时可能输入的数据类型的提示,详见[MDN](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Global_attributes/inputmode) | `string` | `decimal` |
| `[nzPlaceHolder]` | 选择框默认文字 | `string` | - |
| `[nzId]` | 组件内部 input 的 id 值 | `string` | - |
| `(ngModelChange)` | 数值改变时回调 | `EventEmitter<number>` | - |
Expand Down
2 changes: 2 additions & 0 deletions components/input-number/input-number.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import { InputBoolean, isNotNil } from 'ng-zorro-antd/core/util';
[attr.max]="nzMax"
[placeholder]="nzPlaceHolder"
[attr.step]="nzStep"
[attr.inputmode]="nzInputMode"
(keydown)="onKeyDown($event)"
(keyup)="stop()"
[ngModel]="displayValue"
Expand Down Expand Up @@ -117,6 +118,7 @@ export class NzInputNumberComponent implements ControlValueAccessor, AfterViewIn
@Input() nzPrecisionMode: 'cut' | 'toFixed' | ((value: number | string, precision?: number) => number) = 'toFixed';
@Input() nzPlaceHolder = '';
@Input() nzStep = 1;
@Input() nzInputMode: string = 'decimal';
@Input() nzId: string | null = null;
@Input() @InputBoolean() nzDisabled = false;
@Input() @InputBoolean() nzAutoFocus = false;
Expand Down

0 comments on commit cdca7bc

Please sign in to comment.