jqtree 1.8.11 → 1.9.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.
- package/bower.json +1 -1
- package/package.json +45 -51
- package/pnpm-workspace.yaml +5 -0
- package/src/animation.ts +48 -0
- package/src/dataLoader.ts +38 -48
- package/src/dragAndDropHandler/dragElement.ts +11 -11
- package/src/dragAndDropHandler/generateHitAreas.ts +4 -3
- package/src/dragAndDropHandler/index.ts +119 -120
- package/src/dragAndDropHandler/iterateVisibleNodes.ts +1 -1
- package/src/dragAndDropHandler/types.ts +1 -1
- package/src/elementsRenderer.ts +71 -78
- package/src/jqtreeMethodTypes.ts +2 -2
- package/src/jqtreeOptions.ts +3 -2
- package/src/keyHandler.ts +34 -34
- package/src/mouseHandler.ts +118 -119
- package/src/node.ts +22 -22
- package/src/nodeElement/borderDropHint.ts +6 -6
- package/src/nodeElement/folderElement.ts +33 -25
- package/src/nodeElement/ghostDropHint.ts +24 -24
- package/src/nodeElement/index.ts +19 -18
- package/src/positionUtils.ts +18 -0
- package/src/saveStateHandler.ts +56 -55
- package/src/scrollHandler/containerScrollParent.ts +24 -22
- package/src/scrollHandler/documentScrollParent.ts +29 -28
- package/src/scrollHandler/scrollParent.ts +41 -41
- package/src/scrollHandler.ts +23 -22
- package/src/selectNodeHandler.ts +28 -28
- package/src/tree.jquery.d.ts +3 -2
- package/src/tree.jquery.ts +456 -368
- package/src/util.ts +0 -14
- package/src/version.ts +1 -1
- package/tree.jquery.debug.js +1094 -973
- package/tree.jquery.debug.js.map +1 -1
- package/tree.jquery.js +2 -2
- package/tree.jquery.js.map +1 -1
- package/eslint.config.mjs +0 -98
- package/src/simple.widget.ts +0 -134
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type {
|
|
3
2
|
HorizontalScrollDirection,
|
|
4
|
-
ScrollParent,
|
|
5
3
|
VerticalScrollDirection,
|
|
6
4
|
} from "./scrollParent";
|
|
7
5
|
|
|
6
|
+
import { getOffsetTop } from "../positionUtils";
|
|
7
|
+
import { ScrollParent } from "./scrollParent";
|
|
8
|
+
|
|
8
9
|
interface Params {
|
|
9
10
|
refreshHitAreas: () => void;
|
|
10
11
|
treeElement: HTMLElement;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export default class DocumentScrollParent extends ScrollParent {
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
private
|
|
15
|
+
private _documentScrollHeight?: number;
|
|
16
|
+
private _documentScrollWidth?: number;
|
|
17
|
+
private _treeElement: HTMLElement;
|
|
17
18
|
|
|
18
19
|
constructor({ refreshHitAreas, treeElement }: Params) {
|
|
19
20
|
super({ container: document.documentElement, refreshHitAreas });
|
|
20
21
|
|
|
21
|
-
this.
|
|
22
|
+
this._treeElement = treeElement;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
public scrollToY(top: number): void {
|
|
25
|
-
const treeTop = getOffsetTop(this.
|
|
26
|
+
const treeTop = getOffsetTop(this._treeElement);
|
|
26
27
|
|
|
27
28
|
super.scrollToY(top + treeTop);
|
|
28
29
|
}
|
|
@@ -30,20 +31,20 @@ export default class DocumentScrollParent extends ScrollParent {
|
|
|
30
31
|
public stopScrolling() {
|
|
31
32
|
super.stopScrolling();
|
|
32
33
|
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
34
|
+
this._documentScrollHeight = undefined;
|
|
35
|
+
this._documentScrollWidth = undefined;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
protected
|
|
38
|
+
protected _getNewHorizontalScrollDirection(
|
|
38
39
|
pageX: number,
|
|
39
40
|
): HorizontalScrollDirection | undefined {
|
|
40
|
-
const scrollLeft = this.
|
|
41
|
+
const scrollLeft = this._container.scrollLeft;
|
|
41
42
|
const windowWidth = window.innerWidth;
|
|
42
43
|
|
|
43
44
|
const isNearRightEdge = pageX > windowWidth - 20;
|
|
44
45
|
const isNearLeftEdge = pageX - scrollLeft < 20;
|
|
45
46
|
|
|
46
|
-
if (isNearRightEdge && this.
|
|
47
|
+
if (isNearRightEdge && this._canScrollRight()) {
|
|
47
48
|
return "right";
|
|
48
49
|
}
|
|
49
50
|
|
|
@@ -54,10 +55,10 @@ export default class DocumentScrollParent extends ScrollParent {
|
|
|
54
55
|
return undefined;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
protected
|
|
58
|
+
protected _getNewVerticalScrollDirection(
|
|
58
59
|
pageY: number,
|
|
59
60
|
): undefined | VerticalScrollDirection {
|
|
60
|
-
const scrollTop = this.
|
|
61
|
+
const scrollTop = this._container.scrollTop;
|
|
61
62
|
const distanceTop = pageY - scrollTop;
|
|
62
63
|
|
|
63
64
|
if (distanceTop < 20) {
|
|
@@ -66,38 +67,38 @@ export default class DocumentScrollParent extends ScrollParent {
|
|
|
66
67
|
|
|
67
68
|
const windowHeight = window.innerHeight;
|
|
68
69
|
|
|
69
|
-
if (windowHeight - (pageY - scrollTop) < 20 && this.
|
|
70
|
+
if (windowHeight - (pageY - scrollTop) < 20 && this._canScrollDown()) {
|
|
70
71
|
return "bottom";
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
return undefined;
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
private
|
|
77
|
+
private _canScrollDown() {
|
|
77
78
|
return (
|
|
78
|
-
this.
|
|
79
|
-
this.
|
|
79
|
+
this._container.scrollTop + this._container.clientHeight <
|
|
80
|
+
this._getDocumentScrollHeight()
|
|
80
81
|
);
|
|
81
82
|
}
|
|
82
83
|
|
|
83
|
-
private
|
|
84
|
+
private _canScrollRight() {
|
|
84
85
|
return (
|
|
85
|
-
this.
|
|
86
|
-
this.
|
|
86
|
+
this._container.scrollLeft + this._container.clientWidth <
|
|
87
|
+
this._getDocumentScrollWidth()
|
|
87
88
|
);
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
private
|
|
91
|
+
private _getDocumentScrollHeight() {
|
|
91
92
|
// Store the original scroll height because the scroll height can increase when the drag element is moved beyond the scroll height.
|
|
92
|
-
this.
|
|
93
|
+
this._documentScrollHeight ??= this._container.scrollHeight;
|
|
93
94
|
|
|
94
|
-
return this.
|
|
95
|
+
return this._documentScrollHeight;
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
private
|
|
98
|
+
private _getDocumentScrollWidth() {
|
|
98
99
|
// Store the original scroll width because the scroll width can increase when the drag element is moved beyond the scroll width.
|
|
99
|
-
this.
|
|
100
|
+
this._documentScrollWidth ??= this._container.scrollWidth;
|
|
100
101
|
|
|
101
|
-
return this.
|
|
102
|
+
return this._documentScrollWidth;
|
|
102
103
|
}
|
|
103
104
|
}
|
|
@@ -7,33 +7,33 @@ interface ConstructorParams {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export abstract class ScrollParent {
|
|
10
|
-
protected
|
|
11
|
-
protected
|
|
12
|
-
protected
|
|
10
|
+
protected _container: HTMLElement;
|
|
11
|
+
protected _horizontalScrollDirection?: HorizontalScrollDirection;
|
|
12
|
+
protected _horizontalScrollTimeout?: number;
|
|
13
13
|
|
|
14
|
-
protected
|
|
15
|
-
protected
|
|
16
|
-
protected
|
|
14
|
+
protected _refreshHitAreas: () => void;
|
|
15
|
+
protected _verticalScrollDirection?: VerticalScrollDirection;
|
|
16
|
+
protected _verticalScrollTimeout?: number;
|
|
17
17
|
|
|
18
18
|
constructor({ container, refreshHitAreas }: ConstructorParams) {
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
19
|
+
this._container = container;
|
|
20
|
+
this._refreshHitAreas = refreshHitAreas;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
public checkHorizontalScrolling(pageX: number): void {
|
|
24
24
|
const newHorizontalScrollDirection =
|
|
25
|
-
this.
|
|
25
|
+
this._getNewHorizontalScrollDirection(pageX);
|
|
26
26
|
|
|
27
|
-
if (this.
|
|
28
|
-
this.
|
|
27
|
+
if (this._horizontalScrollDirection !== newHorizontalScrollDirection) {
|
|
28
|
+
this._horizontalScrollDirection = newHorizontalScrollDirection;
|
|
29
29
|
|
|
30
|
-
if (this.
|
|
31
|
-
window.clearTimeout(this.
|
|
30
|
+
if (this._horizontalScrollTimeout != null) {
|
|
31
|
+
window.clearTimeout(this._horizontalScrollTimeout);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
if (newHorizontalScrollDirection) {
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
35
|
+
this._horizontalScrollTimeout = window.setTimeout(
|
|
36
|
+
this._scrollHorizontally.bind(this),
|
|
37
37
|
40,
|
|
38
38
|
);
|
|
39
39
|
}
|
|
@@ -42,19 +42,19 @@ export abstract class ScrollParent {
|
|
|
42
42
|
|
|
43
43
|
public checkVerticalScrolling(pageY: number) {
|
|
44
44
|
const newVerticalScrollDirection =
|
|
45
|
-
this.
|
|
45
|
+
this._getNewVerticalScrollDirection(pageY);
|
|
46
46
|
|
|
47
|
-
if (this.
|
|
48
|
-
this.
|
|
47
|
+
if (this._verticalScrollDirection !== newVerticalScrollDirection) {
|
|
48
|
+
this._verticalScrollDirection = newVerticalScrollDirection;
|
|
49
49
|
|
|
50
|
-
if (this.
|
|
51
|
-
window.clearTimeout(this.
|
|
52
|
-
this.
|
|
50
|
+
if (this._verticalScrollTimeout != null) {
|
|
51
|
+
window.clearTimeout(this._verticalScrollTimeout);
|
|
52
|
+
this._verticalScrollTimeout = undefined;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
if (newVerticalScrollDirection) {
|
|
56
|
-
this.
|
|
57
|
-
this.
|
|
56
|
+
this._verticalScrollTimeout = window.setTimeout(
|
|
57
|
+
this._scrollVertically.bind(this),
|
|
58
58
|
40,
|
|
59
59
|
);
|
|
60
60
|
}
|
|
@@ -62,56 +62,56 @@ export abstract class ScrollParent {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
public getScrollLeft(): number {
|
|
65
|
-
return this.
|
|
65
|
+
return this._container.scrollLeft;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
public scrollToY(top: number): void {
|
|
69
|
-
this.
|
|
69
|
+
this._container.scrollTop = top;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
public stopScrolling() {
|
|
73
|
-
this.
|
|
74
|
-
this.
|
|
73
|
+
this._horizontalScrollDirection = undefined;
|
|
74
|
+
this._verticalScrollDirection = undefined;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
protected abstract
|
|
77
|
+
protected abstract _getNewHorizontalScrollDirection(
|
|
78
78
|
pageX: number,
|
|
79
79
|
): HorizontalScrollDirection | undefined;
|
|
80
|
-
protected abstract
|
|
80
|
+
protected abstract _getNewVerticalScrollDirection(
|
|
81
81
|
pageY: number,
|
|
82
82
|
): undefined | VerticalScrollDirection;
|
|
83
83
|
|
|
84
|
-
protected
|
|
85
|
-
if (!this.
|
|
84
|
+
protected _scrollHorizontally() {
|
|
85
|
+
if (!this._horizontalScrollDirection) {
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
const distance = this.
|
|
90
|
-
this.
|
|
89
|
+
const distance = this._horizontalScrollDirection === "left" ? -20 : 20;
|
|
90
|
+
this._container.scrollBy({
|
|
91
91
|
behavior: "instant",
|
|
92
92
|
left: distance,
|
|
93
93
|
top: 0,
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
this.
|
|
96
|
+
this._refreshHitAreas();
|
|
97
97
|
|
|
98
|
-
setTimeout(this.
|
|
98
|
+
setTimeout(this._scrollHorizontally.bind(this), 40);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
protected
|
|
102
|
-
if (!this.
|
|
101
|
+
protected _scrollVertically() {
|
|
102
|
+
if (!this._verticalScrollDirection) {
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
const distance = this.
|
|
107
|
-
this.
|
|
106
|
+
const distance = this._verticalScrollDirection === "top" ? -20 : 20;
|
|
107
|
+
this._container.scrollBy({
|
|
108
108
|
behavior: "instant",
|
|
109
109
|
left: 0,
|
|
110
110
|
top: distance,
|
|
111
111
|
});
|
|
112
112
|
|
|
113
|
-
this.
|
|
113
|
+
this._refreshHitAreas();
|
|
114
114
|
|
|
115
|
-
setTimeout(this.
|
|
115
|
+
setTimeout(this._scrollVertically.bind(this), 40);
|
|
116
116
|
}
|
|
117
117
|
}
|
package/src/scrollHandler.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { PositionInfo } from "./mouseUtils";
|
|
1
|
+
import type { PositionInfo } from "./mouseUtils";
|
|
2
|
+
import type { ScrollParent } from "./scrollHandler/scrollParent";
|
|
3
|
+
|
|
2
4
|
import createScrollParent from "./scrollHandler/createScrollParent";
|
|
3
|
-
import { ScrollParent } from "./scrollHandler/scrollParent";
|
|
4
5
|
|
|
5
6
|
interface ScrollHandlerParams {
|
|
6
7
|
refreshHitAreas: () => void;
|
|
@@ -8,47 +9,47 @@ interface ScrollHandlerParams {
|
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export default class ScrollHandler {
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
private
|
|
12
|
+
private _refreshHitAreas: () => void;
|
|
13
|
+
private _scrollParent?: ScrollParent;
|
|
14
|
+
private _treeElement: HTMLElement;
|
|
14
15
|
|
|
15
16
|
constructor({ refreshHitAreas, treeElement }: ScrollHandlerParams) {
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
17
|
+
this._refreshHitAreas = refreshHitAreas;
|
|
18
|
+
this._scrollParent = undefined;
|
|
19
|
+
this._treeElement = treeElement;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
public checkScrolling(positionInfo: PositionInfo): void {
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
23
|
+
this._checkVerticalScrolling(positionInfo);
|
|
24
|
+
this._checkHorizontalScrolling(positionInfo);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
public getScrollLeft(): number {
|
|
27
|
-
return this.
|
|
28
|
+
return this._getScrollParent().getScrollLeft();
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
public scrollToY(top: number): void {
|
|
31
|
-
this.
|
|
32
|
+
this._getScrollParent().scrollToY(top);
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
public stopScrolling() {
|
|
35
|
-
this.
|
|
36
|
+
this._getScrollParent().stopScrolling();
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
private
|
|
39
|
-
this.
|
|
39
|
+
private _checkHorizontalScrolling(positionInfo: PositionInfo): void {
|
|
40
|
+
this._getScrollParent().checkHorizontalScrolling(positionInfo.pageX);
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
private
|
|
43
|
-
this.
|
|
43
|
+
private _checkVerticalScrolling(positionInfo: PositionInfo): void {
|
|
44
|
+
this._getScrollParent().checkVerticalScrolling(positionInfo.pageY);
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
private
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
47
|
+
private _getScrollParent(): ScrollParent {
|
|
48
|
+
this._scrollParent ??= createScrollParent(
|
|
49
|
+
this._treeElement,
|
|
50
|
+
this._refreshHitAreas,
|
|
50
51
|
);
|
|
51
52
|
|
|
52
|
-
return this.
|
|
53
|
+
return this._scrollParent;
|
|
53
54
|
}
|
|
54
55
|
}
|
package/src/selectNodeHandler.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { GetNodeById } from "./jqtreeMethodTypes";
|
|
2
|
-
import { Node } from "./node";
|
|
1
|
+
import type { GetNodeById } from "./jqtreeMethodTypes";
|
|
2
|
+
import type { Node } from "./node";
|
|
3
3
|
|
|
4
4
|
interface SelectNodeHandlerParameters {
|
|
5
5
|
getNodeById: GetNodeById;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export default class SelectNodeHandler {
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
private
|
|
9
|
+
private _getNodeById: GetNodeById;
|
|
10
|
+
private _selectedNodes: Set<NodeId>;
|
|
11
|
+
private _selectedSingleNode: Node | null;
|
|
12
12
|
|
|
13
13
|
constructor({ getNodeById }: SelectNodeHandlerParameters) {
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
14
|
+
this._getNodeById = getNodeById;
|
|
15
|
+
this._selectedNodes = new Set<NodeId>();
|
|
16
16
|
this.clear();
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
public addToSelection(node: Node): void {
|
|
20
20
|
if (node.id != null) {
|
|
21
|
-
this.
|
|
21
|
+
this._selectedNodes.add(node.id);
|
|
22
22
|
} else {
|
|
23
|
-
this.
|
|
23
|
+
this._selectedSingleNode = node;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
public clear(): void {
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
28
|
+
this._selectedNodes.clear();
|
|
29
|
+
this._selectedSingleNode = null;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
public getSelectedNode(): false | Node {
|
|
@@ -40,13 +40,13 @@ export default class SelectNodeHandler {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
public getSelectedNodes(): Node[] {
|
|
43
|
-
if (this.
|
|
44
|
-
return [this.
|
|
43
|
+
if (this._selectedSingleNode) {
|
|
44
|
+
return [this._selectedSingleNode];
|
|
45
45
|
} else {
|
|
46
46
|
const selectedNodes: Node[] = [];
|
|
47
47
|
|
|
48
|
-
this.
|
|
49
|
-
const node = this.
|
|
48
|
+
this._selectedNodes.forEach((id) => {
|
|
49
|
+
const node = this._getNodeById(id);
|
|
50
50
|
if (node) {
|
|
51
51
|
selectedNodes.push(node);
|
|
52
52
|
}
|
|
@@ -57,17 +57,17 @@ export default class SelectNodeHandler {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
public getSelectedNodesUnder(parent: Node): Node[] {
|
|
60
|
-
if (this.
|
|
61
|
-
if (parent.isParentOf(this.
|
|
62
|
-
return [this.
|
|
60
|
+
if (this._selectedSingleNode) {
|
|
61
|
+
if (parent.isParentOf(this._selectedSingleNode)) {
|
|
62
|
+
return [this._selectedSingleNode];
|
|
63
63
|
} else {
|
|
64
64
|
return [];
|
|
65
65
|
}
|
|
66
66
|
} else {
|
|
67
67
|
const selectedNodes: Node[] = [];
|
|
68
68
|
|
|
69
|
-
this.
|
|
70
|
-
const node = this.
|
|
69
|
+
this._selectedNodes.forEach((id) => {
|
|
70
|
+
const node = this._getNodeById(id);
|
|
71
71
|
if (node && parent.isParentOf(node)) {
|
|
72
72
|
selectedNodes.push(node);
|
|
73
73
|
}
|
|
@@ -79,9 +79,9 @@ export default class SelectNodeHandler {
|
|
|
79
79
|
|
|
80
80
|
public isNodeSelected(node: Node): boolean {
|
|
81
81
|
if (node.id != null) {
|
|
82
|
-
return this.
|
|
83
|
-
} else if (this.
|
|
84
|
-
return this.
|
|
82
|
+
return this._selectedNodes.has(node.id);
|
|
83
|
+
} else if (this._selectedSingleNode) {
|
|
84
|
+
return this._selectedSingleNode.element === node.element;
|
|
85
85
|
} else {
|
|
86
86
|
return false;
|
|
87
87
|
}
|
|
@@ -90,18 +90,18 @@ export default class SelectNodeHandler {
|
|
|
90
90
|
public removeFromSelection(node: Node, includeChildren = false): void {
|
|
91
91
|
if (node.id == null) {
|
|
92
92
|
if (
|
|
93
|
-
this.
|
|
94
|
-
node.element === this.
|
|
93
|
+
this._selectedSingleNode &&
|
|
94
|
+
node.element === this._selectedSingleNode.element
|
|
95
95
|
) {
|
|
96
|
-
this.
|
|
96
|
+
this._selectedSingleNode = null;
|
|
97
97
|
}
|
|
98
98
|
} else {
|
|
99
|
-
this.
|
|
99
|
+
this._selectedNodes.delete(node.id);
|
|
100
100
|
|
|
101
101
|
if (includeChildren) {
|
|
102
102
|
node.iterate(() => {
|
|
103
103
|
if (node.id != null) {
|
|
104
|
-
this.
|
|
104
|
+
this._selectedNodes.delete(node.id);
|
|
105
105
|
}
|
|
106
106
|
return true;
|
|
107
107
|
});
|
package/src/tree.jquery.d.ts
CHANGED
|
@@ -24,8 +24,8 @@ interface IJQTreeOptions {
|
|
|
24
24
|
onCanMove?: (node: INode) => boolean;
|
|
25
25
|
onCanSelectNode?: (node: INode) => boolean;
|
|
26
26
|
onCreateLi?: (node: INode, el: JQuery, isSelected: boolean) => void;
|
|
27
|
-
onDragMove?: (node: INode, event:
|
|
28
|
-
onDragStop?: (node: INode, event:
|
|
27
|
+
onDragMove?: (node: INode, event: Event | Touch) => void;
|
|
28
|
+
onDragStop?: (node: INode, event: Event | Touch) => void;
|
|
29
29
|
onGetStateFromStorage?: () => string;
|
|
30
30
|
onIsMoveHandle?: (el: JQuery) => boolean;
|
|
31
31
|
onLoadFailed?: (response: JQuery.jqXHR) => void;
|
|
@@ -79,6 +79,7 @@ interface IJQTreePlugin {
|
|
|
79
79
|
(behavior: "getStateFromStorage"): INode | null;
|
|
80
80
|
(behavior: "getTree"): INode;
|
|
81
81
|
(behavior: "getVersion"): string;
|
|
82
|
+
(behavior: "isDragging"): boolean;
|
|
82
83
|
(behavior: "isNodeSelected", node: INode): boolean;
|
|
83
84
|
(behavior: "loadData", data: NodeData[], parentNode?: INode): JQuery;
|
|
84
85
|
(
|