npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

xa-time-picker

v0.0.1

Published

时间选择组件,使用方式与 ANTD 一致:

Downloads

3

Readme

xa-time-picker

时间选择组件,使用方式与 ANTD 一致:

 //受控组件: 
<TimePicker value={this.state.value} onChange={this.onChange} defaultOpenValue={moment('12:24:48', 'HH:mm:ss')} /> 
 //禁用组件: 
<TimePicker defaultValue={moment('12:08:23', 'HH:mm:ss')} disabled />         
 //选择时分: 
<TimePicker defaultValue={moment('12:08', 'HH:mm')} format={'HH:mm'} />         
 //选择步长: 
<TimePicker minuteStep={15} secondStep={10} />         
 //附加组件: 
<TimePicker open={this.state.open}
    onOpenChange={this.handleOpenChange}
    addon={() => (<button onClick={this.handleClose}>关闭</button>)}
    />
 //十二小时: 
<TimePicker use12Hours />
//禁用部分时分秒:
<TimePicker disabledHours={() => [0, 1, 2, 3]}
    disabledMinutes={(selectedHour) => selectedHour === 4 ? [0, 1, 2, 3] : []}
    />

| 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | format | 展示的时间格式 | string | "HH:mm:ss" | | value | 选中的时间 | moment| 无 | | defaultValue | 默认时间 | moment | 无 | | defaultOpenValue | 面板打开时默认选中的值 | moment | moment() | | disabled | 禁用全部操作 | boolean | false | | disabledHours | 禁止选择部分小时选项 | ()=>[] | 无 | | disabledMinutes | 禁止选择部分分钟选项 | (selectedHour)=>[] | 无 | | disabledSeconds | 禁止选择部分秒选项 | (selectedHour, selectedMinute)=>[] | 无 | | hideDisabledOptions | 隐藏禁止选择的选项 | boolean | false | | open | 面板是否打开 | boolean | false | | placeholder | 没有值的时候显示的内容 | string | "请选择时间" | | use12Hours | 使用 12 小时制,为 true 时 format 默认为 h:mm:ss a | boolean | false | | onChange | 时间发生变化的回调 | (time, timeString)=>{} | 无 | | onOpenChange | 面板打开/关闭时的回调 | (isOpen)=>{} | 无 | | addon | 选择框底部显示自定义的内容 | ReactElement | 无 |