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 🙏

© 2026 – Pkg Stats / Ryan Hefner

lg.table-plus

v0.0.2

Published

table增强库,单元格选择、复制、粘贴、列拖拽、行拖拽,直接针对原生table做增强,不受各UI组件库限制,不受vue、react和angular等框架限制

Readme

table增强库,单元格选择、复制、粘贴、列拖拽、行拖拽,直接针对原生table做增强,不受各UI组件库限制,不受vue、react和angular等框架限制

六哥开源前后端脚手架

  • https://gitee.com/lgx1992/lg-soar

六哥npm工具库

定义选中单元格样式

.lg-selected-top {
    border-top: 1px solid var(--copy-table-color, #2E5CF6) !important;
}
.lg-selected-bottom {
    border-bottom: 1px solid var(--copy-table-color, #2E5CF6) !important;
}
.lg-selected-left {
    border-left: 1px solid var(--copy-table-color, #2E5CF6) !important;
}
.lg-selected-right {
    border-right: 1px solid var(--copy-table-color, #2E5CF6) !important;
}
.lg-table-row-drag {
    cursor: grabbing;
    background: #f1f3f4;
}
.lg-table-col-drag {
    cursor: grabbing;
    background: #f1f3f4;
}

单元格复制到excel

import { useTableCopy } from 'lg.table-plus'

// 全局使用
useTableCopy()

// 范围使用
useTableCopy({
    el: document.getElementById('你的html元素id')
})

单元格粘贴(支持从excel复制粘贴)

import { useTablePaste } from 'lg.table-plus'

const data = ref([]);

useTablePaste<any>({
    getColumnKeys(): string[] {
        return ['a', 'b', 'c', 'd']
    },
    getRowData(): any[] {
        return data.value
    },
    onChange(rows: any[]) {
        data.value = rows;
    },
    errorHandler({ msg }) {
        alert(msg)
    }
})

行拖动

import { useRowDrag } from 'lg.table-plus'

const data = ref([]);

useRowDrag({
    getRowData() {
        return data.value
    },
    onChange(rows: any[]) {
        data.value = rows;
    },
});

列拖动

import { useColDrag } from 'lg.table-plus'

const colList = ref([]);

useColDrag({
    getColData() {
        return colList
    },
    onChange(cols: any[]) {
        colList = cols;
    },
})

全表复制到excel

import { copyTableToClipboard } from 'lg.table-plus'

// 不指定table,默认选中页面第一个table
function copyTable() {
    copyTableToClipboard()
}

// 指定table
function copyTable() {
    copyTableToClipboard({
        el: document.getElementById('tableId')
    })
}

复制文本到剪切板

import { copyToClipboard } from 'lg.table-plus'

copyToClipboard('你的文本')

事件添加和移除

import { addEventListener, removeEventListener } from 'lg.table-plus'


const listener = (e) => {
    // 事件处理代码
};

// 添加事件
addEventListener(document.getElementById('元素id'), 'click', listener)

// 移除事件
removeEventListener(document.getElementById('元素id'), 'click', listener)