jqtree 1.6.0 → 1.6.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.
Files changed (301) hide show
  1. package/.eslintrc +3 -11
  2. package/.github/workflows/ci.yml +48 -23
  3. package/.github/workflows/codeql-analysis.yml +9 -5
  4. package/.prettier +3 -0
  5. package/README.md +11 -8
  6. package/bower.json +1 -1
  7. package/{.postcssrc → config/.postcssrc} +0 -0
  8. package/config/babel.config.json +11 -0
  9. package/config/babel.coverage.config.json +4 -0
  10. package/{jest-jsdom.config.js → config/jest.config.js} +9 -5
  11. package/config/playwright.config.js +18 -0
  12. package/config/production +4 -0
  13. package/{rollup.config.js → config/rollup.config.js} +19 -14
  14. package/{jqtree.postcss → css/jqtree.postcss} +3 -0
  15. package/devserver/index.html +1 -9
  16. package/docs/Gemfile +2 -0
  17. package/docs/Gemfile.lock +263 -0
  18. package/{_config.yml → docs/_config.yml} +8 -1
  19. package/{_entries → docs/_entries}/01_general.md +0 -0
  20. package/{_entries → docs/_entries}/02_introduction.md +0 -0
  21. package/{_entries → docs/_entries}/03_features.md +1 -1
  22. package/{_entries → docs/_entries}/04_demo.html +1 -7
  23. package/{_entries → docs/_entries}/05_requirements.md +0 -0
  24. package/{_entries → docs/_entries}/06_downloads.md +0 -0
  25. package/{_entries → docs/_entries}/07_tutorial.md +0 -0
  26. package/{_entries → docs/_entries}/08_examples.md +0 -0
  27. package/{_entries → docs/_entries}/09_usecases.md +0 -0
  28. package/{_entries → docs/_entries}/10_changelog.md +14 -0
  29. package/{_entries → docs/_entries}/11_options.md +0 -0
  30. package/{_entries → docs/_entries}/12_animationspeed.md +0 -0
  31. package/{_entries → docs/_entries}/13_autoescape.md +0 -0
  32. package/{_entries → docs/_entries}/14_autoopen.md +0 -0
  33. package/{_entries → docs/_entries}/15_buttonleft.md +0 -0
  34. package/{_entries → docs/_entries}/16_closedicon.md +0 -0
  35. package/{_entries → docs/_entries}/17_data.md +0 -0
  36. package/{_entries → docs/_entries}/18_datafilter.md +0 -0
  37. package/{_entries → docs/_entries}/19_data-url.md +0 -0
  38. package/{_entries → docs/_entries}/20_draganddrop.md +0 -0
  39. package/{_entries → docs/_entries}/21_keyboardsupport.md +0 -0
  40. package/{_entries → docs/_entries}/22_oncanmove.md +0 -0
  41. package/{_entries → docs/_entries}/23_oncanmoveto.md +2 -2
  42. package/{_entries → docs/_entries}/24_oncanselectnode.md +0 -0
  43. package/{_entries → docs/_entries}/25_oncreateli.md +2 -2
  44. package/{_entries → docs/_entries}/26_ondragmove.md +0 -0
  45. package/{_entries → docs/_entries}/27_ondragstop.md +0 -0
  46. package/{_entries → docs/_entries}/28_onismovehandle.md +0 -0
  47. package/{_entries → docs/_entries}/29_onloadfailed.md +0 -0
  48. package/{_entries → docs/_entries}/30_onloading.md +2 -2
  49. package/{_entries → docs/_entries}/31_openedicon.md +0 -0
  50. package/{_entries → docs/_entries}/32_openfolderdelay.md +2 -0
  51. package/{_entries → docs/_entries}/33_rtl.md +0 -0
  52. package/{_entries → docs/_entries}/34_savestate.md +0 -0
  53. package/{_entries → docs/_entries}/35_selectable.md +0 -0
  54. package/{_entries → docs/_entries}/36_showemptyfolder.md +0 -0
  55. package/{_entries → docs/_entries}/37_slide.md +0 -0
  56. package/{_entries → docs/_entries}/38_start_dnd_delay.md +0 -0
  57. package/{_entries → docs/_entries}/39_tabindex.md +0 -0
  58. package/{_entries → docs/_entries}/40_usecontextmenu.md +0 -0
  59. package/{_entries → docs/_entries}/41_functions.md +0 -0
  60. package/{_entries → docs/_entries}/42_addparentnode.md +1 -1
  61. package/{_entries → docs/_entries}/43_addnodeafter.md +1 -1
  62. package/{_entries → docs/_entries}/44_addnodebefore.md +1 -1
  63. package/{_entries → docs/_entries}/45_appendnode.md +5 -5
  64. package/{_entries → docs/_entries}/46_closenode.md +0 -0
  65. package/{_entries → docs/_entries}/47_destroy.md +0 -0
  66. package/{_entries → docs/_entries}/48_getnodebycallback.md +0 -0
  67. package/{_entries → docs/_entries}/49_getnodebyid.md +0 -0
  68. package/{_entries → docs/_entries}/50_getnodebyhtmlelement.md +2 -2
  69. package/{_entries → docs/_entries}/51_getselectednode.md +0 -0
  70. package/{_entries → docs/_entries}/52_getstate.md +0 -0
  71. package/{_entries → docs/_entries}/53_gettree.md +1 -1
  72. package/{_entries → docs/_entries}/54_isdragging.md +1 -1
  73. package/{_entries → docs/_entries}/55_loaddata.md +3 -3
  74. package/{_entries → docs/_entries}/56_loaddatafromurl.md +4 -4
  75. package/{_entries → docs/_entries}/57_movedown.md +0 -0
  76. package/{_entries → docs/_entries}/58_movenode.md +3 -3
  77. package/{_entries → docs/_entries}/59_moveup.md +0 -0
  78. package/{_entries → docs/_entries}/60_opennode.md +3 -3
  79. package/docs/_entries/61_prependnode.md +21 -0
  80. package/docs/_entries/62_refresh.md +12 -0
  81. package/{_entries/62_reload.md → docs/_entries/63_reload.md} +2 -2
  82. package/{_entries/63_removenode.md → docs/_entries/64_removenode.md} +0 -0
  83. package/{_entries/64_selectnode.md → docs/_entries/65_selectnode.md} +0 -0
  84. package/{_entries/65_scrolltonode.md → docs/_entries/66_scrolltonode.md} +0 -0
  85. package/{_entries/66_setoption.md → docs/_entries/67_setoption.md} +0 -0
  86. package/{_entries/67_setstate.md → docs/_entries/68_setstate.md} +0 -0
  87. package/{_entries/68_toggle.md → docs/_entries/69_toggle.md} +0 -0
  88. package/{_entries/69_tojson.md → docs/_entries/70_tojson.md} +0 -0
  89. package/{_entries/70_updatenode.md → docs/_entries/71_updatenode.md} +1 -1
  90. package/{_entries/71_events.md → docs/_entries/72_events.md} +0 -0
  91. package/{_entries/72_tree-click.md → docs/_entries/73_tree-click.md} +0 -0
  92. package/{_entries/73_tree-close.md → docs/_entries/74_tree-close.md} +0 -0
  93. package/{_entries/74_tree-contextmenu.md → docs/_entries/75_tree-contextmenu.md} +0 -0
  94. package/{_entries/75_tree-dblclick.md → docs/_entries/76_tree-dblclick.md} +0 -0
  95. package/{_entries/76_tree-init.md → docs/_entries/77_tree-init.md} +0 -0
  96. package/{_entries/77_tree-load-data.md → docs/_entries/78_tree-load-data.md} +0 -0
  97. package/{_entries/78_tree-loading-data.md → docs/_entries/79_tree-loading-data.md} +0 -0
  98. package/{_entries/79_tree-move.md → docs/_entries/80_tree-move.md} +0 -0
  99. package/{_entries/80_tree-refresh.md → docs/_entries/81_tree-refresh.md} +0 -0
  100. package/{_entries/81_tree-open.md → docs/_entries/82_tree-open.md} +0 -0
  101. package/{_entries/82_tree-select.md → docs/_entries/83_tree-select.md} +0 -0
  102. package/{_entries/83_multiple-selection.md → docs/_entries/84_multiple-selection.md} +0 -0
  103. package/{_entries/84_add-to-selection.md → docs/_entries/85_add-to-selection.md} +0 -0
  104. package/{_entries/85_get-selected-nodes.md → docs/_entries/86_get-selected-nodes.md} +0 -0
  105. package/{_entries/86_is-node-selected.md → docs/_entries/87_is-node-selected.md} +1 -1
  106. package/{_entries/87_remove-from-selection.md → docs/_entries/88_remove-from-selection.md} +0 -0
  107. package/{_entries/88_node-functions.md → docs/_entries/89_node-functions.md} +0 -0
  108. package/{_entries/89_children.md → docs/_entries/90_children.md} +0 -0
  109. package/{_entries/90_getdata.md → docs/_entries/91_getdata.md} +2 -2
  110. package/{_entries/91_getlevel.md → docs/_entries/92_getlevel.md} +0 -0
  111. package/{_entries/92_getnextnode.md → docs/_entries/93_getnextnode.md} +0 -0
  112. package/{_entries/93_getnextsibling.md → docs/_entries/94_getnextsibling.md} +0 -0
  113. package/{_entries/94_getpreviousnode.md → docs/_entries/95_getpreviousnode.md} +0 -0
  114. package/{_entries/95_getprevioussibling.md → docs/_entries/96_getprevioussibling.md} +0 -0
  115. package/{_entries/96_parent.md → docs/_entries/97_parent.md} +1 -1
  116. package/{_entries → docs/_entries}/insert.py +0 -0
  117. package/{_entries → docs/_entries}/renumber.py +0 -0
  118. package/{_examples → docs/_examples}/01_load_json_data.html +3 -5
  119. package/{_examples → docs/_examples}/02_load_json_data_from_server.html +3 -5
  120. package/{_examples → docs/_examples}/03_drag_and_drop.html +3 -5
  121. package/{_examples → docs/_examples}/04_save_state.html +3 -5
  122. package/{_examples → docs/_examples}/05_load_on_demand.html +3 -5
  123. package/{_examples → docs/_examples}/06_autoescape.html +3 -5
  124. package/{_examples → docs/_examples}/07_autoscroll.html +3 -5
  125. package/{_examples → docs/_examples}/08_multiple_select.html +3 -5
  126. package/{_examples → docs/_examples}/09_custom_html.html +3 -5
  127. package/{_examples → docs/_examples}/10_icon_buttons.html +3 -5
  128. package/{_examples → docs/_examples}/11_right-to-left.html +3 -5
  129. package/{_examples → docs/_examples}/12_button_on_right.html +3 -5
  130. package/docs/_examples/13_drag_outside.html +48 -0
  131. package/docs/_examples/14_filter.html +111 -0
  132. package/docs/_layouts/example.html +7 -0
  133. package/docs/_layouts/page.html +26 -0
  134. package/docs/documentation.css +3 -0
  135. package/docs/index.html +65 -0
  136. package/docs/jqtree.css +189 -0
  137. package/docs/package.json +22 -0
  138. package/docs/pnpm-lock.yaml +768 -0
  139. package/docs/postcss.config.js +7 -0
  140. package/docs/static/bower.json +8 -0
  141. package/docs/static/bower_components/fontawesome/css/all.min.css +5 -0
  142. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.eot +0 -0
  143. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.svg +774 -627
  144. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.ttf +0 -0
  145. package/docs/static/bower_components/fontawesome/webfonts/fa-brands-400.woff +0 -0
  146. package/docs/static/bower_components/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
  147. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.eot +0 -0
  148. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.svg +93 -95
  149. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.ttf +0 -0
  150. package/docs/static/bower_components/fontawesome/webfonts/fa-regular-400.woff +0 -0
  151. package/docs/static/bower_components/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
  152. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.eot +0 -0
  153. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.svg +1164 -1074
  154. package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.ttf +0 -0
  155. package/docs/static/bower_components/fontawesome/webfonts/fa-solid-900.woff +0 -0
  156. package/docs/static/bower_components/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
  157. package/{static → docs/static}/bower_components/jquery/dist/jquery.js +118 -109
  158. package/docs/static/bower_components/jquery/dist/jquery.min.js +2 -0
  159. package/{static → docs/static}/bower_components/jquery-mockjax/dist/jquery.mockjax.js +15 -9
  160. package/docs/static/documentation.css +1313 -0
  161. package/docs/static/documentation.js +26 -0
  162. package/{static → docs/static}/example.css +14 -33
  163. package/{static → docs/static}/example.postcss +15 -32
  164. package/{static → docs/static}/example_data.js +33 -36
  165. package/{static → docs/static}/examples/autoescape.js +0 -0
  166. package/{static → docs/static}/examples/autoscroll.js +0 -0
  167. package/{static → docs/static}/examples/button-on-right.js +0 -0
  168. package/{static → docs/static}/examples/custom_html.js +5 -9
  169. package/{static → docs/static}/examples/drag-outside.js +0 -0
  170. package/{static → docs/static}/examples/drag_and_drop.js +0 -0
  171. package/docs/static/examples/filter.js +63 -0
  172. package/{static → docs/static}/examples/icon_buttons.js +0 -0
  173. package/{static → docs/static}/examples/load_json_data.js +0 -0
  174. package/{static → docs/static}/examples/load_json_data_from_server.js +0 -0
  175. package/{static → docs/static}/examples/load_on_demand.js +0 -0
  176. package/{static → docs/static}/examples/multiple_select.js +0 -0
  177. package/{static → docs/static}/examples/right-to-left.js +0 -0
  178. package/{static → docs/static}/examples/save_state.js +0 -0
  179. package/{static → docs/static}/monokai.css +0 -0
  180. package/{static → docs/static}/spinner.gif +0 -0
  181. package/docs/tailwind.config.js +16 -0
  182. package/docs/tree.jquery.js +21 -0
  183. package/jqtree.css +4 -1
  184. package/lib/dataLoader.js +146 -98
  185. package/lib/dragAndDropHandler.js +672 -470
  186. package/lib/elementsRenderer.js +282 -197
  187. package/lib/jqtreeOptions.js +1 -2
  188. package/lib/keyHandler.js +134 -87
  189. package/lib/mouse.widget.js +285 -184
  190. package/lib/node.js +691 -505
  191. package/lib/nodeElement.js +329 -205
  192. package/lib/playwright/coverage.js +140 -0
  193. package/lib/playwright/playwright.test.js +298 -179
  194. package/lib/playwright/testUtils.js +267 -0
  195. package/lib/saveStateHandler.js +311 -204
  196. package/lib/scrollHandler.js +293 -199
  197. package/lib/selectNodeHandler.js +140 -100
  198. package/lib/simple.widget.js +184 -109
  199. package/lib/test/global.d.js +3 -0
  200. package/lib/test/jqTree/create.test.js +44 -40
  201. package/lib/test/jqTree/events.test.js +186 -138
  202. package/lib/test/jqTree/keyboard.test.js +216 -199
  203. package/lib/test/jqTree/loadOnDemand.test.js +238 -157
  204. package/lib/test/jqTree/methods.test.js +1289 -1019
  205. package/lib/test/jqTree/options.test.js +491 -410
  206. package/lib/test/node.test.js +1036 -873
  207. package/lib/test/nodeUtil.test.js +21 -20
  208. package/lib/test/support/exampleData.js +35 -23
  209. package/lib/test/support/jqTreeMatchers.js +72 -54
  210. package/lib/test/support/matchers.d.js +1 -0
  211. package/lib/test/support/setupTests.js +9 -3
  212. package/lib/test/support/testUtil.js +35 -15
  213. package/lib/test/support/treeStructure.js +41 -32
  214. package/lib/test/util.test.js +21 -20
  215. package/lib/tree.jquery.d.js +1 -0
  216. package/lib/tree.jquery.js +1264 -886
  217. package/lib/types.js +1 -2
  218. package/lib/typings.d.js +2 -0
  219. package/lib/util.js +19 -8
  220. package/lib/version.js +8 -3
  221. package/package.json +54 -47
  222. package/src/dataLoader.ts +6 -6
  223. package/src/dragAndDropHandler.ts +8 -8
  224. package/src/elementsRenderer.ts +4 -0
  225. package/src/jqtreeOptions.ts +2 -2
  226. package/src/mouse.widget.ts +19 -15
  227. package/src/node.ts +27 -41
  228. package/src/nodeElement.ts +17 -9
  229. package/src/playwright/.eslintrc +5 -0
  230. package/src/playwright/coverage.ts +41 -0
  231. package/src/playwright/playwright.test.ts +75 -77
  232. package/src/playwright/playwright.test.ts-snapshots/with-dragAndDrop-moves-a-node-1-Chromium-darwin.png +0 -0
  233. package/src/playwright/playwright.test.ts-snapshots/with-dragAndDrop-moves-a-node-1-Chromium-linux.png +0 -0
  234. package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-displays-a-tree-1-Chromium-darwin.png +0 -0
  235. package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-displays-a-tree-1-Chromium-linux.png +0 -0
  236. package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-selects-a-node-1-Chromium-darwin.png +0 -0
  237. package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-selects-a-node-1-Chromium-linux.png +0 -0
  238. package/src/playwright/testUtils.ts +122 -0
  239. package/src/saveStateHandler.ts +11 -6
  240. package/src/selectNodeHandler.ts +1 -1
  241. package/src/simple.widget.ts +1 -1
  242. package/src/test/.eslintrc +14 -0
  243. package/src/test/jqTree/create.test.ts +0 -1
  244. package/src/test/jqTree/events.test.ts +10 -10
  245. package/src/test/jqTree/keyboard.test.ts +0 -1
  246. package/src/test/jqTree/loadOnDemand.test.ts +56 -11
  247. package/src/test/jqTree/methods.test.ts +72 -55
  248. package/src/test/jqTree/options.test.ts +30 -33
  249. package/src/test/node.test.ts +2 -2
  250. package/src/test/support/jqTreeMatchers.ts +8 -9
  251. package/src/test/support/matchers.d.ts +2 -4
  252. package/src/test/support/setupTests.ts +2 -1
  253. package/src/tree.jquery.d.ts +19 -13
  254. package/src/tree.jquery.ts +35 -28
  255. package/src/version.ts +1 -1
  256. package/tree.jquery.debug.js +4810 -3325
  257. package/tree.jquery.debug.js.map +1 -1
  258. package/tree.jquery.js +3 -3
  259. package/tree.jquery.js.map +1 -1
  260. package/tsconfig.json +1 -0
  261. package/_entries/61_prependnode.md +0 -21
  262. package/_examples/13_drag_outside.html +0 -25
  263. package/_layouts/base.html +0 -55
  264. package/_layouts/frontpage.html +0 -20
  265. package/_layouts/page.html +0 -7
  266. package/index.html +0 -48
  267. package/jest-browser.config.js +0 -18
  268. package/jest-playwright.config.js +0 -21
  269. package/jest.config.js +0 -8
  270. package/lib/playwright/testUtil.js +0 -223
  271. package/lib/playwright/visualRegression.js +0 -128
  272. package/production +0 -5
  273. package/src/playwright/screenshots/displays_a_tree_Desktop.png +0 -0
  274. package/src/playwright/screenshots/displays_a_tree_iPhone 6.png +0 -0
  275. package/src/playwright/screenshots/moves_a_node_Desktop.png +0 -0
  276. package/src/playwright/screenshots/moves_a_node_iPhone 6.png +0 -0
  277. package/src/playwright/screenshots/opens_a_node_Desktop.png +0 -0
  278. package/src/playwright/screenshots/opens_a_node_iPhone 6.png +0 -0
  279. package/src/playwright/screenshots/selects_a_node_Desktop.png +0 -0
  280. package/src/playwright/screenshots/selects_a_node_iPhone 6.png +0 -0
  281. package/src/playwright/testUtil.ts +0 -171
  282. package/src/playwright/visualRegression.ts +0 -88
  283. package/static/bower.json +0 -9
  284. package/static/bower_components/bootstrap/dist/css/bootstrap-theme.min.css +0 -6
  285. package/static/bower_components/bootstrap/dist/css/bootstrap.min.css +0 -6
  286. package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot +0 -0
  287. package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg +0 -288
  288. package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
  289. package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff +0 -0
  290. package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 +0 -0
  291. package/static/bower_components/bootstrap/dist/js/bootstrap.min.js +0 -6
  292. package/static/bower_components/fontawesome/css/all.min.css +0 -5
  293. package/static/bower_components/fontawesome/webfonts/fa-brands-400.woff +0 -0
  294. package/static/bower_components/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
  295. package/static/bower_components/fontawesome/webfonts/fa-regular-400.woff +0 -0
  296. package/static/bower_components/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
  297. package/static/bower_components/fontawesome/webfonts/fa-solid-900.woff +0 -0
  298. package/static/bower_components/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
  299. package/static/bower_components/jquery/dist/jquery.min.js +0 -2
  300. package/static/documentation.css +0 -171
  301. package/static/documentation.js +0 -48
