Skip to content

Commit 4fffa06

Browse files
author
Administrator
committed
infos
1 parent 180095b commit 4fffa06

File tree

1 file changed

+3
-95
lines changed

1 file changed

+3
-95
lines changed

README.md

Lines changed: 3 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,14 @@
1-
### TreeMenu / PropertyGrid
1+
### Cascade Forms
22

3-
![npm](https://img.shields.io/npm/v/@code4bones/react-tree-menu-property-grid?label=latest) ![npm](https://img.shields.io/npm/dt/@code4bones/react-tree-menu-property-grid?style=flat-square&label=installs)
3+
![npm](https://img.shields.io/npm/v/@code4bones/react-cascade-forms?label=latest) ![npm](https://img.shields.io/npm/dt/@code4bones/react-cascade-forms?style=flat-square&label=installs)
44

5-
### System default / Custom theme
6-
7-
![sample](https://github.com/code4bones/react-c4b-ui/blob/master/img/theme.png?raw=true "sample")
8-
9-
|feature|sample|
10-
|-------|------|
11-
|![cap](https://github.com/code4bones/react-tree-menu-property-grid/blob/master/img/controls.gif?raw=true)|![cap](https://github.com/code4bones/react-tree-menu-property-grid/blob/master/img/reveal.gif?raw=true) |
12-
![cap](https://github.com/code4bones/react-tree-menu-property-grid/blob/master/img/folders.gif?raw=true)|![cap](https://github.com/code4bones/react-tree-menu-property-grid/blob/master/img/group-right.gif?raw=true)|
135

146
clone, samples available via `yarn storybook`
157

168
#### Brief
179

18-
yarn add `@code4bones/react-tree-menu-property-grid`
19-
20-
```tsx
21-
22-
import {TreeMenu, TreeMenuActions,TreeMenuItem } from "@code4bones/react-tree-menu-property-grid";
23-
import "@code4bones/react-tree-menu-property-grid/build/styles.css";
24-
25-
const ITEMS : TreeMenuItem[] = [{
26-
id:"item1",
27-
title:"Item 1",
28-
// other TreeMenuItem's props
29-
childs:[{
30-
id:"sub",
31-
title:"Subitem 1",
32-
}]
33-
}];
34-
35-
// if your need to use exponsed actions
36-
const ref = createRef<TreeMenuActions>();
37-
38-
<TreeMenu
39-
ref={ref}
40-
items={ITEMS}
41-
onClick={onClick}
42-
/>
43-
44-
```
45-
46-
### Properties
47-
48-
type `RenderFn` = (item:MenuItem) => React.ReactElement | undefined | null;
49-
type `RenderType` = `RenderFn` | React.ReactElement;
50-
51-
52-
| Propery name | Description | Signature
53-
| ------------- | ------------------------------ | ---- |
54-
| `treeID` | tree id | string |
55-
| `propertyGrid` | property grid mode | boolean |
56-
| `items[]` | tree menu items array | `TreeMenuItem`[] |
57-
| `ref` | handle to TreeMenu methods | `TreeMenuActions` |
58-
| `initialCollapsed` | initial tree state | boolean |
59-
| `initialSelected` | initial selected item | item's `id` : string|
60-
| `theme` | theme override class name | `dark`, `light`, custom name |
61-
| `classPrefix` | container global prefix | string |
62-
| `enableRotate` | Rotate collapse / expand icon| boolean |
63-
| `infoStyle` | global custom style | boolean |
64-
| `titleStyle` | global custom style | boolean |
65-
| `infoReveal` | global info display modes | "always" | "vertical" | "horizontal" |
66-
| `badgeVisible` | display badge | boolean |
67-
| `groupIconLeft` | group icon position | boolean |
68-
| `onClick` | item click handler | onClick?:(item:TreeMenuItem) => void|
69-
| `onToggle` | collapse / expand | onToggle?:(id?:string,collapsed?:boolean) => void;|
70-
| `renderBadge` | item click handler | `RenderType` |
71-
| `renderIcon` | Left side element of item | `RenderType` |
72-
| `renderGroupState` | Group indicator | `RenderType` |
73-
74-
75-
`TreeMenuItem`
76-
77-
```tsx
78-
id:string;
79-
title:string | React.ReactElement;
80-
info?:string | React.ReactElement;
81-
badge?:string | React.ReactElement;
82-
control?:string | JSX.Element;
83-
infoReveal?:InfoReveal;
84-
icon?:React.ReactElement;
85-
badge?:string | React.ReactElement;
86-
disabled?:boolean;
87-
unselectable?:boolean;
88-
titleClass?:string;
89-
infoClass?:string;
90-
style?:React.CSSProperties;
91-
titleStyle?:React.CSSProperties;
92-
infoStyle?:React.CSSProperties;
93-
```
10+
yarn add `@code4bones/react-cascade-forms`
9411

95-
`TreeMenuActions` ( use `ref` )
96-
```
97-
enable:(id:string,disable?:boolean) => void;
98-
getItem:(id:string) => TreeMenuItem | null;
99-
collapse:(id:string,collapsed?:boolean) => void;
100-
select:(id:string) => void;
101-
invalidate:() => void;
102-
rebuild:(items:TreeMenuItem[]) => void;
103-
```
10412

10513
### Sample
10614

0 commit comments

Comments
 (0)