jqtree 1.6.2 → 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 (276) hide show
  1. package/.eslintrc +3 -12
  2. package/.github/workflows/ci.yml +57 -30
  3. package/.github/workflows/codeql-analysis.yml +9 -5
  4. package/.prettier +3 -0
  5. package/.tool-versions +1 -0
  6. package/README.md +12 -9
  7. package/bower.json +10 -3
  8. package/{.postcssrc → config/.postcssrc} +0 -0
  9. package/{babel.config.json → config/babel.config.json} +0 -0
  10. package/{babel.coverage.config.json → config/babel.coverage.config.json} +0 -0
  11. package/{jest-jsdom.config.js → config/jest.config.js} +8 -3
  12. package/config/playwright.config.js +18 -0
  13. package/config/production +4 -0
  14. package/{rollup.config.js → config/rollup.config.mjs} +3 -8
  15. package/{jqtree.postcss → css/jqtree.postcss} +0 -0
  16. package/devserver/index.html +1 -9
  17. package/docs/Gemfile +2 -0
  18. package/docs/Gemfile.lock +263 -0
  19. package/{_config.yml → docs/_config.yml} +8 -1
  20. package/{_entries → docs/_entries}/01_general.md +0 -0
  21. package/{_entries → docs/_entries}/02_introduction.md +0 -0
  22. package/{_entries → docs/_entries}/03_features.md +1 -1
  23. package/{_entries → docs/_entries}/04_demo.html +1 -7
  24. package/{_entries → docs/_entries}/05_requirements.md +0 -0
  25. package/{_entries → docs/_entries}/06_downloads.md +0 -0
  26. package/{_entries → docs/_entries}/07_tutorial.md +0 -0
  27. package/{_entries → docs/_entries}/08_examples.md +0 -0
  28. package/{_entries → docs/_entries}/09_usecases.md +0 -0
  29. package/{_entries → docs/_entries}/10_changelog.md +13 -0
  30. package/{_entries → docs/_entries}/11_options.md +0 -0
  31. package/{_entries → docs/_entries}/12_animationspeed.md +0 -0
  32. package/{_entries → docs/_entries}/13_autoescape.md +0 -0
  33. package/{_entries → docs/_entries}/14_autoopen.md +0 -0
  34. package/{_entries → docs/_entries}/15_buttonleft.md +0 -0
  35. package/{_entries → docs/_entries}/16_closedicon.md +0 -0
  36. package/{_entries → docs/_entries}/17_data.md +0 -0
  37. package/{_entries → docs/_entries}/18_datafilter.md +0 -0
  38. package/{_entries → docs/_entries}/19_data-url.md +0 -0
  39. package/{_entries → docs/_entries}/20_draganddrop.md +0 -0
  40. package/{_entries → docs/_entries}/21_keyboardsupport.md +0 -0
  41. package/{_entries → docs/_entries}/22_oncanmove.md +0 -0
  42. package/{_entries → docs/_entries}/23_oncanmoveto.md +2 -2
  43. package/{_entries → docs/_entries}/24_oncanselectnode.md +0 -0
  44. package/{_entries → docs/_entries}/25_oncreateli.md +2 -2
  45. package/{_entries → docs/_entries}/26_ondragmove.md +0 -0
  46. package/{_entries → docs/_entries}/27_ondragstop.md +0 -0
  47. package/{_entries → docs/_entries}/28_onismovehandle.md +0 -0
  48. package/{_entries → docs/_entries}/29_onloadfailed.md +0 -0
  49. package/{_entries → docs/_entries}/30_onloading.md +2 -2
  50. package/{_entries → docs/_entries}/31_openedicon.md +0 -0
  51. package/{_entries → docs/_entries}/32_openfolderdelay.md +2 -0
  52. package/{_entries → docs/_entries}/33_rtl.md +0 -0
  53. package/{_entries → docs/_entries}/34_savestate.md +0 -0
  54. package/{_entries → docs/_entries}/35_selectable.md +0 -0
  55. package/{_entries → docs/_entries}/36_showemptyfolder.md +0 -0
  56. package/{_entries → docs/_entries}/37_slide.md +0 -0
  57. package/{_entries → docs/_entries}/38_start_dnd_delay.md +0 -0
  58. package/{_entries → docs/_entries}/39_tabindex.md +0 -0
  59. package/{_entries → docs/_entries}/40_usecontextmenu.md +0 -0
  60. package/{_entries → docs/_entries}/41_functions.md +0 -0
  61. package/{_entries → docs/_entries}/42_addparentnode.md +1 -1
  62. package/{_entries → docs/_entries}/43_addnodeafter.md +1 -1
  63. package/{_entries → docs/_entries}/44_addnodebefore.md +1 -1
  64. package/{_entries → docs/_entries}/45_appendnode.md +5 -5
  65. package/{_entries → docs/_entries}/46_closenode.md +0 -0
  66. package/{_entries → docs/_entries}/47_destroy.md +0 -0
  67. package/{_entries → docs/_entries}/48_getnodebycallback.md +0 -0
  68. package/{_entries → docs/_entries}/49_getnodebyid.md +0 -0
  69. package/{_entries → docs/_entries}/50_getnodebyhtmlelement.md +2 -2
  70. package/{_entries → docs/_entries}/51_getselectednode.md +0 -0
  71. package/{_entries → docs/_entries}/52_getstate.md +0 -0
  72. package/{_entries → docs/_entries}/53_gettree.md +1 -1
  73. package/{_entries → docs/_entries}/54_isdragging.md +1 -1
  74. package/{_entries → docs/_entries}/55_loaddata.md +3 -3
  75. package/{_entries → docs/_entries}/56_loaddatafromurl.md +4 -4
  76. package/{_entries → docs/_entries}/57_movedown.md +0 -0
  77. package/{_entries → docs/_entries}/58_movenode.md +3 -3
  78. package/{_entries → docs/_entries}/59_moveup.md +0 -0
  79. package/{_entries → docs/_entries}/60_opennode.md +3 -3
  80. package/docs/_entries/61_prependnode.md +21 -0
  81. package/{_entries → docs/_entries}/62_refresh.md +0 -0
  82. package/{_entries → docs/_entries}/63_reload.md +2 -2
  83. package/{_entries → docs/_entries}/64_removenode.md +0 -0
  84. package/{_entries → docs/_entries}/65_selectnode.md +0 -0
  85. package/{_entries → docs/_entries}/66_scrolltonode.md +0 -0
  86. package/{_entries → docs/_entries}/67_setoption.md +0 -0
  87. package/{_entries → docs/_entries}/68_setstate.md +0 -0
  88. package/{_entries → docs/_entries}/69_toggle.md +0 -0
  89. package/{_entries → docs/_entries}/70_tojson.md +0 -0
  90. package/{_entries → docs/_entries}/71_updatenode.md +1 -1
  91. package/{_entries → docs/_entries}/72_events.md +0 -0
  92. package/{_entries → docs/_entries}/73_tree-click.md +0 -0
  93. package/{_entries → docs/_entries}/74_tree-close.md +0 -0
  94. package/{_entries → docs/_entries}/75_tree-contextmenu.md +0 -0
  95. package/{_entries → docs/_entries}/76_tree-dblclick.md +0 -0
  96. package/{_entries → docs/_entries}/77_tree-init.md +0 -0
  97. package/{_entries → docs/_entries}/78_tree-load-data.md +0 -0
  98. package/{_entries → docs/_entries}/79_tree-loading-data.md +0 -0
  99. package/{_entries → docs/_entries}/80_tree-move.md +0 -0
  100. package/{_entries → docs/_entries}/81_tree-refresh.md +0 -0
  101. package/{_entries → docs/_entries}/82_tree-open.md +0 -0
  102. package/{_entries → docs/_entries}/83_tree-select.md +0 -0
  103. package/{_entries → docs/_entries}/84_multiple-selection.md +0 -0
  104. package/{_entries → docs/_entries}/85_add-to-selection.md +0 -0
  105. package/{_entries → docs/_entries}/86_get-selected-nodes.md +0 -0
  106. package/{_entries → docs/_entries}/87_is-node-selected.md +1 -1
  107. package/{_entries → docs/_entries}/88_remove-from-selection.md +0 -0
  108. package/{_entries → docs/_entries}/89_node-functions.md +0 -0
  109. package/{_entries → docs/_entries}/90_children.md +0 -0
  110. package/{_entries → docs/_entries}/91_getdata.md +2 -2
  111. package/{_entries → docs/_entries}/92_getlevel.md +0 -0
  112. package/docs/_entries/93_getnextnode.md +15 -0
  113. package/{_entries → docs/_entries}/94_getnextsibling.md +0 -0
  114. package/{_entries/95_getpreviousnode.md → docs/_entries/95_getnextvisiblenode.md} +1 -1
  115. package/docs/_entries/96_getpreviousnode.md +0 -0
  116. package/{_entries/96_getprevioussibling.md → docs/_entries/97_getprevioussibling.md} +0 -0
  117. package/docs/_entries/98_getpreviousvisiblenode.md +14 -0
  118. package/{_entries/97_parent.md → docs/_entries/99_parent.md} +1 -1
  119. package/{_entries → docs/_entries}/insert.py +0 -0
  120. package/{_entries → docs/_entries}/renumber.py +0 -0
  121. package/{_examples → docs/_examples}/01_load_json_data.html +3 -5
  122. package/{_examples → docs/_examples}/02_load_json_data_from_server.html +3 -5
  123. package/{_examples → docs/_examples}/03_drag_and_drop.html +3 -5
  124. package/{_examples → docs/_examples}/04_save_state.html +3 -5
  125. package/{_examples → docs/_examples}/05_load_on_demand.html +3 -5
  126. package/{_examples → docs/_examples}/06_autoescape.html +3 -5
  127. package/{_examples → docs/_examples}/07_autoscroll.html +3 -5
  128. package/{_examples → docs/_examples}/08_multiple_select.html +3 -5
  129. package/{_examples → docs/_examples}/09_custom_html.html +3 -5
  130. package/{_examples → docs/_examples}/10_icon_buttons.html +3 -5
  131. package/{_examples → docs/_examples}/11_right-to-left.html +3 -5
  132. package/{_examples → docs/_examples}/12_button_on_right.html +3 -5
  133. package/docs/_examples/13_drag_outside.html +48 -0
  134. package/{_examples → docs/_examples}/14_filter.html +7 -9
  135. package/docs/_layouts/example.html +7 -0
  136. package/{_layouts/base.html → docs/_layouts/page.html} +4 -11
  137. package/docs/documentation.css +3 -0
  138. package/docs/index.html +65 -0
  139. package/docs/jqtree.css +189 -0
  140. package/docs/package.json +22 -0
  141. package/docs/pnpm-lock.yaml +798 -0
  142. package/docs/postcss.config.js +7 -0
  143. package/{static → docs/static}/bower.json +1 -2
  144. package/{static → docs/static}/bower_components/fontawesome/css/all.min.css +0 -0
  145. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.eot +0 -0
  146. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.svg +0 -0
  147. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.ttf +0 -0
  148. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.woff +0 -0
  149. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
  150. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.eot +0 -0
  151. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.svg +0 -0
  152. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.ttf +0 -0
  153. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.woff +0 -0
  154. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
  155. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.eot +0 -0
  156. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.svg +0 -0
  157. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.ttf +0 -0
  158. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.woff +0 -0
  159. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
  160. package/{static → docs/static}/bower_components/jquery/dist/jquery.js +209 -97
  161. package/docs/static/bower_components/jquery/dist/jquery.min.js +2 -0
  162. package/{static → docs/static}/bower_components/jquery-mockjax/dist/jquery.mockjax.js +0 -0
  163. package/docs/static/documentation.css +1453 -0
  164. package/docs/static/documentation.js +26 -0
  165. package/{static → docs/static}/example.css +5 -38
  166. package/{static → docs/static}/example.postcss +5 -35
  167. package/{static → docs/static}/example_data.js +0 -0
  168. package/{static → docs/static}/examples/autoescape.js +0 -0
  169. package/{static → docs/static}/examples/autoscroll.js +0 -0
  170. package/{static → docs/static}/examples/button-on-right.js +0 -0
  171. package/{static → docs/static}/examples/custom_html.js +5 -9
  172. package/{static → docs/static}/examples/drag-outside.js +0 -0
  173. package/{static → docs/static}/examples/drag_and_drop.js +0 -0
  174. package/{static → docs/static}/examples/filter.js +2 -2
  175. package/{static → docs/static}/examples/icon_buttons.js +0 -0
  176. package/{static → docs/static}/examples/load_json_data.js +0 -0
  177. package/{static → docs/static}/examples/load_json_data_from_server.js +0 -0
  178. package/{static → docs/static}/examples/load_on_demand.js +0 -0
  179. package/{static → docs/static}/examples/multiple_select.js +0 -0
  180. package/{static → docs/static}/examples/right-to-left.js +0 -0
  181. package/{static → docs/static}/examples/save_state.js +0 -0
  182. package/{static → docs/static}/monokai.css +0 -0
  183. package/{static → docs/static}/spinner.gif +0 -0
  184. package/docs/tailwind.config.js +16 -0
  185. package/docs/tree.jquery.js +21 -0
  186. package/lib/dataLoader.js +5 -31
  187. package/lib/dragAndDropHandler.js +26 -135
  188. package/lib/elementsRenderer.js +29 -59
  189. package/lib/keyHandler.js +8 -32
  190. package/lib/mouse.widget.js +16 -77
  191. package/lib/node.js +60 -125
  192. package/lib/nodeElement.js +8 -75
  193. package/lib/playwright/coverage.js +101 -0
  194. package/lib/playwright/playwright.test.js +212 -182
  195. package/lib/playwright/testUtils.js +201 -0
  196. package/lib/saveStateHandler.js +12 -61
  197. package/lib/scrollHandler.js +17 -74
  198. package/lib/selectNodeHandler.js +5 -24
  199. package/lib/simple.widget.js +18 -53
  200. package/lib/test/jqTree/create.test.js +0 -4
  201. package/lib/test/jqTree/events.test.js +10 -16
  202. package/lib/test/jqTree/keyboard.test.js +0 -6
  203. package/lib/test/jqTree/loadOnDemand.test.js +107 -139
  204. package/lib/test/jqTree/methods.test.js +136 -159
  205. package/lib/test/jqTree/options.test.js +53 -63
  206. package/lib/test/node.test.js +127 -72
  207. package/lib/test/nodeUtil.test.js +0 -1
  208. package/lib/test/support/jqTreeMatchers.js +4 -9
  209. package/lib/test/support/setupTests.js +0 -4
  210. package/lib/test/support/testUtil.js +2 -11
  211. package/lib/test/support/treeStructure.js +0 -6
  212. package/lib/test/util.test.js +0 -1
  213. package/lib/tree.jquery.js +32 -243
  214. package/lib/util.js +0 -6
  215. package/lib/version.js +1 -1
  216. package/package.json +54 -54
  217. package/src/dragAndDropHandler.ts +8 -4
  218. package/src/jqtreeOptions.ts +1 -1
  219. package/src/keyHandler.ts +3 -3
  220. package/src/node.ts +43 -12
  221. package/src/playwright/.eslintrc +2 -2
  222. package/src/playwright/coverage.ts +41 -0
  223. package/src/playwright/playwright.test.ts +50 -52
  224. package/src/playwright/playwright.test.ts-snapshots/with-dragAndDrop-moves-a-node-1-Chromium-darwin.png +0 -0
  225. package/src/playwright/playwright.test.ts-snapshots/with-dragAndDrop-moves-a-node-1-Chromium-linux.png +0 -0
  226. package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-displays-a-tree-1-Chromium-darwin.png +0 -0
  227. package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-displays-a-tree-1-Chromium-linux.png +0 -0
  228. package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-selects-a-node-1-Chromium-darwin.png +0 -0
  229. package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-selects-a-node-1-Chromium-linux.png +0 -0
  230. package/src/playwright/testUtils.ts +122 -0
  231. package/src/test/.eslintrc +15 -3
  232. package/src/test/jqTree/events.test.ts +10 -9
  233. package/src/test/jqTree/loadOnDemand.test.ts +10 -10
  234. package/src/test/jqTree/methods.test.ts +37 -45
  235. package/src/test/jqTree/options.test.ts +26 -28
  236. package/src/test/node.test.ts +146 -54
  237. package/src/tree.jquery.d.ts +1 -1
  238. package/src/tree.jquery.ts +6 -5
  239. package/src/version.ts +1 -1
  240. package/tree.jquery.debug.js +217 -867
  241. package/tree.jquery.debug.js.map +1 -1
  242. package/tree.jquery.js +3 -3
  243. package/tree.jquery.js.map +1 -1
  244. package/_entries/61_prependnode.md +0 -21
  245. package/_entries/93_getnextnode.md +0 -12
  246. package/_examples/13_drag_outside.html +0 -26
  247. package/_layouts/frontpage.html +0 -20
  248. package/_layouts/page.html +0 -7
  249. package/index.html +0 -48
  250. package/jest-browser.config.js +0 -15
  251. package/jest-playwright.config.js +0 -21
  252. package/jest.config.js +0 -8
  253. package/lib/playwright/testUtil.js +0 -459
  254. package/lib/playwright/visualRegression.js +0 -193
  255. package/production +0 -5
  256. package/src/playwright/screenshots/displays_a_tree_Desktop.png +0 -0
  257. package/src/playwright/screenshots/displays_a_tree_iPhone 6.png +0 -0
  258. package/src/playwright/screenshots/moves_a_node_Desktop.png +0 -0
  259. package/src/playwright/screenshots/moves_a_node_iPhone 6.png +0 -0
  260. package/src/playwright/screenshots/opens_a_node_Desktop.png +0 -0
  261. package/src/playwright/screenshots/opens_a_node_iPhone 6.png +0 -0
  262. package/src/playwright/screenshots/selects_a_node_Desktop.png +0 -0
  263. package/src/playwright/screenshots/selects_a_node_iPhone 6.png +0 -0
  264. package/src/playwright/testUtil.ts +0 -170
  265. package/src/playwright/visualRegression.ts +0 -88
  266. package/static/bower_components/bootstrap/dist/css/bootstrap-theme.min.css +0 -6
  267. package/static/bower_components/bootstrap/dist/css/bootstrap.min.css +0 -6
  268. package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot +0 -0
  269. package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg +0 -288
  270. package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
  271. package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff +0 -0
  272. package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 +0 -0
  273. package/static/bower_components/bootstrap/dist/js/bootstrap.min.js +0 -6
  274. package/static/bower_components/jquery/dist/jquery.min.js +0 -2
  275. package/static/documentation.css +0 -171
  276. package/static/documentation.js +0 -48
