jqtree 1.7.1 → 1.7.3
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/.github/workflows/ci.yml +0 -5
- package/.github/workflows/size.yml +24 -0
- package/README.md +1 -1
- package/bower.json +1 -1
- package/docs/Gemfile.lock +15 -13
- package/docs/_config.yml +1 -1
- package/docs/_entries/03_features.md +1 -1
- package/docs/_entries/10_changelog.md +10 -0
- package/docs/_entries/16_closedicon.md +17 -3
- package/docs/_entries/31_openedicon.md +17 -3
- package/docs/package.json +2 -2
- package/docs/pnpm-lock.yaml +106 -130
- package/docs/static/examples/autoescape.js +15 -17
- package/docs/static/examples/autoscroll.js +5 -7
- package/docs/static/examples/button-on-right.js +4 -6
- package/docs/static/examples/custom_html.js +22 -24
- package/docs/static/examples/drag-outside.js +23 -25
- package/docs/static/examples/drag_and_drop.js +4 -6
- package/docs/static/examples/icon_buttons.js +3 -5
- package/docs/static/examples/load_json_data.js +14 -16
- package/docs/static/examples/load_json_data_from_server.js +1 -3
- package/docs/static/examples/load_on_demand.js +3 -5
- package/docs/static/examples/multiple_select.js +19 -21
- package/docs/static/examples/right-to-left.js +2 -4
- package/docs/static/examples/save_state.js +2 -4
- package/docs/tree.jquery.js +2 -2
- package/lib/dataLoader.js +3 -3
- package/lib/dragAndDropHandler.js +1 -1
- package/lib/elementsRenderer.js +1 -1
- package/lib/keyHandler.js +1 -1
- package/lib/mouse.widget.js +1 -1
- package/lib/node.js +4 -4
- package/lib/nodeElement.js +1 -1
- package/lib/playwright/coverage.js +11 -16
- package/lib/playwright/playwright.test.js +37 -58
- package/lib/playwright/testUtils.js +27 -44
- package/lib/saveStateHandler.js +1 -1
- package/lib/scrollHandler.js +1 -1
- package/lib/selectNodeHandler.js +1 -1
- package/lib/simple.widget.js +3 -3
- package/lib/test/jqTree/accessibility.test.js +2 -2
- package/lib/test/jqTree/events.test.js +2 -2
- package/lib/test/jqTree/loadOnDemand.test.js +5 -4
- package/lib/test/jqTree/methods.test.js +2 -2
- package/lib/test/jqTree/options.test.js +43 -2
- package/lib/test/node.test.js +2 -2
- package/lib/tree.jquery.js +5 -5
- package/lib/version.js +1 -1
- package/package.json +31 -30
- package/src/elementsRenderer.ts +17 -17
- package/src/jqtreeOptions.ts +2 -2
- package/src/test/.eslintrc +2 -1
- package/src/test/jqTree/loadOnDemand.test.ts +6 -5
- package/src/test/jqTree/methods.test.ts +26 -26
- package/src/test/jqTree/options.test.ts +61 -8
- package/src/tree.jquery.d.ts +20 -11
- package/src/version.ts +1 -1
- package/tree.jquery.debug.js +45 -45
- package/tree.jquery.debug.js.map +1 -1
- package/tree.jquery.js +2 -2
- package/tree.jquery.js.map +1 -1
package/src/tree.jquery.d.ts
CHANGED
|
@@ -34,6 +34,11 @@ interface ClickNodeEvent {
|
|
|
34
34
|
previous_node?: INode;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
interface SelectNodeOptions {
|
|
38
|
+
mustToggle?: boolean;
|
|
39
|
+
mustSetFocus?: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
37
42
|
interface SavedState {
|
|
38
43
|
open_nodes: NodeId[];
|
|
39
44
|
selected_node: NodeId[];
|
|
@@ -44,7 +49,7 @@ interface IJQTreeOptions {
|
|
|
44
49
|
autoEscape?: boolean;
|
|
45
50
|
autoOpen?: boolean | number | string;
|
|
46
51
|
buttonLeft?: boolean;
|
|
47
|
-
closedIcon?: string |
|
|
52
|
+
closedIcon?: string | HTMLElement | JQuery<HTMLElement>;
|
|
48
53
|
data?: NodeData[];
|
|
49
54
|
dataFilter?: (data: NodeData[]) => NodeData[];
|
|
50
55
|
dataUrl?: DataUrl;
|
|
@@ -61,7 +66,7 @@ interface IJQTreeOptions {
|
|
|
61
66
|
onLoading?: (isLoading: boolean, node: INode, $el: JQuery) => void;
|
|
62
67
|
onGetStateFromStorage?: () => string;
|
|
63
68
|
onSetStateFromStorage?: (data: string) => void;
|
|
64
|
-
openedIcon?: string |
|
|
69
|
+
openedIcon?: string | HTMLElement | JQuery<HTMLElement>;
|
|
65
70
|
openFolderDelay?: number | false;
|
|
66
71
|
rtl?: boolean;
|
|
67
72
|
selectable?: boolean;
|
|
@@ -79,17 +84,17 @@ interface IJQTreePlugin {
|
|
|
79
84
|
(
|
|
80
85
|
behavior: "addNodeAfter",
|
|
81
86
|
newNodeInfo: NodeData,
|
|
82
|
-
existingNode: INode
|
|
87
|
+
existingNode: INode,
|
|
83
88
|
): INode | null;
|
|
84
89
|
(
|
|
85
90
|
behavior: "addNodeBefore",
|
|
86
91
|
newNodeInfo: NodeData,
|
|
87
|
-
existingNode: INode
|
|
92
|
+
existingNode: INode,
|
|
88
93
|
): INode | null;
|
|
89
94
|
(
|
|
90
95
|
behavior: "addParentNode",
|
|
91
96
|
newNodeInfo: NodeData,
|
|
92
|
-
existingNode: INode
|
|
97
|
+
existingNode: INode,
|
|
93
98
|
): INode | null;
|
|
94
99
|
(behavior: "addToSelection", node: INode, mustSetFocus?: boolean): JQuery;
|
|
95
100
|
(behavior: "appendNode", newNodeInfo: NodeData, parentNode?: INode): INode;
|
|
@@ -97,7 +102,7 @@ interface IJQTreePlugin {
|
|
|
97
102
|
(behavior: "destroy"): void;
|
|
98
103
|
(
|
|
99
104
|
behavior: "getNodeByCallback",
|
|
100
|
-
callback: (node: INode) => boolean
|
|
105
|
+
callback: (node: INode) => boolean,
|
|
101
106
|
): INode | null;
|
|
102
107
|
(behavior: "getNodeByHtmlElement", element: Element | JQuery): INode | null;
|
|
103
108
|
(behavior: "getNodeById", id: NodeId): INode | null;
|
|
@@ -116,14 +121,14 @@ interface IJQTreePlugin {
|
|
|
116
121
|
behavior: "loadDataFromUrl",
|
|
117
122
|
param1?: string | null | INode,
|
|
118
123
|
param2?: INode | null | (() => void),
|
|
119
|
-
param3?: () => void
|
|
124
|
+
param3?: () => void,
|
|
120
125
|
): JQuery;
|
|
121
126
|
(behavior: "moveDown"): JQuery;
|
|
122
127
|
(
|
|
123
128
|
behavior: "moveNode",
|
|
124
129
|
node: INode,
|
|
125
130
|
targetNode: INode,
|
|
126
|
-
position: string
|
|
131
|
+
position: string,
|
|
127
132
|
): JQuery;
|
|
128
133
|
(behavior: "moveUp"): JQuery;
|
|
129
134
|
(behavior: "openNode", node: INode): JQuery;
|
|
@@ -131,13 +136,13 @@ interface IJQTreePlugin {
|
|
|
131
136
|
(
|
|
132
137
|
behavior: "openNode",
|
|
133
138
|
node: INode,
|
|
134
|
-
onFinished: (node: INode) => void
|
|
139
|
+
onFinished: (node: INode) => void,
|
|
135
140
|
): JQuery;
|
|
136
141
|
(
|
|
137
142
|
behavior: "openNode",
|
|
138
143
|
node: INode,
|
|
139
144
|
slide: boolean,
|
|
140
|
-
onFinished?: (node: INode) => void
|
|
145
|
+
onFinished?: (node: INode) => void,
|
|
141
146
|
): JQuery;
|
|
142
147
|
(behavior: "prependNode", newNodeInfo: NodeData, parentNode?: INode): INode;
|
|
143
148
|
(behavior: "refresh"): JQuery;
|
|
@@ -145,7 +150,11 @@ interface IJQTreePlugin {
|
|
|
145
150
|
(behavior: "removeFromSelection", node: INode): JQuery;
|
|
146
151
|
(behavior: "removeNode", node: INode): JQuery;
|
|
147
152
|
(behavior: "scrollToNode", node: INode): JQuery;
|
|
148
|
-
(
|
|
153
|
+
(
|
|
154
|
+
behavior: "selectNode",
|
|
155
|
+
node: INode | null,
|
|
156
|
+
optionsParam?: SelectNodeOptions,
|
|
157
|
+
): JQuery;
|
|
149
158
|
(behavior: "setOption", option: string, value: unknown): JQuery;
|
|
150
159
|
(behavior: "setState", options: Record<string, unknown>): JQuery;
|
|
151
160
|
(behavior: "toggle", node: INode, slideParam?: boolean): JQuery;
|
package/src/version.ts
CHANGED
package/tree.jquery.debug.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
JqTree 1.7.
|
|
2
|
+
JqTree 1.7.3
|
|
3
3
|
|
|
4
4
|
Copyright 2023 Marco Braak
|
|
5
5
|
|
|
@@ -20,62 +20,62 @@ limitations under the License.
|
|
|
20
20
|
var jqtree = (function (exports) {
|
|
21
21
|
'use strict';
|
|
22
22
|
|
|
23
|
-
function _iterableToArrayLimit(
|
|
24
|
-
var
|
|
25
|
-
if (null !=
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
function _iterableToArrayLimit(r, l) {
|
|
24
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
25
|
+
if (null != t) {
|
|
26
|
+
var e,
|
|
27
|
+
n,
|
|
28
|
+
i,
|
|
29
|
+
u,
|
|
30
|
+
a = [],
|
|
31
|
+
f = !0,
|
|
32
|
+
o = !1;
|
|
33
33
|
try {
|
|
34
|
-
if (
|
|
35
|
-
if (Object(
|
|
36
|
-
|
|
37
|
-
} else for (; !(
|
|
38
|
-
} catch (
|
|
39
|
-
|
|
34
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
35
|
+
if (Object(t) !== t) return;
|
|
36
|
+
f = !1;
|
|
37
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
38
|
+
} catch (r) {
|
|
39
|
+
o = !0, n = r;
|
|
40
40
|
} finally {
|
|
41
41
|
try {
|
|
42
|
-
if (!
|
|
42
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
43
43
|
} finally {
|
|
44
|
-
if (
|
|
44
|
+
if (o) throw n;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
return
|
|
47
|
+
return a;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
function ownKeys(
|
|
51
|
-
var
|
|
50
|
+
function ownKeys(e, r) {
|
|
51
|
+
var t = Object.keys(e);
|
|
52
52
|
if (Object.getOwnPropertySymbols) {
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
return Object.getOwnPropertyDescriptor(
|
|
56
|
-
})),
|
|
53
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
54
|
+
r && (o = o.filter(function (r) {
|
|
55
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
56
|
+
})), t.push.apply(t, o);
|
|
57
57
|
}
|
|
58
|
-
return
|
|
58
|
+
return t;
|
|
59
59
|
}
|
|
60
|
-
function _objectSpread2(
|
|
61
|
-
for (var
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
_defineProperty(
|
|
65
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
66
|
-
Object.defineProperty(
|
|
60
|
+
function _objectSpread2(e) {
|
|
61
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
62
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
63
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
64
|
+
_defineProperty(e, r, t[r]);
|
|
65
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
66
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
return
|
|
69
|
+
return e;
|
|
70
70
|
}
|
|
71
|
-
function _typeof(
|
|
71
|
+
function _typeof(o) {
|
|
72
72
|
"@babel/helpers - typeof";
|
|
73
73
|
|
|
74
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
75
|
-
return typeof
|
|
76
|
-
} : function (
|
|
77
|
-
return
|
|
78
|
-
}, _typeof(
|
|
74
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
75
|
+
return typeof o;
|
|
76
|
+
} : function (o) {
|
|
77
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
78
|
+
}, _typeof(o);
|
|
79
79
|
}
|
|
80
80
|
function _classCallCheck(instance, Constructor) {
|
|
81
81
|
if (!(instance instanceof Constructor)) {
|
|
@@ -292,7 +292,7 @@ var jqtree = (function (exports) {
|
|
|
292
292
|
return typeof key === "symbol" ? key : String(key);
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
var version = "1.7.
|
|
295
|
+
var version = "1.7.3";
|
|
296
296
|
|
|
297
297
|
var Position = /*#__PURE__*/function (Position) {
|
|
298
298
|
Position[Position["Before"] = 1] = "Before";
|
|
@@ -777,7 +777,7 @@ var jqtree = (function (exports) {
|
|
|
777
777
|
var _this = this;
|
|
778
778
|
this.iterate(function (child) {
|
|
779
779
|
var _this$tree;
|
|
780
|
-
(_this$tree = _this.tree) === null || _this$tree === void 0
|
|
780
|
+
(_this$tree = _this.tree) === null || _this$tree === void 0 || _this$tree.removeNodeFromIndex(child);
|
|
781
781
|
return true;
|
|
782
782
|
});
|
|
783
783
|
this.children = [];
|
|
@@ -967,14 +967,14 @@ var jqtree = (function (exports) {
|
|
|
967
967
|
var _this$tree2;
|
|
968
968
|
this.parent = parent;
|
|
969
969
|
this.tree = parent.tree;
|
|
970
|
-
(_this$tree2 = this.tree) === null || _this$tree2 === void 0
|
|
970
|
+
(_this$tree2 = this.tree) === null || _this$tree2 === void 0 || _this$tree2.addNodeToIndex(this);
|
|
971
971
|
}
|
|
972
972
|
}, {
|
|
973
973
|
key: "doRemoveChild",
|
|
974
974
|
value: function doRemoveChild(node) {
|
|
975
975
|
var _this$tree3;
|
|
976
976
|
this.children.splice(this.getChildIndex(node), 1);
|
|
977
|
-
(_this$tree3 = this.tree) === null || _this$tree3 === void 0
|
|
977
|
+
(_this$tree3 = this.tree) === null || _this$tree3 === void 0 || _this$tree3.removeNodeFromIndex(node);
|
|
978
978
|
}
|
|
979
979
|
}, {
|
|
980
980
|
key: "getNodeClass",
|