@gingkoo/pandora-explorer 0.0.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -0
- package/lib/es/components/Dropdown/index.d.ts +20 -0
- package/lib/es/components/columns/index.d.ts +16 -0
- package/lib/es/components/icons/index.d.ts +17 -0
- package/lib/es/components/menu/index.d.ts +15 -0
- package/lib/es/components/menu/menulist.d.ts +3 -0
- package/lib/es/components/modal/index.d.ts +18 -0
- package/lib/es/components/modal/modal-tab.d.ts +14 -0
- package/lib/es/components/select-box/index.d.ts +19 -0
- package/lib/es/components/tile/index.d.ts +11 -0
- package/lib/es/components/tree/components/DropIndicator.d.ts +5 -0
- package/lib/es/components/tree/components/Indent.d.ts +10 -0
- package/lib/es/components/tree/components/MotionTreeNode.d.ts +14 -0
- package/lib/es/components/tree/components/NodeList.d.ts +14 -0
- package/lib/es/components/tree/components/Tree.d.ts +253 -0
- package/lib/es/components/tree/components/TreeNode.d.ts +12 -0
- package/lib/es/components/tree/components/contextTypes.d.ts +64 -0
- package/lib/es/components/tree/components/index.d.ts +7 -0
- package/lib/es/components/tree/components/interface.d.ts +123 -0
- package/lib/es/components/tree/components/useUnmount.d.ts +4 -0
- package/lib/es/components/tree/components/util.d.ts +54 -0
- package/lib/es/components/tree/components/utils/conductUtil.d.ts +17 -0
- package/lib/es/components/tree/components/utils/diffUtil.d.ts +7 -0
- package/lib/es/components/tree/components/utils/keyUtil.d.ts +2 -0
- package/lib/es/components/tree/components/utils/treeUtil.d.ts +86 -0
- package/lib/es/components/tree/index.d.ts +39 -0
- package/lib/es/components/tree/tree-item-table.d.ts +1 -0
- package/lib/es/components/tree/tree-item.d.ts +3 -0
- package/lib/es/components/virtualScroll/index.d.ts +7 -0
- package/lib/es/css.d.ts +10 -0
- package/lib/es/enum.d.ts +11 -0
- package/lib/es/explorer.d.ts +7 -0
- package/lib/es/index.d.ts +5 -0
- package/lib/es/index.js +6853 -0
- package/lib/es/index.js.map +1 -0
- package/lib/es/layout/components/explorer-head/index.d.ts +3 -0
- package/lib/es/layout/components/explorer-info/index.d.ts +3 -0
- package/lib/es/layout/components/explorer-main/index.d.ts +3 -0
- package/lib/es/layout/components/explorer-menu/index.d.ts +3 -0
- package/lib/es/layout/index.d.ts +4 -0
- package/lib/es/store.d.ts +28 -0
- package/lib/es/types.d.ts +80 -0
- package/lib/umd/index.js +7174 -0
- package/lib/umd/index.js.map +1 -0
- package/lib/umd/index.min.js +2 -0
- package/lib/umd/index.min.js.map +1 -0
- package/package.json +67 -0
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# pandora-explorer
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Getting started
|
|
6
|
+
|
|
7
|
+
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
|
8
|
+
|
|
9
|
+
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
|
10
|
+
|
|
11
|
+
## Add your files
|
|
12
|
+
|
|
13
|
+
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
|
14
|
+
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
cd existing_repo
|
|
18
|
+
git remote add origin http://git.server.gingkoo/frontend/pandora/pandora-components/pandora-explorer.git
|
|
19
|
+
git branch -M main
|
|
20
|
+
git push -uf origin main
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Integrate with your tools
|
|
24
|
+
|
|
25
|
+
- [ ] [Set up project integrations](http://git.server.gingkoo/frontend/pandora/pandora-components/pandora-explorer/-/settings/integrations)
|
|
26
|
+
|
|
27
|
+
## Collaborate with your team
|
|
28
|
+
|
|
29
|
+
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
|
30
|
+
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
|
31
|
+
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
|
32
|
+
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
|
33
|
+
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
|
34
|
+
|
|
35
|
+
## Test and Deploy
|
|
36
|
+
|
|
37
|
+
Use the built-in continuous integration in GitLab.
|
|
38
|
+
|
|
39
|
+
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
|
40
|
+
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
|
41
|
+
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
|
42
|
+
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
|
43
|
+
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
# Editing this README
|
|
48
|
+
|
|
49
|
+
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
|
50
|
+
|
|
51
|
+
## Suggestions for a good README
|
|
52
|
+
|
|
53
|
+
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
|
54
|
+
|
|
55
|
+
## Name
|
|
56
|
+
Choose a self-explaining name for your project.
|
|
57
|
+
|
|
58
|
+
## Description
|
|
59
|
+
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
|
60
|
+
|
|
61
|
+
## Badges
|
|
62
|
+
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
|
63
|
+
|
|
64
|
+
## Visuals
|
|
65
|
+
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
|
66
|
+
|
|
67
|
+
## Installation
|
|
68
|
+
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
|
69
|
+
|
|
70
|
+
## Usage
|
|
71
|
+
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
|
72
|
+
|
|
73
|
+
## Support
|
|
74
|
+
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
|
75
|
+
|
|
76
|
+
## Roadmap
|
|
77
|
+
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
|
78
|
+
|
|
79
|
+
## Contributing
|
|
80
|
+
State if you are open to contributions and what your requirements are for accepting them.
|
|
81
|
+
|
|
82
|
+
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
|
83
|
+
|
|
84
|
+
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
|
85
|
+
|
|
86
|
+
## Authors and acknowledgment
|
|
87
|
+
Show your appreciation to those who have contributed to the project.
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
For open source projects, say how it is licensed.
|
|
91
|
+
|
|
92
|
+
## Project status
|
|
93
|
+
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
interface DropdownProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
children: any;
|
|
5
|
+
trigger?: 'click' | 'hover' | 'contextMenu';
|
|
6
|
+
placement?: 'left' | 'top' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomContent';
|
|
7
|
+
dropdownRender?: any;
|
|
8
|
+
zIndex?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
onExpand?: (val: boolean) => void;
|
|
11
|
+
destroyPopupOnHide?: boolean;
|
|
12
|
+
capture?: boolean;
|
|
13
|
+
position?: {
|
|
14
|
+
x?: number;
|
|
15
|
+
y?: number;
|
|
16
|
+
};
|
|
17
|
+
style?: any;
|
|
18
|
+
}
|
|
19
|
+
export default function Dropdown(props: DropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
interface ColumnsProps {
|
|
4
|
+
data: any[];
|
|
5
|
+
className?: string;
|
|
6
|
+
icons?: (v: any, className: string) => ReactNode;
|
|
7
|
+
onRename?: (key: any, value: string, param: any) => any;
|
|
8
|
+
checks?: string[];
|
|
9
|
+
onMenuClick: any;
|
|
10
|
+
onLoadData?: any;
|
|
11
|
+
onDblclick?: (key: string, param: any) => any;
|
|
12
|
+
onClick?: (key: any, param: any) => any;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export default function Columns(props: ColumnsProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
export declare function FavoriteSvg(): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function SpaceSvg(): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function NetdiskSvg(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function AlbumSvg(): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function RecycleSvg(): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function RecentlySvg(): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function LinkSvg(): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function TextSvg(): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function InfoSvg(): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function ShareLinkSvg(): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function UpdateSvg(): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function NullDataSvg(): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function SuffixIcon({ className, suffix }: {
|
|
15
|
+
className: string;
|
|
16
|
+
suffix: string;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
interface MenuProps {
|
|
3
|
+
menu?: MenuItem[];
|
|
4
|
+
onChange?: (key: string) => any;
|
|
5
|
+
}
|
|
6
|
+
export interface MenuItem {
|
|
7
|
+
key: string;
|
|
8
|
+
title: string;
|
|
9
|
+
type?: string;
|
|
10
|
+
icon?: any;
|
|
11
|
+
children: MenuItem | null;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export default function Menu(props: MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
interface ModalProps {
|
|
4
|
+
id?: string | number;
|
|
5
|
+
show: boolean;
|
|
6
|
+
title?: false | string | ReactNode;
|
|
7
|
+
onClose?: () => any;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
tabIndex?: number;
|
|
10
|
+
isfocus?: boolean;
|
|
11
|
+
onFocus?: () => any;
|
|
12
|
+
onBlur?: () => any;
|
|
13
|
+
minimize: boolean;
|
|
14
|
+
onMinimize: () => any;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
declare function Modal(props: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default Modal;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
interface ModalTabPorps {
|
|
4
|
+
items: any[];
|
|
5
|
+
select?: string;
|
|
6
|
+
showKey: string[];
|
|
7
|
+
className?: string;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
onChange?: () => any;
|
|
10
|
+
onClone?: (key: string, props: any) => any;
|
|
11
|
+
onSelect?: () => any;
|
|
12
|
+
}
|
|
13
|
+
export default function ModalTab(props: ModalTabPorps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface SelectBoxProps {
|
|
3
|
+
checks: string[];
|
|
4
|
+
dataClass?: string;
|
|
5
|
+
selectClass: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
regionClass?: string;
|
|
8
|
+
isDrag: boolean;
|
|
9
|
+
isSelectBoxes: boolean;
|
|
10
|
+
action?: 'stack' | 'rotate';
|
|
11
|
+
onChange: (v: any) => any;
|
|
12
|
+
onDrag: () => any;
|
|
13
|
+
onEndDrag: () => any;
|
|
14
|
+
onStartDrag: () => any;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
18
|
+
declare const SelectBox: (props: SelectBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default SelectBox;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface TileProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
checks: any[];
|
|
4
|
+
onMenuClick?: (key: string, param: any) => void;
|
|
5
|
+
onDblclick?: (key: string, param: any) => void;
|
|
6
|
+
onSelect?: (key: string, param: any) => void;
|
|
7
|
+
onRename?: (key: string, value: string, param: any) => void;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
export default function Tile(props: TileProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FlattenNode, TreeNodeProps } from './interface';
|
|
3
|
+
import { TreeNodeRequiredProps } from './utils/treeUtil';
|
|
4
|
+
interface MotionTreeNodeProps extends Omit<TreeNodeProps, 'domRef'> {
|
|
5
|
+
active: boolean;
|
|
6
|
+
motion?: any;
|
|
7
|
+
motionNodes?: FlattenNode[];
|
|
8
|
+
onMotionStart: () => void;
|
|
9
|
+
onMotionEnd: () => void;
|
|
10
|
+
motionType?: 'show' | 'hide';
|
|
11
|
+
treeNodeRequiredProps: TreeNodeRequiredProps;
|
|
12
|
+
}
|
|
13
|
+
declare const RefMotionTreeNode: React.ForwardRefExoticComponent<MotionTreeNodeProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export default RefMotionTreeNode;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DataEntity, DataNode, FlattenNode, ScrollTo } from './interface';
|
|
3
|
+
export declare const MOTION_KEY: string;
|
|
4
|
+
export declare const MotionEntity: DataEntity;
|
|
5
|
+
export interface NodeListRef {
|
|
6
|
+
scrollTo: ScrollTo;
|
|
7
|
+
getIndentWidth: () => number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* We only need get visible content items to play the animation.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getMinimumRangeTransitionRange(list: FlattenNode[], virtual: boolean, height: number, itemHeight: number): FlattenNode<DataNode>[];
|
|
13
|
+
declare const NodeList: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<NodeListRef>>;
|
|
14
|
+
export default NodeList;
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { NodeDragEventHandler, NodeDragEventParams, NodeMouseEventHandler, NodeMouseEventParams } from './contextTypes';
|
|
3
|
+
import DropIndicator from './DropIndicator';
|
|
4
|
+
import { BasicDataNode, DataNode, Direction, EventDataNode, FieldNames, FlattenNode, IconType, Key, KeyEntities, NodeInstance, SafeKey, ScrollTo } from './interface';
|
|
5
|
+
import { NodeListRef } from './NodeList';
|
|
6
|
+
export interface CheckInfo<TreeDataType extends BasicDataNode = DataNode> {
|
|
7
|
+
event: 'check';
|
|
8
|
+
node: EventDataNode<TreeDataType>;
|
|
9
|
+
checked: boolean;
|
|
10
|
+
nativeEvent: MouseEvent;
|
|
11
|
+
checkedNodes: TreeDataType[];
|
|
12
|
+
checkedNodesPositions?: {
|
|
13
|
+
node: TreeDataType;
|
|
14
|
+
pos: string;
|
|
15
|
+
}[];
|
|
16
|
+
halfCheckedKeys?: Key[];
|
|
17
|
+
}
|
|
18
|
+
export interface AllowDropOptions<TreeDataType extends BasicDataNode = DataNode> {
|
|
19
|
+
dragNode: TreeDataType;
|
|
20
|
+
dropNode: TreeDataType;
|
|
21
|
+
dropPosition: -1 | 0 | 1;
|
|
22
|
+
}
|
|
23
|
+
export type AllowDrop<TreeDataType extends BasicDataNode = DataNode> = (options: AllowDropOptions<TreeDataType>) => boolean;
|
|
24
|
+
export type DraggableFn = (node: DataNode) => boolean;
|
|
25
|
+
export type DraggableConfig = {
|
|
26
|
+
icon?: React.ReactNode | false;
|
|
27
|
+
nodeDraggable?: DraggableFn;
|
|
28
|
+
};
|
|
29
|
+
export type ExpandAction = false | 'click' | 'doubleClick';
|
|
30
|
+
export interface TreeProps<TreeDataType extends BasicDataNode = DataNode> {
|
|
31
|
+
prefixCls: string;
|
|
32
|
+
className?: string;
|
|
33
|
+
style?: React.CSSProperties;
|
|
34
|
+
focusable?: boolean;
|
|
35
|
+
activeKey?: Key | null;
|
|
36
|
+
tabIndex?: number;
|
|
37
|
+
children?: React.ReactNode;
|
|
38
|
+
treeData?: TreeDataType[];
|
|
39
|
+
fieldNames?: FieldNames;
|
|
40
|
+
showLine?: boolean;
|
|
41
|
+
showIcon?: boolean;
|
|
42
|
+
icon?: IconType;
|
|
43
|
+
indentWidth?: number;
|
|
44
|
+
selectable?: boolean;
|
|
45
|
+
expandAction?: ExpandAction;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
multiple?: boolean;
|
|
48
|
+
checkable?: boolean | React.ReactNode;
|
|
49
|
+
checkStrictly?: boolean;
|
|
50
|
+
draggable?: DraggableFn | boolean | DraggableConfig;
|
|
51
|
+
defaultExpandParent?: boolean;
|
|
52
|
+
autoExpandParent?: boolean;
|
|
53
|
+
defaultExpandAll?: boolean;
|
|
54
|
+
defaultExpandedKeys?: Key[];
|
|
55
|
+
expandedKeys?: Key[];
|
|
56
|
+
defaultCheckedKeys?: Key[];
|
|
57
|
+
checkedKeys?: Key[] | {
|
|
58
|
+
checked: Key[];
|
|
59
|
+
halfChecked: Key[];
|
|
60
|
+
};
|
|
61
|
+
defaultSelectedKeys?: Key[];
|
|
62
|
+
selectedKeys?: Key[];
|
|
63
|
+
allowDrop?: AllowDrop<TreeDataType>;
|
|
64
|
+
titleRender?: (node: TreeDataType) => React.ReactNode;
|
|
65
|
+
dropIndicatorRender?: (props: {
|
|
66
|
+
dropPosition: -1 | 0 | 1;
|
|
67
|
+
dropLevelOffset: number;
|
|
68
|
+
indent: number;
|
|
69
|
+
prefixCls: string;
|
|
70
|
+
direction: Direction;
|
|
71
|
+
}) => React.ReactNode;
|
|
72
|
+
onFocus?: React.FocusEventHandler<HTMLDivElement>;
|
|
73
|
+
onBlur?: React.FocusEventHandler<HTMLDivElement>;
|
|
74
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
75
|
+
onContextMenu?: React.MouseEventHandler<HTMLDivElement>;
|
|
76
|
+
onClick?: NodeMouseEventHandler<TreeDataType>;
|
|
77
|
+
onDoubleClick?: NodeMouseEventHandler<TreeDataType>;
|
|
78
|
+
onScroll?: React.UIEventHandler<HTMLElement>;
|
|
79
|
+
onExpand?: (expandedKeys: Key[], info: {
|
|
80
|
+
node: EventDataNode<TreeDataType>;
|
|
81
|
+
expanded: boolean;
|
|
82
|
+
nativeEvent: MouseEvent;
|
|
83
|
+
}) => void;
|
|
84
|
+
onCheck?: (checked: {
|
|
85
|
+
checked: Key[];
|
|
86
|
+
halfChecked: Key[];
|
|
87
|
+
} | Key[], info: CheckInfo<TreeDataType>) => void;
|
|
88
|
+
onSelect?: (selectedKeys: Key[], info: {
|
|
89
|
+
event: 'select';
|
|
90
|
+
selected: boolean;
|
|
91
|
+
node: EventDataNode<TreeDataType>;
|
|
92
|
+
selectedNodes: TreeDataType[];
|
|
93
|
+
nativeEvent: MouseEvent;
|
|
94
|
+
}) => void;
|
|
95
|
+
onLoad?: (loadedKeys: Key[], info: {
|
|
96
|
+
event: 'load';
|
|
97
|
+
node: EventDataNode<TreeDataType>;
|
|
98
|
+
}) => void;
|
|
99
|
+
loadData?: (treeNode: EventDataNode<TreeDataType>) => Promise<any>;
|
|
100
|
+
loadedKeys?: Key[];
|
|
101
|
+
onMouseEnter?: (info: NodeMouseEventParams<TreeDataType>) => void;
|
|
102
|
+
onMouseLeave?: (info: NodeMouseEventParams<TreeDataType>) => void;
|
|
103
|
+
onRightClick?: (info: {
|
|
104
|
+
event: React.MouseEvent;
|
|
105
|
+
node: EventDataNode<TreeDataType>;
|
|
106
|
+
}) => void;
|
|
107
|
+
onDragStart?: (info: NodeDragEventParams<TreeDataType>) => void;
|
|
108
|
+
onDragEnter?: (info: NodeDragEventParams<TreeDataType> & {
|
|
109
|
+
expandedKeys: Key[];
|
|
110
|
+
}) => void;
|
|
111
|
+
onDragOver?: (info: NodeDragEventParams<TreeDataType>) => void;
|
|
112
|
+
onDragLeave?: (info: NodeDragEventParams<TreeDataType>) => void;
|
|
113
|
+
onDragEnd?: (info: NodeDragEventParams<TreeDataType>) => void;
|
|
114
|
+
onDrop?: (info: NodeDragEventParams<TreeDataType> & {
|
|
115
|
+
dragNode: EventDataNode<TreeDataType>;
|
|
116
|
+
dragNodesKeys: Key[];
|
|
117
|
+
dropPosition: number;
|
|
118
|
+
dropToGap: boolean;
|
|
119
|
+
}) => void;
|
|
120
|
+
/**
|
|
121
|
+
* Used for `rc-tree-select` only.
|
|
122
|
+
* Do not use in your production code directly since this will be refactor.
|
|
123
|
+
*/
|
|
124
|
+
onActiveChange?: (key: Key) => void;
|
|
125
|
+
filterTreeNode?: (treeNode: EventDataNode<TreeDataType>) => boolean;
|
|
126
|
+
motion?: any;
|
|
127
|
+
switcherIcon?: IconType;
|
|
128
|
+
height?: number;
|
|
129
|
+
itemHeight?: number;
|
|
130
|
+
scrollWidth?: number;
|
|
131
|
+
onVirtualScroll?: (info: any) => any;
|
|
132
|
+
itemScrollOffset?: number;
|
|
133
|
+
virtual?: boolean;
|
|
134
|
+
direction?: Direction;
|
|
135
|
+
rootClassName?: string;
|
|
136
|
+
rootStyle?: React.CSSProperties;
|
|
137
|
+
}
|
|
138
|
+
interface TreeState<TreeDataType extends BasicDataNode = DataNode> {
|
|
139
|
+
keyEntities: KeyEntities<TreeDataType>;
|
|
140
|
+
indent: number | null;
|
|
141
|
+
selectedKeys: Key[];
|
|
142
|
+
checkedKeys: Key[];
|
|
143
|
+
halfCheckedKeys: Key[];
|
|
144
|
+
loadedKeys: Key[];
|
|
145
|
+
loadingKeys: Key[];
|
|
146
|
+
expandedKeys: Key[];
|
|
147
|
+
draggingNodeKey: Key;
|
|
148
|
+
dragChildrenKeys: Key[];
|
|
149
|
+
dropPosition: -1 | 0 | 1 | null;
|
|
150
|
+
dropLevelOffset: number | null;
|
|
151
|
+
dropContainerKey: Key | null;
|
|
152
|
+
dropTargetKey: Key | null;
|
|
153
|
+
dropTargetPos: string | null;
|
|
154
|
+
dropAllowed: boolean;
|
|
155
|
+
dragOverNodeKey: Key | null;
|
|
156
|
+
treeData: TreeDataType[];
|
|
157
|
+
flattenNodes: FlattenNode<TreeDataType>[];
|
|
158
|
+
focused: boolean;
|
|
159
|
+
activeKey: Key | null;
|
|
160
|
+
listChanging: boolean;
|
|
161
|
+
prevProps: TreeProps;
|
|
162
|
+
fieldNames: FieldNames;
|
|
163
|
+
}
|
|
164
|
+
declare class Tree<TreeDataType extends DataNode | BasicDataNode = DataNode> extends React.Component<TreeProps<TreeDataType>, TreeState<TreeDataType>> {
|
|
165
|
+
static defaultProps: {
|
|
166
|
+
prefixCls: string;
|
|
167
|
+
showLine: boolean;
|
|
168
|
+
showIcon: boolean;
|
|
169
|
+
selectable: boolean;
|
|
170
|
+
multiple: boolean;
|
|
171
|
+
checkable: boolean;
|
|
172
|
+
disabled: boolean;
|
|
173
|
+
checkStrictly: boolean;
|
|
174
|
+
draggable: boolean;
|
|
175
|
+
defaultExpandParent: boolean;
|
|
176
|
+
autoExpandParent: boolean;
|
|
177
|
+
defaultExpandAll: boolean;
|
|
178
|
+
defaultExpandedKeys: never[];
|
|
179
|
+
defaultCheckedKeys: never[];
|
|
180
|
+
defaultSelectedKeys: never[];
|
|
181
|
+
dropIndicatorRender: typeof DropIndicator;
|
|
182
|
+
allowDrop: () => boolean;
|
|
183
|
+
expandAction: boolean;
|
|
184
|
+
};
|
|
185
|
+
static TreeNode: React.FC<import("./interface").TreeNodeProps<DataNode>>;
|
|
186
|
+
destroyed: boolean;
|
|
187
|
+
delayedDragEnterLogic: Record<SafeKey, number>;
|
|
188
|
+
loadingRetryTimes: Record<SafeKey, number>;
|
|
189
|
+
state: TreeState<TreeDataType>;
|
|
190
|
+
dragStartMousePosition: null;
|
|
191
|
+
dragNode: NodeInstance<TreeDataType>;
|
|
192
|
+
currentMouseOverDroppableNodeKey: null;
|
|
193
|
+
listRef: React.RefObject<NodeListRef>;
|
|
194
|
+
componentDidMount(): void;
|
|
195
|
+
componentDidUpdate(): void;
|
|
196
|
+
onUpdated(): void;
|
|
197
|
+
componentWillUnmount(): void;
|
|
198
|
+
static getDerivedStateFromProps(props: TreeProps, prevState: TreeState): Partial<TreeState<DataNode>>;
|
|
199
|
+
onNodeDragStart: NodeDragEventHandler<TreeDataType, HTMLDivElement>;
|
|
200
|
+
/**
|
|
201
|
+
* [Legacy] Select handler is smaller than node,
|
|
202
|
+
* so that this will trigger when drag enter node or select handler.
|
|
203
|
+
* This is a little tricky if customize css without padding.
|
|
204
|
+
* Better for use mouse move event to refresh drag state.
|
|
205
|
+
* But let's just keep it to avoid event trigger logic change.
|
|
206
|
+
*/
|
|
207
|
+
onNodeDragEnter: (event: React.DragEvent<HTMLDivElement>, node: NodeInstance<TreeDataType>) => void;
|
|
208
|
+
onNodeDragOver: (event: React.DragEvent<HTMLDivElement>, node: NodeInstance<TreeDataType>) => void;
|
|
209
|
+
onNodeDragLeave: NodeDragEventHandler<TreeDataType>;
|
|
210
|
+
onWindowDragEnd: (event: any) => void;
|
|
211
|
+
onNodeDragEnd: NodeDragEventHandler<TreeDataType>;
|
|
212
|
+
onNodeDrop: (event: React.DragEvent<HTMLDivElement>, node: any, outsideTree?: boolean) => void;
|
|
213
|
+
resetDragState(): void;
|
|
214
|
+
cleanDragState: () => void;
|
|
215
|
+
triggerExpandActionExpand: NodeMouseEventHandler;
|
|
216
|
+
onNodeClick: NodeMouseEventHandler<TreeDataType>;
|
|
217
|
+
onNodeDoubleClick: NodeMouseEventHandler<TreeDataType>;
|
|
218
|
+
onNodeSelect: NodeMouseEventHandler<TreeDataType>;
|
|
219
|
+
onNodeCheck: (e: React.MouseEvent<HTMLSpanElement>, treeNode: EventDataNode<TreeDataType>, checked: boolean) => void;
|
|
220
|
+
onNodeLoad: (treeNode: EventDataNode<TreeDataType>) => Promise<void>;
|
|
221
|
+
onNodeMouseEnter: NodeMouseEventHandler<TreeDataType>;
|
|
222
|
+
onNodeMouseLeave: NodeMouseEventHandler<TreeDataType>;
|
|
223
|
+
onNodeContextMenu: NodeMouseEventHandler<TreeDataType>;
|
|
224
|
+
onFocus: React.FocusEventHandler<HTMLDivElement>;
|
|
225
|
+
onBlur: React.FocusEventHandler<HTMLDivElement>;
|
|
226
|
+
getTreeNodeRequiredProps: () => {
|
|
227
|
+
expandedKeys: React.Key[];
|
|
228
|
+
selectedKeys: React.Key[];
|
|
229
|
+
loadedKeys: React.Key[];
|
|
230
|
+
loadingKeys: React.Key[];
|
|
231
|
+
checkedKeys: React.Key[];
|
|
232
|
+
halfCheckedKeys: React.Key[];
|
|
233
|
+
dragOverNodeKey: React.Key | null;
|
|
234
|
+
dropPosition: 0 | 1 | -1 | null;
|
|
235
|
+
keyEntities: KeyEntities<TreeDataType>;
|
|
236
|
+
};
|
|
237
|
+
/** Set uncontrolled `expandedKeys`. This will also auto update `flattenNodes`. */
|
|
238
|
+
setExpandedKeys: (expandedKeys: Key[]) => void;
|
|
239
|
+
onNodeExpand: (e: React.MouseEvent<HTMLDivElement>, treeNode: EventDataNode<TreeDataType>) => void;
|
|
240
|
+
onListChangeStart: () => void;
|
|
241
|
+
onListChangeEnd: () => void;
|
|
242
|
+
onActiveChange: (newActiveKey: Key | null) => void;
|
|
243
|
+
getActiveItem: () => FlattenNode<TreeDataType> | null;
|
|
244
|
+
offsetActiveKey: (offset: number) => void;
|
|
245
|
+
onKeyDown: React.KeyboardEventHandler<HTMLDivElement>;
|
|
246
|
+
/**
|
|
247
|
+
* Only update the value which is not in props
|
|
248
|
+
*/
|
|
249
|
+
setUncontrolledState: (state: Partial<TreeState<TreeDataType>>, atomic?: boolean, forceState?: Partial<TreeState<TreeDataType>> | null) => void;
|
|
250
|
+
scrollTo: ScrollTo;
|
|
251
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
252
|
+
}
|
|
253
|
+
export default Tree;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TreeContextProps } from './contextTypes';
|
|
3
|
+
import { TreeNodeProps } from './interface';
|
|
4
|
+
export type { TreeNodeProps } from './interface';
|
|
5
|
+
export interface InternalTreeNodeProps extends TreeNodeProps {
|
|
6
|
+
context?: TreeContextProps;
|
|
7
|
+
}
|
|
8
|
+
export interface TreeNodeState {
|
|
9
|
+
dragNodeHighlight: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const ContextTreeNode: React.FC<TreeNodeProps>;
|
|
12
|
+
export default ContextTreeNode;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Webpack has bug for import loop, which is not the same behavior as ES module.
|
|
3
|
+
* When util.js imports the TreeNode for tree generate will cause treeContextTypes be empty.
|
|
4
|
+
*/
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { BasicDataNode, DataNode, Direction, EventDataNode, IconType, Key, KeyEntities, NodeInstance } from './interface';
|
|
7
|
+
import { DraggableConfig } from './Tree';
|
|
8
|
+
export type NodeMouseEventParams<TreeDataType extends BasicDataNode = DataNode, T = HTMLSpanElement> = {
|
|
9
|
+
event: React.MouseEvent<T>;
|
|
10
|
+
node: EventDataNode<TreeDataType>;
|
|
11
|
+
};
|
|
12
|
+
export type NodeDragEventParams<TreeDataType extends BasicDataNode = DataNode, T = HTMLDivElement> = {
|
|
13
|
+
event: React.DragEvent<T>;
|
|
14
|
+
node: EventDataNode<TreeDataType>;
|
|
15
|
+
};
|
|
16
|
+
export type NodeMouseEventHandler<TreeDataType extends BasicDataNode = DataNode, T = HTMLSpanElement> = (e: React.MouseEvent<T>, node: EventDataNode<TreeDataType>) => void;
|
|
17
|
+
export type NodeDragEventHandler<TreeDataType extends BasicDataNode = DataNode, T = HTMLDivElement> = (e: React.DragEvent<T>, node: NodeInstance<TreeDataType>, outsideTree?: boolean) => void;
|
|
18
|
+
export interface TreeContextProps<TreeDataType extends BasicDataNode = DataNode> {
|
|
19
|
+
prefixCls: string;
|
|
20
|
+
selectable: boolean;
|
|
21
|
+
showIcon: boolean;
|
|
22
|
+
icon: IconType;
|
|
23
|
+
switcherIcon: IconType;
|
|
24
|
+
draggable?: DraggableConfig;
|
|
25
|
+
draggingNodeKey?: Key;
|
|
26
|
+
checkable: boolean | React.ReactNode;
|
|
27
|
+
checkStrictly: boolean;
|
|
28
|
+
disabled: boolean;
|
|
29
|
+
keyEntities: KeyEntities;
|
|
30
|
+
dropLevelOffset?: number;
|
|
31
|
+
dropContainerKey: Key | null;
|
|
32
|
+
dropTargetKey: Key | null;
|
|
33
|
+
dropPosition: -1 | 0 | 1 | null;
|
|
34
|
+
indent: number | null;
|
|
35
|
+
indentWidth?: number;
|
|
36
|
+
dropIndicatorRender: (props: {
|
|
37
|
+
dropPosition: -1 | 0 | 1;
|
|
38
|
+
dropLevelOffset: number;
|
|
39
|
+
indent: any;
|
|
40
|
+
prefixCls: any;
|
|
41
|
+
direction: Direction;
|
|
42
|
+
}) => React.ReactNode;
|
|
43
|
+
dragOverNodeKey: Key | null;
|
|
44
|
+
direction: Direction;
|
|
45
|
+
loadData: (treeNode: EventDataNode<TreeDataType>) => Promise<void>;
|
|
46
|
+
filterTreeNode: (treeNode: EventDataNode<TreeDataType>) => boolean;
|
|
47
|
+
titleRender?: (node: any) => React.ReactNode;
|
|
48
|
+
onNodeClick: NodeMouseEventHandler<TreeDataType>;
|
|
49
|
+
onNodeDoubleClick: NodeMouseEventHandler<TreeDataType>;
|
|
50
|
+
onNodeExpand: NodeMouseEventHandler<TreeDataType>;
|
|
51
|
+
onNodeSelect: NodeMouseEventHandler<TreeDataType>;
|
|
52
|
+
onNodeCheck: (e: React.MouseEvent<HTMLSpanElement>, treeNode: EventDataNode<TreeDataType>, checked: boolean) => void;
|
|
53
|
+
onNodeLoad: (treeNode: EventDataNode<TreeDataType>) => void;
|
|
54
|
+
onNodeMouseEnter: NodeMouseEventHandler<TreeDataType>;
|
|
55
|
+
onNodeMouseLeave: NodeMouseEventHandler<TreeDataType>;
|
|
56
|
+
onNodeContextMenu: NodeMouseEventHandler<TreeDataType>;
|
|
57
|
+
onNodeDragStart: NodeDragEventHandler<any, any>;
|
|
58
|
+
onNodeDragEnter: NodeDragEventHandler<any, any>;
|
|
59
|
+
onNodeDragOver: NodeDragEventHandler<any, any>;
|
|
60
|
+
onNodeDragLeave: NodeDragEventHandler<any, any>;
|
|
61
|
+
onNodeDragEnd: NodeDragEventHandler<any, any>;
|
|
62
|
+
onNodeDrop: NodeDragEventHandler<any, any>;
|
|
63
|
+
}
|
|
64
|
+
export declare const TreeContext: React.Context<TreeContextProps<any> | null>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Tree from './Tree';
|
|
2
|
+
import TreeNode from './TreeNode';
|
|
3
|
+
import type { TreeProps } from './Tree';
|
|
4
|
+
import type { TreeNodeProps, BasicDataNode, FieldDataNode } from './interface';
|
|
5
|
+
export { TreeNode };
|
|
6
|
+
export type { TreeProps, TreeNodeProps, BasicDataNode, FieldDataNode };
|
|
7
|
+
export default Tree;
|