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

ember-timerange-picker

v0.1.0

Published

Component and UI to pick time ranges

Downloads

6

Readme

Ember-timerange-picker

##WIP

Addon preview

{{timerange-picker
	interval="15"
	minTime="06:00"
	maxTime="12:00"
	class="time-range-picker"
	afterDrag=(action "getTimeRange") 
	initFromValue="08:00"
	initToValue="10:00"
}}

Supported attrs:

  • Interval: minimal amount of minutes needed to change value (default: 15)
  • maxTime: Maximal time (default: 24:00)
  • minTime: Minimal time (defualt: 00:00)
  • minDuration: Minimal duration that can be picked (defaults to Interval, setting this to 0 is not reccomended)
  • maxDuration: Maximum duration that can be picked - WIP
  • class: Applied to the whole element
  • containerClass: Applied to the internal container element
  • afterDrag(fromTime, toTime): Action called after the dragging has ended
  • onChange(fromTime, toTime): Action called whenever any value changed
  • initFromValue: starting value of the "from" marker // binding not supported atm
  • initToValue: starting value of the "to" marker // binding not supported atm

Features

  • control + drag for synchronous dragging of both markers (TODO: make it work with cmd button for mac)

The addon does not currently come with styling, feel free to grab this SCSS

* {box-sizing:border-box;}
$red:#DB2828; 

.time-range-picker {
	width: 100%;
	height: 75px;
	position: relative;
	border: 1px solid transparentize(grey, 0.8);
	border-radius: 5px;
	background: transparentize(grey, 0.9);
	user-select:none;
	-webkit-user-select:none;
	padding: 25px 30px;

	.tp-container {
		width: 96%;
		margin: 2%;
		position: relative;
	}

	.marker {
		position: absolute;
		width: 28px;
		height: 28px;
		background: transparentize($red, 0.5);
		border: 2px solid $red;
		border-radius:50%;
		cursor: pointer;
		top: -14px;
		z-index: 2;
		transition: 0.2s background;

		&.from {

			background: transparentize(green, 0.5);
			border: 2px solid green;

			&.dragging {
				background: transparentize(green, 0);
			}

			&:hover {
				z-index: 3;
			}
		}

		&.to {
			&.dragging {
				background: transparentize($red, 0);
			}
		}
	}

	.icon {
		font-size:2rem;
	}

	.line {
		width: 100%;
		height: 5px;
		position: absolute;
		left: 0;
		top: 0;
		transform: translate(0,-50%);	
		background: gray;
		border-radius: 5px;
	}
}

ToDO

  • [x] require chronology
  • [x] implement container to provide whitespace
  • [x] sync marker movement on ctrlKey
  • [x] settable min and max time
  • [x] touch support
  • [ ] improve the code quality of the mouseMove function
  • [x] interval set by a param
  • [x] set marker width on didInsertElement
  • [ ] AM/PM format
  • [ ] minutes format
  • [x] onChange function
  • [ ] write tests
  • [x] test the onChange and afterDrag function
  • [ ] test the interval
  • [x] test resize functionality
  • [x] test ctrlKey dragging
  • [x] test dragging out of range
  • [ ] test min and max duration
  • [ ] render into SVG (optionally?)
  • [x] settable minDuration
  • [ ] settable maxDuration
  • [x] basic functionality
  • [ ] sync dragging if limits are reached
  • [ ] make sure X = limit if limit is reached
  • [ ] update chronology check when ctrlKey is pressed
  • [ ] write custom computed macros
  • [ ] synchronous dragging when dragging space between markers
  • [ ] styles
  • [ ] functionality