jqtree 1.8.1 → 1.8.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/bower.json +1 -1
- package/package.json +20 -19
- package/src/dragAndDropHandler/generateHitAreas.ts +56 -41
- package/src/nodeElement/ghostDropHint.ts +3 -37
- package/src/nodeElement/index.ts +1 -1
- package/src/saveStateHandler.ts +43 -59
- package/src/version.ts +1 -1
- package/tree.jquery.debug.js +77 -104
- package/tree.jquery.debug.js.map +1 -1
- package/tree.jquery.js +2 -2
- package/tree.jquery.js.map +1 -1
- package/.editorconfig +0 -12
- package/.eslintrc +0 -48
- package/.github/workflows/ci.yml +0 -68
- package/.github/workflows/codeql-analysis.yml +0 -32
- package/.github/workflows/size.yml +0 -24
- package/.github/workflows/static.yml +0 -57
- package/.prettier +0 -3
- package/config/.postcssrc +0 -6
- package/config/babel.config.json +0 -11
- package/config/babel.coverage.config.json +0 -4
- package/config/jest.config.js +0 -24
- package/config/jest.polyfills.js +0 -14
- package/config/playwright.config.js +0 -18
- package/config/production +0 -6
- package/config/rollup.config.mjs +0 -71
- package/css/jqtree.postcss +0 -193
- package/devserver/devserver.js +0 -7
- package/devserver/devserver_scroll.js +0 -8
- package/devserver/index.html +0 -22
- package/devserver/test_index.html +0 -22
- package/devserver/test_scroll.html +0 -28
- package/devserver/test_scroll_container.html +0 -39
- package/docs/.ruby-version +0 -1
- package/docs/Gemfile +0 -5
- package/docs/Gemfile.lock +0 -82
- package/docs/_config.yml +0 -126
- package/docs/_entries/events/index.md +0 -6
- package/docs/_entries/events/tree-click.md +0 -37
- package/docs/_entries/events/tree-close.md +0 -15
- package/docs/_entries/events/tree-contextmenu.md +0 -21
- package/docs/_entries/events/tree-dblclick.md +0 -19
- package/docs/_entries/events/tree-init.md +0 -15
- package/docs/_entries/events/tree-load-data.md +0 -15
- package/docs/_entries/events/tree-loading-data.md +0 -27
- package/docs/_entries/events/tree-move.md +0 -73
- package/docs/_entries/events/tree-open.md +0 -15
- package/docs/_entries/events/tree-refresh.md +0 -12
- package/docs/_entries/events/tree-select.md +0 -28
- package/docs/_entries/functions/addnodeafter.md +0 -20
- package/docs/_entries/functions/addnodebefore.md +0 -8
- package/docs/_entries/functions/addparentnode.md +0 -20
- package/docs/_entries/functions/appendnode.md +0 -50
- package/docs/_entries/functions/closenode.md +0 -23
- package/docs/_entries/functions/destroy.md +0 -12
- package/docs/_entries/functions/getnodebycallback.md +0 -24
- package/docs/_entries/functions/getnodebyhtmlelement.md +0 -29
- package/docs/_entries/functions/getnodebyid.md +0 -21
- package/docs/_entries/functions/getselectednode.md +0 -10
- package/docs/_entries/functions/getstate.md +0 -19
- package/docs/_entries/functions/gettree.md +0 -12
- package/docs/_entries/functions/index.md +0 -6
- package/docs/_entries/functions/is-node-selected.md +0 -11
- package/docs/_entries/functions/isdragging.md +0 -12
- package/docs/_entries/functions/loaddata.md +0 -46
- package/docs/_entries/functions/loaddatafromurl.md +0 -55
- package/docs/_entries/functions/movedown.md +0 -8
- package/docs/_entries/functions/movenode.md +0 -15
- package/docs/_entries/functions/moveup.md +0 -8
- package/docs/_entries/functions/opennode.md +0 -44
- package/docs/_entries/functions/prependnode.md +0 -21
- package/docs/_entries/functions/refresh.md +0 -12
- package/docs/_entries/functions/reload.md +0 -22
- package/docs/_entries/functions/removenode.md +0 -12
- package/docs/_entries/functions/scrolltonode.md +0 -13
- package/docs/_entries/functions/selectnode.md +0 -45
- package/docs/_entries/functions/setoption.md +0 -12
- package/docs/_entries/functions/setstate.md +0 -8
- package/docs/_entries/functions/toggle.md +0 -25
- package/docs/_entries/functions/tojson.md +0 -13
- package/docs/_entries/functions/updatenode.md +0 -50
- package/docs/_entries/general/changelog.md +0 -430
- package/docs/_entries/general/demo.html +0 -28
- package/docs/_entries/general/downloads.md +0 -9
- package/docs/_entries/general/examples.md +0 -8
- package/docs/_entries/general/features.md +0 -15
- package/docs/_entries/general/index.md +0 -7
- package/docs/_entries/general/introduction.md +0 -9
- package/docs/_entries/general/requirements.md +0 -6
- package/docs/_entries/general/tutorial.md +0 -71
- package/docs/_entries/general/usecases.md +0 -15
- package/docs/_entries/multiple_selection/add-to-selection.md +0 -21
- package/docs/_entries/multiple_selection/get-selected-nodes.md +0 -10
- package/docs/_entries/multiple_selection/index.md +0 -9
- package/docs/_entries/multiple_selection/remove-from-selection.md +0 -11
- package/docs/_entries/node/children.md +0 -12
- package/docs/_entries/node/getdata.md +0 -17
- package/docs/_entries/node/getlevel.md +0 -13
- package/docs/_entries/node/getnextnode.md +0 -12
- package/docs/_entries/node/getnextsibling.md +0 -10
- package/docs/_entries/node/getnextvisiblenode.md +0 -15
- package/docs/_entries/node/getpreviousnode.md +0 -12
- package/docs/_entries/node/getprevioussibling.md +0 -10
- package/docs/_entries/node/getpreviousvisiblenode.md +0 -15
- package/docs/_entries/node/index.md +0 -13
- package/docs/_entries/node/parent.md +0 -10
- package/docs/_entries/options/animationspeed.md +0 -7
- package/docs/_entries/options/autoescape.md +0 -6
- package/docs/_entries/options/autoopen.md +0 -28
- package/docs/_entries/options/buttonleft.md +0 -12
- package/docs/_entries/options/closedicon.md +0 -26
- package/docs/_entries/options/data-url.md +0 -45
- package/docs/_entries/options/data.md +0 -46
- package/docs/_entries/options/datafilter.md +0 -17
- package/docs/_entries/options/draganddrop.md +0 -18
- package/docs/_entries/options/index.md +0 -6
- package/docs/_entries/options/keyboardsupport.md +0 -14
- package/docs/_entries/options/oncanmove.md +0 -22
- package/docs/_entries/options/oncanmoveto.md +0 -22
- package/docs/_entries/options/oncanselectnode.md +0 -26
- package/docs/_entries/options/oncreateli.md +0 -22
- package/docs/_entries/options/ondragmove.md +0 -20
- package/docs/_entries/options/ondragstop.md +0 -20
- package/docs/_entries/options/onismovehandle.md +0 -17
- package/docs/_entries/options/onloadfailed.md +0 -15
- package/docs/_entries/options/onloading.md +0 -22
- package/docs/_entries/options/openedicon.md +0 -26
- package/docs/_entries/options/openfolderdelay.md +0 -15
- package/docs/_entries/options/rtl.md +0 -18
- package/docs/_entries/options/savestate.md +0 -39
- package/docs/_entries/options/selectable.md +0 -18
- package/docs/_entries/options/showemptyfolder.md +0 -26
- package/docs/_entries/options/slide.md +0 -12
- package/docs/_entries/options/start_dnd_delay.md +0 -13
- package/docs/_entries/options/tabindex.md +0 -14
- package/docs/_entries/options/usecontextmenu.md +0 -14
- package/docs/_examples/01_load_json_data.html +0 -45
- package/docs/_examples/02_load_json_data_from_server.html +0 -29
- package/docs/_examples/03_drag_and_drop.html +0 -42
- package/docs/_examples/04_save_state.html +0 -46
- package/docs/_examples/05_load_on_demand.html +0 -68
- package/docs/_examples/06_autoescape.html +0 -45
- package/docs/_examples/07_autoscroll.html +0 -42
- package/docs/_examples/08_multiple_select.html +0 -60
- package/docs/_examples/09_custom_html.html +0 -61
- package/docs/_examples/10_icon_buttons.html +0 -26
- package/docs/_examples/11_right-to-left.html +0 -25
- package/docs/_examples/12_button_on_right.html +0 -26
- package/docs/_examples/13_drag_outside.html +0 -48
- package/docs/_examples/14_filter.html +0 -111
- package/docs/_layouts/example.html +0 -7
- package/docs/_layouts/page.html +0 -26
- package/docs/documentation.css +0 -3
- package/docs/index.html +0 -65
- package/docs/package.json +0 -22
- package/docs/pnpm-lock.yaml +0 -892
- package/docs/postcss.config.js +0 -7
- package/docs/static/bower.json +0 -8
- package/docs/static/bower_components/fontawesome/css/all.min.css +0 -9
- package/docs/static/bower_components/fontawesome/webfonts/fa-brands-400.ttf +0 -0
- package/docs/static/bower_components/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
- package/docs/static/bower_components/fontawesome/webfonts/fa-regular-400.ttf +0 -0
- package/docs/static/bower_components/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
- package/docs/static/bower_components/fontawesome/webfonts/fa-solid-900.ttf +0 -0
- package/docs/static/bower_components/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
- package/docs/static/bower_components/fontawesome/webfonts/fa-v4compatibility.ttf +0 -0
- package/docs/static/bower_components/fontawesome/webfonts/fa-v4compatibility.woff2 +0 -0
- package/docs/static/bower_components/jquery/dist/jquery.js +0 -10704
- package/docs/static/bower_components/jquery/dist/jquery.min.js +0 -2
- package/docs/static/bower_components/jquery-mockjax/dist/jquery.mockjax.js +0 -1061
- package/docs/static/documentation.js +0 -26
- package/docs/static/example.postcss +0 -68
- package/docs/static/example_data.js +0 -122
- package/docs/static/examples/autoescape.js +0 -17
- package/docs/static/examples/autoscroll.js +0 -6
- package/docs/static/examples/button-on-right.js +0 -13
- package/docs/static/examples/custom_html.js +0 -27
- package/docs/static/examples/drag-outside.js +0 -37
- package/docs/static/examples/drag_and_drop.js +0 -13
- package/docs/static/examples/filter.js +0 -63
- package/docs/static/examples/icon_buttons.js +0 -12
- package/docs/static/examples/load_json_data.js +0 -16
- package/docs/static/examples/load_json_data_from_server.js +0 -9
- package/docs/static/examples/load_on_demand.js +0 -19
- package/docs/static/examples/multiple_select.js +0 -23
- package/docs/static/examples/right-to-left.js +0 -11
- package/docs/static/examples/save_state.js +0 -11
- package/docs/static/monokai.css +0 -70
- package/docs/static/spinner.gif +0 -0
- package/docs/tailwind.config.js +0 -16
- package/sitemap.txt +0 -14
- package/src/playwright/.eslintrc +0 -5
- package/src/playwright/coverage.ts +0 -38
- package/src/playwright/playwright.test.ts +0 -401
- package/src/playwright/playwright.test.ts-snapshots/with-dragAndDrop-moves-a-node-1-Chromium-darwin.png +0 -0
- package/src/playwright/playwright.test.ts-snapshots/with-dragAndDrop-moves-a-node-1-Chromium-linux.png +0 -0
- package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-displays-a-tree-1-Chromium-darwin.png +0 -0
- package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-displays-a-tree-1-Chromium-linux.png +0 -0
- package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-selects-a-node-1-Chromium-darwin.png +0 -0
- package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-selects-a-node-1-Chromium-linux.png +0 -0
- package/src/playwright/testUtils.ts +0 -153
- package/src/test/.eslintrc +0 -17
- package/src/test/global.d.ts +0 -1
- package/src/test/jqTree/accessibility.test.ts +0 -25
- package/src/test/jqTree/create.test.ts +0 -54
- package/src/test/jqTree/events.test.ts +0 -290
- package/src/test/jqTree/keyboard.test.ts +0 -247
- package/src/test/jqTree/loadOnDemand.test.ts +0 -198
- package/src/test/jqTree/methods.test.ts +0 -1491
- package/src/test/jqTree/mouse.test.ts +0 -82
- package/src/test/jqTree/options.test.ts +0 -595
- package/src/test/node.test.ts +0 -1396
- package/src/test/nodeUtils.test.ts +0 -21
- package/src/test/position.test.ts +0 -30
- package/src/test/support/exampleData.ts +0 -23
- package/src/test/support/jqTreeMatchers.ts +0 -68
- package/src/test/support/matchers.d.ts +0 -31
- package/src/test/support/setupTests.ts +0 -5
- package/src/test/support/testUtil.ts +0 -30
- package/src/test/support/treeStructure.ts +0 -39
- package/src/test/util.test.ts +0 -27
- package/tsconfig.json +0 -24
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
$(function () {
|
|
2
|
-
// demo tree
|
|
3
|
-
var data = [
|
|
4
|
-
{
|
|
5
|
-
label: "node1",
|
|
6
|
-
id: 1,
|
|
7
|
-
children: [
|
|
8
|
-
{ label: "child1", id: 2 },
|
|
9
|
-
{ label: "child2", id: 3 },
|
|
10
|
-
],
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
label: "node2",
|
|
14
|
-
id: 4,
|
|
15
|
-
children: [{ label: "child3", id: 5 }],
|
|
16
|
-
},
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
var $tree1 = $("#tree1");
|
|
20
|
-
|
|
21
|
-
$tree1.tree({
|
|
22
|
-
data: data,
|
|
23
|
-
autoOpen: true,
|
|
24
|
-
dragAndDrop: true,
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
#tree1 {
|
|
2
|
-
background-color: #ccc;
|
|
3
|
-
padding: 8px 16px;
|
|
4
|
-
margin-bottom: 16px;
|
|
5
|
-
|
|
6
|
-
&.block-style {
|
|
7
|
-
background-color: #fafafa;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.jqtree-tree .jqtree-loading > div .jqtree-title:after {
|
|
12
|
-
content: url(spinner.gif);
|
|
13
|
-
margin-left: 8px;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
#tree1.jqtree-loading:after {
|
|
17
|
-
content: url(spinner.gif);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
#scroll-container {
|
|
21
|
-
height: 200px;
|
|
22
|
-
overflow-y: scroll;
|
|
23
|
-
-ms-user-select: none;
|
|
24
|
-
user-select: none;
|
|
25
|
-
margin-bottom: 16px;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.block-style {
|
|
29
|
-
ul.jqtree-tree {
|
|
30
|
-
margin-left: 0;
|
|
31
|
-
|
|
32
|
-
ul.jqtree_common {
|
|
33
|
-
margin-left: 2em;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.jqtree-element {
|
|
37
|
-
margin-bottom: 8px;
|
|
38
|
-
background-color: #ddd;
|
|
39
|
-
padding: 8px;
|
|
40
|
-
|
|
41
|
-
.jqtree-title {
|
|
42
|
-
margin-left: 0;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
li.jqtree-selected {
|
|
47
|
-
> .jqtree-element,
|
|
48
|
-
> .jqtree-element:hover {
|
|
49
|
-
background-color: #97bdd6;
|
|
50
|
-
text-shadow: none;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.hidden-node {
|
|
57
|
-
display: none;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.highlight-node > .jqtree-element > .jqtree-title {
|
|
61
|
-
font-weight: bold;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.jqtree-tree {
|
|
65
|
-
.jqtree-toggler {
|
|
66
|
-
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
const ExampleData = {};
|
|
2
|
-
|
|
3
|
-
ExampleData.exampleData = [
|
|
4
|
-
{
|
|
5
|
-
name: "Saurischia",
|
|
6
|
-
id: 1,
|
|
7
|
-
children: [
|
|
8
|
-
{ name: "Herrerasaurians", id: 2 },
|
|
9
|
-
{
|
|
10
|
-
name: "Theropods",
|
|
11
|
-
id: 3,
|
|
12
|
-
children: [
|
|
13
|
-
{ name: "Coelophysoids", id: 4 },
|
|
14
|
-
{ name: "Ceratosaurians", id: 5 },
|
|
15
|
-
{ name: "Spinosauroids", id: 6 },
|
|
16
|
-
{ name: "Carnosaurians", id: 7 },
|
|
17
|
-
{
|
|
18
|
-
name: "Coelurosaurians",
|
|
19
|
-
id: 8,
|
|
20
|
-
children: [
|
|
21
|
-
{ name: "Tyrannosauroids", id: 9 },
|
|
22
|
-
{ name: "Ornithomimosaurians", id: 10 },
|
|
23
|
-
{ name: "Therizinosauroids", id: 11 },
|
|
24
|
-
{ name: "Oviraptorosaurians", id: 12 },
|
|
25
|
-
{ name: "Dromaeosaurids", id: 13 },
|
|
26
|
-
{ name: "Troodontids", id: 14 },
|
|
27
|
-
{ name: "Avialans", id: 15 },
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: "Sauropodomorphs",
|
|
34
|
-
id: 16,
|
|
35
|
-
children: [
|
|
36
|
-
{ name: "Prosauropods", id: 17 },
|
|
37
|
-
{
|
|
38
|
-
name: "Sauropods",
|
|
39
|
-
id: 18,
|
|
40
|
-
children: [
|
|
41
|
-
{ name: "Diplodocoids", id: 19 },
|
|
42
|
-
{
|
|
43
|
-
name: "Macronarians",
|
|
44
|
-
id: 20,
|
|
45
|
-
children: [
|
|
46
|
-
{ name: "Brachiosaurids", id: 21 },
|
|
47
|
-
{ name: "Titanosaurians", id: 22 },
|
|
48
|
-
],
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: "Ornithischians",
|
|
58
|
-
id: 23,
|
|
59
|
-
children: [
|
|
60
|
-
{ name: "Heterodontosaurids", id: 24 },
|
|
61
|
-
{
|
|
62
|
-
name: "Thyreophorans",
|
|
63
|
-
id: 25,
|
|
64
|
-
children: [
|
|
65
|
-
{ name: "Ankylosaurians", id: 26 },
|
|
66
|
-
{ name: "Stegosaurians", id: 27 },
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: "Ornithopods",
|
|
71
|
-
id: 28,
|
|
72
|
-
children: [{ name: "Hadrosaurids", id: 29 }],
|
|
73
|
-
},
|
|
74
|
-
{ name: "Pachycephalosaurians", id: 30 },
|
|
75
|
-
{ name: "Ceratopsians", id: 31 },
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
];
|
|
79
|
-
|
|
80
|
-
ExampleData.getFirstLevelData = function (nodes) {
|
|
81
|
-
if (!nodes) {
|
|
82
|
-
nodes = ExampleData.exampleData;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const data = [];
|
|
86
|
-
|
|
87
|
-
nodes.forEach(function (node) {
|
|
88
|
-
const newNode = { id: node.id, name: node.name };
|
|
89
|
-
|
|
90
|
-
if (node.children) {
|
|
91
|
-
newNode.load_on_demand = true;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
data.push(newNode);
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
return data;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
ExampleData.getChildrenOfNode = function (nodeId) {
|
|
101
|
-
let result = null;
|
|
102
|
-
|
|
103
|
-
function iterate(nodes) {
|
|
104
|
-
nodes.forEach(function (node) {
|
|
105
|
-
if (result) {
|
|
106
|
-
return;
|
|
107
|
-
} else {
|
|
108
|
-
if (node.id == nodeId) {
|
|
109
|
-
result = node;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (node.children) {
|
|
113
|
-
iterate(node.children);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
iterate(ExampleData.exampleData);
|
|
120
|
-
|
|
121
|
-
return ExampleData.getFirstLevelData(result.children);
|
|
122
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
var data = [
|
|
2
|
-
{
|
|
3
|
-
name: "examples",
|
|
4
|
-
children: [
|
|
5
|
-
{ name: '<a href="example1.html">Example 1</a>' },
|
|
6
|
-
{ name: '<a href="example2.html">Example 2</a>' },
|
|
7
|
-
'<a href="example3.html">Example 3</a>'
|
|
8
|
-
]
|
|
9
|
-
}
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
// set autoEscape to false
|
|
13
|
-
$("#tree1").tree({
|
|
14
|
-
data: data,
|
|
15
|
-
autoEscape: false,
|
|
16
|
-
autoOpen: true
|
|
17
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
var $tree = $("#tree1");
|
|
2
|
-
|
|
3
|
-
$tree.tree({
|
|
4
|
-
data: ExampleData.exampleData,
|
|
5
|
-
autoOpen: 1,
|
|
6
|
-
onCreateLi: function (node, $li) {
|
|
7
|
-
// Append a link to the jqtree-element div.
|
|
8
|
-
// The link has an url '#node-[id]' and a data property 'node-id'.
|
|
9
|
-
$li.find(".jqtree-element").append(
|
|
10
|
-
`<a href="#node-${node.id}" class="edit underline font-medium ml-2 hover:text-slate-900" data-node-id="${node.id}">edit</a>`
|
|
11
|
-
);
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
// Handle a click on the edit link
|
|
16
|
-
$tree.on("click", ".edit", function (e) {
|
|
17
|
-
// Get the id from the 'node-id' data property
|
|
18
|
-
var node_id = $(e.target).data("node-id");
|
|
19
|
-
|
|
20
|
-
// Get the node from the tree
|
|
21
|
-
var node = $tree.tree("getNodeById", node_id);
|
|
22
|
-
|
|
23
|
-
if (node) {
|
|
24
|
-
// Display the node name
|
|
25
|
-
alert(node.name);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
$.mockjax({
|
|
2
|
-
url: "*",
|
|
3
|
-
response: function(options) {
|
|
4
|
-
this.responseText = ExampleData.exampleData;
|
|
5
|
-
},
|
|
6
|
-
responseTime: 0
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
var targetCollisionDiv = $("#targetDiv");
|
|
10
|
-
|
|
11
|
-
function isOverTarget(e) {
|
|
12
|
-
return (
|
|
13
|
-
e.clientX > targetCollisionDiv.position().left &&
|
|
14
|
-
e.clientX <
|
|
15
|
-
targetCollisionDiv.position().left +
|
|
16
|
-
targetCollisionDiv.width() &&
|
|
17
|
-
e.clientY > targetCollisionDiv.position().top &&
|
|
18
|
-
e.clientY <
|
|
19
|
-
targetCollisionDiv.position().top + targetCollisionDiv.height()
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function handleMove(node, e) {
|
|
24
|
-
if (isOverTarget(e)) {
|
|
25
|
-
console.log("the node is over the target div");
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function handleStop(node, e) {
|
|
30
|
-
console.log("stopped over target: ", isOverTarget(e));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
$("#tree1").tree({
|
|
34
|
-
dragAndDrop: true,
|
|
35
|
-
onDragMove: handleMove,
|
|
36
|
-
onDragStop: handleStop
|
|
37
|
-
});
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const $tree = $("#tree1");
|
|
2
|
-
|
|
3
|
-
let foundMatch = false;
|
|
4
|
-
|
|
5
|
-
$tree.tree({
|
|
6
|
-
autoOpen: false,
|
|
7
|
-
data: ExampleData.exampleData,
|
|
8
|
-
useContextMenu: false,
|
|
9
|
-
onCreateLi: (node, $el) => {
|
|
10
|
-
if (foundMatch && !node.openForMatch && !node.parent.matches) {
|
|
11
|
-
$el.addClass("hidden-node");
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (node.matches) {
|
|
15
|
-
$el.addClass("highlight-node");
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
$("#search").on("click", () => {
|
|
21
|
-
const searchTerm = $("#search-term").val().toLowerCase();
|
|
22
|
-
const tree = $tree.tree("getTree");
|
|
23
|
-
|
|
24
|
-
if (!searchTerm) {
|
|
25
|
-
foundMatch = false;
|
|
26
|
-
|
|
27
|
-
tree.iterate((node) => {
|
|
28
|
-
node["openForMatch"] = false;
|
|
29
|
-
node["matches"] = false;
|
|
30
|
-
return true;
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
$tree.tree("refresh");
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
foundMatch = false;
|
|
38
|
-
|
|
39
|
-
tree.iterate((node) => {
|
|
40
|
-
const matches = node.name.toLowerCase().includes(searchTerm);
|
|
41
|
-
node["openForMatch"] = matches;
|
|
42
|
-
node["matches"] = matches;
|
|
43
|
-
|
|
44
|
-
if (matches) {
|
|
45
|
-
foundMatch = true;
|
|
46
|
-
|
|
47
|
-
if (node.isFolder()) {
|
|
48
|
-
node.is_open = true;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
let parent = node.parent;
|
|
52
|
-
while (parent) {
|
|
53
|
-
parent["openForMatch"] = true;
|
|
54
|
-
parent.is_open = true;
|
|
55
|
-
parent = parent.parent;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return true;
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
$tree.tree("refresh");
|
|
63
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
$.mockjax({
|
|
2
|
-
url: "*",
|
|
3
|
-
response: function(options) {
|
|
4
|
-
this.responseText = ExampleData.exampleData;
|
|
5
|
-
},
|
|
6
|
-
responseTime: 0
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
$("#tree1").tree({
|
|
10
|
-
closedIcon: $('<i class="fas fa-arrow-circle-right"></i>'),
|
|
11
|
-
openedIcon: $('<i class="fas fa-arrow-circle-down"></i>')
|
|
12
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
$.mockjax({
|
|
2
|
-
url: "*",
|
|
3
|
-
responseTime: 1000,
|
|
4
|
-
response: function(options) {
|
|
5
|
-
if (options.data && options.data.node) {
|
|
6
|
-
this.responseText = ExampleData.getChildrenOfNode(
|
|
7
|
-
options.data.node
|
|
8
|
-
);
|
|
9
|
-
} else {
|
|
10
|
-
this.responseText = ExampleData.getFirstLevelData();
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
var $tree = $("#tree1");
|
|
16
|
-
|
|
17
|
-
$tree.tree({
|
|
18
|
-
saveState: true
|
|
19
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var $tree = $("#tree1");
|
|
2
|
-
$tree.tree({
|
|
3
|
-
data: ExampleData.exampleData,
|
|
4
|
-
autoOpen: true
|
|
5
|
-
});
|
|
6
|
-
$tree.on("tree.click", function(e) {
|
|
7
|
-
// Disable single selection
|
|
8
|
-
e.preventDefault();
|
|
9
|
-
|
|
10
|
-
var selected_node = e.node;
|
|
11
|
-
|
|
12
|
-
if (selected_node.id == undefined) {
|
|
13
|
-
console.log(
|
|
14
|
-
"The multiple selection functions require that nodes have an id"
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if ($tree.tree("isNodeSelected", selected_node)) {
|
|
19
|
-
$tree.tree("removeFromSelection", selected_node);
|
|
20
|
-
} else {
|
|
21
|
-
$tree.tree("addToSelection", selected_node);
|
|
22
|
-
}
|
|
23
|
-
});
|
package/docs/static/monokai.css
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
.highlight .hll { background-color: #49483e }
|
|
2
|
-
.highlight { background: #272822; color: #f8f8f2 }
|
|
3
|
-
.highlight .c { color: #75715e } /* Comment */
|
|
4
|
-
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
|
|
5
|
-
.highlight .k { color: #66d9ef } /* Keyword */
|
|
6
|
-
.highlight .l { color: #ae81ff } /* Literal */
|
|
7
|
-
.highlight .n { color: #f8f8f2 } /* Name */
|
|
8
|
-
.highlight .o { color: #f92672 } /* Operator */
|
|
9
|
-
.highlight .p { color: #f8f8f2 } /* Punctuation */
|
|
10
|
-
.highlight .ch { color: #75715e } /* Comment.Hashbang */
|
|
11
|
-
.highlight .cm { color: #75715e } /* Comment.Multiline */
|
|
12
|
-
.highlight .cp { color: #75715e } /* Comment.Preproc */
|
|
13
|
-
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
|
|
14
|
-
.highlight .c1 { color: #75715e } /* Comment.Single */
|
|
15
|
-
.highlight .cs { color: #75715e } /* Comment.Special */
|
|
16
|
-
.highlight .gd { color: #f92672 } /* Generic.Deleted */
|
|
17
|
-
.highlight .ge { font-style: italic } /* Generic.Emph */
|
|
18
|
-
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
|
|
19
|
-
.highlight .gs { font-weight: bold } /* Generic.Strong */
|
|
20
|
-
.highlight .gu { color: #75715e } /* Generic.Subheading */
|
|
21
|
-
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
|
|
22
|
-
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
|
|
23
|
-
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
|
|
24
|
-
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
|
|
25
|
-
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
|
|
26
|
-
.highlight .kt { color: #66d9ef } /* Keyword.Type */
|
|
27
|
-
.highlight .ld { color: #e6db74 } /* Literal.Date */
|
|
28
|
-
.highlight .m { color: #ae81ff } /* Literal.Number */
|
|
29
|
-
.highlight .s { color: #e6db74 } /* Literal.String */
|
|
30
|
-
.highlight .na { color: #a6e22e } /* Name.Attribute */
|
|
31
|
-
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
|
|
32
|
-
.highlight .nc { color: #a6e22e } /* Name.Class */
|
|
33
|
-
.highlight .no { color: #66d9ef } /* Name.Constant */
|
|
34
|
-
.highlight .nd { color: #a6e22e } /* Name.Decorator */
|
|
35
|
-
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
|
|
36
|
-
.highlight .ne { color: #a6e22e } /* Name.Exception */
|
|
37
|
-
.highlight .nf { color: #a6e22e } /* Name.Function */
|
|
38
|
-
.highlight .nl { color: #f8f8f2 } /* Name.Label */
|
|
39
|
-
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
|
|
40
|
-
.highlight .nx { color: #a6e22e } /* Name.Other */
|
|
41
|
-
.highlight .py { color: #f8f8f2 } /* Name.Property */
|
|
42
|
-
.highlight .nt { color: #f92672 } /* Name.Tag */
|
|
43
|
-
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
|
|
44
|
-
.highlight .ow { color: #f92672 } /* Operator.Word */
|
|
45
|
-
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
|
|
46
|
-
.highlight .mb { color: #ae81ff } /* Literal.Number.Bin */
|
|
47
|
-
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
|
|
48
|
-
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
|
|
49
|
-
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
|
|
50
|
-
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
|
|
51
|
-
.highlight .sa { color: #e6db74 } /* Literal.String.Affix */
|
|
52
|
-
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
|
|
53
|
-
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
|
|
54
|
-
.highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */
|
|
55
|
-
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
|
|
56
|
-
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
|
|
57
|
-
.highlight .se { color: #ae81ff } /* Literal.String.Escape */
|
|
58
|
-
.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
|
|
59
|
-
.highlight .si { color: #e6db74 } /* Literal.String.Interpol */
|
|
60
|
-
.highlight .sx { color: #e6db74 } /* Literal.String.Other */
|
|
61
|
-
.highlight .sr { color: #e6db74 } /* Literal.String.Regex */
|
|
62
|
-
.highlight .s1 { color: #e6db74 } /* Literal.String.Single */
|
|
63
|
-
.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
|
|
64
|
-
.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
|
|
65
|
-
.highlight .fm { color: #a6e22e } /* Name.Function.Magic */
|
|
66
|
-
.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
|
|
67
|
-
.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
|
|
68
|
-
.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
|
|
69
|
-
.highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */
|
|
70
|
-
.highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */
|
package/docs/static/spinner.gif
DELETED
|
Binary file
|
package/docs/tailwind.config.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
content: [
|
|
3
|
-
"./_layouts/**/*.html",
|
|
4
|
-
"./index.html",
|
|
5
|
-
"./_examples/**/*.html",
|
|
6
|
-
"./static/examples/*.js",
|
|
7
|
-
],
|
|
8
|
-
theme: {
|
|
9
|
-
extend: {
|
|
10
|
-
maxWidth: {
|
|
11
|
-
"8xl": "90rem",
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
plugins: [require("@tailwindcss/typography")],
|
|
16
|
-
};
|
package/sitemap.txt
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
https://mbraak.github.io/jqTree/
|
|
2
|
-
https://mbraak.github.io/jqTree/examples/01_load_json_data/
|
|
3
|
-
https://mbraak.github.io/jqTree/examples/02_load_json_data_from_server/
|
|
4
|
-
https://mbraak.github.io/jqTree/examples/03_drag_and_drop/
|
|
5
|
-
https://mbraak.github.io/jqTree/examples/04_save_state/
|
|
6
|
-
https://mbraak.github.io/jqTree/examples/05_load_on_demand/
|
|
7
|
-
https://mbraak.github.io/jqTree/examples/06_autoescape/
|
|
8
|
-
https://mbraak.github.io/jqTree/examples/07_autoscroll/
|
|
9
|
-
https://mbraak.github.io/jqTree/examples/08_multiple_select/
|
|
10
|
-
https://mbraak.github.io/jqTree/examples/09_custom_html/
|
|
11
|
-
https://mbraak.github.io/jqTree/examples/10_icon_buttons/
|
|
12
|
-
https://mbraak.github.io/jqTree/examples/11_right-to-left/
|
|
13
|
-
https://mbraak.github.io/jqTree/examples/12_button_on_right/
|
|
14
|
-
https://mbraak.github.io/jqTree/examples/13_drag_outside/
|
package/src/playwright/.eslintrc
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import crypto from "crypto";
|
|
4
|
-
import { BrowserContext } from "@playwright/test";
|
|
5
|
-
|
|
6
|
-
const istanbulCLIOutput = path.join(process.cwd(), ".nyc_output");
|
|
7
|
-
|
|
8
|
-
const generateUUID = () => crypto.randomBytes(16).toString("hex");
|
|
9
|
-
|
|
10
|
-
export const initCoverage = async (context: BrowserContext) => {
|
|
11
|
-
await fs.promises.mkdir(istanbulCLIOutput, { recursive: true });
|
|
12
|
-
|
|
13
|
-
await context.exposeFunction(
|
|
14
|
-
"collectIstanbulCoverage",
|
|
15
|
-
(coverageJSON: string) => {
|
|
16
|
-
if (coverageJSON) {
|
|
17
|
-
const filename = path.join(
|
|
18
|
-
istanbulCLIOutput,
|
|
19
|
-
`playwright_coverage_${generateUUID()}.json`,
|
|
20
|
-
);
|
|
21
|
-
fs.writeFileSync(filename, coverageJSON);
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const saveCoverage = async (context: BrowserContext) => {
|
|
28
|
-
for (const page of context.pages()) {
|
|
29
|
-
await page.evaluate(() => {
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
31
|
-
const anyWindow = window as any;
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
33
|
-
const coverageData = anyWindow.__coverage__;
|
|
34
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, playwright/no-unsafe-references
|
|
35
|
-
anyWindow.collectIstanbulCoverage(JSON.stringify(coverageData));
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
};
|