@balkangraph/orgchart.js 8.16.2 → 8.16.4

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
@@ -2785,17 +2785,45 @@ declare namespace OrgChart {
2785
2785
 
2786
2786
 
2787
2787
  interface filterUI {
2788
+ /**
2789
+ * @ignore
2790
+ */
2788
2791
  init(instance: OrgChart): void;
2792
+
2793
+ /**
2794
+ * @ignore
2795
+ */
2789
2796
  update(): void;
2797
+
2790
2798
  /**
2791
2799
  * Opens filter Tab
2800
+ * ```typescript
2801
+ * let chart = new OrgChart("#tree", {
2802
+ * })
2803
+ * chart.onInit(() => {
2804
+ * chart.filterUI.show("city")
2805
+ * })
2806
+ * chart.load(nodes)
2807
+ * ```
2792
2808
  * @param filterTabName the name of the filter tab
2793
2809
  */
2794
2810
  show(filterTabName: string): void;
2811
+
2795
2812
  /**
2796
- * Hides the filter tabs
2813
+ * Opens filter Tab
2814
+ * ```typescript
2815
+ * chart.element.addEventListener('click', function(event){
2816
+ * if (event.target == chart.getSvg()){
2817
+ * chart.filterUI.hide();
2818
+ * }
2819
+ * });
2820
+ * ```
2797
2821
  */
2798
2822
  hide(): void;
2823
+
2824
+ /**
2825
+ * @ignore
2826
+ */
2799
2827
  addFilterTag(data: object): boolean;
2800
2828
  /**
2801
2829
  * The on() method of the filterUI interface sets up a function that will be called whenever the specified event is delivered to the target. *
@@ -2803,6 +2831,22 @@ declare namespace OrgChart {
2803
2831
  * @param type A case-sensitive string representing the event type to listen for.
2804
2832
  * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
2805
2833
  */
2834
+
2835
+ /**
2836
+ * Opens filter Tab
2837
+ * ```typescript
2838
+ * let chart = new OrgChart("#tree", {
2839
+ * })
2840
+ * chart.filterUI.on('add-filter', function(sender, args){
2841
+ * let names = Object.keys(sender.filterBy);
2842
+ * let index = names.indexOf(args.name);
2843
+ * if (index == names.length - 1) {
2844
+ * args.html += `<div data-btn-reset style="color: #039BE5;">reset</div>`;
2845
+ * }
2846
+ * });
2847
+ * chart.load(nodes)
2848
+ * ```
2849
+ */
2806
2850
  on(type: "update" | "add-item" | "add-filter" | "show-items" , listener: (sender: filterUI, args: any, args1: any, args2: any) => void | boolean): filterUI;
2807
2851
  filterBy?: any;
2808
2852
  element: HTMLElement;
@@ -3370,6 +3414,19 @@ declare namespace OrgChart {
3370
3414
  btn?: string,
3371
3415
  vlidators?: { required?: string, email?: string }
3372
3416
  }
3417
+
3418
+ /**
3419
+ * Defines a Slink or Clink.
3420
+ * ```typescript
3421
+ * let chart = new OrgChart('#tree', {
3422
+ * clinks: [
3423
+ * { from: 4, to: 0, label: 'text' },
3424
+ * { from: 4, to: 5, template: 'blue', label: '4 reports to 3' },
3425
+ * { from: 2, to: 6, template: 'yellow', label: 'lorem ipsum' }
3426
+ * ]
3427
+ * });
3428
+ * ```
3429
+ */
3373
3430
  interface link {
3374
3431
  from?: string | number,
3375
3432
  to?: string | number,
@@ -3387,15 +3444,50 @@ declare namespace OrgChart {
3387
3444
  opacity?: number,
3388
3445
  except?: Array<string | number>
3389
3446
  }
3447
+
3448
+ /**
3449
+ * Node object that shows a secondary connection
3450
+ * ```typescript
3451
+ * let chart = new OrgChart('#tree', {
3452
+ * dottedLines: [
3453
+ * { from: 5, to: 1 }
3454
+ * ]
3455
+ * });
3456
+ * ```
3457
+ * {@link https://balkan.app/OrgChartJS/Docs/DottedLine | See doc...}
3458
+ */
3390
3459
  interface dottedLine {
3391
3460
  from?: string | number,
3392
3461
  to?: string | number,
3393
3462
  tags?: Array<string>
3394
3463
  }
3464
+
3465
+ /**
3466
+ * The orderBy contains the field name and the *desc* value
3467
+ * ```typescript
3468
+ * let chart = new OrgChart('#tree', {
3469
+ * orderBy: [
3470
+ * { field: 'name', desc: false },
3471
+ * { field: 'surname', desc: true },
3472
+ * ]
3473
+ * });
3474
+ * ```
3475
+ */
3395
3476
  interface orderBy {
3396
3477
  field?: string,
3397
3478
  desc?: boolean
3398
3479
  }
3480
+
3481
+ /**
3482
+ * Contains the move position
3483
+ * ```typescript
3484
+ * document.getElementById('btn_left').addEventListener('mousedown', function(){
3485
+ * chart.moveStart({
3486
+ * left: true
3487
+ * });
3488
+ * });
3489
+ * ```
3490
+ */
3399
3491
  interface move {
3400
3492
  left?: boolean,
3401
3493
  right?: boolean,
@@ -4416,11 +4508,11 @@ declare namespace OrgChart {
4416
4508
  /**
4417
4509
  * Adds curved link.
4418
4510
  * ```typescript
4419
- * var chart = new OrgChart('#tree', {
4511
+ * let chart = new OrgChart('#tree', {
4420
4512
  * clinks: [
4421
- * from: 4, to: 0, label: 'text'},
4422
- * {from: 4, to: 5, template: 'blue', label: '4 reports to 3' },
4423
- * {from: 2, to: 6, template: 'yellow', label: 'lorem ipsum' }
4513
+ * { from: 4, to: 0, label: 'text'},
4514
+ * { from: 4, to: 5, template: 'blue', label: '4 reports to 3' },
4515
+ * { from: 2, to: 6, template: 'yellow', label: 'lorem ipsum' }
4424
4516
  * ]
4425
4517
  * });
4426
4518
  * ```
@@ -4429,11 +4521,11 @@ declare namespace OrgChart {
4429
4521
  /**
4430
4522
  * Adds second link.
4431
4523
  * ```typescript
4432
- * var chart = new OrgChart('#tree', {
4524
+ * let chart = new OrgChart('#tree', {
4433
4525
  * slinks: [
4434
- * from: 4, to: 0, label: 'text'},
4435
- * {from: 4, to: 5, template: 'blue', label: '4 reports to 3' },
4436
- * {from: 2, to: 6, template: 'yellow', label: 'lorem ipsum' }
4526
+ * { from: 4, to: 0, label: 'text' },
4527
+ * { from: 4, to: 5, template: 'blue', label: '4 reports to 3' },
4528
+ * { from: 2, to: 6, template: 'yellow', label: 'lorem ipsum' }
4437
4529
  * ]
4438
4530
  * });
4439
4531
  * ```