jqtree 1.6.3 → 1.7.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 (64) hide show
  1. package/.github/workflows/ci.yml +21 -19
  2. package/.tool-versions +1 -0
  3. package/README.md +1 -1
  4. package/bower.json +10 -3
  5. package/config/production +2 -2
  6. package/config/{rollup.config.js → rollup.config.mjs} +3 -8
  7. package/docs/Gemfile.lock +3 -3
  8. package/docs/_config.yml +1 -1
  9. package/docs/_entries/10_changelog.md +9 -0
  10. package/docs/_entries/93_getnextnode.md +4 -1
  11. package/docs/_entries/{95_getpreviousnode.md → 95_getnextvisiblenode.md} +1 -1
  12. package/docs/_entries/96_getpreviousnode.md +0 -0
  13. package/docs/_entries/{96_getprevioussibling.md → 97_getprevioussibling.md} +0 -0
  14. package/docs/_entries/98_getpreviousvisiblenode.md +14 -0
  15. package/docs/_entries/{97_parent.md → 99_parent.md} +0 -0
  16. package/docs/package.json +7 -7
  17. package/docs/pnpm-lock.yaml +138 -108
  18. package/docs/static/bower.json +1 -1
  19. package/docs/static/bower_components/jquery/dist/jquery.js +209 -97
  20. package/docs/static/bower_components/jquery/dist/jquery.min.js +2 -2
  21. package/docs/static/documentation.css +224 -84
  22. package/docs/static/example.css +0 -1
  23. package/docs/tree.jquery.js +2 -2
  24. package/lib/dataLoader.js +5 -31
  25. package/lib/dragAndDropHandler.js +19 -132
  26. package/lib/elementsRenderer.js +29 -59
  27. package/lib/keyHandler.js +8 -32
  28. package/lib/mouse.widget.js +13 -74
  29. package/lib/node.js +60 -125
  30. package/lib/nodeElement.js +5 -72
  31. package/lib/playwright/coverage.js +58 -97
  32. package/lib/playwright/playwright.test.js +148 -210
  33. package/lib/playwright/testUtils.js +116 -182
  34. package/lib/saveStateHandler.js +12 -61
  35. package/lib/scrollHandler.js +17 -74
  36. package/lib/selectNodeHandler.js +5 -24
  37. package/lib/simple.widget.js +18 -53
  38. package/lib/test/jqTree/create.test.js +0 -4
  39. package/lib/test/jqTree/events.test.js +0 -7
  40. package/lib/test/jqTree/keyboard.test.js +0 -6
  41. package/lib/test/jqTree/loadOnDemand.test.js +84 -121
  42. package/lib/test/jqTree/methods.test.js +107 -150
  43. package/lib/test/jqTree/options.test.js +32 -54
  44. package/lib/test/node.test.js +127 -72
  45. package/lib/test/nodeUtil.test.js +0 -1
  46. package/lib/test/support/jqTreeMatchers.js +4 -9
  47. package/lib/test/support/setupTests.js +0 -4
  48. package/lib/test/support/testUtil.js +2 -11
  49. package/lib/test/support/treeStructure.js +0 -6
  50. package/lib/test/util.test.js +0 -1
  51. package/lib/tree.jquery.js +28 -239
  52. package/lib/util.js +0 -6
  53. package/lib/version.js +1 -1
  54. package/package.json +40 -39
  55. package/src/keyHandler.ts +3 -3
  56. package/src/node.ts +43 -12
  57. package/src/test/.eslintrc +3 -1
  58. package/src/test/node.test.ts +146 -54
  59. package/src/tree.jquery.ts +6 -5
  60. package/src/version.ts +1 -1
  61. package/tree.jquery.debug.js +202 -855
  62. package/tree.jquery.debug.js.map +1 -1
  63. package/tree.jquery.js +2 -2
  64. package/tree.jquery.js.map +1 -1
package/lib/util.js CHANGED
@@ -4,21 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.isInt = exports.isFunction = exports.getBoolString = void 0;
7
-
8
7
  var isInt = function isInt(n) {
9
8
  return typeof n === "number" && n % 1 === 0;
10
9
  };
11
-
12
10
  exports.isInt = isInt;
13
-
14
11
  var isFunction = function isFunction(v) {
15
12
  return typeof v === "function";
16
13
  };
17
-
18
14
  exports.isFunction = isFunction;
