jqtree 1.8.0 → 1.8.1

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 (60) hide show
  1. package/.eslintrc +13 -3
  2. package/.github/workflows/ci.yml +6 -6
  3. package/.github/workflows/codeql-analysis.yml +4 -4
  4. package/.github/workflows/size.yml +3 -3
  5. package/.github/workflows/static.yml +1 -1
  6. package/bower.json +1 -1
  7. package/config/jest.config.js +4 -0
  8. package/config/jest.polyfills.js +14 -0
  9. package/devserver/test_index.html +9 -0
  10. package/docs/.ruby-version +1 -1
  11. package/docs/_config.yml +1 -1
  12. package/docs/_entries/general/changelog.md +4 -0
  13. package/docs/_entries/multiple_selection/get-selected-nodes.md +1 -1
  14. package/docs/_entries/node/getnextnode.md +3 -6
  15. package/docs/_entries/node/getnextsibling.md +1 -1
  16. package/docs/_entries/node/getnextvisiblenode.md +8 -5
  17. package/docs/_entries/node/getpreviousnode.md +12 -0
  18. package/docs/_entries/node/getprevioussibling.md +1 -1
  19. package/docs/_entries/node/getpreviousvisiblenode.md +6 -5
  20. package/package.json +32 -30
  21. package/src/dataLoader.ts +19 -21
  22. package/src/dragAndDropHandler/dragElement.ts +37 -25
  23. package/src/dragAndDropHandler/generateHitAreas.ts +176 -0
  24. package/src/dragAndDropHandler/index.ts +32 -48
  25. package/src/dragAndDropHandler/iterateVisibleNodes.ts +91 -0
  26. package/src/dragAndDropHandler/types.ts +2 -1
  27. package/src/mouseHandler.ts +385 -0
  28. package/src/mouseUtils.ts +23 -0
  29. package/src/node.ts +1 -29
  30. package/src/nodeElement/folderElement.ts +1 -1
  31. package/src/nodeElement/ghostDropHint.ts +2 -1
  32. package/src/nodeElement/index.ts +2 -1
  33. package/src/playwright/coverage.ts +3 -3
  34. package/src/playwright/playwright.test.ts +150 -49
  35. package/src/playwright/testUtils.ts +28 -5
  36. package/src/position.ts +28 -0
  37. package/src/scrollHandler/containerScrollParent.ts +13 -23
  38. package/src/scrollHandler/createScrollParent.ts +22 -22
  39. package/src/scrollHandler/documentScrollParent.ts +16 -13
  40. package/src/scrollHandler.ts +6 -14
  41. package/src/test/jqTree/events.test.ts +97 -30
  42. package/src/test/jqTree/loadOnDemand.test.ts +22 -15
  43. package/src/test/jqTree/methods.test.ts +8 -11
  44. package/src/test/jqTree/mouse.test.ts +82 -0
  45. package/src/test/jqTree/options.test.ts +9 -8
  46. package/src/test/node.test.ts +2 -1
  47. package/src/test/{nodeUtil.test.ts → position.test.ts} +1 -1
  48. package/src/tree.jquery.ts +108 -184
  49. package/src/util.ts +10 -1
  50. package/src/version.ts +1 -1
  51. package/tree.jquery.debug.js +2158 -2135
  52. package/tree.jquery.debug.js.map +1 -1
  53. package/tree.jquery.js +3 -3
  54. package/tree.jquery.js.map +1 -1
  55. package/tsconfig.json +5 -3
  56. package/docs/_entries/functions/get-selected-nodes.md +0 -10
  57. package/src/dragAndDropHandler/hitAreasGenerator.ts +0 -175
  58. package/src/dragAndDropHandler/visibleNodeIterator.ts +0 -97
  59. package/src/mouse.widget.ts +0 -266
  60. package/src/mouseWidgetTypes.ts +0 -6
package/.eslintrc CHANGED
@@ -6,8 +6,7 @@
6
6
  "plugin:@typescript-eslint/eslint-recommended",
7
7
  "plugin:@typescript-eslint/recommended",
8
8
  "plugin:@typescript-eslint/recommended-requiring-type-checking",
9
- "plugin:import/errors",
10
- "plugin:import/warnings",
9
+ "plugin:import/recommended",
11
10
  "plugin:import/typescript"