@@ -1,18 +1,16 @@
1
1
  ---
2
2
  title: Javascript tree with drag and drop
3
- layout: page
4
3
  js: examples/drag_and_drop.js
5
- css: example.css
6
4
  ---
7
5
 
8
- <p id="nav">
6
+ <p class="flex justify-between">
9
7
  <a href="../02_load_json_data_from_server/">&laquo; Example 2</a>
10
- <a href="../04_save_state/" class="next">Example 4 &raquo;</a>
8
+ <a href="../04_save_state/">Example 4 &raquo;</a>
11
9
  </p>
12
10
 
13
11
  <h1>Example 3 - Drag and drop</h1>
14
12
 
15
- <div id="tree1" data-url="/example_data/"></div>
13
+ <div id="tree1" class="not-prose" data-url="/example_data/"></div>
16
14
 
17
15
  <p>
18
16
  Let's add drag-and-drop support by setting the option <strong>dragAndDrop</strong> to true.
@@ -1,18 +1,16 @@
1
1
  ---
2
2
  title: Save the state in javascript tree
3
- layout: page
4
3
  js: examples/save_state.js
5
- css: example.css
6
4
  ---
7
5
 
8
- <p id="nav">
6
+ <p class="flex justify-between">
9
7
  <a href="../03_drag_and_drop/">&laquo; Example 3</a>
