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

mousemultiples

v1.0.6

Published

React component for making selections on elements

Downloads

17

Readme

React mousemultiples

React 鼠标多选组件

React 鼠标多选组件

主要实现鼠标多选的效果, 在不破坏原有的列表情况下,嵌入组件拥有鼠标多选功能。

操作说明:

> 鼠标点击,单选
> Ctrl + 鼠标点击,多选,复选,反选
> Ctrl + a 全选
> 鼠标拖动,范围多选
npm包地址 [链接](https://www.npmjs.com/package/mousemultiples)

安装

npm i mousemultiples

使用配置项

/**
 * wrapperScroll?: any, // 滚动单位'ID';
 * 
 * itemClass: string,  // 列表框通用携带 class
 * 
 * activeClass?: string, // 列表框 选中class
 * 
 * isDataChange: any,  // 渲染的数组,检测数据更改
 * 
 * activePosition?: any,  // 主动选中数据
 * 
 * onSelected: (pos: any, item: any, data: any) => void, // 拖动
 * 
 * onSingleSelected?: (pos: any, item: any, data: any) => void, // 单击
 * 
 * 注:itemClass 与 children 循环box className必须携带一致,同box必须绑定data-position,data-position导出选中的唯一识别
 * 注:带问号为可选项,否则都是必填项。
 */

示例:

<MouseMultiples
   wrapperScroll="classify-img_body"
   itemClass='selection_box'
   activeClass='selection_box-active'
   activePosition={activePosition}
   onSelected={selected}
   isDataChange={imageLists}
>
   {imageLists.map(item => {
       return (
           <div 
           className="selection_box" 
           data-position={item.FileId}
           >
               <div className="listImage"><img src={ item.FileUrl } /></div>
           </div>
       )
   })}
</MouseMultiples>

说明:

children 自定义设计,样式,格子,选中效果等.

导入组件直接包裹已经设计好的列表即可,确保className和itemClass一致,确保导入data-position,和activeClass是否存在高亮样式。。。