12
11
  ],
13
12
  "rules": {
@@ -33,6 +32,17 @@
33
32
  ]
34
33
  },
35
34
  "parserOptions": {
36
- "project": "./tsconfig.json",
35
+ "project": "./tsconfig.json"
36
+ },
37
+ "settings": {
38
+ "import/parsers": {
39
+ "@typescript-eslint/parser": [".ts"]
40
+ },
41
+ "import/resolver": {
42
+ "typescript": {
43
+ "alwaysTryTypes": true,
44
+ "project": "./tsconfig.json"
45
+ }
46
+ }
37
47
  }
38
48
  }
@@ -8,25 +8,25 @@ jobs:
8
8
 
9
9
  steps:
10
10
  - name: Check out repository code
11
- uses: actions/checkout@v3
11
+ uses: actions/checkout@v4
12
12
  - name: Setup node
13
- uses: actions/setup-node@v3
13
+ uses: actions/setup-node@v4
14
14
  with:
15
- node-version: 16
15
+ node-version: "20"
16
16
  - name: Install pnpm
17
17
  run: npm install -g pnpm
18
18
  - name: Get pnpm store directory
19
19
  id: pnpm-cache
20
20
  run: |
21
21
  echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
22
- - uses: actions/cache@v3
22
+ - uses: actions/cache@v4
23
23
  name: Setup pnpm cache
24
24
  with:
25
25
  path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
26
26
  key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
27
27
  restore-keys: |
28
28
  ${{ runner.os }}-pnpm-store-
29
- - uses: actions/cache@v3
29
+ - uses: actions/cache@v4
30
30
  name: Setup Playwright browsers cache
31
31
  with:
32
32
  path: /home/runner/.cache/ms-playwright/
@@ -55,7 +55,7 @@ jobs:
55
55
  run: pnpm run playwright
56
56
  - name: Screenshots artifact
57
57
  if: always()
58
- uses: actions/upload-artifact@v3
58
+ uses: actions/upload-artifact@v4
59
59
  with:
60
60
  name: screenshots
61
61
  path: src/playwright/playwright.test.ts-snapshots/
@@ -18,15 +18,15 @@ jobs:
18
18
 
19
19
  steps:
20
20
  - name: Checkout repository
21
- uses: actions/checkout@v3
21
+ uses: actions/checkout@v4
22
22
 
23
23
  - name: Initialize CodeQL
24
- uses: github/codeql-action/init@v2
24
+ uses: github/codeql-action/init@v3
25
25
  with:
26
26
  languages: ${{ matrix.language }}
27
27
 
28
28
  - name: Autobuild
29
- uses: github/codeql-action/autobuild@v2
29
+ uses: github/codeql-action/autobuild@v3
30
30
 
31
31
  - name: Perform CodeQL Analysis
32
- uses: github/codeql-action/analyze@v2
32
+ uses: github/codeql-action/analyze@v3
@@ -7,11 +7,11 @@ jobs:
7
7
 
8
8
  steps:
9
9
  - name: Check out repository code
10
- uses: actions/checkout@v3
10
+ uses: actions/checkout@v4
11
11
  - name: Setup node
12
- uses: actions/setup-node@v3
12
+ uses: actions/setup-node@v4
13
13
  with:
14
- node-version: 16
14
+ node-version: "20"
15
15
  - name: Install pnpm
16
16
  run: npm install -g pnpm
17
17
  - name: Install packages
@@ -31,7 +31,7 @@ jobs:
31
31
  - name: Setup node
32
32
  uses: actions/setup-node@v3
33
33
  with:
34
- node-version: 16
34
+ node-version: 20
35
35
  - name: Install pnpm
36
36
  run: npm install -g pnpm
37
37
  - name: Install ruby packages
package/bower.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jqTree",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "main": [
5
5
  "jqtree.css",
6
6
  "jqtree-circle.png",
@@ -12,7 +12,11 @@ module.exports = {
12
12
  "givens/setup.js",
13
13
  "jest-extended/all",
14
14
  ],
15
+ setupFiles: ["<rootDir>/config/jest.polyfills.js"],
15
16
  testEnvironment: "jsdom",
