balkan-orgchart-js 9.2.49 → 9.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.
package/orgchart.d.mts CHANGED
@@ -252,6 +252,17 @@ declare class OrgChart {
252
252
  onNodeMouseleave(listener: (this: OrgChart, args: OrgChart.nodeMouseEventArgs) => void): OrgChart;
253
253
 
254
254
 
255
+ /**
256
+ * Fires when the chart requests nodes on demand.
257
+ * Use this event to dynamically load and append nodes.
258
+ *
259
+ * @param listener Callback function triggered on demand node request.
260
+ * @param listener.args Event arguments containing the requested node data.
261
+ * @returns {OrgChart} The current chart instance.
262
+ */
263
+ onDemand(listener: (this: OrgChart, args: OrgChart.demandEventArgs) => void): OrgChart;
264
+
265
+
255
266
  /**
256
267
  * On canvas SVG click event listener.
257
268
  * ```typescript
@@ -624,6 +635,16 @@ declare class OrgChart {
624
635
  */
625
636
  addNode(data: OrgChart.nodeData, callback?: () => void, fireEvent?: boolean): void;
626
637
 
638
+ /**
639
+ * Adds new nodes to the chart while keeping the specified node fixed in its current position.
640
+ *
641
+ * @param {string | number} id The id of the node that should remain stationary when the new nodes are added.
642
+ * @param {Array<OrgChart.nodeData>} dataArray An array of node data objects to add to the chart.
643
+ * @param {() => void} [callback] A callback function that is called after the nodes are added.
644
+ * @returns {void}
645
+ */
646
+ addNodes(id: string | number, dataArray: Array<OrgChart.nodeData>, callback?: () => void): void;
647
+
627
648
  /**
628
649
  * Removes specified node from nodes collection, redraws the chart and fires remove event.
629
650
  * ```typescript
@@ -1026,16 +1047,7 @@ declare class OrgChart {
1026
1047
  __searchField: string,
1027
1048
  __searchMarks: string
1028
1049
  }>;
1029
- /**
1030
- * Gets collpased node ids of the specifeid node
1031
- * ```typescript
1032
- * let chart = new OrgChart('#tree', {});
1033
- * ...
1034
- * let ids = chart.getCollapsedIds(2);
1035
- * ```
1036
- * @param node
1037
- */
1038
- getCollapsedIds(node: OrgChart.node): Array<string | number>;
1050
+
1039
1051
  /**
1040
1052
  * State to url.
1041
1053
  * ```typescript
@@ -2372,6 +2384,18 @@ declare namespace OrgChart {
2372
2384
  */
2373
2385
  event: MouseEvent
2374
2386
  }
2387
+
2388
+ interface demandEventArgs {
2389
+ /**
2390
+ * The id of the clicked node.
2391
+ */
2392
+ id: string | number,
2393
+
2394
+ /**
2395
+ * An array of node ids that should be loaded from the server.
2396
+ */
2397
+ ids: Array<string | number>
2398
+ }
2375
2399
 
2376
2400
 
