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

lpi-angular-resizable

v1.2.0

Published

A directive for creating resizable containers in angular.

Downloads

4

Readme

angular-resizable

A directive for creating resizable containers.

Why?

All other resizable directive concepts I came across include layout logic in the directive. I wanted a directive that only handled the resize logic. This way, the layout logic is quarantined to the CSS.

Usage

  1. npm install angular-resizable or bower install angular-resizable or clone/download this repo
  2. Include angular-resizable.min.js in your project.
  3. Include angular-resizable.min.css in your project as well (this provides default styling for the resize handles).
  4. Then include the module in your app: angular.module('app', ['angularResizable'])
  5. Use it: <section resizable r-directions="['bottom', 'right']" r-flex="true">

Include any sides you want to be resizable in an array inside r-directions. Accepts 'top','right','bottom', and 'left'. You can style the handles however you want. Just override the styles in the css in your own stylesheet.

Options

Attributes | Default | Accepts | Description --- | --- | --- | --- rDirections | ['right'] | ['top', 'right', 'bottom', 'left',] | Determines which sides of the element are resizable. rFlex | false | boolean | Set as true if you are using flexbox. See this codepen. rCenteredX | false | boolean | If set as true, the velocity of horizontal resizing will be doubled. rCenteredY | false | boolean | If set as true, the velocity of vertical resizing will be doubled. rWidth | false | integer or $scope variable | If set, the resizable element will be rendered with a predefined width relative to this value in pixels and a watcher will be set on the 'rWidth' attribute. See this codepen. rHeight | false | integer or $scope variable | If set, the resizable element will be rendered with a predefined height relative to this value in pixels and a watcher will be set on the 'rHeight' attribute. See this codepen. rGrabber | <span></span> | string | Defines custom inner html for the grabber. rNoThrottle | false | boolean | Disables angular-resizable.resizing throttling (see events section below). rStart | undefined | function | callback called with info when resize starts. (analogous to the angular-resizable.resizeStart). rEnd | undefined | function | callback called with info when resize ends. (analogous to the angular-resizable.resizeEnd).

Events

For an example using the events, see this codepen.

angular-resizable.resizeStart

This event is emitted at the beginning of a resize with the following info object:

  • info.width : The width of the directive at time of resize start. Will be false if resizing vertically
  • info.height : The height of the directive at time of resize start. Will be false if resizing horizontally
  • info.id : The id of the directive. Will be false if there is no id set.
  • info.evt : original mouse event object

angular-resizable.resizing

Called repeatedly while the mouse is being moved. By default, only calls once every 100ms to keep CPU usage low. For smooth resizing, use the rNoThrottle attribute. This event is emitted during the resizing of the element with the following object as an argument:

  • info.width : The width of the directive at time of resize end. Will be false if resizing vertically
  • info.height : The height of the directive at time of resize end. Will be false if resizing horizontally
  • info.id : The id of the directive. Will be false if there is no id set.
  • info.evt : original mouse event object

angular-resizable.resizeEnd

This event is emitted at the end of a resize with the following object as an argument:

  • info.width : The width of the directive at time of resize end. Will be false if resizing vertically
  • info.height : The height of the directive at time of resize end. Will be false if resizing horizontally
  • info.id : The id of the directive. Will be false if there is no id set.
  • info.evt : original mouse event object

version notes

1.2.0

  • Add angular-resizable.resizing event (see pull request #7)
  • Add attribute for providing custom inner html to the grabber element (see pull request #7)

License

MIT