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

react-form-input-table

v0.0.4

Published

a react input form table

Readme

install

npm i react-form-input-table

Usage

基本模式

基本模式

const COLUMNS = [
  {
    title: "名称",
    dataIndex: "title",
  },
  {
    title: "富文本",
    dataIndex: "richText",
    rows: "3",
  },
  {
    title: "日期",
    dataIndex: "time",
    inputType: "dateTimePicker",
  },
  {
    title: "开关",
    dataIndex: "switch",
    inputType: "boolean",
  },
  {
    title: "选择框",
    dataIndex: "select",
    inputType: "select",
    selectSource: [
      {
        id: 1,
        name: "第一项",
      },
      {
        id: 2,
        name: "第二项",
      },
    ],
  },
  {
    title: "自定义时间",
    dataIndex: "dateRange",
    inputType: "customAction",
    customRender: (record) => {
      return (
        <>
          <Button>自定义操作</Button>
        </>
      );
    },
  },
  {
    title: "操作",
    dataIndex: "operation",
    inputType: "operation",
  },
];
const dataSource = [
  {
    id: 1,
    title: "测试",
    time: moment(),
    switch: true,
    select: 2,
  },
];
const save = values => {

}
<ReactFormInputTable.d
      columns={COLUMNS_RELATED_WORD}
      dataSource={searchRelatedWordData}
      onSave={values => { save(values) }}
/>

单行保存模式

单行保存模式


<ReactFormInputTable
      columns={COLUMNS}
      isSingleSave
      dataSource={[]}
      onSave={onSave}
      onDelete={onDelete}
      addBtnText="新增一条数据"
    />

API and Usage

Table Properties

| Property | Type | Required | Explanation | | ------------------ | ---------------- | -------- | ----------------------------------------------- | | columns | array | yes | 见下面 Columns | | dataSource | array | yes | 默认数据 | | saveBtnText | string | no | 保存按钮文案 默认 ‘保存’ | | addBtnText | string | no | 新增按钮文案 默认添加 | | isSingleSave | boolean | no | 是否单行保存,此模式每行数据都有保存按钮 | | limitDataSourceLen | number | no | 最大的数据条数限制 超出则添加按钮 disabled 状态 | | onSave | (record) => void | yes | 保存成功回调 | | onDelete | (id) => void | no | isSingleSave 为 true 时需要,删除一行回调 |

Columns

表格 title

| Property | Type | Required | Explanation | | ------------ | --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | title | string | yes | | | dataIndex | string | yes | 后端关联的字段名 | | inputType | string | no | 'number'/'customAction'/'operation'分别表示数字类型/自定义节点类型/操作(固定类型,默认内置删除操作) 省略该字段默认为 string 输入框类型 | | rules | [] | no | 自定义校验规则,参考 antd form,默认所有项必填,传[]可表示非必填 | | customRender | (record)=> void | no | 自定义输出 | | max | number | no | 最大数字或最长字符串 | | min | number | no | 最小数字或最短字符串 |