10
- <a href="../05_load_on_demand/" class="next">Example 5 &raquo;</a>
8
+ <a href="../05_load_on_demand/">Example 5 &raquo;</a>
11
9
  </p>
12
10
 
13
11
  <h1>Example 4 - Save the state</h1>
14
12
 
15
- <div id="tree1" data-url="/example_data/"></div>
13
+ <div id="tree1" class="not-prose" data-url="/example_data/"></div>
16
14
 
17
15
  <p>
18
16
  If you set the option <strong>saveState</strong> to true, then jqtree remembers the tree state after a page reload.
@@ -1,19 +1,17 @@
1
1
  ---
2
2
  title: Load nodes on demand from the server in javascript tree
3
- layout: page
4
3
  js: examples/load_on_demand.js
5
- css: example.css
6
4
  ---
7
5
 
8
- <p id="nav">
6
+ <p class="flex justify-between">
9
7
  <a href="../04_save_state/">&laquo; Example 4</a>
10
- <a href="../06_autoescape/" class="next">Example 6 &raquo;</a>
8
+ <a href="../06_autoescape/">Example 6 &raquo;</a>
11
9
  </p>
12
10
 
13
11
  <h1>Example 5 - Load nodes on demand from the server</h1>
14
12
 
15
13
 
16
- <div id="tree1" data-url="/nodes/"></div>
14
+ <div id="tree1" class="not-prose" data-url="/nodes/"></div>
17
15
 
