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

@swzs/erp-common

v1.0.2

Published

ERP通用组件库,包含可复用的组件、样式和资源

Readme

@swzs/erp-common

npm version License: MIT

ERP通用组件库,基于React + TypeScript + Ant Design开发,提供可复用的组件、样式和资源。

🚀 特性

  • 📦 开箱即用: 基于Ant Design设计语言,提供高质量React组件
  • 🎯 TypeScript: 完整的类型定义,更好的开发体验
  • 🎨 主题定制: 支持主题定制,满足不同业务需求
  • 📱 响应式: 支持移动端和桌面端
  • 🔧 工程化: 完整的开发工具链,支持多种模块格式
  • 🌍 国际化: 支持多语言
  • 性能优化: 支持按需加载

📦 安装

# npm
npm install @swzs/erp-common

# yarn
yarn add @swzs/erp-common

# pnpm
pnpm add @swzs/erp-common

🔨 使用

基础用法

import React from 'react';
import { DictSelect, CountrySelect, StatusIcons } from '@swzs/erp-common';

function App() {
  return (
    <div>
      {/* 字典选择组件 */}
      <DictSelect
        dictType="USER_STATUS"
        onLoadDict={fetchDictData}
        onChange={value => console.log(value)}
      />

      {/* 国家选择组件 */}
      <CountrySelect
        open={true}
        onLoadCountry={fetchCountryData}
        onChange={codes => console.log(codes)}
      />

      {/* 图标使用 */}
      <StatusIcons.success />
    </div>
  );
}

样式引入

// 在你的应用入口文件中引入样式
import '@swzs/erp-common/dist/erp-common.min.css';

📚 组件文档

字典组件

  • DictSelect - 字典选择器
  • DictRadio - 字典单选框
  • DictCheckbox - 字典复选框
  • DictTree - 字典树形选择
  • DictTreeSelect - 字典树形下拉选择

业务组件

  • CountrySelect - 国家选择器
  • Button - 通用按钮

图标模块

  • StatusIcons - 状态图标
  • ActionIcons - 操作图标
  • BusinessIcons - 业务图标
  • IconFont - Iconfont图标

Hooks

  • useDict - 字典数据管理
  • useCountry - 国家数据管理

🔗 依赖

同伴依赖 (peerDependencies)

{
  "react": ">=16.9.0",
  "react-dom": ">=16.9.0",
  "antd": ">=5.0.0"
}

确保你的项目中已安装这些依赖。

🛠️ 开发

# 克隆仓库
git clone https://github.com/your-username/erp-common.git

# 安装依赖
cd erp-common
npm install

# 启动开发服务器
npm run dev

# 构建
npm run build

# 运行测试
npm test

# 类型检查
npm run type-check

📋 目录结构

erp-common/
├── src/                    # 源码目录
│   ├── components/         # 组件
│   ├── hooks/             # Hooks
│   ├── icons/             # 图标模块
│   ├── styles/            # 样式
│   ├── types/             # 类型定义
│   └── utils/             # 工具函数
├── docs/                  # 文档
├── lib/                   # CommonJS 构建产物
├── es/                    # ES Module 构建产物
└── dist/                  # UMD 构建产物

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📄 许可证

MIT

🔗 相关链接