@balkangraph/orgchart.js 8.14.77 → 8.14.78
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/orgchart.d.ts +301 -305
- package/orgchart.js +1 -1
- package/package.json +1 -1
package/orgchart.d.ts
CHANGED
|
@@ -1,6 +1,199 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
declare class OrgChart
|
|
3
|
+
declare class OrgChart {
|
|
4
|
+
|
|
5
|
+
static icon: {
|
|
6
|
+
png: (w: string| number, h: string | number, c: string) => string,
|
|
7
|
+
pdf: (w: string | number| number, h: string | number, c: string) => string,
|
|
8
|
+
svg: (w: string| number, h: string| number, c: string | number) => string,
|
|
9
|
+
csv: (w: string| number, h: string| number, c: string| number) => string,
|
|
10
|
+
excel: (w: string| number, h: string| number, c: string| number) => string,
|
|
11
|
+
edit: (w: string| number, h: string| number, c: string| number) => string,
|
|
12
|
+
details: (w: string| number, h: string| number, c: string| number) => string,
|
|
13
|
+
remove: (w: string| number, h: string| number, c: string| number) => string,
|
|
14
|
+
add: (w: string| number, h: string| number, c: string| number) => string,
|
|
15
|
+
xml: (w: string| number, h: string| number, c: string| number) => string,
|
|
16
|
+
link: (w: string| number, h: string| number, c: string| number) => string,
|
|
17
|
+
happy: (w: string| number, h: string| number, c: string| number) => string,
|
|
18
|
+
sad: (w: string| number, h: string| number, c: string| number) => string,
|
|
19
|
+
share: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
|
|
20
|
+
user: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
|
|
21
|
+
undo: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
|
|
22
|
+
redo: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Can update link
|
|
29
|
+
* @param id child id
|
|
30
|
+
* @param pid parent id
|
|
31
|
+
*/
|
|
32
|
+
canUpdateLink(id: string | number, pid: string | number): boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Removes specified node from nodes collection, redraws the chart and fires remove event.
|
|
36
|
+
* @param id identification number of the node
|
|
37
|
+
* @param callback called at the end of animation
|
|
38
|
+
* @param fireEvent indicates if the remove event will be called or not
|
|
39
|
+
*/
|
|
40
|
+
removeNode(id: string | number, callback?: () => void, fireEvent?: boolean): void;
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The on() method of the OrgChart class sets up a function that will be called whenever the specified event is delivered to the target. *
|
|
48
|
+
* @category Event Listeners
|
|
49
|
+
* @param type A case-sensitive string representing the event type to listen for.
|
|
50
|
+
* @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
|
|
51
|
+
*/
|
|
52
|
+
on(type: "init" | "field" | "update" | "add" | "remove" | "renderbuttons" | "label" | "render-link" | "drag" | "drop" | "redraw" | "expcollclick" | "exportstart" | "exportend" | "click" | "dbclick" | "slink-click" | "clink-click" | "up-click" | "searchclick" | "import" | "updated" | "key-down" | "visibility-change" | "renderdefs" | "render" | "prerender" | "screen-reader-text" | "ready" | "ripple" | "node-initialized" | "nodes-initialized" | "node-layout", listener: (sender: OrgChart, args?: any, args1?: any, args2?: any) => void | boolean): OrgChart;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Removes an event listener previously registered. The event listener to be removed is identified using a combination of the event type and the event listener function itself. Returns true if success and false if fail.
|
|
56
|
+
* @param type A string which specifies the type of event for which to remove an event listener
|
|
57
|
+
* @param listener The event listener function of the event handler to remove from the event target
|
|
58
|
+
*/
|
|
59
|
+
removeListener(type: "init" | "field" | "update" | "add" | "remove" | "renderbuttons" | "label" | "render-link" | "drag" | "drop" | "redraw" | "expcollclick" | "exportstart" | "exportend" | "click" | "dbclick" | "slink-click" | "clink-click" | "up-click" | "searchclick" | "import" | "updated" | "key-down" | "visibility-change" | "renderdefs" | "render" | "prerender" | "screen-reader-text" | "ready" | "ripple" | "node-initialized" | "nodes-initialized" | "node-layout", listener?: () => void): boolean;
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Occurs when the node data has been updated by updateNode method.
|
|
64
|
+
* ```typescript
|
|
65
|
+
* var chart = new OrgChart('#tree', {});
|
|
66
|
+
* chart.onUpdateNode((args) => {
|
|
67
|
+
* //return false; to cancel the operation
|
|
68
|
+
* });
|
|
69
|
+
* ```
|
|
70
|
+
* @category Event Listeners
|
|
71
|
+
* @param listener
|
|
72
|
+
*/
|
|
73
|
+
onUpdateNode(listener: (args: {
|
|
74
|
+
/**
|
|
75
|
+
* old node data
|
|
76
|
+
*/
|
|
77
|
+
oldData: object,
|
|
78
|
+
/**
|
|
79
|
+
* new node data
|
|
80
|
+
*/
|
|
81
|
+
newData: object
|
|
82
|
+
}) => void): OrgChart;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Occurs when new nodes are added, removed, updated or imported, also when slink or clink is added or removed and after undo or redo operations.
|
|
86
|
+
* Use this event listener to synch your server side database with this.config.nodes, this.config.clinks, this.config.slinks etc.
|
|
87
|
+
* ```typescript
|
|
88
|
+
* var chart = new OrgChart('#tree', {});
|
|
89
|
+
* chart.onUpdated(() => {
|
|
90
|
+
* //Update your server database with this.config.nodes, this.config.clinks, this.config.slinks etc.
|
|
91
|
+
* });
|
|
92
|
+
* ```
|
|
93
|
+
* @category Event Listeners
|
|
94
|
+
*/
|
|
95
|
+
onUpdated(): OrgChart;
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Occurs when a node has been removed by removeNode method.
|
|
102
|
+
* ```typescript
|
|
103
|
+
* var chart = new OrgChart('#tree', {});
|
|
104
|
+
* chart.onRemoveNode((args) => {
|
|
105
|
+
* //return false; to cancel the operation
|
|
106
|
+
* });
|
|
107
|
+
* ```
|
|
108
|
+
* @category Event Listeners
|
|
109
|
+
* @param listener
|
|
110
|
+
*/
|
|
111
|
+
onRemoveNode(listener: (args: {
|
|
112
|
+
/**
|
|
113
|
+
* node id
|
|
114
|
+
*/
|
|
115
|
+
id: number | string,
|
|
116
|
+
/**
|
|
117
|
+
* parent ids and sub tree parents ids that needs to be updated on the server. For example if you remove a node that has children all chilren nodes will change their pid to the parent node id of the removed node.
|
|
118
|
+
*/
|
|
119
|
+
newPidsAndStpidsForIds: {
|
|
120
|
+
newPidsForIds: { [key in any]: string | number },
|
|
121
|
+
newStpidsForIds: { [key in any]: string | number }
|
|
122
|
+
}
|
|
123
|
+
}) => void): OrgChart;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Occurs when a node has been added by addNode method.
|
|
127
|
+
* ```typescript
|
|
128
|
+
* var chart = new OrgChart('#tree', {});
|
|
129
|
+
* chart.onAddNode((args) => {
|
|
130
|
+
* //return false; to cancel the operation
|
|
131
|
+
* });
|
|
132
|
+
* ```
|
|
133
|
+
* @category Event Listeners
|
|
134
|
+
* @param listener
|
|
135
|
+
*/
|
|
136
|
+
onAddNode(listener: (args: {
|
|
137
|
+
/**
|
|
138
|
+
* new added data node
|
|
139
|
+
*/
|
|
140
|
+
data: object
|
|
141
|
+
}) => void): OrgChart;
|
|
142
|
+
/**
|
|
143
|
+
* The onDrag event occurs when a node is dragged. *enableDragDrop* option has to be turned on.
|
|
144
|
+
* ```typescript
|
|
145
|
+
* var chart = new OrgChart('#tree', {});
|
|
146
|
+
* chart.onDrag(() => {
|
|
147
|
+
* //return false; to cancel the operation
|
|
148
|
+
* });
|
|
149
|
+
* ```
|
|
150
|
+
* @category Event Listeners
|
|
151
|
+
* @param listener
|
|
152
|
+
*/
|
|
153
|
+
onDrag(listener: (args: {
|
|
154
|
+
/**
|
|
155
|
+
* dragged node id
|
|
156
|
+
*/
|
|
157
|
+
dragId: string | number,
|
|
158
|
+
event: MouseEvent,
|
|
159
|
+
/**
|
|
160
|
+
* array of node ids
|
|
161
|
+
*
|
|
162
|
+
* this property is initialized only if movable option is set
|
|
163
|
+
*/
|
|
164
|
+
nodeIds: Array<string | number>
|
|
165
|
+
}) => void): OrgChart;
|
|
166
|
+
/**
|
|
167
|
+
* The onDrop event occurs when a node is dropped. *enableDragDrop* option has to be turned on.
|
|
168
|
+
* ```typescript
|
|
169
|
+
* var chart = new OrgChart('#tree', {});
|
|
170
|
+
* chart.onDrop(() => {
|
|
171
|
+
* //return false; to cancel the operation
|
|
172
|
+
* });
|
|
173
|
+
* ```
|
|
174
|
+
* @category Event Listeners
|
|
175
|
+
* @param listener
|
|
176
|
+
*/
|
|
177
|
+
onDrop(listener: (args: {
|
|
178
|
+
/**
|
|
179
|
+
* dragged node id
|
|
180
|
+
*/
|
|
181
|
+
dragId: string | number,
|
|
182
|
+
/**
|
|
183
|
+
* dropped node id
|
|
184
|
+
*/
|
|
185
|
+
dropId: string | number,
|
|
186
|
+
/**
|
|
187
|
+
* draging element
|
|
188
|
+
*/
|
|
189
|
+
dragNodeElement: HTMLElement,
|
|
190
|
+
/**
|
|
191
|
+
* Mouse event
|
|
192
|
+
*/
|
|
193
|
+
event: MouseEvent
|
|
194
|
+
}) => void): OrgChart;
|
|
195
|
+
|
|
196
|
+
|
|
4
197
|
nodes: { [key in any]: OrgChart.node };
|
|
5
198
|
isVisible: boolean;
|
|
6
199
|
visibleNodeIds: Array<number | string>;
|
|
@@ -1447,39 +1640,124 @@ declare class OrgChart extends OrgChartBase {
|
|
|
1447
1640
|
static grCloseTag: any;
|
|
1448
1641
|
}
|
|
1449
1642
|
|
|
1450
|
-
declare namespace OrgChart {
|
|
1643
|
+
declare namespace OrgChart {
|
|
1644
|
+
|
|
1645
|
+
interface node {
|
|
1646
|
+
/**
|
|
1647
|
+
* same pid you provided in the source node, the default value is null if not provided or if node with the same id does not exist
|
|
1648
|
+
*/
|
|
1649
|
+
pid?: string | number,
|
|
1650
|
+
}
|
|
1451
1651
|
/**
|
|
1452
|
-
* deprecated
|
|
1652
|
+
* deprecated, use OrgChart.align.center isntead
|
|
1453
1653
|
* @ignore
|
|
1454
1654
|
*/
|
|
1455
|
-
const
|
|
1456
|
-
|
|
1655
|
+
const CENTER: number;
|
|
1457
1656
|
/**
|
|
1657
|
+
* deprecated, use OrgChart.align.orientation isntead
|
|
1458
1658
|
* @ignore
|
|
1459
|
-
*/
|
|
1460
|
-
const
|
|
1461
|
-
|
|
1659
|
+
*/
|
|
1660
|
+
const ORIENTATION: number;
|
|
1661
|
+
|
|
1662
|
+
|
|
1462
1663
|
/**
|
|
1664
|
+
* deprecated, use OrgChart.layout.normal isntead
|
|
1463
1665
|
* @ignore
|
|
1464
1666
|
*/
|
|
1465
|
-
const
|
|
1466
|
-
|
|
1667
|
+
const normal: number;
|
|
1467
1668
|
|
|
1468
|
-
|
|
1669
|
+
/**
|
|
1670
|
+
* deprecated, use OrgChart.layout.mixed isntead
|
|
1671
|
+
* @ignore
|
|
1672
|
+
*/
|
|
1673
|
+
const mixed: number;
|
|
1674
|
+
/**
|
|
1675
|
+
* deprecated, use OrgChart.layout.tree isntead
|
|
1676
|
+
* @ignore
|
|
1677
|
+
*/
|
|
1678
|
+
const tree: number;
|
|
1679
|
+
/**
|
|
1680
|
+
* deprecated, use OrgChart.layout.treeLeftOffset isntead
|
|
1681
|
+
* @ignore
|
|
1682
|
+
*/
|
|
1683
|
+
const treeLeftOffset: any;
|
|
1684
|
+
/**
|
|
1685
|
+
* deprecated, use OrgChart.layout.treeRightOffset isntead
|
|
1686
|
+
* @ignore
|
|
1687
|
+
*/
|
|
1688
|
+
const treeRightOffset: any;
|
|
1469
1689
|
|
|
1470
|
-
interface
|
|
1471
|
-
/**
|
|
1472
|
-
* the same id you provided in the source node
|
|
1473
|
-
*/
|
|
1474
|
-
id?: string | number,
|
|
1475
|
-
/**
|
|
1476
|
-
* partner parent id, it is the partner parent node id of the partner node, it is the same ppid you provided in the source node, the default value is undefined.
|
|
1477
|
-
*/
|
|
1478
|
-
ppid?: string | number,
|
|
1690
|
+
interface options {
|
|
1479
1691
|
/**
|
|
1480
|
-
*
|
|
1692
|
+
* With the drag and drop features enabled you can move nodes easily and change the tree structure. Default value - *false*.
|
|
1693
|
+
* ```typescript
|
|
1694
|
+
* var chart = new OrgChart('#tree', {
|
|
1695
|
+
* enableDragDrop: true
|
|
1696
|
+
* });
|
|
1697
|
+
* ```
|
|
1481
1698
|
*/
|
|
1482
|
-
|
|
1699
|
+
enableDragDrop?: boolean,
|
|
1700
|
+
/**
|
|
1701
|
+
* Collapse specified level of the chart and its children if allChildren is true.
|
|
1702
|
+
* ```typescript
|
|
1703
|
+
* var chart = new OrgChart('#tree', {
|
|
1704
|
+
* collapse: {level: 2, allChildren: true}
|
|
1705
|
+
* });
|
|
1706
|
+
* ```
|
|
1707
|
+
*/
|
|
1708
|
+
collapse?: {
|
|
1709
|
+
level: number,
|
|
1710
|
+
allChildren?: boolean
|
|
1711
|
+
},
|
|
1712
|
+
/**
|
|
1713
|
+
* Expand specified node ids and its children if allChildren is true. The expand option works only if collapse is set.
|
|
1714
|
+
*
|
|
1715
|
+
* In the example above the second level of the chart will be collapsed but node with id 155 and its children will be expanded.
|
|
1716
|
+
* ```typescript
|
|
1717
|
+
* var chart = new OrgChart('#tree', {
|
|
1718
|
+
* collapse: {level: 2, allChildren: true},
|
|
1719
|
+
* expand: {nodes: [155], allChildren: true}
|
|
1720
|
+
* });
|
|
1721
|
+
* ```
|
|
1722
|
+
*/
|
|
1723
|
+
expand?: {
|
|
1724
|
+
nodes?: Array<string | number>,
|
|
1725
|
+
allChildren?: boolean
|
|
1726
|
+
},
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
/**
|
|
1730
|
+
* deprecated
|
|
1731
|
+
* @ignore
|
|
1732
|
+
*/
|
|
1733
|
+
const none: number;
|
|
1734
|
+
|
|
1735
|
+
/**
|
|
1736
|
+
* @ignore
|
|
1737
|
+
*/
|
|
1738
|
+
const COLLAPSE_PARENT_NEIGHBORS: number;
|
|
1739
|
+
|
|
1740
|
+
/**
|
|
1741
|
+
* @ignore
|
|
1742
|
+
*/
|
|
1743
|
+
const COLLAPSE_SUB_CHILDRENS: number;
|
|
1744
|
+
|
|
1745
|
+
|
|
1746
|
+
var template: object;
|
|
1747
|
+
|
|
1748
|
+
interface node {
|
|
1749
|
+
/**
|
|
1750
|
+
* the same id you provided in the source node
|
|
1751
|
+
*/
|
|
1752
|
+
id?: string | number,
|
|
1753
|
+
/**
|
|
1754
|
+
* partner parent id, it is the partner parent node id of the partner node, it is the same ppid you provided in the source node, the default value is undefined.
|
|
1755
|
+
*/
|
|
1756
|
+
ppid?: string | number,
|
|
1757
|
+
/**
|
|
1758
|
+
* a reference to the parent node, default value is null, if the nodes is collapse this proprty is not initalized and can be null even if pid is not null
|
|
1759
|
+
*/
|
|
1760
|
+
parent?: node,
|
|
1483
1761
|
/**
|
|
1484
1762
|
* ub tree parent id, it is the parent node id of the root node of the sub tree, it is the same stpid you provided in the source node, the default value is null if not provided or if node with the same id does not exist.
|
|
1485
1763
|
*/
|
|
@@ -3004,286 +3282,4 @@ declare namespace OrgChart {
|
|
|
3004
3282
|
};
|
|
3005
3283
|
|
|
3006
3284
|
var t: any;
|
|
3007
|
-
}
|
|
3008
|
-
|
|
3009
|
-
declare class OrgChartBase {
|
|
3010
|
-
|
|
3011
|
-
static icon: {
|
|
3012
|
-
png: (w: string| number, h: string | number, c: string) => string,
|
|
3013
|
-
pdf: (w: string | number| number, h: string | number, c: string) => string,
|
|
3014
|
-
svg: (w: string| number, h: string| number, c: string | number) => string,
|
|
3015
|
-
csv: (w: string| number, h: string| number, c: string| number) => string,
|
|
3016
|
-
excel: (w: string| number, h: string| number, c: string| number) => string,
|
|
3017
|
-
edit: (w: string| number, h: string| number, c: string| number) => string,
|
|
3018
|
-
details: (w: string| number, h: string| number, c: string| number) => string,
|
|
3019
|
-
remove: (w: string| number, h: string| number, c: string| number) => string,
|
|
3020
|
-
add: (w: string| number, h: string| number, c: string| number) => string,
|
|
3021
|
-
xml: (w: string| number, h: string| number, c: string| number) => string,
|
|
3022
|
-
link: (w: string| number, h: string| number, c: string| number) => string,
|
|
3023
|
-
happy: (w: string| number, h: string| number, c: string| number) => string,
|
|
3024
|
-
sad: (w: string| number, h: string| number, c: string| number) => string,
|
|
3025
|
-
share: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
|
|
3026
|
-
user: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
|
|
3027
|
-
undo: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
|
|
3028
|
-
redo: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string
|
|
3029
|
-
}
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
/**
|
|
3034
|
-
* Can update link
|
|
3035
|
-
* @param id child id
|
|
3036
|
-
* @param pid parent id
|
|
3037
|
-
*/
|
|
3038
|
-
canUpdateLink(id: string | number, pid: string | number): boolean;
|
|
3039
|
-
|
|
3040
|
-
/**
|
|
3041
|
-
* Removes specified node from nodes collection, redraws the chart and fires remove event.
|
|
3042
|
-
* @param id identification number of the node
|
|
3043
|
-
* @param callback called at the end of animation
|
|
3044
|
-
* @param fireEvent indicates if the remove event will be called or not
|
|
3045
|
-
*/
|
|
3046
|
-
removeNode(id: string | number, callback?: () => void, fireEvent?: boolean): void;
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
/**
|
|
3053
|
-
* The on() method of the OrgChart class sets up a function that will be called whenever the specified event is delivered to the target. *
|
|
3054
|
-
* @category Event Listeners
|
|
3055
|
-
* @param type A case-sensitive string representing the event type to listen for.
|
|
3056
|
-
* @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
|
|
3057
|
-
*/
|
|
3058
|
-
on(type: "init" | "field" | "update" | "add" | "remove" | "renderbuttons" | "label" | "render-link" | "drag" | "drop" | "redraw" | "expcollclick" | "exportstart" | "exportend" | "click" | "dbclick" | "slink-click" | "clink-click" | "up-click" | "searchclick" | "import" | "updated" | "key-down" | "visibility-change" | "renderdefs" | "render" | "prerender" | "screen-reader-text" | "ready" | "ripple" | "node-initialized" | "nodes-initialized" | "node-layout", listener: (sender: OrgChart, args?: any, args1?: any, args2?: any) => void | boolean): OrgChart;
|
|
3059
|
-
|
|
3060
|
-
/**
|
|
3061
|
-
* Removes an event listener previously registered. The event listener to be removed is identified using a combination of the event type and the event listener function itself. Returns true if success and false if fail.
|
|
3062
|
-
* @param type A string which specifies the type of event for which to remove an event listener
|
|
3063
|
-
* @param listener The event listener function of the event handler to remove from the event target
|
|
3064
|
-
*/
|
|
3065
|
-
removeListener(type: "init" | "field" | "update" | "add" | "remove" | "renderbuttons" | "label" | "render-link" | "drag" | "drop" | "redraw" | "expcollclick" | "exportstart" | "exportend" | "click" | "dbclick" | "slink-click" | "clink-click" | "up-click" | "searchclick" | "import" | "updated" | "key-down" | "visibility-change" | "renderdefs" | "render" | "prerender" | "screen-reader-text" | "ready" | "ripple" | "node-initialized" | "nodes-initialized" | "node-layout", listener?: () => void): boolean;
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
/**
|
|
3069
|
-
* Occurs when the node data has been updated by updateNode method.
|
|
3070
|
-
* ```typescript
|
|
3071
|
-
* var chart = new OrgChart('#tree', {});
|
|
3072
|
-
* chart.onUpdateNode((args) => {
|
|
3073
|
-
* //return false; to cancel the operation
|
|
3074
|
-
* });
|
|
3075
|
-
* ```
|
|
3076
|
-
* @category Event Listeners
|
|
3077
|
-
* @param listener
|
|
3078
|
-
*/
|
|
3079
|
-
onUpdateNode(listener: (args: {
|
|
3080
|
-
/**
|
|
3081
|
-
* old node data
|
|
3082
|
-
*/
|
|
3083
|
-
oldData: object,
|
|
3084
|
-
/**
|
|
3085
|
-
* new node data
|
|
3086
|
-
*/
|
|
3087
|
-
newData: object
|
|
3088
|
-
}) => void): OrgChart;
|
|
3089
|
-
|
|
3090
|
-
/**
|
|
3091
|
-
* Occurs when new nodes are added, removed, updated or imported, also when slink or clink is added or removed and after undo or redo operations.
|
|
3092
|
-
* Use this event listener to synch your server side database with this.config.nodes, this.config.clinks, this.config.slinks etc.
|
|
3093
|
-
* ```typescript
|
|
3094
|
-
* var chart = new OrgChart('#tree', {});
|
|
3095
|
-
* chart.onUpdated(() => {
|
|
3096
|
-
* //Update your server database with this.config.nodes, this.config.clinks, this.config.slinks etc.
|
|
3097
|
-
* });
|
|
3098
|
-
* ```
|
|
3099
|
-
* @category Event Listeners
|
|
3100
|
-
*/
|
|
3101
|
-
onUpdated(): OrgChart;
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
/**
|
|
3107
|
-
* Occurs when a node has been removed by removeNode method.
|
|
3108
|
-
* ```typescript
|
|
3109
|
-
* var chart = new OrgChart('#tree', {});
|
|
3110
|
-
* chart.onRemoveNode((args) => {
|
|
3111
|
-
* //return false; to cancel the operation
|
|
3112
|
-
* });
|
|
3113
|
-
* ```
|
|
3114
|
-
* @category Event Listeners
|
|
3115
|
-
* @param listener
|
|
3116
|
-
*/
|
|
3117
|
-
onRemoveNode(listener: (args: {
|
|
3118
|
-
/**
|
|
3119
|
-
* node id
|
|
3120
|
-
*/
|
|
3121
|
-
id: number | string,
|
|
3122
|
-
/**
|
|
3123
|
-
* parent ids and sub tree parents ids that needs to be updated on the server. For example if you remove a node that has children all chilren nodes will change their pid to the parent node id of the removed node.
|
|
3124
|
-
*/
|
|
3125
|
-
newPidsAndStpidsForIds: {
|
|
3126
|
-
newPidsForIds: { [key in any]: string | number },
|
|
3127
|
-
newStpidsForIds: { [key in any]: string | number }
|
|
3128
|
-
}
|
|
3129
|
-
}) => void): OrgChart;
|
|
3130
|
-
|
|
3131
|
-
/**
|
|
3132
|
-
* Occurs when a node has been added by addNode method.
|
|
3133
|
-
* ```typescript
|
|
3134
|
-
* var chart = new OrgChart('#tree', {});
|
|
3135
|
-
* chart.onAddNode((args) => {
|
|
3136
|
-
* //return false; to cancel the operation
|
|
3137
|
-
* });
|
|
3138
|
-
* ```
|
|
3139
|
-
* @category Event Listeners
|
|
3140
|
-
* @param listener
|
|
3141
|
-
*/
|
|
3142
|
-
onAddNode(listener: (args: {
|
|
3143
|
-
/**
|
|
3144
|
-
* new added data node
|
|
3145
|
-
*/
|
|
3146
|
-
data: object
|
|
3147
|
-
}) => void): OrgChart;
|
|
3148
|
-
/**
|
|
3149
|
-
* The onDrag event occurs when a node is dragged. *enableDragDrop* option has to be turned on.
|
|
3150
|
-
* ```typescript
|
|
3151
|
-
* var chart = new OrgChart('#tree', {});
|
|
3152
|
-
* chart.onDrag(() => {
|
|
3153
|
-
* //return false; to cancel the operation
|
|
3154
|
-
* });
|
|
3155
|
-
* ```
|
|
3156
|
-
* @category Event Listeners
|
|
3157
|
-
* @param listener
|
|
3158
|
-
*/
|
|
3159
|
-
onDrag(listener: (args: {
|
|
3160
|
-
/**
|
|
3161
|
-
* dragged node id
|
|
3162
|
-
*/
|
|
3163
|
-
dragId: string | number,
|
|
3164
|
-
event: MouseEvent,
|
|
3165
|
-
/**
|
|
3166
|
-
* array of node ids
|
|
3167
|
-
*
|
|
3168
|
-
* this property is initialized only if movable option is set
|
|
3169
|
-
*/
|
|
3170
|
-
nodeIds: Array<string | number>
|
|
3171
|
-
}) => void): OrgChart;
|
|
3172
|
-
/**
|
|
3173
|
-
* The onDrop event occurs when a node is dropped. *enableDragDrop* option has to be turned on.
|
|
3174
|
-
* ```typescript
|
|
3175
|
-
* var chart = new OrgChart('#tree', {});
|
|
3176
|
-
* chart.onDrop(() => {
|
|
3177
|
-
* //return false; to cancel the operation
|
|
3178
|
-
* });
|
|
3179
|
-
* ```
|
|
3180
|
-
* @category Event Listeners
|
|
3181
|
-
* @param listener
|
|
3182
|
-
*/
|
|
3183
|
-
onDrop(listener: (args: {
|
|
3184
|
-
/**
|
|
3185
|
-
* dragged node id
|
|
3186
|
-
*/
|
|
3187
|
-
dragId: string | number,
|
|
3188
|
-
/**
|
|
3189
|
-
* dropped node id
|
|
3190
|
-
*/
|
|
3191
|
-
dropId: string | number,
|
|
3192
|
-
/**
|
|
3193
|
-
* draging element
|
|
3194
|
-
*/
|
|
3195
|
-
dragNodeElement: HTMLElement,
|
|
3196
|
-
/**
|
|
3197
|
-
* Mouse event
|
|
3198
|
-
*/
|
|
3199
|
-
event: MouseEvent
|
|
3200
|
-
}) => void): OrgChart;
|
|
3201
|
-
}
|
|
3202
|
-
|
|
3203
|
-
declare namespace OrgChart {
|
|
3204
|
-
interface node {
|
|
3205
|
-
/**
|
|
3206
|
-
* same pid you provided in the source node, the default value is null if not provided or if node with the same id does not exist
|
|
3207
|
-
*/
|
|
3208
|
-
pid?: string | number,
|
|
3209
|
-
}
|
|
3210
|
-
/**
|
|
3211
|
-
* deprecated, use OrgChart.align.center isntead
|
|
3212
|
-
* @ignore
|
|
3213
|
-
*/
|
|
3214
|
-
const CENTER: number;
|
|
3215
|
-
/**
|
|
3216
|
-
* deprecated, use OrgChart.align.orientation isntead
|
|
3217
|
-
* @ignore
|
|
3218
|
-
*/
|
|
3219
|
-
const ORIENTATION: number;
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
/**
|
|
3223
|
-
* deprecated, use OrgChart.layout.normal isntead
|
|
3224
|
-
* @ignore
|
|
3225
|
-
*/
|
|
3226
|
-
const normal: number;
|
|
3227
|
-
|
|
3228
|
-
/**
|
|
3229
|
-
* deprecated, use OrgChart.layout.mixed isntead
|
|
3230
|
-
* @ignore
|
|
3231
|
-
*/
|
|
3232
|
-
const mixed: number;
|
|
3233
|
-
/**
|
|
3234
|
-
* deprecated, use OrgChart.layout.tree isntead
|
|
3235
|
-
* @ignore
|
|
3236
|
-
*/
|
|
3237
|
-
const tree: number;
|
|
3238
|
-
/**
|
|
3239
|
-
* deprecated, use OrgChart.layout.treeLeftOffset isntead
|
|
3240
|
-
* @ignore
|
|
3241
|
-
*/
|
|
3242
|
-
const treeLeftOffset: any;
|
|
3243
|
-
/**
|
|
3244
|
-
* deprecated, use OrgChart.layout.treeRightOffset isntead
|
|
3245
|
-
* @ignore
|
|
3246
|
-
*/
|
|
3247
|
-
const treeRightOffset: any;
|
|
3248
|
-
|
|
3249
|
-
interface options {
|
|
3250
|
-
/**
|
|
3251
|
-
* With the drag and drop features enabled you can move nodes easily and change the tree structure. Default value - *false*.
|
|
3252
|
-
* ```typescript
|
|
3253
|
-
* var chart = new OrgChart('#tree', {
|
|
3254
|
-
* enableDragDrop: true
|
|
3255
|
-
* });
|
|
3256
|
-
* ```
|
|
3257
|
-
*/
|
|
3258
|
-
enableDragDrop?: boolean,
|
|
3259
|
-
/**
|
|
3260
|
-
* Collapse specified level of the chart and its children if allChildren is true.
|
|
3261
|
-
* ```typescript
|
|
3262
|
-
* var chart = new OrgChart('#tree', {
|
|
3263
|
-
* collapse: {level: 2, allChildren: true}
|
|
3264
|
-
* });
|
|
3265
|
-
* ```
|
|
3266
|
-
*/
|
|
3267
|
-
collapse?: {
|
|
3268
|
-
level: number,
|
|
3269
|
-
allChildren?: boolean
|
|
3270
|
-
},
|
|
3271
|
-
/**
|
|
3272
|
-
* Expand specified node ids and its children if allChildren is true. The expand option works only if collapse is set.
|
|
3273
|
-
*
|
|
3274
|
-
* In the example above the second level of the chart will be collapsed but node with id 155 and its children will be expanded.
|
|
3275
|
-
* ```typescript
|
|
3276
|
-
* var chart = new OrgChart('#tree', {
|
|
3277
|
-
* collapse: {level: 2, allChildren: true},
|
|
3278
|
-
* expand: {nodes: [155], allChildren: true}
|
|
3279
|
-
* });
|
|
3280
|
-
* ```
|
|
3281
|
-
*/
|
|
3282
|
-
expand?: {
|
|
3283
|
-
nodes?: Array<string | number>,
|
|
3284
|
-
allChildren?: boolean
|
|
3285
|
-
},
|
|
3286
|
-
}
|
|
3287
|
-
|
|
3288
|
-
}
|
|
3289
|
-
export default OrgChart
|
|
3285
|
+
}export default OrgChart
|