Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

bee-form-control

tinper-bee821MIT2.0.28

form-control ui component for react

react, react-component, react-form-control, iuap-design, neoui-react, form-control

readme

bee-form-control

npm version Build Status Coverage Status

<FormControl> 来代替 <input>, <textarea>, and <select>

安装步骤

$ git clone https://github.com/tinper-bee/bee-form-control
$ cd bee-form-control
$ npm install
$ npm run dev

使用

使用单独的bee-form-control包

组件引入

先进行下载bee-form-control包

npm install --save bee-form-control

组件调用

import FormControl from 'bee-form-control';
React.render(<div>
    <div>
        <FormControl placeholder="input placeholder" ref="test" />
    </div>
</div>, document.getElementById('target'));

样式引入

  • 可以使用link引入dist目录下bee-form-control.css
    <link rel="stylesheet" href="./node_modules/build/bee-form-control.css">
  • 可以在js中import样式
    import "./node_modules/src/FormControl.scss"
    //或是
    import "./node_modules/build/bee-form-control.css"

API

参数 说明 类型 默认值
className 类名 string -
componentClass 说明表单类型(input,textarea) string 'input'
type 类型(text,search, submit,'checkbox',...详情http://www.w3school.com.cn/html5/att_input_type.asp) string 'text'
onChange input值发生改变触发的回调 func -
onKeyDown keydown回调 func -
value input当前值 string -
defaultValue input默认值 string -
onSearch input type="search" 回车和点击搜索按钮的回调 func -
showClose 是否显示清空按钮 bool -
focusSelect 设置当focus的时候是否选择内容 bool false

changelog

2.0.24 (2020-08-13)

Features

2.0.23 (2020-07-20)

Bug Fixes

Features

  • maxLength (e832e80)
  • textarea支持自适应文本高度[JCJS-2437] (4a40fb1)

2.0.22 (2020-07-02)

Bug Fixes

  • 最大长度无法输入中文bug (3639189)

2.0.21 (2020-06-02)

Bug Fixes

2.0.20 (2020-05-29)

Features

2.0.19 (2020-04-24)

Bug Fixes

  • blur回调增加参数,判断是否为清空操作 (62ed3f3)
  • 自动化 (ae44701)

2.0.18 (2020-03-28)

Bug Fixes

  • blur回调增加参数,判断是否为清空操作 (62ed3f3)

Features

  • bee-form-control: 清空按钮放大,有可能会点不到 (ae4a423)

2.0.16 (2020-03-27)

2.0.15 (2020-03-26)

Features

  • bee-form-control: 在showClose时候加onBlur的延迟 (c42dbd6)

2.0.14 (2020-03-23)

Bug Fixes

  • bee-form-control: 清空按钮触发onChange时,没有事件对象 (ce35509)

2.0.13 (2020-03-21)

Bug Fixes

  • bee-form-control: onBlur e对象 (3d25082)

2.0.12 (2020-03-20)

Bug Fixes

  • bee-form-control: componentWillReceiveProps value判断 (5574583)

Features

  • bee-form-control: 清空按钮不触发blur (3257de9)

2.0.11 (2020-01-14)

Bug Fixes

  • bee-form-control: componentWillReceiveProps value判断 (bfa183f)

2.0.10 (2019-11-14)

Features

  • bee-form-control: 新增 prefix suffix api (037a6d0)

2.0.9 (2019-09-24)

2.0.8 (2019-09-21)

2.0.7 (2019-08-20)

2.0.6 (2019-08-05)

2.0.5 (2019-08-02)

2.0.3 (2019-05-20)

2.0.2 (2019-04-12)

Features

  • bee-form-control: 新增onkeydown回调 (2d46fb2)

2.0.1 (2019-03-08)

2.0.0 (2019-03-07)

1.1.12 (2019-03-07)

1.1.11 (2019-02-28)

1.1.10 (2019-02-25)

1.1.9 (2019-01-08)

Bug Fixes

  • bee-form-control: type=search 无法获得值 (c21b9af)

1.1.8 (2018-11-29)

Bug Fixes

  • bee-form-control: type=search改造 (42a5cbc)

1.1.7 (2018-11-16)

Features

  • bee-form-control: 新增focusSelect 获得焦点后全选内容功能 (4a80544)

1.1.6 (2018-11-15)

1.1.5 (2018-11-13)

Features

  • bee-form-control: 新增onChange,defaultSelect (b2c5b53)

1.1.4 (2018-11-13)

1.1.3 (2018-08-28)

Bug Fixes

  • bee-form-control: 去掉showClose和showPop警告 (2d80d59)

1.1.2 (2018-08-01)

Features

1.1.1 (2018-08-01)

1.1.0 (2018-06-22)

Features

  • bee-form-control: 支持onBlur (7b7c4c8)

1.0.10 (2018-06-22)

Bug Fixes

  • bee-form-control: search disabled 显示了清除icon (507acf8)

1.0.9 (2018-05-29)

Bug Fixes

  • 样式兼容bug: ie10以上的显示x号bug (cc7aea9)

1.0.8 (2018-01-27)

Bug Fixes

  • bee-form-control: 修改输入框onChange事件限制value时,显示滞后bug (b73fba2)
  • type is undefined (ada6b3c)

1.0.5 (2018-01-16)

Bug Fixes

  • bee-form-control: change dependebcies (ff09bc3)
  • bee-form-control: 去掉样式中的rem (d321282)