@balkangraph/orgchart.js 8.2.77 → 8.3.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.
Files changed (3) hide show
  1. package/orgchart.d.ts +154 -112
  2. package/orgchart.js +1 -1
  3. package/package.json +1 -1
package/orgchart.d.ts CHANGED
@@ -343,6 +343,7 @@ declare class OrgChart extends OrgChartBase {
343
343
  * chart.onField((args) => {
344
344
  * //return false; to cancel
345
345
  * });
346
+ * chart.load(nodes);
346
347
  * ```
347
348
  * @category Event Listeners
348
349
  * @param listener
@@ -376,6 +377,7 @@ declare class OrgChart extends OrgChartBase {
376
377
  * var chart = new OrgChart('#tree', {});
377
378
  * chart.onInit(() => {
378
379
  * });
380
+ * chart.load(nodes);
379
381
  * ```
380
382
  * @category Event Listeners
381
383
  * @param listener
@@ -390,6 +392,7 @@ declare class OrgChart extends OrgChartBase {
390
392
  * var chart = new OrgChart('#tree', {});
391
393
  * chart.onRedraw(() => {
392
394
  * });
395
+ * chart.load(nodes);
393
396
  * ```
394
397
  * @category Event Listeners
395
398
  * @param listener
@@ -403,6 +406,7 @@ declare class OrgChart extends OrgChartBase {
403
406
  * chart.onExpandCollpaseButtonClick(() => {
404
407
  * //return false; to cancel the operation
405
408
  * });
409
+ * chart.load(nodes);
406
410
  * ```
407
411
  * @category Event Listeners
408
412
  * @param listener
@@ -429,6 +433,7 @@ declare class OrgChart extends OrgChartBase {
429
433
  * args.styles += '<link href="https://fonts.googleapis.com/css?family=Gochi+Hand" rel="stylesheet">';
430
434
  * //return false; to cancel the operation
431
435
  * });
436
+ * chart.load(nodes);
432
437
  * ```
433
438
  * @category Event Listeners
434
439
  * @param listener
@@ -485,6 +490,7 @@ declare class OrgChart extends OrgChartBase {
485
490
  * chart.onExportEnd(() => {
486
491
  * //return false; to cancel the operation for example id you prefer the exported document to not download
487
492
  * });
493
+ * chart.load(nodes);
488
494
  * ```
489
495
  * @category Event Listeners
490
496
  * @param listener
@@ -544,6 +550,7 @@ declare class OrgChart extends OrgChartBase {
544
550
  * chart.onNodeClick(() => {
545
551
  * //return false; to cancel the operation
546
552
  * });
553
+ * chart.load(nodes);
547
554
  * ```
548
555
  * @category Event Listeners
549
556
  * @param listener
@@ -565,6 +572,7 @@ declare class OrgChart extends OrgChartBase {
565
572
  * chart.onNodeDoubleClick(() => {
566
573
  * //return false; to cancel the operation
567
574
  * });
575
+ * chart.load(nodes);
568
576
  * ```
569
577
  * @category Event Listeners
570
578
  * @param listener
@@ -639,8 +647,14 @@ declare class OrgChart extends OrgChartBase {
639
647
  firefox?: { smooth?: number; speed?: number; },
640
648
  opera?: { smooth?: number; speed?: number; }
641
649
  };
650
+
642
651
 
643
652
  static events: {
653
+ /**
654
+ * node-created and layout event listeners are obsolete use node-initialized or node-layout instead
655
+ * @param type
656
+ * @param listener
657
+ */
644
658
  on(type: "node-created" | "layout", listener: (args: any, args1: any, args2: any) => void): void
645
659
  };
646
660
  static state: { clear(stateName: string): void };
@@ -792,6 +806,118 @@ declare namespace OrgChart {
792
806
 
793
807
  var template: object;
794
808
 
809
+ interface node {
810
+ /**
811
+ * the same id you provided in the source node
812
+ */
813
+ id?: string | number,
814
+ /**
815
+ * 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.
816
+ */
817
+ ppid?: string | number,
818
+ /**
819
+ * 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
820
+ */
821
+ parent?: node,
822
+ /**
823
+ * 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.
824
+ */
825
+ stpid?: string | number,
826
+ /**
827
+ * - a reference to the parent node of a sub tree, default value is null, if the parent node is minimized this proprty is not initalized and can be null even if we have stpid
828
+ */
829
+ stParent?: node,
830
+ isPartner?: boolean,
831
+ partnerSeparation?: number,
832
+ /**
833
+ * array of ids, always initialized
834
+ */
835
+ childrenIds?: Array<string | number>,
836
+ /**
837
+ * array of children nodes, initialized on demand if all children are collpased it will be empty array
838
+ */
839
+ children?: Array<node>,
840
+ /**
841
+ * array of sub tree children root node ids, always initialized
842
+ */
843
+ stChildrenIds?: Array<string | number>,
844
+ /**
845
+ * array of sub tree children root nodes, initialized on demand if the node is minimized it will be empty array
846
+ */
847
+ stChildren?: Array<node>,
848
+ /**
849
+ * array of string values, the same array you provided in the source node
850
+ */
851
+ tags?: Array<string>,
852
+ /**
853
+ * template name, you can specify multiple templates with tags in one chart
854
+ */
855
+ templateName?: string,
856
+ /**
857
+ * a reference to the left node neighbor, the default value is undefined
858
+ */
859
+ leftNeighbor?: node | undefined,
860
+ /**
861
+ * a reference to the right node neighbor, the default value is undefined
862
+ */
863
+ rightNeighbor?: node | undefined,
864
+ /**
865
+ * x position, default value undefined
866
+ */
867
+ x?: number | undefined,
868
+ /**
869
+ * y position, default value undefined
870
+ */
871
+ y?: number | undefined,
872
+ /**
873
+ * width of the node, default value undefined
874
+ */
875
+ w?: number | undefined,
876
+ /**
877
+ * height of the node, default value undefined
878
+ */
879
+ h?: number | undefined,
880
+ /**
881
+ * if the node is assistant is true if not false if the node is not initialized is undefined
882
+ */
883
+ isAssistant?: boolean | undefined,
884
+ /**
885
+ * sub tree container nodes array, property only for the root node, default value undefined
886
+ */
887
+ stContainerNodes?: Array<node> | undefined,
888
+ /**
889
+ * it is set only if you define order option, default value undefined
890
+ */
891
+ order?: number | undefined,
892
+ /**
893
+ * true if the node is collpased, false if it is not and undefined if not initalized
894
+ */
895
+ collapsed?: boolean | undefined,
896
+ /**
897
+ * a level of the node starting from zero
898
+ */
899
+ level?: number,
900
+ /**
901
+ * true if the node is minimized, default value undefined
902
+ */
903
+ min?: boolean | undefined,
904
+ /**
905
+ * sub levels, default value undefined
906
+ */
907
+ subLevels?: number | undefined,
908
+ /**
909
+ * set only if the node contains sub trees and padding is defined in the template, default value undefined
910
+ */
911
+ padding?: number | undefined,
912
+ /**
913
+ * layout configuration name, default value undefined
914
+ */
915
+ lcn?: string | undefined,
916
+ /**
917
+ * for assistant nodes and mixed layout we create dynamic nodes called splits, default value undefined
918
+ */
919
+ isSplit?: boolean | undefined
920
+ }
795
921
 
796
922
 
797
923
  interface template
@@ -880,6 +1006,14 @@ declare namespace OrgChart {
880
1006
  createItem(img: string, id: string | number, first: string, second: string): string;
881
1007
  }
882
1008
 
1009
+
1010
+ interface filterUI {
1011
+ init(instance: OrgChart): void;
1012
+ update(): void;
1013
+ shouldFilter(data: object): boolean;
1014
+ }
1015
+
1016
+
883
1017
  interface menuUI {
884
1018
  init(obj: OrgChart, menu: { [key: string]: menu }): void;
885
1019
  /**
@@ -1677,7 +1811,21 @@ declare namespace OrgChart {
1677
1811
  * });
1678
1812
  * ```
1679
1813
  */
1680
- orderBy?: string,
1814
+ orderBy?: string | Array<OrgChart.orderBy>,
1815
+ /**
1816
+ * Filter the OrgChart by the specified fields.
1817
+ * ```typescript
1818
+ * var chart = new OrgChart('#tree', {
1819
+ * filterBy: 'all'
1820
+ * });
1821
+ * ```
1822
+ * ```typescript
1823
+ * var chart = new OrgChart('#tree', {
1824
+ * filterBy: ['country', 'title']
1825
+ * });
1826
+ * ```
1827
+ */
1828
+ filterBy?: string | Array<string> | boolean,
1681
1829
  /**
1682
1830
  * @ignore
1683
1831
  */
@@ -1686,6 +1834,10 @@ declare namespace OrgChart {
1686
1834
  * @ignore
1687
1835
  */
1688
1836
  searchUI?: OrgChart.searchUI,
1837
+ /**
1838
+ * @ignore
1839
+ */
1840
+ filterUI?: OrgChart.filterUI,
1689
1841
  /**
1690
1842
  * @ignore
1691
1843
  */
@@ -1923,7 +2075,7 @@ declare class OrgChartBase {
1923
2075
  * @param type A case-sensitive string representing the event type to listen for.
1924
2076
  * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
1925
2077
  */
1926
- 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" | "adding" | "added" | "updated" | "key-down" | "visibility-change" | "renderdefs" | "render" | "prerender" | "screen-reader-text" | "removed" | "ready" | "ripple", listener: (sender: OrgChart, args?: any, args1?: any, args2?: any) => void | boolean): OrgChart;
2078
+ 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" | "adding" | "added" | "updated" | "key-down" | "visibility-change" | "renderdefs" | "render" | "prerender" | "screen-reader-text" | "removed" | "ready" | "ripple" | "node-initialized" | "node-layout", listener: (sender: OrgChart, args?: any, args1?: any, args2?: any) => void | boolean): OrgChart;
1927
2079
 
1928
2080
  /**
1929
2081
  * Occurs when the node data has been updated by updateNode method.
@@ -2033,120 +2185,10 @@ declare class OrgChartBase {
2033
2185
  declare namespace OrgChart {
2034
2186
 
2035
2187
  interface node {
2036
- /**
2037
- * the same id you provided in the source node
2038
- */
2039
- id?: string | number,
2040
2188
  /**
2041
2189
  * 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
2042
2190
  */
2043
2191
  pid?: string | number,
2044
- /**
2045
- * 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.
2046
- */
2047
- ppid?: string | number,
2048
- /**
2049
- * 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
2050
- */
2051
- parent?: node,
2052
- /**
2053
- * 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.
2054
- */
2055
- stpid?: string | number,
2056
- /**
2057
- * - a reference to the parent node of a sub tree, default value is null, if the parent node is minimized this proprty is not initalized and can be null even if we have stpid
2058
- */
2059
- stParent?: node,
2060
- isPartner?: boolean,
2061
- partnerSeparation?: number,
2062
- /**
2063
- * array of ids, always initialized
2064
- */
2065
- childrenIds?: Array<string | number>,
2066
- /**
2067
- * array of children nodes, initialized on demand if all children are collpased it will be empty array
2068
- */
2069
- children?: Array<node>,
2070
- /**
2071
- * array of sub tree children root node ids, always initialized
2072
- */
2073
- stChildrenIds?: Array<string | number>,
2074
- /**
2075
- * array of sub tree children root nodes, initialized on demand if the node is minimized it will be empty array
2076
- */
2077
- stChildren?: Array<node>,
2078
- /**
2079
- * array of string values, the same array you provided in the source node
2080
- */
2081
- tags?: Array<string>,
2082
- /**
2083
- * template name, you can specify multiple templates with tags in one chart
2084
- */
2085
- templateName?: string,
2086
- /**
2087
- * a reference to the left node neighbor, the default value is undefined
2088
- */
2089
- leftNeighbor?: node | undefined,
2090
- /**
2091
- * a reference to the right node neighbor, the default value is undefined
2092
- */
2093
- rightNeighbor?: node | undefined,
2094
- /**
2095
- * x position, default value undefined
2096
- */
2097
- x?: number | undefined,
2098
- /**
2099
- * y position, default value undefined
2100
- */
2101
- y?: number | undefined,
2102
- /**
2103
- * width of the node, default value undefined
2104
- */
2105
- w?: number | undefined,
2106
- /**
2107
- * height of the node, default value undefined
2108
- */
2109
- h?: number | undefined,
2110
- /**
2111
- * if the node is assistant is true if not false if the node is not initialized is undefined
2112
- */
2113
- isAssistant?: boolean | undefined,
2114
- /**
2115
- * sub tree container nodes array, property only for the root node, default value undefined
2116
- */
2117
- stContainerNodes?: Array<node> | undefined,
2118
- /**
2119
- * it is set only if you define order option, default value undefined
2120
- */
2121
- order?: number | undefined,
2122
- /**
2123
- * true if the node is collpased, false if it is not and undefined if not initalized
2124
- */
2125
- collapsed?: boolean | undefined,
2126
- /**
2127
- * a level of the node starting from zero
2128
- */
2129
- level?: number,
2130
- /**
2131
- * true if the node is minimized, default value undefined
2132
- */
2133
- min?: boolean | undefined,
2134
- /**
2135
- * sub levels, default value undefined
2136
- */
2137
- subLevels?: number | undefined,
2138
- /**
2139
- * set only if the node contains sub trees and padding is defined in the template, default value undefined
2140
- */
2141
- padding?: number | undefined,
2142
- /**
2143
- * layout configuration name, default value undefined
2144
- */
2145
- lcn?: string | undefined,
2146
- /**
2147
- * for assistant nodes and mixed layout we create dynamic nodes called splits, default value undefined
2148
- */
2149
- isSplit?: boolean | undefined
2150
2192
  }
2151
2193
  /**
2152
2194
  * deprecated, use OrgChart.align.center isntead