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

react-waterfall-calendar

v2.1.2

Published

react-waterfall-calendar

Downloads

19

Readme

react-waterfall-calendar

Build Status Coverage Status npm version Total downloads PRs Welcome MIT Licence

流式布局日历模块

Props

    <Calendar
      interval

      selectType
      classNames
      dataAttribute
      defaultSelected

      dateFormat
      monthFormat

      enableTouchTap
      onClick
    />

interval

日历显示的月份区间

    const { from, to, months } = interval;
{ from, to }

格式为符合 ISO 8601String 类型

{ months }

格式为大于0的 Number 类型,{ from }undefined 时从当前月份开始计算

⚠️ 当months !== undefined时,to将不起任何作用


selectType

日期如何被选中的类型

格式为 String 类型,接受以下三个值,默认为 'SINGLE'

    const selectType = 'INTERVAL' || 'MULTIPLE' || 'SINGLE'
'INTERVAL'

被选中的日期 是前后选择的两次日期间的所有日期

'MULTIPLE'

所有被选中的日期都会同时存在

'SINGLE'

只有最后一个被选择的日期

classNames

传入自定义样式的样式名

    const { calendar, month, horizontal, date } = classNames;

dataAttribute

可对个别日期单独设置 data-* 属性

    const dataAttribute = {};
    dataAttribute['2017-04-05'] = { attribute: 'attribute' }

defaultSelected

在挂载日历组件时默认选中的日期

    const defaultSelected = ['2017-02-06', '2017-02-07'];

dateFormat

日期格式化

默认为 'D'

    const dateFormat = 'D' || 'DD' || 'D日';

monthFormat

月份格式化

默认为 'YYYY-MM'

    const dateFormat = 'M' || 'MM' || 'M月';

onClick

日期被点击时的回调方法

    function onClick({ date, event, nextSelected, state }) {}

return

false [boolean]

被选中的日期不会更新为 nextSelected 中的内容

{ nextSelected } [Array]

会根据 onClick 返回的 nextSelected 值更新 nextSelected符合 ISO 8601String 类型数组

enableTouchTap

enableTouchTap = true 时,onClick回调事件为 onTouchTap

默认为 false