2377
2401
  interface canvasClickEventArgs {
@@ -2603,15 +2627,14 @@ declare namespace OrgChart {
2603
2627
  * template name, you can specify multiple templates with tags in one chart
2604
2628
  */
2605
2629
  templateName?: string,
2606
-
2607
- /**
2608
- * Number of direct child nodes.
2609
- */
2610
- childCount?: number,
2630
+
2611
2631
  /**
2612
- * Number of direct child nodes that are currently collapsed (hidden).
2613
- */
2614
- collapsedChildCount?: number,
2632
+ * Array of collapsed direct child node IDs.
2633
+ *
2634
+ * Contains the IDs of child nodes whose `collapsed` state is `true`.
2635
+ * Always initialized as an array.
2636
+ */
2637
+ collapsedChildrenIds?: Array<string | number>,
2615
2638
  /**
2616
2639
  * Total number of collapsed descendant nodes (collapsed at any depth).
2617
2640
  */
@@ -2621,6 +2644,12 @@ declare namespace OrgChart {
2621
2644
  */
2622
2645
  deepChildCount?: number,
2623
2646
 
2647
+ /**
2648
+ * An array of child node ids.
2649
+ */
2650
+ cids?: Array<number | string>,
2651
+
2652
+
2624
2653
  /**
2625
2654
  * a reference to the left node neighbor, the default value is undefined
2626
2655
  */
@@ -6131,8 +6160,5 @@ declare namespace OrgChart {
6131
6160
  */
6132
6161
  var t: any;
6133
6162
  }
6134
-
6135
-
6136
-
6137
6163
 
6138
6164
  export default OrgChart;
package/orgchart.d.ts CHANGED
@@ -252,6 +252,17 @@ declare class OrgChart {
252
252
  onNodeMouseleave(listener: (this: OrgChart, args: OrgChart.nodeMouseEventArgs) => void): OrgChart;
253
253
 
254
254
 
255
+ /**
256
+ * Fires when the chart requests nodes on demand.
257
+ * Use this event to dynamically load and append nodes.
258
+ *
259
+ * @param listener Callback function triggered on demand node request.
260
+ * @param listener.args Event arguments containing the requested node data.
261
+ * @returns {OrgChart} The current chart instance.
262
+ */
263
+ onDemand(listener: (this: OrgChart, args: OrgChart.demandEventArgs) => void): OrgChart;
264
+
265
+
255
266
  /**
256
267
  * On canvas SVG click event listener.
257
268
  * ```typescript
@@ -624,6 +635,16 @@ declare class OrgChart {
624
635
  */
625
636
  addNode(data: OrgChart.nodeData, callback?: () => void, fireEvent?: boolean): void;
626
637
 
638
+ /**
639
+ * Adds new nodes to the chart while keeping the specified node fixed in its current position.
640
+ *
641
+ * @param {string | number} id The id of the node that should remain stationary when the new nodes are added.
642
+ * @param {Array<OrgChart.nodeData>} dataArray An array of node data objects to add to the chart.
643
+ * @param {() => void} [callback] A callback function that is called after the nodes are added.
644
+ * @returns {void}
645
+ */
646
+ addNodes(id: string | number, dataArray: Array<OrgChart.nodeData>, callback?: () => void): void;
647
+
627
648
  /**
628
649
  * Removes specified node from nodes collection, redraws the chart and fires remove event.
629
650
  * ```typescript
@@ -1026,16 +1047,7 @@ declare class OrgChart {
1026
1047
  __searchField: string,
1027
1048
  __searchMarks: string
1028
1049
  }>;
1029
- /**
1030
- * Gets collpased node ids of the specifeid node
1031
- * ```typescript
1032
- * let chart = new OrgChart('#tree', {});
1033
- * ...
1034
- * let ids = chart.getCollapsedIds(2);
1035
- * ```
1036
- * @param node
1037
- */
1038
- getCollapsedIds(node: OrgChart.node): Array<string | number>;
1050
+
1039
1051
  /**
1040
1052
  * State to url.
1041
1053
  * ```typescript
@@ -2372,6 +2384,18 @@ declare namespace OrgChart {
2372
2384
  */
2373
2385
  event: MouseEvent
2374
2386
  }
2387
+
2388
+ interface demandEventArgs {
2389
+ /**
2390
+ * The id of the clicked node.
2391
+ */
2392
+ id: string | number,
2393
+
2394
+ /**
2395
+ * An array of node ids that should be loaded from the server.
2396
+ */
2397
+ ids: Array<string | number>
2398
+ }
2375
2399
 
2376
2400
 
2377
2401
  interface canvasClickEventArgs {
@@ -2603,15 +2627,14 @@ declare namespace OrgChart {
2603
2627
  * template name, you can specify multiple templates with tags in one chart
2604
2628
  */
2605
2629
  templateName?: string,
2606
-
2607
- /**
2608
- * Number of direct child nodes.
2609
- */
2610
- childCount?: number,
2630
+
2611
2631
  /**
2612
- * Number of direct child nodes that are currently collapsed (hidden).
2613
- */
2614
- collapsedChildCount?: number,
2632
+ * Array of collapsed direct child node IDs.
2633
+ *
2634
+ * Contains the IDs of child nodes whose `collapsed` state is `true`.
2635
+ * Always initialized as an array.
2636
+ */
2637
+ collapsedChildrenIds?: Array<string | number>,
2615
2638
  /**
2616
2639
  * Total number of collapsed descendant nodes (collapsed at any depth).
2617
2640
  */
@@ -2621,6 +2644,12 @@ declare namespace OrgChart {
2621
2644
  */
2622
2645
  deepChildCount?: number,
2623
2646
 
2647
+ /**
2648
+ * An array of child node ids.
2649
+ */
2650
+ cids?: Array<number | string>,
2651
+
2652
+
2624
2653
  /**
2625
2654
  * a reference to the left node neighbor, the default value is undefined
2626
2655
  */
@@ -6131,8 +6160,5 @@ declare namespace OrgChart {
6131
6160
  */
6132
6161
  var t: any;
6133
6162
  }
6134
-
6135
-
6136
-
6137
6163
 
6138
6164
  export default OrgChart;