18
16
  <p>
19
17
  In this example, the data is loaded on demand from the server.
@@ -1,13 +1,11 @@
1
1
  ---
2
2
  title: Javascript tree with autoescape
3
- layout: page
4
3
  js: examples/autoescape.js
5
- css: example.css
6
4
  ---
7
5
 
8
- <p id="nav">
6
+ <p class="flex justify-between">
9
7
  <a href="../05_load_on_demand/">&laquo; Example 5</a>
10
- <a href="../07_autoscroll/" class="next">Example 7 &raquo;</a>
8
+ <a href="../07_autoscroll/">Example 7 &raquo;</a>
11
9
  </p>
12
10
 
13
11
  <h1>Example 6 - autoEscape</h1>
@@ -16,7 +14,7 @@ css: example.css
16
14
  You can put html in the node titles setting the <a href="../index.html#tree-options-autoescape">autoEscape</a> option to <strong>false</strong>.
17
15
  </p>
18
16
 
19
- <div id="tree1"></div>
17
+ <div id="tree1" class="not-prose"></div>
20
18
 
21
19
  <h3>html</h3>
22
20
 
@@ -1,18 +1,16 @@
1
1
  ---
2
2
  title: Javascript tree with autoscroll
3
- layout: page
4
3
  js: examples/autoscroll.js
