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

editable-tree-antd

v1.1.1

Published

An editable treeview component based on antd and powered by react.

Readme

EditableTree


An editable tree component based on antd tree and powered by react.

Preview

EditableTree

Features

  • Add sub nodes
  • Add sister nodes
  • Parse and insert yaml nodes
  • Edit node name and node value
  • Load nodes asynchronously
  • Supported languages: en_US / zh_CN

Env

Working with React^16.13.0 and Antd^4.6.3, please confirm to install them first.

Install

$: npm install editable-tree-antd
# or
$: yarn add editable-tree-antd

Options

  • data [Array]
    The data to build an editable antd tree, Check data instruction from Usage below.

  • maxLevel [Number]
    The max tree level depth, default 50.

  • enableYaml [Boolean]
    Enable input yaml string, default false.

  • defaultExpandAll [Boolean]
    Expand all nodes, default true.

  • onDataChange [Function]
    Get treeData when data changed.

  • lang [String]
    lang env: zh_CN | en_US, default zh_CN.

  • loadData [Function]
    Set option - defaultExpandAll to false and Load the children of node element asynchronously.

function loadData(node) {
  console.log(node); // the parent node you clicked to expand
  const data = [ // the child nodes array
    {
      nodeName: 'x', // child node name
      nodeValue: 'x-value', // child node value
      id: '[unique id]', // child node unique id
    },
    {
      nodeName: 'x2',
      nodeValue: 'x2-value', // child node value
      id: '[unique id]',
    },
  ];

  return new Promise((resolve) => {
    setTimeout(() => {
      resolve(data);
    }, 1000);
  });
}

Usage

A full demo

// ----- import antd depends
import 'antd/dist/antd.css';
// ----- import editable-tree depends
import 'editable-tree/lib/styles/icon-font/iconfont.css';
import 'editable-tree/lib/styles/editable-tree.css';
// ----- import component
import EditableTree from 'editable-tree-antd';

/* demo data */
[
  {
    nodeName: '出版者',
    id: '出版者', // unique id, required
    nameEditable: true, // is level editable (name), default true
    valueEditable: true, // is level editable (value), default true
    nodeDeletable: false, // is level deletable, default true
    nodeValue: [
      {
        nodeName: '出版者描述',
        isInEdit: true, // is level in edit status
        id: '出版者描述',
        nodeValue: [
          {
            nodeName: '出版者名称',
            id: '出版者名称',
            nodeValue: '出版者A',
          },
          {
            nodeName: '出版者地',
            id: '出版者地',
            valueEditable: false,
            nodeValue: '出版地B1',
          },
        ],
      }
    ],
  },
  ...
];

/* render function */
<EditableTree
  data={treeData} // see demo data above
  maxLevel={10} // tree max level limitation, default 50
  enableYaml={true} // enable parse yaml string, default false
  enableEdit={true} // enable tree edit, default true
  defaultExpandAll={true} // expand all nodes, default true
  // loadData={this.loadData} // load the children of node element asynchronously.
  lang="en_US" // default zh_CN
  onDataChange={this.onDataChange} // data change listener
/>