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

legit-scheduler

v0.3.2

Published

A React drag and drop scheduler component

Downloads

29

Readme

Codetree

Legit Scheduler

A pure React implementation of a drag and drop scheduler

Usage

Install it:

$ npm install --save legit-scheduler

Import it:

import Scheduler from 'legit-scheduler'

The scheduler component has three required props: events - An array of event objects resources - An array of resources width - The width of the scheduler container, in pixels. An integer.

The resources array is just strings:

['Resource 1', 'Resource 2', 'Resource 3']

The events array is an array of objects:

{
  title: 'A great event',  // Required: The title of the event
  startDate: '2016-01-24', // Required: The start date, must be in the format of "YYYY-MM-DD"
  duration: 4,             // Required: The duration of the event in days
  resource: 'Resource 1',  // Required: The name of the resource the event belongs to. Must match the resource name from the resources prop
  id: '3829-fds89',        // Required: A unique identifier. This can be anything you want as long as it's unique
  disabled: false,         // Optional: Whether or not this event can be moved (it can still be resized). Defaults to false.
  styles: {}               // Optional: An object of styles to apply to the event object
}

The scheduler component also takes more optional props:

onEventChanged - A call back that is fired when the event is moved. It receives an object containing the new event props
onEventResized - A call back that is fired when the event is resized. It receives an object containing the new event props
onEventClicked - A call back that is fired when the event is clicked. It receives an object containing the event props
onCellClicked - A call back that is fired when an empty cell on the scheduler is clicked. It receives the date and resource name as props
onRangeChanged - A call back that is fired when the date range is changed. It receives a DateRange object with the new range.
from - Either a date string or a RangeDate object defining the start date for the range. to - Either a date string or a RangeDate object defining the end date for the range.

Development

$ npm install
$ npm run example

Visit: localhost:8080/example