5
- css: example.css
6
4
  ---
7
5
 
8
- <p id="nav">
6
+ <p class="flex justify-between">
9
7
  <a href="../06_autoescape/">&laquo; Example 6</a>
10
- <a href="../08_multiple_select/" class="next">Example 8 &raquo;</a>
8
+ <a href="../08_multiple_select/">Example 8 &raquo;</a>
11
9
  </p>
12
10
 
13
11
  <h1>Example 7 - autoscroll</h1>
14
12
 
15
- <div id="scroll-container"><div id="tree1"></div></div>
13
+ <div id="scroll-container"><div id="tree1" class="not-prose"></div></div>
16
14
 
17
15
  <p>
18
16
  This is an example of autoscroll. The tree will scroll automatically if you
@@ -1,13 +1,11 @@
1
1
  ---
2
2
  title: Javascript tree with multiple select
3
- layout: page
4
3
  js: examples/multiple_select.js
5
- css: example.css
6
4
  ---
7
5
 
8
- <p id="nav">
6
+ <p class="flex justify-between">
9
7
  <a href="../07_autoscroll/">&laquo; Example 7</a>
10
- <a href="../09_custom_html/" class="next">Example 9 &raquo;</a>
8
+ <a href="../09_custom_html/">Example 9 &raquo;</a>
11
9
  </p>
12
10
 
13
11
  <h1>Example 8 - multiple select</h1>
@@ -26,7 +24,7 @@ css: example.css
26
24
  </li>
27
25
  </ul>
28
26
 
29
- <div id="tree1"></div>
27
+ <div id="tree1" class="not-prose"></div>
30
28
 
31
29
  <h3>html</h3>
32
30
 
@@ -1,13 +1,11 @@
1
1
  ---
2
2
  title: Javascript tree with custom html
3
- layout: page
4
3
  js: examples/custom_html.js
5
- css: example.css
6
4
  ---
7
5
 
8
- <p id="nav">
6
+ <p class="flex justify-between">
9
7
  <a href="../08_multiple_select/">&laquo; Example 8</a>
10
- <a href="../10_icon_buttons/" class="next">Example 10 &raquo;</a>
8
+ <a href="../10_icon_buttons/">Example 10 &raquo;</a>
11
9
  </p>
12
10
 
13
11
  <h1>Example 9 - custom html</h1>
@@ -22,7 +20,7 @@ css: example.css
22
20
  This example uses the <strong>onCreateLi</strong> option to create an edit
23
21
  link next to the tree node.
24
22
  </p>
25
- <div id="tree1"></div>
23
+ <div id="tree1" class="not-prose"></div>
26
24
 
27
25
  <h3>html</h3>
28
26
 
@@ -1,13 +1,11 @@
1
1
  ---
2
2
  title: Use icon toggle buttons
3
- layout: page
4
3
  js: examples/icon_buttons.js
5
- css: example.css
6
4
  ---
7
5
 
8
- <p id="nav">
6
+ <p class="flex justify-between">
9
7
  <a href="../09_custom_html/">&laquo; Example 9</a>
10
- <a href="../11_right-to-left/" class="next">Example 11 &raquo;</a>
8
+ <a href="../11_right-to-left/">Example 11 &raquo;</a>
11
9
  </p>
12
10
 
13
11
  <h1>Example 10 - use icon toggle buttons</h1>
@@ -16,7 +14,7 @@ css: example.css
16
14
  You can use the <strong>openedIcon</strong> and <strong>closedIcon</strong> options to use html for
17
15
  the toggle buttons. You can for example use <a href="https://github.com/FortAwesome/Font-Awesome">Fontawesome icons</a>.
18
16
  </p>
19
- <div id="tree1" data-url="/example_data/"></div>
17
+ <div id="tree1" class="not-prose" data-url="/example_data/"></div>
20
18
 
21
19
  <h3>javascript</h3>
22
20
 
@@ -1,13 +1,11 @@
1
1
  ---
2
2
  title: Right-to-left support
3
- layout: page
4
3
  js: examples/right-to-left.js
5
- css: example.css
6
4
  ---
7
5
 
8
- <p id="nav">
6
+ <p class="flex justify-between">
9
7
  <a href="../10_icon_buttons/">&laquo; Example 10</a>
10
- <a href="../12_button_on_right/" class="next">Example 12 &raquo;</a>
8
+ <a href="../12_button_on_right/">Example 12 &raquo;</a>
11
9
  </p>
12
10
 
13
11
  <h1>Example 11 - right-to-left support</h1>
@@ -16,7 +14,7 @@ css: example.css
16
14
  You can display the tree from right to left with the <strong>rtl</strong> option.
17
15
  </p>
18
16
 
19
- <div id="tree1" data-url="/example_data/"></div>
17
+ <div id="tree1" class="not-prose" data-url="/example_data/"></div>
20
18
 
21
19
  <h3>javascript</h3>
22
20
 
@@ -1,13 +1,11 @@
1
1
  ---
2
2
  title: Button on right
3
- layout: page
4
3
  js: examples/button-on-right.js
5
- css: example.css
6
4
  ---
7
5
 
8
- <p id="nav">
6
+ <p class="flex justify-between">
9
7
  <a href="../11_right-to-left/">&laquo; Example 11</a>
10
- <a href="../13_drag_outside/" class="next">Example 13 &raquo;</a>
8
+ <a href="../13_drag_outside/">Example 13 &raquo;</a>
11
9
  </p>