17
+ testEnvironmentOptions: {
18
+ customExportConditions: [""],
19
+ },
16
20
  testRegex: "\\/src\\/test\\/.*\\.test\\.ts",
17
21
  transform: {
18
22
  "\\.tsx?$": ["babel-jest", { root: __dirname }],
@@ -0,0 +1,14 @@
1
+ const { TextEncoder, TextDecoder } = require("node:util");
2
+
3
+ Reflect.set(globalThis, "TextEncoder", TextEncoder);
4
+ Reflect.set(globalThis, "TextDecoder", TextDecoder);
5
+
6
+ const { Blob } = require("node:buffer");
7
+ const { fetch, Request, Response, Headers, FormData } = require("undici");
8
+
9
+ Reflect.set(globalThis, "fetch", fetch);
10
+ Reflect.set(globalThis, "Blob", Blob);
11
+ Reflect.set(globalThis, "Request", Request);
12
+ Reflect.set(globalThis, "Response", Response);
13
+ Reflect.set(globalThis, "Headers", Headers);
14
+ Reflect.set(globalThis, "FormData", FormData);
@@ -6,6 +6,15 @@
6
6
  <script src="/bower_components/jquery/dist/jquery.min.js"></script>
7
7
  <script src="tree.jquery.js"></script>
8
8
  <script src="/example_data.js"></script>
9
+ <style>
10
+ .wide-tree {
11
+ font-size: 20px;
12
+ }
13
+
14
+ .wide-tree ul.jqtree-tree ul.jqtree_common {
15
+ margin-left: 128px;
16
+ }
17
+ </style>
9
18
  </head>
10
19
  <body>
11
20
  <div id="tree1"></div>
@@ -1 +1 @@
1
- 3.2.2
1
+ 3.2.3
package/docs/_config.yml CHANGED
@@ -118,7 +118,7 @@ defaults:
118
118
  values:
119
119
  layout: "example"
120
120
 
121
- jqtree_version: 1.8.0
121
+ jqtree_version: 1.8.1
122
122
 
123
123
  # Build settings
124
124
  markdown: kramdown
@@ -3,6 +3,10 @@ title: Changelog
3
3
  name: changelog
4
4
  ---
5
5
 
6
+ #### 1.8.1 (march 16 2024)
7
+
8
+ - Issue #791: fix onCanMoveTo (thanks to Christophe Caron)
9
+
6
10
  #### 1.8.0 (november 26 2023)
7
11
 
8
12
  This release drops support for very old browsers (like IE 11).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: getSelectedNodes
3
- name: multiple-get-selected-nodes
3
+ name: multiple-selection-get-selected-nodes
4
4
  ---
5
5
 
6
6
  Get the selected nodes. Return an array of nodes
@@ -3,13 +3,10 @@ title: getNextNode
3
3
  name: node-functions-getnextnode
4
4
  ---
5
5
 
6
- Get the next node in the tree.
6
+ Get the next node in the tree. This is the next sibling, if there is one. Or, if there is no next sibling, a node further down in the tree.
7
7
 
8
- - If the node has children, return the first child.
9
- - If the node is the last child, return the next sibling of the parent.
10
-
11
- Returns a node or null.
8
+ - Returns a node or null.
12
9
 
13
10
  {% highlight js %}
14
- var node = node.getNextNode();
11
+ const nextNode = node.getNextNode();
15
12
  {% endhighlight %}
@@ -6,5 +6,5 @@ name: node-functions-getnextsibling
6
6
  Get the next sibling of this node. Returns a node or null.
7
7
 
8
8
  {% highlight js %}
9
- var node = node.getNextSibling();
9
+ const nextSibling = node.getNextSibling();
10
10
  {% endhighlight %}
@@ -1,12 +1,15 @@
1
1
  ---
2
- title: getPreviousNode
3
- name: node-functions-getpreviousnode
2
+ title: getNextVisibleNode
3
+ name: node-functions-getnextvisiblenode
4
4
  ---
5
5
 
6
- Return the previous node in the tree.
6
+ Get the next visible node in the tree. Does the same as using the _down_ key.
7
7
 
8
- Returns a node or null.
8
+ This is the previous sibling, if there is one. Or, if there is no previous sibling, a node further up in the tree that is visible.
9
+
10
+ - Returns a node or null.
11
+ - A node is visible if all its parents are open.
9
12
 
10
13
  {% highlight js %}
11
- var node = node.getPreviousNode();
14
+ const nextNode = node.getNextVisibleNode();
12
15
  {% endhighlight %}
@@ -0,0 +1,12 @@
1
+ ---
2
+ title: getPreviousNode
3
+ name: node-functions-getpreviousnode
4
+ ---
5
+
6
+ Return the previous node in the tree. This is the previous sibling, if there is one. Or, if there is no previous sibling, a node further up in the tree.
7
+
8
+ - Returns a node or null.
9
+
10
+ {% highlight js %}
11
+ const previousNode = node.getPreviousNode();
12
+ {% endhighlight %}
@@ -6,5 +6,5 @@ name: node-functions-getprevioussibling
6
6
  Get the previous sibling of this node. Returns a node or null.
7
7
 
8
8
  {% highlight js %}
9
- var node = node.getPreviousSibling();
9
+ const previousSibling = node.getPreviousSibling();
10
10
  {% endhighlight %}
@@ -3,12 +3,13 @@ title: getPreviousVisibleNode
3
3
  name: node-functions-getpreviousvisiblenode
4
4
  ---
5
5
 
6
- - Get the previous visible node in the tree. Does the same as using the _up_ key.
7
- - If the previous node is an open parent: return the last child of the node.
8
- - If the previous node is a closed parent: skip the child nodes of the previous parent, return the previous parent node.
6
+ Get the previous visible node in the tree. Does the same as using the _up_ key.
9
7
 
10
- Returns a node or null.
8
+ This is the previous sibling, if there is one. Or, if there is no previous sibling, a node further up in the tree that is visible.
9
+
10
+ - Returns a node or null.
11
+ - A node is visible if all its parents are open.
11
12
 
12
13
  {% highlight js %}
13
- var node = node.getPreviousVisibleNode();
14
+ const previousNode = node.getPreviousVisibleNode();
14
15
  {% endhighlight %}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jqtree",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "Tree widget for jQuery",
5
5
  "keywords": [
6
6
  "jquery-plugin",
@@ -35,31 +35,32 @@
35
35
  "jquery": "^3"
36
36
  },
37
37
  "devDependencies": {
38
- "@babel/cli": "^7.23.0",
39
- "@babel/core": "^7.23.2",
40
- "@babel/preset-env": "^7.23.2",
41
- "@babel/preset-typescript": "^7.23.2",
42
- "@playwright/test": "^1.39.0",
38
+ "@babel/cli": "^7.23.9",
39
+ "@babel/core": "^7.23.9",
40
+ "@babel/preset-env": "^7.23.9",
41
+ "@babel/preset-typescript": "^7.23.3",
42
+ "@playwright/test": "^1.41.2",
43
43
  "@rollup/plugin-babel": "^6.0.4",
44
44
  "@rollup/plugin-node-resolve": "^15.2.3",
45
45
  "@rollup/plugin-terser": "^0.4.4",
46
- "@testing-library/dom": "^9.3.3",
47
- "@testing-library/user-event": "^14.5.1",
48
- "@types/debug": "^4.1.10",
49
- "@types/jest": "^29.5.6",
50
- "@types/jest-axe": "^3.5.7",
51
- "@types/jquery": "^3.5.24",
52
- "@types/node": "^20.8.7",
53
- "@typescript-eslint/eslint-plugin": "^6.8.0",
54
- "@typescript-eslint/parser": "^6.8.0",
55
- "autoprefixer": "^10.4.16",
46
+ "@testing-library/dom": "^9.3.4",
47
+ "@testing-library/user-event": "^14.5.2",
48
+ "@types/debug": "^4.1.12",
49
+ "@types/jest": "^29.5.12",
50
+ "@types/jest-axe": "^3.5.9",
51
+ "@types/jquery": "^3.5.29",
52
+ "@types/node": "^20.11.19",
53
+ "@typescript-eslint/eslint-plugin": "^7.0.1",
54
+ "@typescript-eslint/parser": "^7.0.1",
55
+ "autoprefixer": "^10.4.17",
56
56
  "babel-jest": "^29.7.0",
57
57
  "babel-plugin-istanbul": "^6.1.1",
58
- "eslint": "^8.52.0",
59
- "eslint-plugin-import": "^2.28.1",
60
- "eslint-plugin-jest": "^27.4.3",
61
- "eslint-plugin-playwright": "^0.17.0",
62
- "eslint-plugin-testing-library": "^6.1.0",
58
+ "eslint": "^8.56.0",
59
+ "eslint-import-resolver-typescript": "^3.6.1",
60
+ "eslint-plugin-import": "^2.29.1",
61
+ "eslint-plugin-jest": "^27.9.0",
62
+ "eslint-plugin-playwright": "^1.1.2",
63
+ "eslint-plugin-testing-library": "^6.2.0",
63
64
  "givens": "^1.3.9",
64
65
  "graphql": "^16.8.1",
65
66
  "jest": "^29.7.0",
@@ -68,16 +69,17 @@
68
69
  "jest-extended": "^4.0.2",
69
70
  "jsonfile": "^6.1.0",
70
71
  "lodash.template": "^4.5.0",
71
- "msw": "^1.3.2",
72
- "postcss": "^8.4.31",
73
- "postcss-cli": "^10.1.0",
74
- "postcss-import": "^15.1.0",
75
- "postcss-load-config": "^4.0.1",
72
+ "msw": "^2.2.1",
73
+ "postcss": "^8.4.35",
74
+ "postcss-cli": "^11.0.0",
75
+ "postcss-import": "^16.0.1",
76
+ "postcss-load-config": "^5.0.3",
76
77
  "postcss-nested": "^6.0.1",
77
- "prettier": "^3.0.3",
78
- "rollup": "^4.1.4",
79
- "rollup-plugin-serve": "^2.0.2",
78
+ "prettier": "^3.2.5",
79
+ "rollup": "^4.12.0",
80
+ "rollup-plugin-serve": "^3.0.0",
80
81
  "tslib": "^2.6.2",
81
- "typescript": "^5.2.2"
82
+ "typescript": "^5.3.3",
83
+ "undici": "^5.28.3"
82
84
  }
83
85
  }
