@balkangraph/orgchart.js 8.2.6 → 8.2.10

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 CHANGED
@@ -1924,4 +1924,196 @@ declare namespace OrgChart {
1924
1924
  elements?: { [key: string]: OrgChart.editFormElement | Array<OrgChart.editFormElement> }
1925
1925
  }
1926
1926
  }
1927
- }export default OrgChart
1927
+ }
1928
+ /// <reference path="OrgChart.d.ts" />
1929
+
1930
+ declare class OrgChartBase {
1931
+
1932
+ /**
1933
+ * Removes specified node from nodes collection, redraws the chart and fires remove event.
1934
+ * @param id identification number of the node
1935
+ * @param callback called at the end of animation
1936
+ * @param fireEvent indicates if the remove event will be called or not
1937
+ */
1938
+ removeNode(id: string | number, callback?: () => void, fireEvent?: boolean): void;
1939
+ /**
1940
+ * Updates the node data, redraws the chart and fires update event.
1941
+ * @param data node data
1942
+ * @param callback function called when the animation completes
1943
+ * @param fireEvent if it set to true the update event is called
1944
+ */
1945
+ updateNode(data: object, callback?: () => void, fireEvent?: boolean): void;
1946
+ /**
1947
+ * Adds new node to the nodes collection, redraws the chart and fires remove event
1948
+ * @param data node data
1949
+ * @param callback called at the end of animation
1950
+ * @param fireEvent indicates if the add event will be called or not
1951
+ */
1952
+ addNode(data: object, callback?: () => void, fireEvent?: boolean): void;
1953
+
1954
+ /**
1955
+ * The on() method of the OrgChart class sets up a function that will be called whenever the specified event is delivered to the target. *
1956
+ * @category Event Listeners
1957
+ * @param type A case-sensitive string representing the event type to listen for.
1958
+ * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
1959
+ */
1960
+ 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" | "import" | "adding" | "added" | "updated" | "key-down" | "visibility-change" | "renderdefs" | "render" | "prerender" | "screen-reader-text" | "removed" | "ready" | "ripple", listener: (sender: OrgChart, args: unknown, args1: unknown, args2: unknown) => void | boolean): OrgChart;
1961
+
1962
+ /**
1963
+ * Occurs when the node data has been updated by updateNode method.
1964
+ * ```typescript
1965
+ * var chart = new OrgChart('#tree', {});
1966
+ * chart.onUpdateNode((args) => {
1967
+ * //return false; to cancel the operation
1968
+ * });
1969
+ * ```
1970
+ * @category Event Listeners
1971
+ * @param listener
1972
+ */
1973
+ onUpdateNode(listener: (args: {
1974
+ /**
1975
+ * old node data
1976
+ */
1977
+ oldData: object,
1978
+ /**
1979
+ * new node data
1980
+ */
1981
+ newData: object
1982
+ }) => void): OrgChart;
1983
+
1984
+
1985
+ /**
1986
+ * Occurs when a node has been removed by removeNode method.
1987
+ * ```typescript
1988
+ * var chart = new OrgChart('#tree', {});
1989
+ * chart.onRemoveNode((args) => {
1990
+ * //return false; to cancel the operation
1991
+ * });
1992
+ * ```
1993
+ * @category Event Listeners
1994
+ * @param listener
1995
+ */
1996
+ onRemoveNode(listener: (args: {
1997
+ /**
1998
+ * node id
1999
+ */
2000
+ id: number | string,
2001
+ /**
2002
+ * 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.
2003
+ */
2004
+ newPidsAndStpidsForIds: {
2005
+ newPidsForIds: { [key: string | number]: string | number },
2006
+ newStpidsForIds: { [key: string | number]: string | number }
2007
+ }
2008
+ }) => void): OrgChart;
2009
+
2010
+ /**
2011
+ * Occurs when a node has been added by addNode method.
2012
+ * ```typescript
2013
+ * var chart = new OrgChart('#tree', {});
2014
+ * chart.onAddNode((args) => {
2015
+ * //return false; to cancel the operation
2016
+ * });
2017
+ * ```
2018
+ * @category Event Listeners
2019
+ * @param listener
2020
+ */
2021
+ onAddNode(listener: (args: {
2022
+ /**
2023
+ * new added data node
2024
+ */
2025
+ data: object
2026
+ }) => void): OrgChart;
2027
+ /**
2028
+ * The onDrag event occurs when a node is dragged. *enableDragDrop* option has to be turned on.
2029
+ * ```typescript
2030
+ * var chart = new OrgChart('#tree', {});
2031
+ * chart.onDrag(() => {
2032
+ * //return false; to cancel the operation
2033
+ * });
2034
+ * ```
2035
+ * @category Event Listeners
2036
+ * @param listener
2037
+ */
2038
+ onDrag(listener: (args: {
2039
+ /**
2040
+ * dragged node id
2041
+ */
2042
+ dragId: string | number
2043
+ }) => void): OrgChart;
2044
+ /**
2045
+ * The onDrop event occurs when a node is dropped. *enableDragDrop* option has to be turned on.
2046
+ * ```typescript
2047
+ * var chart = new OrgChart('#tree', {});
2048
+ * chart.onDrop(() => {
2049
+ * //return false; to cancel the operation
2050
+ * });
2051
+ * ```
2052
+ * @category Event Listeners
2053
+ * @param listener
2054
+ */
2055
+ onDrop(listener: (args: {
2056
+ /**
2057
+ * dragged node id
2058
+ */
2059
+ dragId: string | number,
2060
+ /**
2061
+ * dropped node id
2062
+ */
2063
+ dropId: string | number
2064
+ }) => void): OrgChart;
2065
+ }
2066
+
2067
+ declare namespace OrgChart {
2068
+ /**
2069
+ * deprecated, use OrgChart.align.center isntead
2070
+ * @ignore
2071
+ */
2072
+ const CENTER: number;
2073
+ /**
2074
+ * deprecated, use OrgChart.align.orientation isntead
2075
+ * @ignore
2076
+ */
2077
+ const ORIENTATION: number;
2078
+
2079
+
2080
+ /**
2081
+ * deprecated, use OrgChart.layout.normal isntead
2082
+ * @ignore
2083
+ */
2084
+ const normal: number;
2085
+
2086
+ /**
2087
+ * deprecated, use OrgChart.layout.mixed isntead
2088
+ * @ignore
2089
+ */
2090
+ const mixed: number;
2091
+ /**
2092
+ * deprecated, use OrgChart.layout.tree isntead
2093
+ * @ignore
2094
+ */
2095
+ const tree: number;
2096
+ /**
2097
+ * deprecated, use OrgChart.layout.treeLeftOffset isntead
2098
+ * @ignore
2099
+ */
2100
+ const treeLeftOffset: any;
2101
+ /**
2102
+ * deprecated, use OrgChart.layout.treeRightOffset isntead
2103
+ * @ignore
2104
+ */
2105
+ const treeRightOffset: any;
2106
+
2107
+ interface options {
2108
+ /**
2109
+ * With the drag and drop features enabled you can move nodes easily and change the tree structure. Default value - *false*.
2110
+ * ```typescript
2111
+ * var chart = new OrgChart('#tree', {
2112
+ * enableDragDrop: true
2113
+ * });
2114
+ * ```
2115
+ */
2116
+ enableDragDrop?: boolean,
2117
+ }
2118
+ }
2119
+ export default OrgChart