12
10
 
13
11
  <h1>Example 12 - button on right</h1>
@@ -16,7 +14,7 @@ css: example.css
16
14
  You can put the toggle button on the right by setting the <strong>buttonLeft</strong> option to <strong>false</strong>.
17
15
  </p>
18
16
 
19
- <div id="tree1" class="block-style" data-url="/example_data/"></div>
17
+ <div id="tree1" class="block-style not-prose" data-url="/example_data/"></div>
20
18
 
21
19
  <h3>javascript</h3>
22
20
 
@@ -0,0 +1,48 @@
1
+ ---
2
+ title: Drag outside tree
3
+ js: examples/drag-outside.js
4
+ ---
5
+
6
+ <p class="flex justify-between">
7
+ <a href="../12_button_on_right/">&laquo; Example 12</a>
8
+ <a href="../14_filter/">Example 14 &raquo;</a>
9
+ </p>
10
+
11
+ <h1>Example 13 - drag node outside tree</h1>
12
+
13
+ <div id="tree1" class="not-prose" data-url="/example_data/"></div>
14
+
15
+ <div id="targetDiv">drag here (see the console)</div>
16
+
17
+ <h3>javascript</h3>
18
+
19
+ {% highlight js %}
20
+ var targetCollisionDiv = $("#targetDiv");
21
+
22
+ function isOverTarget(e) {
23
+ return (
24
+ e.clientX > targetCollisionDiv.position().left &&
25
+ e.clientX <
26
+ targetCollisionDiv.position().left +
27
+ targetCollisionDiv.width() &&
28
+ e.clientY > targetCollisionDiv.position().top &&
29
+ e.clientY <
30
+ targetCollisionDiv.position().top + targetCollisionDiv.height()
31
+ );
32
+ }
33
+
34
+ function handleMove(node, e) {
35
+ if (isOverTarget(e)) {
36
+ console.log("the node is over the target div");
37
+ }
38
+ }
39
+
40
+ function handleStop(node, e) {
41
+ console.log("stopped over target: ", isOverTarget(e));
42
+ }
43
+
44
+ $('#tree1').tree({
45
+ onDragMove: handleMove,
46
+ onDragStop: handleStop
47
+ });
48
+ {% endhighlight %}
@@ -1,21 +1,19 @@
1
1
  ---
2
2
  title: Filter
3
- layout: page
4
3
  js: examples/filter.js
5
- css: example.css
6
4
  ---
7
5
 
8
- <p id="nav">
6
+ <p class="flex justify-between">
9
7
  <a href="../13_drag_outside/">&laquo; Example 13</a>
10
8
  </p>
11
9
 
12
10
  <h1>Example 14 - filter</h1>
13
11
 
14
- <div>
15
- <input id="search-term" autofocus></input>
16
- <button id="search">Search</button>
12
+ <div class="pb-6">
13
+ <input id="search-term" class="shadow-sm border px-4 py-1 focus:ring-indigo-500 focus:border-indigo-500 border-gray-300 rounded-md mr-4" autofocus></input>
14
+ <button id="search" class="bg-white py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Search</button>
17
15
  </div>
18
- <div id="tree1"></div>
16
+ <div id="tree1" class="not-prose"></div>
19
17
 
20
18
  <h3>javascript</h3>
21
19
 
