# @beisen-phoenix/textarea

> textarea

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

## Install

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

## 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-03-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 65.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | beisencorp |

## Links

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

## Dependencies (2)

- [@beisen-phoenix/style-token](https://npm.io/package/@beisen-phoenix/style-token.md) ^3.3.55
- [@beisen-phoenix/common-utils](https://npm.io/package/@beisen-phoenix/common-utils.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.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
- 3.3.41 — 2019-11-21
- … 359 more at https://npm.io/package/@beisen-phoenix/textarea/versions

## README

# 文本框组件

> @beisen-phoenix/textarea

## 概述

> 高度自适应，默认 3 行，最小 1 行，最大 5 行<br>
> 若传入 autoHeight 为 true，则没有最大高度的限制<br>
> 若用户通过右下角图标拖拽过文本域的大小，则高度不再自适应，只能由用户拖拽控制

## API

| 参数           | 说明                                                                          | 类型                               | 默认值    | 是否必传 |
| -------------- | ----------------------------------------------------------------------------- | ---------------------------------- | --------- | -------- |
| size           | 文本域尺寸，仅支持 `default` `large`                                          | string                             | 'default' | No       |
| value          | 文本域内容                                                                    | string                             | -         | No       |
| defaultValue   | 文本域默认内容，若使用了 value，则 defaultValue 无效                          | string                             | -         | No       |
| placeholder    | 同原生 textarea                                                               | string                             | 请输入    | No       |
| status         | 输入框状态，正常、禁用、提示、错误，支持 `normal` `disabled` `isHint` `error` | string                             | 'normal'  | No       |
| minLength      | 最少字数，不传表示不显示                                                      | number                             | -         | No       |
| maxLength      | 最大字数，不传表示不显示                                                      | number                             | -         | No       |
| autoHeight     | 是否有最大高度的限制，默认状态下最大高度为 5 行                               | boolean                            | false     | No       |
| allowResize    | 是否允许用户通过右下角图标拖拽大小                                            | boolean                            | true      | No       |
| translation    | 国际化                                                                        | object                             | -         | No       |
| onChange       | 文本域内容变化时的回调                                                        | function(value: string)            | -         | No       |
| onFocus        | 获取焦点时的回调                                                              | function(value: string)            | -         | No       |
| onBlur         | 失去焦点时的回调                                                              | function(value: string)            | -         | No       |
| onClick        | 鼠标点击文本域的回调                                                          | function(event)                    | -         | No       |
| onPaste        | 粘贴事件的回调函数                                                            | function(event)                    | -         | No       |
| onKeyDown      | 按下键盘的回调                                                                | function(event)                    | -         | No       |
| getTextareaRef | 获取 textarea dom 节点，在 componentDidMount 和 componentDidUpdate 中执行     | function(ref: HTMLTextAreaElement) | -         | No       |
| lang           | 当前语言环境(zh_CN,en_US,zh_TW)                                               | string                             | zh_CN     | 否       |

## translation

```
translation: {
  placeholder: '请输入',
  minLengthMessage:'至少输入{{0}}个字',//优先使用
  minLengthBefore: '至少输入',//不建议使用，或许会废弃掉，请使用minLengthMessage
  minLengthAfter: '个字'//不建议使用，或许会废弃掉，请使用minLengthMessage
}
```

## changelog

### 2019/11/21

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

> translation 对象下的新增 minLengthMessage 属性，后续会废弃 minLengthBefore 和 minLengthAfter 属性

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