19
-
20
15
  var getBoolString = function getBoolString(value) {
21
16
  return value ? "true" : "false";
22
17
  };
23
-
24
18
  exports.getBoolString = getBoolString;
package/lib/version.js CHANGED
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
- var version = "1.6.2";
7
+ var version = "1.7.0";
8
8
  var _default = version;
9
9
  exports["default"] = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jqtree",
3
- "version": "1.6.3",
3
+ "version": "1.7.0",
4
4
  "description": "Tree widget for jQuery",
5
5
  "keywords": [
6
6
  "jquery-plugin",
@@ -16,14 +16,14 @@
16
16
  "scripts": {
17
17
  "ci": "pnpm lint && pnpm tsc && pnpm test",
18
18
  "jest": "jest --coverage --no-cache --verbose --config ./config/jest.config.js",
19
- "jest-watch": "jest --watch",
19
+ "jest-watch": "jest --watch --config ./config/jest.config.js",
20
20
  "lint": "eslint src/ --ext .ts,.tsx",
21
21
  "production": "./config/production",
22
- "devserver": "SERVE=true rollup --config config/rollup.config.js --watch",
23
- "devserver-with-coverage": "COVERAGE=true SERVE=true rollup --config config/rollup.config.js",
24
- "build-with-coverage": "COVERAGE=true rollup --config config/rollup.config.js",
22
+ "devserver": "SERVE=true rollup --config config/rollup.config.mjs --watch",
23
+ "devserver-with-coverage": "COVERAGE=true SERVE=true rollup --config config/rollup.config.mjs",
24
+ "build-with-coverage": "COVERAGE=true rollup --config config/rollup.config.mjs",
25
25
  "prettier": "prettier src/*.ts --write --tab-width 4",
26
- "coveralls": "nyc report --reporter=text-lcov | coveralls",
26
+ "write-coverage": "nyc report --reporter=text-lcov > lcov.info",
27
27
  "tsc": "tsc --noEmit --project tsconfig.json",
28
28
  "merge-coverage": "cp jest-coverage/coverage-final.json .nyc_output/coverage_jsdom.json",
29
29
  "clean-coverage": "rm -rf .nyc_output && jest --clearCache",
@@ -32,50 +32,51 @@
32
32
  "test": "pnpm jest && pnpm playwright"
33
33
  },
34
34
  "dependencies": {
35
- "jquery": "^3.6.0"
35
+ "jquery": "^3.6.3"
36
36
  },
37
37
  "devDependencies": {
38
- "@babel/cli": "^7.18.10",
39
- "@babel/core": "^7.18.10",
40
- "@babel/preset-env": "^7.18.10",
38
+ "@babel/cli": "^7.20.7",
39
+ "@babel/core": "^7.20.7",
40
+ "@babel/preset-env": "^7.20.2",
41
41
  "@babel/preset-typescript": "^7.18.6",
42
- "@playwright/test": "^1.24.2",
43
- "@rollup/plugin-babel": "^5.3.1",
44
- "@rollup/plugin-node-resolve": "^13.3.0",
45
- "@testing-library/dom": "^8.16.1",
42
+ "@playwright/test": "^1.29.1",
43
+ "@rollup/plugin-babel": "^6.0.3",
44
+ "@rollup/plugin-node-resolve": "^15.0.1",
45
+ "@rollup/plugin-terser": "^0.1.0",
46
+ "@testing-library/dom": "^8.19.0",
46
47
  "@types/debug": "^4.1.7",
47
- "@types/jest": "^28.1.6",
48
+ "@types/jest": "^29.2.4",
48
49
  "@types/jquery": "^3.5.14",
49
- "@typescript-eslint/eslint-plugin": "^5.32.0",
50
- "@typescript-eslint/parser": "^5.32.0",
51
- "autoprefixer": "^10.4.8",
52
- "babel-jest": "^28.1.3",
50
+ "@types/node": "^18.11.17",
51
+ "@typescript-eslint/eslint-plugin": "^5.47.0",
52
+ "@typescript-eslint/parser": "^5.47.0",
53
+ "autoprefixer": "^10.4.13",
54
+ "babel-jest": "^29.3.1",
53
55
  "babel-plugin-istanbul": "^6.1.1",
54
- "coveralls": "^3.1.1",
55
- "eslint": "^8.21.0",
56
+ "eslint": "^8.30.0",
56
57
  "eslint-plugin-import": "^2.26.0",
57
- "eslint-plugin-jest": "^26.7.0",
58
- "eslint-plugin-playwright": "^0.10.0",
59
- "eslint-plugin-testing-library": "^5.6.0",
58
+ "eslint-plugin-jest": "^27.1.7",
59
+ "eslint-plugin-playwright": "^0.11.2",
60
+ "eslint-plugin-testing-library": "^5.9.1",
60
61
  "givens": "^1.3.9",
61
- "jest": "^28.1.3",
62
- "jest-environment-jsdom": "^28.1.3",
63
- "jest-extended": "^3.0.2",
62
+ "graphql": "^16.6.0",
63
+ "jest": "^29.3.1",
64
+ "jest-environment-jsdom": "^29.3.1",
65
+ "jest-extended": "^3.2.0",
64
66
  "jsonfile": "^6.1.0",
65
67
  "lodash.template": "^4.5.0",
66
- "msw": "^0.44.2",
68
+ "msw": "^0.49.2",
67
69
  "nyc": "^15.1.0",
68
- "playwright": "^1.24.2",
69
- "postcss": "^8.4.16",
70
- "postcss-cli": "^10.0.0",
71
- "postcss-import": "^14.1.0",
70
+ "playwright": "^1.29.1",
71
+ "postcss": "^8.4.20",
72
+ "postcss-cli": "^10.1.0",
73
+ "postcss-import": "^15.1.0",
72
74
  "postcss-load-config": "^4.0.1",
73
- "postcss-nested": "^5.0.6",
74
- "prettier": "^2.7.1",
75
- "rollup": "^2.77.2",
76
- "rollup-plugin-serve": "^2.0.0",
77
- "rollup-plugin-terser": "^7.0.2",
78
- "tslib": "^2.4.0",
79
- "typescript": "^4.7.4"
75
+ "postcss-nested": "^6.0.0",
76
+ "prettier": "^2.8.1",
77
+ "rollup": "^3.8.1",
78
+ "rollup-plugin-serve": "^2.0.2",
79
+ "tslib": "^2.4.1",
80
+ "typescript": "~4.9.4"
80
81
  }
81
82
  }