@@ -41,6 +39,7 @@ $tree.tree({
41
39
 
42
40
  $("#search").on("click", () => {
43
41
  const searchTerm = $("#search-term").val().toLowerCase();
42
+ const tree = $tree.tree("getTree");
44
43
 
45
44
  if (!searchTerm) {
46
45
  foundMatch = false;
@@ -55,7 +54,6 @@ $("#search").on("click", () => {
55
54
  return;
56
55
  }
57
56
 
58
- const tree = $tree.tree("getTree");
59
57
  foundMatch = false;
60
58
 
61
59
  tree.iterate((node) => {
@@ -88,7 +86,7 @@ $("#search").on("click", () => {
88
86
  <h3>html</h3>
89
87
 
90
88
  {% highlight html %}
91
- <div>
89
+ <div">
92
90
  <input id="search-term" autofocus></input>
93
91
  <button id="search">Search</button>
94
92
  </div>
@@ -0,0 +1,7 @@
1
+ ---
2
+ layout: page
3
+ ---
4
+
5
+ <div class="mx-auto max-w-8xl mt-4 prose px-8">
6
+ {{ content }}
7
+ </div>
@@ -5,17 +5,11 @@
5
5
  <title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <meta name="description" content="JqTree is a jQuery widget for displaying a tree structure in html" />
8
- <link rel="stylesheet" href="{{ site.baseurl }}/static/bower_components/bootstrap/dist/css/bootstrap.min.css" />
9
- <link
10
- rel="stylesheet"
11
- href="{{ site.baseurl }}/static/bower_components/bootstrap/dist/css/bootstrap-theme.min.css"
12
- />
13
- <link rel="stylesheet" href="{{ site.baseurl }}/jqtree.css" />
14
8
  <link rel="stylesheet" href="{{ site.baseurl }}/static/monokai.css" />
15
9
  <link rel="stylesheet" href="{{ site.baseurl }}/static/bower_components/fontawesome/css/all.min.css" />
16
- {% if page.css %}
17
- <link rel="stylesheet" href="{{ site.baseurl }}/static/{{ page.css }}" />
18
- {% endif %}
10
+ <link rel="stylesheet" href="{{ site.baseurl }}/static/documentation.css" />
11
+ <link rel="stylesheet" href="{{ site.baseurl }}/jqtree.css" />
12
+ <link rel="stylesheet" href="{{ site.baseurl }}/static/example.css" />
19
13
  </head>
20
14
  <body>
21
15
  {{ content }}
@@ -23,11 +17,10 @@
23
17
 
24
18
  <script src="{{ site.baseurl }}/static/bower_components/jquery/dist/jquery.min.js"></script>
25
19
  <script src="{{ site.baseurl }}/tree.jquery.js"></script>
26
- <script src="{{ site.baseurl }}/static/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
27
20
  <script src="{{ site.baseurl }}/static/bower_components/jquery-mockjax/dist/jquery.mockjax.js"></script>
28
21
  <script src="{{ site.baseurl }}/static/example_data.js"></script>
29
22
 
30
23
  {% if page.js %}
31
- <script src="{{ site.baseurl }}/static/{{ page.js }}"></script>
24
+ <script src="{{ site.baseurl }}/static/{{ page.js }}"></script>
32
25
  {% endif %}
33
26
  </html>
@@ -0,0 +1,3 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
@@ -0,0 +1,65 @@
1
+ ---
2
+ layout: page
3
+ js: documentation.js
4
+ ---
5
+
6
+ <div class="mx-auto max-w-8xl">
7
+ <div class="hidden lg:block fixed inset-0 px-8 left-[max(0px,calc(50%-45rem))] right-auto w-[19.5rem] overflow-y-auto">
8
+ <nav>
9
+ <ul>
10
+ {% assign level = 0 %}
11
+
12
+ {% for entry in site.entries %}
13
+ {% if entry.section %}
14
+ {% if level == 1 %}
15
+ </ul>
16
+ </li>
17
+ {% endif %}
18
+ <li class="mt-8">
19
+ <a class="mb-3 block font-semibold text-slate-700 hover:text-slate-900" href="#{{ entry.name }}">{{ entry.title }}</a>
20
+ <ul class="space-y-2 border-l border-slate-100">
21
+ {% assign level = 1 %}
22
+ {% else %}
23
+ <li>
24
+ <a class="block border-l pl-4 border-transparent hover:border-slate-400 text-slate-700 hover:text-slate-900" href="#{{ entry.name }}">{{ entry.title }}</a>
25
+ </li>
26
+ {% endif %}
27
+ {% endfor %}
28
+
29
+ {% if level == 1 %}
30
+ </ul>
31
+ </li>
32
+ {% endif %}
33
+ </ul>
34
+ </nav>
35
+ </div>
36
+ <div class="lg:pl-[19.5rem]">
37
+ <div class="bg-gray-50 text-center pt-16 pb-24 px-8">
38
+ <h1 class="text-gray-900 tracking-tight font-extrabold text-6xl">
39
+ <span class="text-indigo-600">jqTree</span> is a jQuery widget for displaying a tree
40
+ </h1>
41
+ <p class="mt-5 text-xl text-gray-500">
42
+ It supports json data, loading via ajax and drag-and-drop.
43
+ </p>
44
+ <div class="mt-8">
45
+ <a class="rounded-md shadow text-lg text-white px-10 py-4 bg-indigo-600 hover:bg-indigo-700" href="https://github.com/mbraak/jqTree/tarball/master">Download jqTree</a>
46
+ </div>
47
+ </div>
48
+ <div class="px-8 py-8">
49
+ {% for entry in site.entries %}
50
+ {% if entry.hide_title %}
51
+ <div id="{{ entry.name }}"></div>
52
+ {% elsif entry.section %}
53
+ <h3 class="text-4xl mb-8 font-extrabold text-slate-900 tracking-tight" id="{{ entry.name }}">{{ entry.title }}</h3>
54
+ {% else %}
55
+ <h4 class="text-xl mb-4 font-bold text-slate-900 tracking-tight" id="{{ entry.name }}">{{ entry.title }}</h4>
56
+ {% endif %}
57
+ {% if entry.output.size > 1 %}
58
+ <div class="mb-16 text-slate-700 doc-entry prose">
59
+ {{ entry.output }}
60
+ </div>
61
+ {% endif %}
62
+ {% endfor %}
63
+ </div>
64
+ </div>
65
+ </div>
@@ -0,0 +1,189 @@
1
+ ul.jqtree-tree {
2
+ list-style: none outside;
3
+ margin-left: 0;
4
+ margin-bottom: 0;
5
+ padding: 0;
6
+ }
7
+
8
+ ul.jqtree-tree.jqtree-dnd {
9
+ touch-action: none;
10
+ }
11
+
12
+ ul.jqtree-tree ul.jqtree_common {
13
+ list-style: none outside;
14
+ margin-left: 12px;
15
+ margin-right: 0;
16
+ margin-bottom: 0;
17
+ padding: 0;
18
+ display: block;
19
+ }
20
+
21
+ ul.jqtree-tree li.jqtree-closed > ul.jqtree_common {
22
+ display: none;
23
+ }
24
+
25
+ ul.jqtree-tree li.jqtree_common {
26
+ clear: both;
27
+ list-style-type: none;
28
+ }
29
+
30
+ ul.jqtree-tree .jqtree-toggler {
31
+ border-bottom: none;
32
+ color: #333;
33
+ text-decoration: none;
34
+ vertical-align: middle;
35
+ }
36
+
37
+ ul.jqtree-tree .jqtree-toggler:hover {
38
+ color: #000;
39
+ text-decoration: none;
40
+ }
41
+
42
+ ul.jqtree-tree .jqtree-toggler.jqtree-closed {
43
+ background-position: 0 0;
44
+ }
45
+
46
+ ul.jqtree-tree .jqtree-toggler.jqtree-toggler-left {
47
+ margin-right: 0.5em;
48
+ }
49
+
50
+ ul.jqtree-tree .jqtree-toggler.jqtree-toggler-right {
51
+ margin-left: 0.5em;
52
+ }
53
+
54
+ ul.jqtree-tree .jqtree-element {
55
+ cursor: pointer;
56
+ position: relative;
57
+ display: flex;
58
+ }
59
+
60
+ ul.jqtree-tree .jqtree-title {
61
+ color: #1c4257;
62
+ vertical-align: middle;
63
+ }
64
+
65
+ ul.jqtree-tree .jqtree-title-button-left {
66
+ margin-left: 1.5em;
67
+ }
68
+
69
+ ul.jqtree-tree .jqtree-title-button-left.jqtree-title-folder {
70
+ margin-left: 0;
71
+ }
72
+
73
+ ul.jqtree-tree li.jqtree-folder {
74
+ margin-bottom: 4px;
75
+ }
76
+
77
+ ul.jqtree-tree li.jqtree-folder.jqtree-closed {
78
+ margin-bottom: 1px;
79
+ }
80
+
81
+ ul.jqtree-tree li.jqtree-ghost {
82
+ position: relative;
83
+ z-index: 10;
84
+ margin-right: 10px;
85
+ }
86
+
87
+ ul.jqtree-tree li.jqtree-ghost span {
88
+ display: block;
89
+ }
90
+
91
+ ul.jqtree-tree li.jqtree-ghost span.jqtree-circle {
92
+ border: solid 2px #0000ff;
93
+ border-radius: 100px;
94
+ height: 8px;
95
+ width: 8px;
96
+ position: absolute;
97
+ top: -4px;
98
+ left: -6px;
99
+ box-sizing: border-box;
100
+ }
101
+
102
+ ul.jqtree-tree li.jqtree-ghost span.jqtree-line {
103
+ background-color: #0000ff;
104
+ height: 2px;
105
+ padding: 0;
106
+ position: absolute;
107
+ top: -1px;
108
+ left: 2px;
109
+ width: 100%;
110
+ }
111
+
112
+ ul.jqtree-tree li.jqtree-ghost.jqtree-inside {
113
+ margin-left: 48px;
114
+ }
115
+
116
+ ul.jqtree-tree span.jqtree-border {
117
+ position: absolute;
118
+ display: block;
119
+ left: -2px;
120
+ top: 0;
121
+ border: solid 2px #0000ff;
122
+ border-radius: 6px;
123
+ margin: 0;
124
+ box-sizing: content-box;
125
+ }
126
+
127
+ ul.jqtree-tree li.jqtree-selected > .jqtree-element,
128
+ ul.jqtree-tree li.jqtree-selected > .jqtree-element:hover {
129
+ background-color: #97bdd6;
130
+ background: linear-gradient(#bee0f5, #89afca);
131
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
132
+ }
133
+
134
+ ul.jqtree-tree .jqtree-moving > .jqtree-element .jqtree-title {
135
+ outline: dashed 1px #0000ff;
136
+ }
137
+
138
+ ul.jqtree-tree.jqtree-rtl {
139
+ direction: rtl;
140
+ }
141
+
142
+ ul.jqtree-tree.jqtree-rtl ul.jqtree_common {
143
+ margin-left: 0;
144
+ margin-right: 12px;
145
+ }
146
+
147
+ ul.jqtree-tree.jqtree-rtl .jqtree-toggler {
148
+ margin-left: 0.5em;
149
+ margin-right: 0;
150
+ }
151
+
152
+ ul.jqtree-tree.jqtree-rtl .jqtree-title {
153
+ margin-left: 0;
154
+ margin-right: 1.5em;
155
+ }
156
+
157
+ ul.jqtree-tree.jqtree-rtl .jqtree-title.jqtree-title-folder {
158
+ margin-right: 0;
159
+ }
160
+
161
+ ul.jqtree-tree.jqtree-rtl li.jqtree-ghost {
162
+ margin-right: 0;
163
+ margin-left: 10px;
164
+ }
165
+
166
+ ul.jqtree-tree.jqtree-rtl li.jqtree-ghost span.jqtree-circle {
167
+ right: -6px;
168
+ }
169
+
170
+ ul.jqtree-tree.jqtree-rtl li.jqtree-ghost span.jqtree-line {
171
+ right: 2px;
172
+ }
173
+
174
+ ul.jqtree-tree.jqtree-rtl li.jqtree-ghost.jqtree-inside {
175
+ margin-left: 0;
176
+ margin-right: 48px;
177
+ }
178
+
179
+ ul.jqtree-tree.jqtree-rtl span.jqtree-border {
180
+ right: -2px;
181
+ }
182
+
183
+ span.jqtree-dragging {
184
+ color: #fff;
185
+ background: #000;
186
+ opacity: 0.6;
187
+ cursor: pointer;
188
+ padding: 2px 8px;
189
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "jqtree_documentation",
3
+ "private": true,
4
+ "scripts": {
5
+ "jekyll-build": "bundle exec jekyll build",
6
+ "jekyll-serve": "bundle exec jekyll serve",
7
+ "build_docs_css": "pnpm tailwind && pnpm build_example_css && pnpm copy_static",
8
+ "tailwind": "tailwindcss -i documentation.css -o static/documentation.css",
9
+ "build_example_css": "postcss -o static/example.css static/example.postcss",
10
+ "copy_static": "cp ../tree.jquery.js . && cp ../jqtree.css ."
11
+ },
12
+ "devDependencies": {
13
+ "@tailwindcss/typography": "^0.5.7",
14
+ "autoprefixer": "^10.4.12",
15
+ "postcss": "^8.4.18",
16
+ "postcss-cli": "^10",
17
+ "postcss-import": "^15",
18
+ "postcss-load-config": "^4.0.1",
19
+ "postcss-nested": "^6",
20
+ "tailwindcss": "^3.1.8"
21
+ }
22
+ }