# @beisen-phoenix/input-number

> ## API

Latest version **3.3.55** (published 2019-11-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install @beisen-phoenix/input-number
pnpm add @beisen-phoenix/input-number
yarn add @beisen-phoenix/input-number
bun add @beisen-phoenix/input-number
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.3.55 |
| Published | 2019-11-25 |
| First published | 2019-08-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 71.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | beisencorp |

## Links

- npm: https://www.npmjs.com/package/@beisen-phoenix/input-number
- npm.io page: https://npm.io/package/@beisen-phoenix/input-number

## Dependencies (2)

- [@beisen-phoenix/tooltip](https://npm.io/package/@beisen-phoenix/tooltip.md) ^3.3.55
- [@beisen-phoenix/style-token](https://npm.io/package/@beisen-phoenix/style-token.md) ^3.3.55

## Recent versions

- 3.3.55 (latest) — 2019-11-25
- 3.2.44-rc.1 (rc) — 2019-10-24
- 3.3.54 — 2019-11-25
- 3.3.53 — 2019-11-25
- 3.3.52 — 2019-11-24
- 3.3.51 — 2019-11-23
- 3.3.50 — 2019-11-22
- 3.3.49 — 2019-11-22
- 3.3.48 — 2019-11-22
- 3.3.47 — 2019-11-22
- 3.3.46 — 2019-11-22
- 3.3.45 — 2019-11-21
- 3.3.43 — 2019-11-21
- 3.3.42 — 2019-11-21
- 3.3.41-beta.1 — 2019-11-21
- … 204 more at https://npm.io/package/@beisen-phoenix/input-number/versions

## README

# 数字输入框

## API

| 参数         | 说明                                                                           | 类型                 | 默认值                    | 是否必传 |
| ------------ | ------------------------------------------------------------------------------ | -------------------- | ------------------------- | -------- |
| autoFocus    | 自动聚焦                                                                       | boolean              | `false`                   | 否       |
| size         | 输入框尺寸，仅支持 `normal` `large` `small`                                    | string               | `normal`                  | 否       |
| status       | 输入框状态：默认状态`default`，只读`readonly`，禁用`disabled`，校验错误`error` | string               | `default`                 | 否       |
| value        | 当前值                                                                         | number               | 无                        | 否       |
| defaultValue | 默认值                                                                         | number               | `null`                    | 否       |
| max          | 最大值，当值改变超过此值时会被置为此值                                         | number               | `Number.MIN_SAFE_INTEGER` | 否       |
| min          | 最小值，当值改变超过此值时会被置为此值                                         | number               | `Number.MAX_SAFE_INTEGER` | 否       |
| step         | 步进                                                                           | number               | 无                        | 否       |
| precision    | 精度，当不设置时，会根据当前值和 step 的最大精度设置                           | number               | 无                        | 否       |
| placeholder  | 提示语                                                                         | string               | `'请输入'`                | 否       |
| translation  | 国际化                                                                         | object               | 见下方                    | 否       |
| formatter    | 格式化展示函数                                                                 | function             | 无                        | 否       |
| parser       | 解析格式化展示函数                                                             | function             | 无                        | 否       |
| onChange     | 值改变事件                                                                     | `value=>void`        | 无                        | 否       |
| onBlur       | 失焦事件                                                                       | `(event, num)=>void` | 无                        | 否       |
| onFocus      | 聚焦事件                                                                       | `(event)=>void`      | 无                        | 否       |
| lang         | 当前语言环境(zh_CN,en_US,zh_TW)                                                | string               | zh_CN                     | 否       |

## 多语言

```js
translation = {
  placeholder: "请输入"
};
```

### 暴露方法

`focus` 和 `blur`，用法：

```js
const ref = React.createRef<HTMLInputElement>();

<InputNumebr ref={ref}/>

ref.current && ref.current.focus()
```

## changelog

### 2019-11-19

> 新增 lang 属性，用于表示当前的语言环境，取值范围为“zh_CN,zh_TW,en_US”内部新增中文简体、英文、中文繁体语言包。

---
_Source: https://npm.io/package/@beisen-phoenix/input-number · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