package/src/keyHandler.ts CHANGED
@@ -22,11 +22,11 @@ export default class KeyHandler {
22
22
  }
23
23
 
24
24
  public moveDown(selectedNode: Node): boolean {
25
- return this.selectNode(selectedNode.getNextNode());
25
+ return this.selectNode(selectedNode.getNextVisibleNode());
26
26
  }
27
27
 
28
28
  public moveUp(selectedNode: Node): boolean {
29
- return this.selectNode(selectedNode.getPreviousNode());
29
+ return this.selectNode(selectedNode.getPreviousVisibleNode());
30
30
  }
31
31
 
32
32
  public moveRight(selectedNode: Node): boolean {
@@ -36,7 +36,7 @@ export default class KeyHandler {
36
36
  // folder node
37
37
  if (selectedNode.is_open) {
38
38
  // Right moves to the first child of an open node
39
- return this.selectNode(selectedNode.getNextNode());
39
+ return this.selectNode(selectedNode.getNextVisibleNode());
40
40
  } else {
41
41
  // Right expands a closed node
42
42
  this.treeWidget.openNode(selectedNode);
package/src/node.ts CHANGED
@@ -557,7 +557,23 @@ export class Node implements INode {
557
557
  }
558
558
 
559
559
  public getNextNode(includeChildren = true): Node | null {
560
- if (includeChildren && this.hasChildren() && this.is_open) {
560
+ if (includeChildren && this.hasChildren()) {
561
+ return this.children[0];
562
+ } else if (!this.parent) {
563
+ return null;
564
+ } else {
565
+ const nextSibling = this.getNextSibling();
566
+
567
+ if (nextSibling) {
568
+ return nextSibling;
569
+ } else {
570
+ return this.parent.getNextNode(false);
571
+ }
572
+ }
573
+ }
574
+
575
+ public getNextVisibleNode(): Node | null {
576
+ if (this.hasChildren() && this.is_open) {
561
577
  // First child
562
578
  return this.children[0];
563
579
  } else {
@@ -581,19 +597,34 @@ export class Node implements INode {
581
597
  return null;
582
598
  } else {
583
599
  const previousSibling = this.getPreviousSibling();
584
- if (previousSibling) {
585
- if (
586
- !previousSibling.hasChildren() ||
587
- !previousSibling.is_open
588
- ) {
589
- // Previous sibling
590
- return previousSibling;
591
- } else {
592
- // Last child of previous sibling
593
- return previousSibling.getLastChild();
594
- }
600
+
601
+ if (!previousSibling) {
602
+ return this.getParent();
603
+ } else if (previousSibling.hasChildren()) {
604
+ return previousSibling.getLastChild();
595
605
  } else {
606
+ return previousSibling;
607
+ }
608
+ }
609
+ }
610
+
611
+ public getPreviousVisibleNode(): Node | null {
612
+ if (!this.parent) {
613
+ return null;
614
+ } else {
615
+ const previousSibling = this.getPreviousSibling();
616
+
617
+ if (!previousSibling) {
596
618
  return this.getParent();
619
+ } else if (
620
+ !previousSibling.hasChildren() ||
621
+ !previousSibling.is_open
622
+ ) {
623
+ // Previous sibling
624
+ return previousSibling;
625
+ } else {
626
+ // Last child of previous sibling
627
+ return previousSibling.getLastChild();
597
628
  }
598
629
  }
599
630
  }
@@ -3,10 +3,12 @@
3
3
  "extends": ["plugin:jest/all", "plugin:testing-library/dom"],
4
4
  "rules": {
5
5
  "jest/consistent-test-it": "off",
6
- "jest/prefer-expect-assertions": "off",
6
+ "jest/max-expects": ["off"],
7
7
  "jest/no-duplicate-hooks": "off",
8
8
  "jest/no-hooks": "off",
9
9
  "jest/no-identical-title": "off",
10
+ "jest/no-standalone-expect": "off",
11
+ "jest/prefer-expect-assertions": "off",
10
12
  "jest/prefer-strict-equal": "off",
11
13
  "jest/require-hook": "off",
12
14
  "jest/require-top-level-describe": "off"
@@ -568,52 +568,47 @@ describe("getLastChild", () => {
568
568
 
569
569
  describe("getNextNode", () => {
570
570
  interface Vars {
571
- includeChildren: boolean;
572
571
  fromNode: Node;
573
- nextNode: Node | null;
574
572
  tree: Node;
575
573
  }
576
574
  const given = getGiven<Vars>();
577
575
  given("tree", () => new Node().loadFromData(exampleData));
578
- given("nextNode", () => given.fromNode.getNextNode(given.includeChildren));
579
576
 
580
- context("with includeChildren is true", () => {
581
- given("includeChildren", () => true);
577
+ context("with a parent node", () => {
578
+ given("fromNode", () => given.tree.getNodeByNameMustExist("node1"));
582
579
 
583
- context("with a parent node", () => {
584
- given("fromNode", () => given.tree.getNodeByNameMustExist("node1"));
585
-
586
- context("when the parent node is closed", () => {
587
- it("returns the next sibling", () => {
588
- expect(given.nextNode).toMatchObject({ name: "node2" });
580
+ context("when the parent node is closed", () => {
581
+ it("returns the first child", () => {
582
+ expect(given.fromNode.getNextNode()).toMatchObject({
583
+ name: "child1",
589
584
  });
590
585
  });
586
+ });
591
587
 
592
- context("when the parent node is open", () => {
593
- beforeEach(() => {
594
- given.fromNode.is_open = true;
595
- });
588
+ context("when the parent node is open", () => {
589
+ beforeEach(() => {
590
+ given.fromNode.is_open = true;
591
+ });
596
592
 
597
- it("returns the first child", () => {
598
- expect(given.nextNode).toMatchObject({ name: "child1" });
593
+ it("returns the first child", () => {
594
+ expect(given.fromNode.getNextNode()).toMatchObject({
595
+ name: "child1",
599
596
  });
600
597
  });
601
598
  });
599
+ });
602
600
 
603
- context("with the node is the last child", () => {
604
- given("fromNode", () =>
605
- given.tree.getNodeByNameMustExist("child2")
606
- );
601
+ context("with the node is the last child", () => {
602
+ given("fromNode", () => given.tree.getNodeByNameMustExist("child2"));
607
603
 
608
- it("returns the next sibling of the parent", () => {
609
- expect(given.nextNode).toMatchObject({ name: "node2" });
604
+ it("returns the next sibling of the parent", () => {
605
+ expect(given.fromNode.getNextNode()).toMatchObject({
606
+ name: "node2",
610
607
  });
611
608
  });
612
609
  });
613
610
 
614
611
  context("with includeChildren is false", () => {
615
- given("includeChildren", () => false);
616
-
617
612
  context("with an open parent node", () => {
618
613
  given("fromNode", () => given.tree.getNodeByNameMustExist("node1"));
619
614
 
@@ -622,10 +617,63 @@ describe("getNextNode", () => {
622
617
  });
623
618
 
624
619
  it("returns the next sibling", () => {
625
- expect(given.nextNode).toMatchObject({ name: "node2" });
620
+ expect(given.fromNode.getNextNode(false)).toMatchObject({
621
+ name: "node2",
622
+ });
623
+ });
624
+ });
625
+ });
626
+ });
627
+
628
+ describe("getNextVisibleNode", () => {
629
+ interface Vars {
630
+ fromNode: Node;
631
+ tree: Node;
632
+ }
633
+ const given = getGiven<Vars>();
634
+ given("tree", () => new Node().loadFromData(exampleData));
635
+
636
+ context("with a parent node", () => {
637
+ given("fromNode", () => given.tree.getNodeByNameMustExist("node1"));
638
+
639
+ context("when the parent node is closed", () => {
640
+ it("returns the next sibling", () => {
641
+ expect(given.fromNode.getNextVisibleNode()).toMatchObject({
642
+ name: "node2",
643
+ });
644
+ });
645
+ });
646
+
647
+ context("when the parent node is open", () => {
648
+ beforeEach(() => {
649
+ given.fromNode.is_open = true;
650
+ });
651
+
652
+ it("returns the first child", () => {
653
+ expect(given.fromNode.getNextVisibleNode()).toMatchObject({
654
+ name: "child1",
655
+ });
626
656
  });
627
657
  });
628
658
  });
659
+
660
+ context("with the node is the last child", () => {
661
+ given("fromNode", () => given.tree.getNodeByNameMustExist("child2"));
662
+
663
+ it("returns the next sibling of the parent", () => {
664
+ expect(given.fromNode.getNextVisibleNode()).toMatchObject({
665
+ name: "node2",
666
+ });
667
+ });
668
+ });
669
+
670
+ context("with the tree node", () => {
671
+ given("fromNode", () => given.tree);
672
+
673
+ it("returns null", () => {
674
+ expect(given.fromNode.getNextVisibleNode()).toBeNull();
675
+ });
676
+ });
629
677
  });
630
678
 
631
679
  describe("getNextSibling", () => {
@@ -766,48 +814,92 @@ describe("getParent", () => {
766
814
 
767
815
  describe("getPreviousNode", () => {
768
816
  interface Vars {
769
- node2: Node;
770
- node3: Node;
771
817
  tree: Node;
772
818
  }
773
819
  const given = getGiven<Vars>();
774
- given("node2", () => given.tree.getNodeByNameMustExist("node2"));
775
- given("node3", () => given.tree.getNodeByNameMustExist("node3"));
776
820
  given("tree", () => new Node().loadFromData(exampleData));
777
821
 
778
- context("with a tree", () => {
779
- it("returns null", () => {
780
- expect(given.tree.getPreviousNode()).toBeNull();
822
+ it("returns null with a tree node", () => {
823
+ expect(given.tree.getPreviousNode()).toBeNull();
824
+ });
825
+
826
+ it("returns the last child of the previous sibling when the previous node is closed and has children", () => {
827
+ given.tree.getNodeByNameMustExist("node2").is_open = false;
828
+ const node2 = given.tree.getNodeByNameMustExist("node2");
829
+
830
+ expect(node2.getPreviousNode()).toMatchObject({
831
+ name: "child2",
781
832
  });
782
833
  });
783
834
 
784
- context("when the previous sibling has children", () => {
785
- context("when the previous node is closed", () => {
786
- it("returns the previous sibling", () => {
787
- expect(given.node2.getPreviousNode()).toMatchObject({
788
- name: "node1",
789
- });
790
- });
835
+ it("returns the last child of the previous sibling when the previous node is open and has children", () => {
836
+ given.tree.getNodeByNameMustExist("node2").is_open = true;
837
+ const node2 = given.tree.getNodeByNameMustExist("node2");
838
+
839
+ expect(node2.getPreviousNode()).toMatchObject({
840
+ name: "child2",
791
841
  });
842
+ });
792
843
 
793
- context("when the previous node is open", () => {
794
- beforeEach(() => {
795
- given.tree.getNodeByNameMustExist("node1").is_open = true;
796
- });
844
+ it("returns the first child if a node is the second child", () => {
845
+ const child2 = given.tree.getNodeByNameMustExist("child2");
797
846
 
798
- it("returns the last child of the previous sibling", () => {
799
- expect(given.node2.getPreviousNode()).toMatchObject({
800
- name: "child2",
801
- });
802
- });
847
+ expect(child2.getPreviousNode()).toMatchObject({
848
+ name: "child1",
803
849
  });
804
850
  });
805
851
 
806
- context("with a node that is the first child", () => {
807
- it("returns the parent", () => {
808
- expect(given.node3.getPreviousNode()).toMatchObject({
809
- name: "node2",
810
- });
852
+ it("returns the parent with a node that is the first child", () => {
853
+ const node3 = given.tree.getNodeByNameMustExist("node3");
854
+
855
+ expect(node3.getPreviousNode()).toMatchObject({
856
+ name: "node2",
857
+ });
858
+ });
859
+ });
860
+
861
+ describe("getPreviousVisibleNode", () => {
862
+ interface Vars {
863
+ tree: Node;
864
+ }
865
+ const given = getGiven<Vars>();
866
+ given("tree", () => new Node().loadFromData(exampleData));
867
+
868
+ it("returns null with a tree node", () => {
869
+ expect(given.tree.getPreviousVisibleNode()).toBeNull();
870
+ });
871
+
872
+ it("returns the previous sibling when the previous sibling is closed and has children", () => {
873
+ given.tree.getNodeByNameMustExist("node2").is_open = false;
874
+ const node2 = given.tree.getNodeByNameMustExist("node2");
875
+
876
+ expect(node2.getPreviousVisibleNode()).toMatchObject({
877
+ name: "node1",
878
+ });
879
+ });
880
+
881
+ it("returns the last child of the previous sibling when the previous sibling is open and has children", () => {
882
+ given.tree.getNodeByNameMustExist("node1").is_open = true;
883
+ const node2 = given.tree.getNodeByNameMustExist("node2");
884
+
885
+ expect(node2.getPreviousVisibleNode()).toMatchObject({
886
+ name: "child2",
887
+ });
888
+ });
889
+
890
+ it("returns the first child if a node is the second child", () => {
891
+ const child2 = given.tree.getNodeByNameMustExist("child2");
892
+
893
+ expect(child2.getPreviousVisibleNode()).toMatchObject({
894
+ name: "child1",
895
+ });
896
+ });
897
+
898
+ it("returns the parent when a node is the first child", () => {
899
+ const node3 = given.tree.getNodeByNameMustExist("node3");
900
+
901
+ expect(node3.getPreviousVisibleNode()).toMatchObject({
902
+ name: "node2",
811
903
  });
812
904
  });
813
905
  });
@@ -1118,11 +1118,7 @@ export class JqTreeWidget extends MouseWidget<JQTreeOptions> {
1118
1118
  }
1119
1119
 
1120
1120
  private doLoadData(data: NodeData[] | null, parentNode: Node | null): void {
1121
- if (!data) {
1122
- return;
1123
- } else {
1124
- this._triggerEvent("tree.load_data", { tree_data: data });
1125
-
1121
+ if (data) {
1126
1122
  if (parentNode) {
1127
1123
  this.deselectNodes(parentNode);
1128
1124
  this.loadSubtree(data, parentNode);
@@ -1134,6 +1130,11 @@ export class JqTreeWidget extends MouseWidget<JQTreeOptions> {
1134
1130
  this.dndHandler.refresh();
1135
1131
  }
1136
1132
  }
1133
+
1134
+ this._triggerEvent("tree.load_data", {
1135
+ tree_data: data,
1136
+ parent_node: parentNode,
1137
+ });
1137
1138
  }
1138
1139
 
1139
1140
  private deselectNodes(parentNode: Node): void {
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
- const version = "1.6.2";
1
+ const version = "1.7.0";
2
2
 
3
3
  export default version;