Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
bee-datepicker
Advanced tools
react datepicker component for tinper-bee
可定制的日期组件
先进行下载bee-datepicker包
npm install --save bee-datepicker
组件调用
import DatePicker from 'bee-datepicker';
ReactDOM.render(
<DatePicker></DatePicker>
, document.getElementById('target'));
<link rel="stylesheet" href="./node_modules/bee-datepicker/build/DatePicker.css">
import "./node_modules/bee-datepicker/src/DatePicker.scss"
//或是
import "./node_modules/bee-datepicker/build/DatePicker.css"
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
prefixCls | 组件的前缀 | String | - |
className | 添加节点的样式 | String | - |
dropdownClassName | 添加下拉面板的样式 | String | - |
style | 添加内联样式 | Object | - |
dateRender | 日期表格 | (current, value) => React.Node | - |
renderSidebar | 侧边栏 | () => React.Node | - |
renderFooter | 扩展底边栏 | () => React.Node | - |
defaultValue | 默认值,输入框的默认值 | moment | - |
value | 日期 | moment | - |
locale | 日历的语言 | Object | en_US |
format | 日期格式化 | String | - |
open | 日期组件隐藏、显示 | Boolean | false |
disabled | 是否禁用功能 | Boolean | false |
disabledDate | 禁用的日期 | Function(current:moment):Boolean | - |
disabledTime | 禁用的时间 | Function(current:moment):Object | - |
showDateInput | 显示日期输入框 | Boolean | true |
showWeekNumber | 是否显示周数 | Boolean | false |
showToday | 是否显示今天 | Boolean | true |
showOk | 底边栏是否显示ok按钮 | Boolean | auto |
onSelect | 选择日期的回调函数 | Function(date: moment) | - |
onChange | 日期改变的回调函数 | Function(date: moment) | - |
onOk | 点击确定按钮的回调 | Function(date: moment) | - |
dateInputPlaceholder | 日期的placeholder | String | - |
showTime | 是否显示时间选择面板 | Boolean | - |
renderIcon | 更改默认的图标 | Function | () => |
closeIcon | 鼠标划过清空内容的icon | Function | () => |
getCalendarContainer | 更改默认渲染位置 | Function | - |
keyboardInput | 外层输入框是否支持键盘输入 | Boolean | false |
iconClick | 日期按钮点击的回调 | Function | - |
outInputFocus | 外层输入框获得焦点的回调 | Function | - |
outInputKeydown | 外层输入框keydown回调 | Function | - |
注:使用keyboardInput时,以下api变化
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
prefixCls | 组件的前缀 | String | - |
className | 添加节点的样式 | String | - |
style | 添加内联样式 | Object | - |
value | 当前值,如输入框的值 | moment | - |
defaultValue | 默认值,输入框的默认值 | moment | - |
locale | 语言 | Object | en_US |
disabledDate | 禁用的日期 | Function(current:moment):Boolean | - |
onSelect | 选择日期的回调函数 | Function(date: moment) | - |
onChange | 日期改变的回调函数 | Function(date: moment) | - |
monthCellRender | 月份的渲染方法 | function | - |
dateCellRender | 日期的渲染方法 | function | - |
monthCellContentRender | 自定义月份的渲染方法,将被添加渲染内容中 | function | - |
getCalendarContainer | 更改默认渲染位置 | Function | - |
closeIcon | 鼠标划过清空内容的icon | Function | () => |
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
prefixCls | 组件的前缀 | String | - |
className | 添加节点的样式 | String | - |
style | 添加内联样式 | Object | - |
dateRender | 日期表格 | (current, value) => React.Node | - |
renderSidebar | 侧边栏 | () => React.Node | - |
renderFooter | 扩展底边栏 | () => React.Node | - |
value | 当前选中的区间 | moment[] | - |
defaultValue | 默认选中的区间 | moment[] | - |
locale | 日历的语言 | Object | en_US |
format | 日期格式化 | String | - |
disabledDate | 禁用的日期 | Function(current:moment):Boolean | - |
disabledTime | 禁用的时间 | Function(current:moment):Object | - |
showDateInput | 显示日期输入康 | Boolean | true |
showWeekNumber | 是否显示周数 | Boolean | false |
showToday | 是否显示今天 | Boolean | true |
showOk | 底边栏是否显示ok按钮 | Boolean | auto |
showClear | 是否显示清除按钮 | Boolean | false |
onSelect | 选择日期的回调函数 | Function(date: moment) | - |
onChange | 日期改变的回调函数 | Function(date: moment) | - |
dateInputPlaceholder | 日期的placeholder | String | - |
type | 是否固定开始或结束选定的值 | enum('both','start', 'end') | - |
getCalendarContainer | 更改默认渲染位置 | Function | - |
closeIcon | 鼠标划过清空内容的icon | Function | () => |
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
placeholder | 输入框placeholder | String | - |
defaultValue | 默认值 | moment | - |
getCalendarContainer | 更改默认渲染位置 | Function | - |
closeIcon | 鼠标划过清空内容的icon | Function | () => |
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
placeholder | 输入框placeholder | String | - |
defaultValue | 默认值 | moment | 当前年 |
getCalendarContainer | 更改默认渲染位置 | Function | - |
format | 日期格式化 | String | - |
disabled | 是否禁用功能 | Boolean | false |
closeIcon | 鼠标划过清空内容的icon | Function | () => |
按键 | 功能 |
---|---|
↓(下箭) | 打开面板 |
esc | 关闭面板 |
delete | 清除内容 |
$ npm install -g bee-tools
$ git clone https://github.com/tinper-bee/bee-datepicker.git
$ cd bee-datepicker
$ npm install
$ npm run dev
FAQs
DatePicker ui component for react
The npm package bee-datepicker receives a total of 287 weekly downloads. As such, bee-datepicker popularity was classified as not popular.
We found that bee-datepicker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 20 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.