package/src/dataLoader.ts CHANGED
@@ -9,7 +9,7 @@ interface DataLoaderParams {
9
9
  loadData: LoadData;
10
10
  onLoadFailed?: OnLoadFailed;
11
11
  onLoading?: OnLoading;
12
- $treeElement: JQuery<HTMLElement>;
12
+ treeElement: HTMLElement;
13
13
  triggerEvent: TriggerEvent;
14
14
  }
15
15
 
@@ -18,7 +18,7 @@ export default class DataLoader {
18
18
  private loadData: LoadData;
19
19
  private onLoadFailed?: OnLoadFailed;
20
20
  private onLoading?: OnLoading;
21
- private $treeElement: JQuery<HTMLElement>;
21
+ private treeElement: HTMLElement;
22
22
  private triggerEvent: TriggerEvent;
23
23
 
24
24
  constructor({
@@ -26,14 +26,14 @@ export default class DataLoader {
26
26
  loadData,
27
27
  onLoadFailed,
28
28
  onLoading,
29
- $treeElement,
29
+ treeElement,
30
30
  triggerEvent,
31
31
  }: DataLoaderParams) {
32
32
  this.dataFilter = dataFilter;
33
33
  this.loadData = loadData;
34
34
  this.onLoadFailed = onLoadFailed;
35
35
  this.onLoading = onLoading;
36
- this.$treeElement = $treeElement;
36
+ this.treeElement = treeElement;
37
37
  this.triggerEvent = triggerEvent;
38
38
  }
39
39
 
@@ -46,13 +46,13 @@ export default class DataLoader {
46
46
  return;
47
47
  }
48
48
 
49
- const $el = this.getDomElement(parentNode);
50
- this.addLoadingClass($el);
51
- this.notifyLoading(true, parentNode, $el);
49
+ const element = this.getDomElement(parentNode);
50
+ this.addLoadingClass(element);
51
+ this.notifyLoading(true, parentNode, element);
52
52
 
53
53
  const stopLoading = (): void => {
54
- this.removeLoadingClass($el);
55
- this.notifyLoading(false, parentNode, $el);
54
+ this.removeLoadingClass(element);
55
+ this.notifyLoading(false, parentNode, element);
56
56
  };
57
57
 
58
58
  const handleSuccess = (data: string | NodeData[]): void => {
@@ -75,31 +75,29 @@ export default class DataLoader {
75
75
  this.submitRequest(urlInfo, handleSuccess, handleError);
76
76
  }
77
77
 
78
- private addLoadingClass($el: JQuery<HTMLElement>): void {
79
- if ($el) {
80
- $el.addClass("jqtree-loading");
81
- }
78
+ private addLoadingClass(element: HTMLElement): void {
79
+ element.classList.add("jqtree-loading");
82
80
  }
83
81
 
84
- private removeLoadingClass($el: JQuery<HTMLElement>): void {
85
- if ($el) {
86
- $el.removeClass("jqtree-loading");
87
- }
82
+ private removeLoadingClass(element: HTMLElement): void {
83
+ element.classList.remove("jqtree-loading");
88
84
  }
89
85
 
90
- private getDomElement(parentNode: Node | null): JQuery<HTMLElement> {
86
+ private getDomElement(parentNode: Node | null): HTMLElement {
91
87
  if (parentNode) {
92
- return jQuery(parentNode.element);
88
+ return parentNode.element;
93
89
  } else {
94
- return this.$treeElement;
90
+ return this.treeElement;
95
91
  }
96
92
  }
97
93
 
98
94
  private notifyLoading(
99
95
  isLoading: boolean,
100
96
  node: Node | null,
101
- $el: JQuery,
97
+ element: HTMLElement,
102
98
  ): void {
99
+ const $el = jQuery(element);
100
+
103
101
  if (this.onLoading) {
104
102
  this.onLoading(isLoading, node, $el);
105
103
  }
@@ -1,41 +1,53 @@
1
+ interface DragElementParams {
2
+ autoEscape: boolean;
3
+ nodeName: string;
4
+ offsetX: number;
5
+ offsetY: number;
6
+ treeElement: HTMLElement;
7
+ }
8
+
1
9
  class DragElement {
2
10
  private offsetX: number;
3
11
  private offsetY: number;
4
- private $element: JQuery;
5
-
6
- constructor(
7
- nodeName: string,
8
- offsetX: number,
9
- offsetY: number,
10
- $tree: JQuery,
11
- autoEscape: boolean,
12
- ) {
12
+ private element: HTMLElement;
13
+
14
+ constructor({
15
+ autoEscape,
16
+ nodeName,
17
+ offsetX,
18
+ offsetY,
19
+ treeElement,
20
+ }: DragElementParams) {
13
21
  this.offsetX = offsetX;
14
22
  this.offsetY = offsetY;
15
23
 
16
- this.$element = jQuery("<span>").addClass(
17
- "jqtree-title jqtree-dragging",
18
- );
19
-
20
- if (autoEscape) {
21
- this.$element.text(nodeName);
22
- } else {
23
- this.$element.html(nodeName);
24
- }
24
+ this.element = this.createElement(nodeName, autoEscape);
25
25
 
26
- this.$element.css("position", "absolute");
27
- $tree.append(this.$element);
26
+ treeElement.appendChild(this.element);
28
27
  }
29
28
 
30
29
  public move(pageX: number, pageY: number): void {
31
- this.$element.offset({
32
- left: pageX - this.offsetX,
33
- top: pageY - this.offsetY,
34
- });
30
+ this.element.style.left = `${pageX - this.offsetX}px`;
31
+ this.element.style.top = `${pageY - this.offsetY}px`;
35
32
  }
36
33
 
37
34
  public remove(): void {
38
- this.$element.remove();
35
+ this.element.remove();
36
+ }
37
+
38
+ private createElement(nodeName: string, autoEscape: boolean) {
39
+ const element = document.createElement("span");
40
+ element.classList.add("jqtree-title", "jqtree-dragging");
41
+
42
+ if (autoEscape) {
43
+ element.textContent = nodeName;
44
+ } else {
45
+ element.innerHTML = nodeName;
46
+ }
47
+
48
+ element.style.position = "absolute";
49
+
50
+ return element;
39
51
  }
40
52
  }
41
53