@@ -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 %}
@@ -0,0 +1,111 @@
1
+ ---
2
+ title: Filter
3
+ js: examples/filter.js
4
+ ---
5
+
6
+ <p class="flex justify-between">
7
+ <a href="../13_drag_outside/">&laquo; Example 13</a>
8
+ </p>
9
+
10
+ <h1>Example 14 - filter</h1>
11
+
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>
15
+ </div>
16
+ <div id="tree1" class="not-prose"></div>
17
+
18
+ <h3>javascript</h3>
19
+
20
+ {% highlight js %}
21
+ const $tree = $("#tree1");
22
+
23
+ let foundMatch = false;
24
+
25
+ $tree.tree({
26
+ autoOpen: false,
27
+ data: ExampleData.exampleData,
28
+ useContextMenu: false,
29
+ onCreateLi: (node, $el) => {
30
+ if (foundMatch && !node.openForMatch && !node.parent.matches) {
31
+ $el.addClass("hidden-node");
32
+ }
33
+
34
+ if (node.matches) {
35
+ $el.addClass("highlight-node");
36
+ }
37
+ },
38
+ });
39
+
40
+ $("#search").on("click", () => {
41
+ const searchTerm = $("#search-term").val().toLowerCase();
42
+ const tree = $tree.tree("getTree");
43
+
44
+ if (!searchTerm) {
45
+ foundMatch = false;
46
+
47
+ tree.iterate((node) => {
48
+ node['openForMatch'] = false;
49
+ node["matches"] = false;
50
+ return true;
51
+ });
52
+
53
+ $tree.tree("refresh");
54
+ return;
55
+ }
56
+
57
+ foundMatch = false;
58
+
59
+ tree.iterate((node) => {
60
+ const matches = node.name.toLowerCase().includes(searchTerm);
61
+ node["openForMatch"] = matches;
62
+ node["matches"] = matches;
63
+
64
+ if (matches) {
65
+ foundMatch = true;
66
+
67
+ if (node.isFolder()) {
68
+ node.is_open = true;
69
+ }
70
+
71
+ let parent = node.parent;
72
+ while (parent) {
73
+ parent["openForMatch"] = true;
74
+ parent.is_open = true;
75
+ parent = parent.parent;
76
+ }
77
+ }
78
+
79
+ return true;
80
+ });
81
+
82
+ $tree.tree("refresh");
83
+ });
84
+ {% endhighlight %}
85
+
86
+ <h3>html</h3>
87
+
88
+ {% highlight html %}
89
+ <div">
90
+ <input id="search-term" autofocus></input>
91
+ <button id="search">Search</button>
92
+ </div>
93
+ <div id="tree1"></div>
94
+ {% endhighlight %}
95
+
96
+ <h3>css</h3>
97
+
98
+ {% highlight css %}
99
+ .hidden-node {
100
+ display: none;
101
+ }
102
+
103
+ .highlight-node > .jqtree-element > .jqtree-title {
104
+ font-weight: bold;
105
+ }
106
+
107
+ #search-term {
108
+ margin-bottom: 16px;
109
+ margin-right: 8px;
110
+ }
111
+ {% endhighlight %}
@@ -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>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
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/monokai.css" />
9
+ <link rel="stylesheet" href="{{ site.baseurl }}/static/bower_components/fontawesome/css/all.min.css" />
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" />
13
+ </head>
14
+ <body>
15
+ {{ content }}
16
+ </body>
17
+
18
+ <script src="{{ site.baseurl }}/static/bower_components/jquery/dist/jquery.min.js"></script>
19
+ <script src="{{ site.baseurl }}/tree.jquery.js"></script>
20
+ <script src="{{ site.baseurl }}/static/bower_components/jquery-mockjax/dist/jquery.mockjax.js"></script>
21
+ <script src="{{ site.baseurl }}/static/example_data.js"></script>
22
+
23
+ {% if page.js %}
24
+ <script src="{{ site.baseurl }}/static/{{ page.js }}"></script>
25
+ {% endif %}
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
+ }