Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bee-datepicker

Package Overview
Dependencies
Maintainers
17
Versions
276
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bee-datepicker

DatePicker ui component for react

  • 2.4.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
327
decreased by-66.7%
Maintainers
17
Weekly downloads
 
Created
Source

datepicker

npm version Build Status Coverage Status dependencies Status NPM downloads Average time to resolve an issue Percentage of issues still open

react datepicker component for tinper-bee

可定制的日期组件

使用

使用单独的datepicker包

组件引入

先进行下载bee-datepicker包

npm install --save bee-datepicker

组件调用

import DatePicker from 'bee-datepicker';
ReactDOM.render(
        <DatePicker></DatePicker>
        , document.getElementById('target'));
样式引入
  • 可以使用link引入build目录下DatePicker.css
<link rel="stylesheet" href="./node_modules/bee-datepicker/build/DatePicker.css">
  • 可以在js中import样式
import "./node_modules/bee-datepicker/src/DatePicker.scss"
//或是
import "./node_modules/bee-datepicker/build/DatePicker.css"

API

DatePicker

参数说明类型默认值
prefixCls组件的前缀String-
className添加节点的样式String-
dropdownClassName添加下拉面板的样式String-
style添加内联样式Object-
dateRender日期表格(current, value) => React.Node-
renderSidebar侧边栏() => React.Node-
renderFooter扩展底边栏() => React.Node-
defaultValue默认值,输入框的默认值moment-
value日期moment-
locale日历的语言Objecten_US
format日期格式化String-
open日期组件隐藏、显示Booleanfalse
disabled是否禁用功能Booleanfalse
disabledDate禁用的日期Function(current:moment):Boolean-
disabledTime禁用的时间Function(current:moment):Object-
showDateInput显示日期输入框Booleantrue
showWeekNumber是否显示周数Booleanfalse
showToday是否显示今天Booleantrue
showOk底边栏是否显示ok按钮Booleanauto
onSelect选择日期的回调函数Function(date: moment)-
onChange日期改变的回调函数Function(date: moment)-
onOk点击确定按钮的回调Function(date: moment)-
dateInputPlaceholder日期的placeholderString-
showTime是否显示时间选择面板Boolean-
renderIcon更改默认的图标Function() =>
closeIcon鼠标划过清空内容的iconFunction() =>
getCalendarContainer更改默认渲染位置Function-
keyboardInput外层输入框是否支持键盘输入Booleanfalse
iconClick日期按钮点击的回调Function-
outInputFocus外层输入框获得焦点的回调Function-
outInputKeydown外层输入框keydown回调Function-

注:使用keyboardInput时,以下api变化

  • 输入内容的格式需要个format格式相同,也可以有部分变化,变化范围参考 moment.js。例如:format='YYYY-MM-DD' 输入 '19-1-1'也可识别
  • 当输入日期格式无法转换为 moment 对象时,onChange,onClick回调内对应的moment参数值为 null

MonthPicker

参数说明类型默认值
prefixCls组件的前缀String-
className添加节点的样式String-
style添加内联样式Object-
value当前值,如输入框的值moment-
defaultValue默认值,输入框的默认值moment-
locale语言Objecten_US
disabledDate禁用的日期Function(current:moment):Boolean-
onSelect选择日期的回调函数Function(date: moment)-
onChange日期改变的回调函数Function(date: moment)-
monthCellRender月份的渲染方法function-
dateCellRender日期的渲染方法function-
monthCellContentRender自定义月份的渲染方法,将被添加渲染内容中function-
getCalendarContainer更改默认渲染位置Function-
closeIcon鼠标划过清空内容的iconFunction() =>

RangePicker

参数说明类型默认值
prefixCls组件的前缀String-
className添加节点的样式String-
style添加内联样式Object-
dateRender日期表格(current, value) => React.Node-
renderSidebar侧边栏() => React.Node-
renderFooter扩展底边栏() => React.Node-
value当前选中的区间moment[]-
defaultValue默认选中的区间moment[]-
locale日历的语言Objecten_US
format日期格式化String-
disabledDate禁用的日期Function(current:moment):Boolean-
disabledTime禁用的时间Function(current:moment):Object-
showDateInput显示日期输入康Booleantrue
showWeekNumber是否显示周数Booleanfalse
showToday是否显示今天Booleantrue
showOk底边栏是否显示ok按钮Booleanauto
showClear是否显示清除按钮Booleanfalse
onSelect选择日期的回调函数Function(date: moment)-
onChange日期改变的回调函数Function(date: moment)-
dateInputPlaceholder日期的placeholderString-
type是否固定开始或结束选定的值enum('both','start', 'end')-
getCalendarContainer更改默认渲染位置Function-
closeIcon鼠标划过清空内容的iconFunction() =>

WeekPicker

参数说明类型默认值
placeholder输入框placeholderString-
defaultValue默认值moment-
getCalendarContainer更改默认渲染位置Function-
closeIcon鼠标划过清空内容的iconFunction() =>

YearPicker

参数说明类型默认值
placeholder输入框placeholderString-
defaultValue默认值moment当前年
getCalendarContainer更改默认渲染位置Function-
format日期格式化String-
disabled是否禁用功能Booleanfalse
closeIcon鼠标划过清空内容的iconFunction() =>

DatePicker 已支持的键盘操作

按键功能
↓(下箭)打开面板
esc关闭面板
delete清除内容
setup develop environment
$ npm install -g bee-tools
$ git clone https://github.com/tinper-bee/bee-datepicker.git
$ cd bee-datepicker
$ npm install
$ npm run dev

Keywords

FAQs

Package last updated on 03 Feb 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc