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

lisagao-btn

v0.0.2

Published

This is a react component library which could help to generate sort, drag and drop for the specific elements, and it also supports **Mobile Operation**. This library provided a drag toggle `<DragToogle />` to specify the draggable element and droppable e

Downloads

2

Readme

react-to-dragdrop

This is a react component library which could help to generate sort, drag and drop for the specific elements, and it also supports Mobile Operation. This library provided a drag toggle <DragToogle /> to specify the draggable element and droppable elements, and set as sortable.

Install

npm i react-to-dragdrop -s After install react-to-dragdrop, please check jquery and jquery-ui has been installed via the dependencies. If these libraries are not installed, please do as follows: npm i jquery jquery-ui -s

Import

  import { DragToggle } from 'react-to-dragdrop';
  import 'react-kekkai/dist/index.css';

Except import the <DragToggle />, you also need import the css file.

<DragToggle> API Documentation

  • Props

    • icon: string (required) Set as a class name to define the toggle icon.

    • sortable: boolean Could sort the elements when dragging. Default is false.

    • params: { [property]: any } Define the parameters which could be inputted on the events.

    • dragOn: string | HTMLElement | Component (required) Set the draggable target, and the option must be the parent of <DragToggle />. If you set it as a string, it means a jQuery selector.

    • dropInto: Specify the droppable elements. This prop could support many types, check as follows:

      • string - A jQuery selector.
      • HTMLElement - Specify the target element.
      • Component - Specify the react component.
      • IExactSelector - Except specifying the element, you could also define the selector, and that will find the droppable element more exactly.
      • [string, HTMLElement, Component, IExactSelector] - <DragToggle /> allowed of defining multiple droppable, so you could also set up the selectors via array.
  • Events

    • onSort: ({ params, $sort }) => void Set sortable as true, and this event will be triggered when sorting finish.

      • Parameters
        • params - { [property]: any } This parameter was defined in params.

        • $sort - <T>(list: T[], data: T) => T[] It's a helper function for resorting array, and you could call this function in the event to get a resorted array.

    • onDrop: ({ dragEl, dropEl, params }) => void This event will be triggered when dropping.

      • Parameters
        • dragEl - HTMLElement The draggable element.

        • dropEl - HTMLElement The target droppable element.

        • params - { [property]: any } This parameter was defined in params.

  • Type References

    • IExactSelector: { el: string | HTMLElement | Component, selector: string }