@balkangraph/orgchart.js 8.2.7 → 8.2.11

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
@@ -174,7 +174,13 @@ declare class OrgChart extends OrgChartBase {
174
174
  * @param retrieveFields retrive data for fields
175
175
  * {@link https://balkan.app/OrgChartJS/Docs/Search | See doc...}
176
176
  */
177
- search(value: string, searchInFileds?: Array<string>, retrieveFields?: Array<string>): void;
177
+ search(value: string, searchInFileds?: Array<string>, retrieveFields?: Array<string>): Array<{
178
+ id: number | string,
179
+ name: string,
180
+ __score: number,
181
+ __searchField: string,
182
+ __searchMarks: string
183
+ }>;
178
184
  /**
179
185
  * Gets collpased node ids of the specifeid node
180
186
  * @param node
@@ -547,7 +553,8 @@ declare class OrgChart extends OrgChartBase {
547
553
  nodeCircleMenuUI: OrgChart.circleMenuUI;
548
554
  nodeContextMenuUI: OrgChart.menuUI;
549
555
  menuUI: OrgChart.menuUI;
550
- toolbarUI: OrgChart.toolbarUI;
556
+ toolbarUI: OrgChart.toolbarUI;
557
+ config: OrgChart.options
551
558
 
552
559
  static fileUploadDialog(callback: () => void): void;
553
560
  static isMobile(): boolean;
@@ -596,21 +603,21 @@ declare class OrgChart extends OrgChartBase {
596
603
 
597
604
 
598
605
  static icon: {
599
- png: (w: string, h: string, c: string) => string,
600
- pdf: (w: string, h: string, c: string) => string,
601
- svg: (w: string, h: string, c: string) => string,
602
- csv: (w: string, h: string, c: string) => string,
603
- excel: (w: string, h: string, c: string) => string,
604
- edit: (w: string, h: string, c: string) => string,
605
- details: (w: string, h: string, c: string) => string,
606
- remove: (w: string, h: string, c: string) => string,
607
- add: (w: string, h: string, c: string) => string,
608
- xml: (w: string, h: string, c: string) => string,
609
- link: (w: string, h: string, c: string) => string,
610
- happy: (w: string, h: string, c: string) => string,
611
- sad: (w: string, h: string, c: string) => string,
612
- share: (w: string, h: string, c: string, x: string, y: string) => string,
613
- user: (w: string, h: string, c: string, x: string, y: string) => string
606
+ png: (w: string| number, h: string | number, c: string) => string,
607
+ pdf: (w: string | number| number, h: string | number, c: string) => string,
608
+ svg: (w: string| number, h: string| number, c: string | number) => string,
609
+ csv: (w: string| number, h: string| number, c: string| number) => string,
610
+ excel: (w: string| number, h: string| number, c: string| number) => string,
611
+ edit: (w: string| number, h: string| number, c: string| number) => string,
612
+ details: (w: string| number, h: string| number, c: string| number) => string,
613
+ remove: (w: string| number, h: string| number, c: string| number) => string,
614
+ add: (w: string| number, h: string| number, c: string| number) => string,
615
+ xml: (w: string| number, h: string| number, c: string| number) => string,
616
+ link: (w: string| number, h: string| number, c: string| number) => string,
617
+ happy: (w: string| number, h: string| number, c: string| number) => string,
618
+ sad: (w: string| number, h: string| number, c: string| number) => string,
619
+ share: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
620
+ user: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string
614
621
  }
615
622
 
616
623
 
@@ -736,6 +743,8 @@ declare class OrgChart extends OrgChartBase {
736
743
  */
737
744
  static LAZY_LOADING_FACTOR: number;
738
745
 
746
+
747
+
739
748
  }
740
749
 
741
750
  declare namespace OrgChart {
@@ -1924,4 +1933,196 @@ declare namespace OrgChart {
1924
1933
  elements?: { [key: string]: OrgChart.editFormElement | Array<OrgChart.editFormElement> }
1925
1934
  }
1926
1935
  }
1927
- }export default OrgChart
1936
+ }
1937
+ /// <reference path="OrgChart.d.ts" />
1938
+
1939
+ declare class OrgChartBase {
1940
+
1941
+ /**
1942
+ * Removes specified node from nodes collection, redraws the chart and fires remove event.
1943
+ * @param id identification number of the node
1944
+ * @param callback called at the end of animation
1945
+ * @param fireEvent indicates if the remove event will be called or not
1946
+ */
1947
+ removeNode(id: string | number, callback?: () => void, fireEvent?: boolean): void;
1948
+ /**
1949
+ * Updates the node data, redraws the chart and fires update event.
1950
+ * @param data node data
1951
+ * @param callback function called when the animation completes
1952
+ * @param fireEvent if it set to true the update event is called
1953
+ */
1954
+ updateNode(data: object, callback?: () => void, fireEvent?: boolean): void;
1955
+ /**
1956
+ * Adds new node to the nodes collection, redraws the chart and fires remove event
1957
+ * @param data node data
1958
+ * @param callback called at the end of animation
1959
+ * @param fireEvent indicates if the add event will be called or not
1960
+ */
1961
+ addNode(data: object, callback?: () => void, fireEvent?: boolean): void;
1962
+
1963
+ /**
1964
+ * The on() method of the OrgChart class sets up a function that will be called whenever the specified event is delivered to the target. *
1965
+ * @category Event Listeners
1966
+ * @param type A case-sensitive string representing the event type to listen for.
1967
+ * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
1968
+ */
1969
+ 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;
1970
+
1971
+ /**
1972
+ * Occurs when the node data has been updated by updateNode method.
1973
+ * ```typescript
1974
+ * var chart = new OrgChart('#tree', {});
1975
+ * chart.onUpdateNode((args) => {
1976
+ * //return false; to cancel the operation
1977
+ * });
1978
+ * ```
1979
+ * @category Event Listeners
1980
+ * @param listener
1981
+ */
1982
+ onUpdateNode(listener: (args: {
1983
+ /**
1984
+ * old node data
1985
+ */
1986
+ oldData: object,
1987
+ /**
1988
+ * new node data
1989
+ */
1990
+ newData: object
1991
+ }) => void): OrgChart;
1992
+
1993
+
1994
+ /**
1995
+ * Occurs when a node has been removed by removeNode method.
1996
+ * ```typescript
1997
+ * var chart = new OrgChart('#tree', {});
1998
+ * chart.onRemoveNode((args) => {
1999
+ * //return false; to cancel the operation
2000
+ * });
2001
+ * ```
2002
+ * @category Event Listeners
2003
+ * @param listener
2004
+ */
2005
+ onRemoveNode(listener: (args: {
2006
+ /**
2007
+ * node id
2008
+ */
2009
+ id: number | string,
2010
+ /**
2011
+ * 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.
2012
+ */
2013
+ newPidsAndStpidsForIds: {
2014
+ newPidsForIds: { [key: string | number]: string | number },
2015
+ newStpidsForIds: { [key: string | number]: string | number }
2016
+ }
2017
+ }) => void): OrgChart;
2018
+
2019
+ /**
2020
+ * Occurs when a node has been added by addNode method.
2021
+ * ```typescript
2022
+ * var chart = new OrgChart('#tree', {});
2023
+ * chart.onAddNode((args) => {
2024
+ * //return false; to cancel the operation
2025
+ * });
2026
+ * ```
2027
+ * @category Event Listeners
2028
+ * @param listener
2029
+ */
2030
+ onAddNode(listener: (args: {
2031
+ /**
2032
+ * new added data node
2033
+ */
2034
+ data: object
2035
+ }) => void): OrgChart;
2036
+ /**
2037
+ * The onDrag event occurs when a node is dragged. *enableDragDrop* option has to be turned on.
2038
+ * ```typescript
2039
+ * var chart = new OrgChart('#tree', {});
2040
+ * chart.onDrag(() => {
2041
+ * //return false; to cancel the operation
2042
+ * });
2043
+ * ```
2044
+ * @category Event Listeners
2045
+ * @param listener
2046
+ */
2047
+ onDrag(listener: (args: {
2048
+ /**
2049
+ * dragged node id
2050
+ */
2051
+ dragId: string | number
2052
+ }) => void): OrgChart;
2053
+ /**
2054
+ * The onDrop event occurs when a node is dropped. *enableDragDrop* option has to be turned on.
2055
+ * ```typescript
2056
+ * var chart = new OrgChart('#tree', {});
2057
+ * chart.onDrop(() => {
2058
+ * //return false; to cancel the operation
2059
+ * });
2060
+ * ```
2061
+ * @category Event Listeners
2062
+ * @param listener
2063
+ */
2064
+ onDrop(listener: (args: {
2065
+ /**
2066
+ * dragged node id
2067
+ */
2068
+ dragId: string | number,
2069
+ /**
2070
+ * dropped node id
2071
+ */
2072
+ dropId: string | number
2073
+ }) => void): OrgChart;
2074
+ }
2075
+
2076
+ declare namespace OrgChart {
2077
+ /**
2078
+ * deprecated, use OrgChart.align.center isntead
2079
+ * @ignore
2080
+ */
2081
+ const CENTER: number;
2082
+ /**
2083
+ * deprecated, use OrgChart.align.orientation isntead
2084
+ * @ignore
2085
+ */
2086
+ const ORIENTATION: number;
2087
+
2088
+
2089
+ /**
2090
+ * deprecated, use OrgChart.layout.normal isntead
2091
+ * @ignore
2092
+ */
2093
+ const normal: number;
2094
+
2095
+ /**
2096
+ * deprecated, use OrgChart.layout.mixed isntead
2097
+ * @ignore
2098
+ */
2099
+ const mixed: number;
2100
+ /**
2101
+ * deprecated, use OrgChart.layout.tree isntead
2102
+ * @ignore
2103
+ */
2104
+ const tree: number;
2105
+ /**
2106
+ * deprecated, use OrgChart.layout.treeLeftOffset isntead
2107
+ * @ignore
2108
+ */
2109
+ const treeLeftOffset: any;
2110
+ /**
2111
+ * deprecated, use OrgChart.layout.treeRightOffset isntead
2112
+ * @ignore
2113
+ */
2114
+ const treeRightOffset: any;
2115
+
2116
+ interface options {
2117
+ /**
2118
+ * With the drag and drop features enabled you can move nodes easily and change the tree structure. Default value - *false*.
2119
+ * ```typescript
2120
+ * var chart = new OrgChart('#tree', {
2121
+ * enableDragDrop: true
2122
+ * });
2123
+ * ```
2124
+ */
2125
+ enableDragDrop?: boolean,
2126
+ }
2127
+ }
2128
+ export default OrgChart