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

@bsnbase/components-react

v1.1.7

Published

## 项目介绍

Downloads

11

Readme

bsn-components

项目介绍

项目背景或基础介绍

BSN React 公共组件

开发指南

运行环境

项目运行所需环境要求

  • node: >= 16.18

  • pnpm: >= 8.1.1

    pnpm 安装方法:npm install -g pnpm

本地开发

本地开发启动命令

  • pnpm storybook

打包编译

项目构建命令

  • pnpm build

开发资源

项目不同环节的产出,包括系统架构、产品原型、PRD、设计稿等

组件产出

| components | description | | ------------------ | ------------------------------- | | LibraryContext | 组件库公共配置 | | TableContext | CustomQuery组件table每行的数据 | | CustomQuery | 查询组件 | | CustomQueryButtons | 查询组件-表格行最后一列按钮组件 | | CustomTable | antd-table 二次封装 | | CustomForm | antd-form 二次封装 | | CustomButton | antd-button 二次封装 | | CustomConfirm | antd-confirm 二次封装 | | CustomModal | antd-modal 二次封装 |

LibraryContext

默认配置,类型内有具体注释

import { LibraryContext,type LibraryContextProps } from "@bsn/components-react";

export default function HomeLayout(props: PropsWithChildren) {
  const libraryContextVal = useMemo<LibraryContextProps>(
    () => ({
      // 国际化语言表示,zh-CN、en-US
      lang: "zh-CN",
      // 接口请求函数
      callRequest: <T, R>(func: (arg: T) => Promise<R>, arg: T) => Promise<R>;
      // 获取状态&类型的接口函数
      getStateApi: (key: string) => Promise<ResultInfo>;
      // 列表组件配置
      CustomQueryConfig?: {
         // table 操作列超过 actionsMax 个 显示更多按钮
        actionsMax: 3,
        // table 操作列更多按钮显示 (默认 0): 0:更多, 1:...,
        actionsType: 0,
        // antd 主题配置
        antdTheme: {}
        // 查询部分配置,支持大部分 antd 原生 form 属性
        form?: {
          // 是否显示查询框的展开、收起按钮
          showExpand: false;
          // label&value 排列方式 通 antd [官方文档](https://ant-design.antgroup.com/components/form-cn)
          layout:  "inline",
          // 不同分辨率下 每行显示几个查询项
          layoutCol?: {
            xs: 1,
            sm: 1,
            md: 2,
            lg: 2,
            xl: 3,
            "2xl": 4
          };
          fieldNames: {
            requestParam: "data", // 查询接口入参字段配置: 默认 param:{...},
            requestPage: "page" // 查询接口入参字段配置: 默认 page:{pageSize,pageNum},
          };
        }
      }
    }),
    [params]
  );
  return <LibraryContext.Provider value={libraryContextVal}>
      {...}
    </LibraryContext.Provider>
}