@elliemae/ds-treeview 2.3.0-next.3 → 3.0.0-alpha.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 (333) hide show
  1. package/dist/cjs/TreeView.js +50 -0
  2. package/dist/cjs/TreeView.js.map +7 -0
  3. package/dist/cjs/TreeViewContext.js +116 -0
  4. package/dist/cjs/TreeViewContext.js.map +7 -0
  5. package/dist/cjs/config/cssClassesConstants.js +41 -0
  6. package/dist/cjs/config/cssClassesConstants.js.map +7 -0
  7. package/dist/cjs/config/useTreeview.js +151 -0
  8. package/dist/cjs/config/useTreeview.js.map +7 -0
  9. package/dist/cjs/hoc/DnDTreeContext.js +45 -0
  10. package/dist/cjs/hoc/DnDTreeContext.js.map +7 -0
  11. package/dist/cjs/hoc/SortableItemContext.js +46 -0
  12. package/dist/cjs/hoc/SortableItemContext.js.map +7 -0
  13. package/dist/cjs/hoc/WithConditionalDnDContext.js +128 -0
  14. package/dist/cjs/hoc/WithConditionalDnDContext.js.map +7 -0
  15. package/dist/cjs/hoc/WithDnDSortableItemContext.js +69 -0
  16. package/dist/cjs/hoc/WithDnDSortableItemContext.js.map +7 -0
  17. package/dist/cjs/index.js +37 -0
  18. package/dist/cjs/index.js.map +7 -0
  19. package/dist/cjs/parts/CheckboxSelectable.js +97 -0
  20. package/dist/cjs/parts/CheckboxSelectable.js.map +7 -0
  21. package/dist/cjs/parts/ChildrenCountDisplayer.js +47 -0
  22. package/dist/cjs/parts/ChildrenCountDisplayer.js.map +7 -0
  23. package/dist/cjs/parts/DnDHandle.js +57 -0
  24. package/dist/cjs/parts/DnDHandle.js.map +7 -0
  25. package/dist/cjs/parts/DropIndicator.js +80 -0
  26. package/dist/cjs/parts/DropIndicator.js.map +7 -0
  27. package/dist/cjs/parts/ExpandCaret.js +96 -0
  28. package/dist/cjs/parts/ExpandCaret.js.map +7 -0
  29. package/dist/cjs/parts/Icon.js +52 -0
  30. package/dist/cjs/parts/Icon.js.map +7 -0
  31. package/dist/cjs/parts/NestingSpace.js +55 -0
  32. package/dist/cjs/parts/NestingSpace.js.map +7 -0
  33. package/dist/cjs/parts/RadioSelectable.js +74 -0
  34. package/dist/cjs/parts/RadioSelectable.js.map +7 -0
  35. package/dist/cjs/parts/TreeItem.js +166 -0
  36. package/dist/cjs/parts/TreeItem.js.map +7 -0
  37. package/dist/cjs/parts/TreeItemText.js +101 -0
  38. package/dist/cjs/parts/TreeItemText.js.map +7 -0
  39. package/dist/cjs/parts/TreeList.js +123 -0
  40. package/dist/cjs/parts/TreeList.js.map +7 -0
  41. package/dist/cjs/plugins/dnd/TreeDndPlugin.js +35 -0
  42. package/dist/cjs/plugins/dnd/TreeDndPlugin.js.map +7 -0
  43. package/dist/cjs/plugins/dnd/index.js +28 -0
  44. package/dist/cjs/plugins/dnd/index.js.map +7 -0
  45. package/dist/cjs/plugins/index.js +34 -0
  46. package/dist/cjs/plugins/index.js.map +7 -0
  47. package/dist/cjs/plugins/roving/TreeRovingPlugin.js +35 -0
  48. package/dist/cjs/plugins/roving/TreeRovingPlugin.js.map +7 -0
  49. package/dist/cjs/plugins/roving/index.js +28 -0
  50. package/dist/cjs/plugins/roving/index.js.map +7 -0
  51. package/dist/cjs/plugins/searchable/SearchableTreePlugin.js +35 -0
  52. package/dist/cjs/plugins/searchable/SearchableTreePlugin.js.map +7 -0
  53. package/dist/cjs/plugins/searchable/index.js +28 -0
  54. package/dist/cjs/plugins/searchable/index.js.map +7 -0
  55. package/dist/cjs/plugins/selectable/SelectablePluginTree.js +35 -0
  56. package/dist/cjs/plugins/selectable/SelectablePluginTree.js.map +7 -0
  57. package/dist/cjs/plugins/selectable/index.js +28 -0
  58. package/dist/cjs/plugins/selectable/index.js.map +7 -0
  59. package/dist/cjs/plugins/toolbar/TreeToolbarPlugin.js +35 -0
  60. package/dist/cjs/plugins/toolbar/TreeToolbarPlugin.js.map +7 -0
  61. package/dist/cjs/plugins/toolbar/index.js +28 -0
  62. package/dist/cjs/plugins/toolbar/index.js.map +7 -0
  63. package/dist/cjs/plugins/tree/TreeDataPlugin.js +35 -0
  64. package/dist/cjs/plugins/tree/TreeDataPlugin.js.map +7 -0
  65. package/dist/cjs/plugins/tree/index.js +28 -0
  66. package/dist/cjs/plugins/tree/index.js.map +7 -0
  67. package/dist/cjs/plugins/virtualization/TreeVirtualizationPlugin.js +35 -0
  68. package/dist/cjs/plugins/virtualization/TreeVirtualizationPlugin.js.map +7 -0
  69. package/dist/cjs/plugins/virtualization/index.js +28 -0
  70. package/dist/cjs/plugins/virtualization/index.js.map +7 -0
  71. package/dist/cjs/react-desc-prop-types.js +85 -0
  72. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  73. package/dist/cjs/related-components/TreeViewSearchBar.js +50 -0
  74. package/dist/cjs/related-components/TreeViewSearchBar.js.map +7 -0
  75. package/dist/cjs/sharedTypes.js +27 -0
  76. package/dist/cjs/sharedTypes.js.map +7 -0
  77. package/dist/cjs/utils/array-helpers.js +48 -0
  78. package/dist/cjs/utils/array-helpers.js.map +7 -0
  79. package/dist/cjs/utils/group-expands-helpers.js +138 -0
  80. package/dist/cjs/utils/group-expands-helpers.js.map +7 -0
  81. package/dist/cjs/utils/keyboard-helpers.js +170 -0
  82. package/dist/cjs/utils/keyboard-helpers.js.map +7 -0
  83. package/dist/cjs/utils/object-helpers.js +76 -0
  84. package/dist/cjs/utils/object-helpers.js.map +7 -0
  85. package/dist/cjs/utils/refs-helpers.js +52 -0
  86. package/dist/cjs/utils/refs-helpers.js.map +7 -0
  87. package/dist/cjs/utils/selectable-helper.js +88 -0
  88. package/dist/cjs/utils/selectable-helper.js.map +7 -0
  89. package/dist/cjs/utils/string-helpers.js +35 -0
  90. package/dist/cjs/utils/string-helpers.js.map +7 -0
  91. package/dist/cjs/utils/tree-helpers.js +184 -0
  92. package/dist/cjs/utils/tree-helpers.js.map +7 -0
  93. package/dist/cjs/utils/useInstanceRefActions.js +98 -0
  94. package/dist/cjs/utils/useInstanceRefActions.js.map +7 -0
  95. package/dist/cjs/utils/useTree.js +106 -0
  96. package/dist/cjs/utils/useTree.js.map +7 -0
  97. package/dist/esm/TreeView.js +21 -0
  98. package/dist/esm/TreeView.js.map +7 -0
  99. package/{esm → dist/esm}/TreeViewContext.js +24 -29
  100. package/dist/esm/TreeViewContext.js.map +7 -0
  101. package/dist/esm/config/cssClassesConstants.js +12 -0
  102. package/dist/esm/config/cssClassesConstants.js.map +7 -0
  103. package/dist/esm/config/useTreeview.js +122 -0
  104. package/dist/esm/config/useTreeview.js.map +7 -0
  105. package/dist/esm/hoc/DnDTreeContext.js +16 -0
  106. package/dist/esm/hoc/DnDTreeContext.js.map +7 -0
  107. package/dist/esm/hoc/SortableItemContext.js +17 -0
  108. package/dist/esm/hoc/SortableItemContext.js.map +7 -0
  109. package/dist/esm/hoc/WithConditionalDnDContext.js +99 -0
  110. package/dist/esm/hoc/WithConditionalDnDContext.js.map +7 -0
  111. package/dist/esm/hoc/WithDnDSortableItemContext.js +40 -0
  112. package/dist/esm/hoc/WithDnDSortableItemContext.js.map +7 -0
  113. package/dist/esm/index.js +8 -0
  114. package/dist/esm/index.js.map +7 -0
  115. package/dist/esm/parts/CheckboxSelectable.js +68 -0
  116. package/dist/esm/parts/CheckboxSelectable.js.map +7 -0
  117. package/dist/esm/parts/ChildrenCountDisplayer.js +18 -0
  118. package/dist/esm/parts/ChildrenCountDisplayer.js.map +7 -0
  119. package/dist/esm/parts/DnDHandle.js +28 -0
  120. package/dist/esm/parts/DnDHandle.js.map +7 -0
  121. package/dist/esm/parts/DropIndicator.js +51 -0
  122. package/dist/esm/parts/DropIndicator.js.map +7 -0
  123. package/dist/esm/parts/ExpandCaret.js +67 -0
  124. package/dist/esm/parts/ExpandCaret.js.map +7 -0
  125. package/dist/esm/parts/Icon.js +23 -0
  126. package/dist/esm/parts/Icon.js.map +7 -0
  127. package/dist/esm/parts/NestingSpace.js +26 -0
  128. package/dist/esm/parts/NestingSpace.js.map +7 -0
  129. package/dist/esm/parts/RadioSelectable.js +45 -0
  130. package/dist/esm/parts/RadioSelectable.js.map +7 -0
  131. package/dist/esm/parts/TreeItem.js +137 -0
  132. package/dist/esm/parts/TreeItem.js.map +7 -0
  133. package/dist/esm/parts/TreeItemText.js +72 -0
  134. package/dist/esm/parts/TreeItemText.js.map +7 -0
  135. package/dist/esm/parts/TreeList.js +94 -0
  136. package/dist/esm/parts/TreeList.js.map +7 -0
  137. package/dist/esm/plugins/dnd/TreeDndPlugin.js +6 -0
  138. package/dist/esm/plugins/dnd/TreeDndPlugin.js.map +7 -0
  139. package/dist/esm/plugins/dnd/index.js +3 -0
  140. package/dist/esm/plugins/dnd/index.js.map +7 -0
  141. package/dist/esm/plugins/index.js +9 -0
  142. package/dist/esm/plugins/index.js.map +7 -0
  143. package/dist/esm/plugins/roving/TreeRovingPlugin.js +6 -0
  144. package/dist/esm/plugins/roving/TreeRovingPlugin.js.map +7 -0
  145. package/dist/esm/plugins/roving/index.js +3 -0
  146. package/dist/esm/plugins/roving/index.js.map +7 -0
  147. package/dist/esm/plugins/searchable/SearchableTreePlugin.js +6 -0
  148. package/dist/esm/plugins/searchable/SearchableTreePlugin.js.map +7 -0
  149. package/dist/esm/plugins/searchable/index.js +3 -0
  150. package/dist/esm/plugins/searchable/index.js.map +7 -0
  151. package/dist/esm/plugins/selectable/SelectablePluginTree.js +6 -0
  152. package/dist/esm/plugins/selectable/SelectablePluginTree.js.map +7 -0
  153. package/dist/esm/plugins/selectable/index.js +3 -0
  154. package/dist/esm/plugins/selectable/index.js.map +7 -0
  155. package/dist/esm/plugins/toolbar/TreeToolbarPlugin.js +6 -0
  156. package/dist/esm/plugins/toolbar/TreeToolbarPlugin.js.map +7 -0
  157. package/dist/esm/plugins/toolbar/index.js +3 -0
  158. package/dist/esm/plugins/toolbar/index.js.map +7 -0
  159. package/dist/esm/plugins/tree/TreeDataPlugin.js +6 -0
  160. package/dist/esm/plugins/tree/TreeDataPlugin.js.map +7 -0
  161. package/dist/esm/plugins/tree/index.js +3 -0
  162. package/dist/esm/plugins/tree/index.js.map +7 -0
  163. package/dist/esm/plugins/virtualization/TreeVirtualizationPlugin.js +6 -0
  164. package/dist/esm/plugins/virtualization/TreeVirtualizationPlugin.js.map +7 -0
  165. package/dist/esm/plugins/virtualization/index.js +3 -0
  166. package/dist/esm/plugins/virtualization/index.js.map +7 -0
  167. package/dist/esm/react-desc-prop-types.js +56 -0
  168. package/dist/esm/react-desc-prop-types.js.map +7 -0
  169. package/dist/esm/related-components/TreeViewSearchBar.js +21 -0
  170. package/dist/esm/related-components/TreeViewSearchBar.js.map +7 -0
  171. package/dist/esm/sharedTypes.js +2 -0
  172. package/dist/esm/sharedTypes.js.map +7 -0
  173. package/{esm → dist/esm}/utils/array-helpers.js +6 -6
  174. package/dist/esm/utils/array-helpers.js.map +7 -0
  175. package/dist/esm/utils/group-expands-helpers.js +109 -0
  176. package/dist/esm/utils/group-expands-helpers.js.map +7 -0
  177. package/{esm → dist/esm}/utils/keyboard-helpers.js +43 -71
  178. package/dist/esm/utils/keyboard-helpers.js.map +7 -0
  179. package/dist/esm/utils/object-helpers.js +47 -0
  180. package/dist/esm/utils/object-helpers.js.map +7 -0
  181. package/dist/esm/utils/refs-helpers.js +23 -0
  182. package/dist/esm/utils/refs-helpers.js.map +7 -0
  183. package/dist/esm/utils/selectable-helper.js +59 -0
  184. package/dist/esm/utils/selectable-helper.js.map +7 -0
  185. package/dist/esm/utils/string-helpers.js +6 -0
  186. package/dist/esm/utils/string-helpers.js.map +7 -0
  187. package/dist/esm/utils/tree-helpers.js +155 -0
  188. package/dist/esm/utils/tree-helpers.js.map +7 -0
  189. package/{esm → dist/esm}/utils/useInstanceRefActions.js +21 -35
  190. package/dist/esm/utils/useInstanceRefActions.js.map +7 -0
  191. package/dist/esm/utils/useTree.js +77 -0
  192. package/dist/esm/utils/useTree.js.map +7 -0
  193. package/{types → dist/types}/TreeView.d.ts +0 -0
  194. package/{types → dist/types}/TreeViewContext.d.ts +0 -0
  195. package/{types → dist/types}/config/cssClassesConstants.d.ts +0 -0
  196. package/{types → dist/types}/config/useTreeview.d.ts +0 -0
  197. package/{types → dist/types}/hoc/DnDTreeContext.d.ts +0 -0
  198. package/{types → dist/types}/hoc/SortableItemContext.d.ts +0 -0
  199. package/{types → dist/types}/hoc/WithConditionalDnDContext.d.ts +0 -0
  200. package/{types → dist/types}/hoc/WithDnDSortableItemContext.d.ts +0 -0
  201. package/{types → dist/types}/index.d.ts +0 -0
  202. package/{types → dist/types}/parts/CheckboxSelectable.d.ts +0 -0
  203. package/{types → dist/types}/parts/ChildrenCountDisplayer.d.ts +0 -0
  204. package/{types → dist/types}/parts/DnDHandle.d.ts +0 -0
  205. package/{types → dist/types}/parts/DropIndicator.d.ts +0 -0
  206. package/{types → dist/types}/parts/ExpandCaret.d.ts +0 -0
  207. package/{types → dist/types}/parts/Icon.d.ts +0 -0
  208. package/{types → dist/types}/parts/NestingSpace.d.ts +0 -0
  209. package/{types → dist/types}/parts/RadioSelectable.d.ts +0 -0
  210. package/{types → dist/types}/parts/TreeItem.d.ts +0 -0
  211. package/{types → dist/types}/parts/TreeItemText.d.ts +0 -0
  212. package/{types → dist/types}/parts/TreeList.d.ts +0 -0
  213. package/{types → dist/types}/plugins/dnd/TreeDndPlugin.d.ts +0 -0
  214. package/{types → dist/types}/plugins/dnd/index.d.ts +0 -0
  215. package/{types → dist/types}/plugins/index.d.ts +0 -0
  216. package/{types → dist/types}/plugins/roving/TreeRovingPlugin.d.ts +0 -0
  217. package/{types → dist/types}/plugins/roving/index.d.ts +0 -0
  218. package/{types → dist/types}/plugins/searchable/SearchableTreePlugin.d.ts +0 -0
  219. package/{types → dist/types}/plugins/searchable/index.d.ts +0 -0
  220. package/{types → dist/types}/plugins/selectable/SelectablePluginTree.d.ts +0 -0
  221. package/{types → dist/types}/plugins/selectable/index.d.ts +0 -0
  222. package/{types → dist/types}/plugins/toolbar/TreeToolbarPlugin.d.ts +0 -0
  223. package/{types → dist/types}/plugins/toolbar/index.d.ts +0 -0
  224. package/{types → dist/types}/plugins/tree/TreeDataPlugin.d.ts +0 -0
  225. package/{types → dist/types}/plugins/tree/index.d.ts +0 -0
  226. package/{types → dist/types}/plugins/virtualization/TreeVirtualizationPlugin.d.ts +0 -0
  227. package/{types → dist/types}/plugins/virtualization/index.d.ts +0 -0
  228. package/{types → dist/types}/react-desc-prop-types.d.ts +0 -0
  229. package/{types → dist/types}/related-components/TreeViewSearchBar.d.ts +0 -0
  230. package/{types → dist/types}/sharedTypes.d.ts +0 -0
  231. package/{types → dist/types}/utils/array-helpers.d.ts +0 -0
  232. package/{types → dist/types}/utils/group-expands-helpers.d.ts +0 -0
  233. package/{types → dist/types}/utils/keyboard-helpers.d.ts +0 -0
  234. package/{types → dist/types}/utils/object-helpers.d.ts +0 -0
  235. package/{types → dist/types}/utils/refs-helpers.d.ts +0 -0
  236. package/{types → dist/types}/utils/selectable-helper.d.ts +0 -0
  237. package/{types → dist/types}/utils/string-helpers.d.ts +0 -0
  238. package/{types → dist/types}/utils/tree-helpers.d.ts +0 -0
  239. package/{types → dist/types}/utils/useInstanceRefActions.d.ts +0 -0
  240. package/{types → dist/types}/utils/useTree.d.ts +0 -0
  241. package/package.json +129 -120
  242. package/cjs/TreeView.js +0 -30
  243. package/cjs/TreeViewContext.js +0 -98
  244. package/cjs/config/cssClassesConstants.js +0 -13
  245. package/cjs/config/useTreeview.js +0 -127
  246. package/cjs/hoc/DnDTreeContext.js +0 -18
  247. package/cjs/hoc/SortableItemContext.js +0 -21
  248. package/cjs/hoc/WithConditionalDnDContext.js +0 -138
  249. package/cjs/hoc/WithDnDSortableItemContext.js +0 -70
  250. package/cjs/index.js +0 -26
  251. package/cjs/parts/CheckboxSelectable.js +0 -86
  252. package/cjs/parts/ChildrenCountDisplayer.js +0 -30
  253. package/cjs/parts/DnDHandle.js +0 -46
  254. package/cjs/parts/DropIndicator.js +0 -75
  255. package/cjs/parts/ExpandCaret.js +0 -94
  256. package/cjs/parts/Icon.js +0 -37
  257. package/cjs/parts/NestingSpace.js +0 -47
  258. package/cjs/parts/RadioSelectable.js +0 -59
  259. package/cjs/parts/TreeItem.js +0 -185
  260. package/cjs/parts/TreeItemText.js +0 -108
  261. package/cjs/parts/TreeList.js +0 -139
  262. package/cjs/plugins/dnd/TreeDndPlugin.js +0 -7
  263. package/cjs/plugins/dnd/index.js +0 -9
  264. package/cjs/plugins/index.js +0 -21
  265. package/cjs/plugins/roving/TreeRovingPlugin.js +0 -7
  266. package/cjs/plugins/roving/index.js +0 -9
  267. package/cjs/plugins/searchable/SearchableTreePlugin.js +0 -7
  268. package/cjs/plugins/searchable/index.js +0 -9
  269. package/cjs/plugins/selectable/SelectablePluginTree.js +0 -7
  270. package/cjs/plugins/selectable/index.js +0 -9
  271. package/cjs/plugins/toolbar/TreeToolbarPlugin.js +0 -7
  272. package/cjs/plugins/toolbar/index.js +0 -9
  273. package/cjs/plugins/tree/TreeDataPlugin.js +0 -7
  274. package/cjs/plugins/tree/index.js +0 -9
  275. package/cjs/plugins/virtualization/TreeVirtualizationPlugin.js +0 -7
  276. package/cjs/plugins/virtualization/index.js +0 -9
  277. package/cjs/react-desc-prop-types.js +0 -56
  278. package/cjs/related-components/TreeViewSearchBar.js +0 -48
  279. package/cjs/sharedTypes.js +0 -2
  280. package/cjs/utils/array-helpers.js +0 -24
  281. package/cjs/utils/group-expands-helpers.js +0 -111
  282. package/cjs/utils/keyboard-helpers.js +0 -175
  283. package/cjs/utils/object-helpers.js +0 -69
  284. package/cjs/utils/refs-helpers.js +0 -31
  285. package/cjs/utils/selectable-helper.js +0 -80
  286. package/cjs/utils/string-helpers.js +0 -7
  287. package/cjs/utils/tree-helpers.js +0 -220
  288. package/cjs/utils/useInstanceRefActions.js +0 -87
  289. package/cjs/utils/useTree.js +0 -108
  290. package/esm/TreeView.js +0 -21
  291. package/esm/config/cssClassesConstants.js +0 -6
  292. package/esm/config/useTreeview.js +0 -119
  293. package/esm/hoc/DnDTreeContext.js +0 -14
  294. package/esm/hoc/SortableItemContext.js +0 -17
  295. package/esm/hoc/WithConditionalDnDContext.js +0 -128
  296. package/esm/hoc/WithDnDSortableItemContext.js +0 -61
  297. package/esm/index.js +0 -9
  298. package/esm/parts/CheckboxSelectable.js +0 -78
  299. package/esm/parts/ChildrenCountDisplayer.js +0 -22
  300. package/esm/parts/DnDHandle.js +0 -38
  301. package/esm/parts/DropIndicator.js +0 -68
  302. package/esm/parts/ExpandCaret.js +0 -85
  303. package/esm/parts/Icon.js +0 -29
  304. package/esm/parts/NestingSpace.js +0 -39
  305. package/esm/parts/RadioSelectable.js +0 -53
  306. package/esm/parts/TreeItem.js +0 -173
  307. package/esm/parts/TreeItemText.js +0 -99
  308. package/esm/parts/TreeList.js +0 -127
  309. package/esm/plugins/dnd/TreeDndPlugin.js +0 -3
  310. package/esm/plugins/dnd/index.js +0 -1
  311. package/esm/plugins/index.js +0 -7
  312. package/esm/plugins/roving/TreeRovingPlugin.js +0 -3
  313. package/esm/plugins/roving/index.js +0 -1
  314. package/esm/plugins/searchable/SearchableTreePlugin.js +0 -3
  315. package/esm/plugins/searchable/index.js +0 -1
  316. package/esm/plugins/selectable/SelectablePluginTree.js +0 -3
  317. package/esm/plugins/selectable/index.js +0 -1
  318. package/esm/plugins/toolbar/TreeToolbarPlugin.js +0 -3
  319. package/esm/plugins/toolbar/index.js +0 -1
  320. package/esm/plugins/tree/TreeDataPlugin.js +0 -3
  321. package/esm/plugins/tree/index.js +0 -1
  322. package/esm/plugins/virtualization/TreeVirtualizationPlugin.js +0 -3
  323. package/esm/plugins/virtualization/index.js +0 -1
  324. package/esm/react-desc-prop-types.js +0 -52
  325. package/esm/related-components/TreeViewSearchBar.js +0 -40
  326. package/esm/sharedTypes.js +0 -1
  327. package/esm/utils/group-expands-helpers.js +0 -99
  328. package/esm/utils/object-helpers.js +0 -64
  329. package/esm/utils/refs-helpers.js +0 -27
  330. package/esm/utils/selectable-helper.js +0 -70
  331. package/esm/utils/string-helpers.js +0 -3
  332. package/esm/utils/tree-helpers.js +0 -205
  333. package/esm/utils/useTree.js +0 -99
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ const TreeRovingPlugin = "tree-roving";
3
+ export {
4
+ TreeRovingPlugin
5
+ };
6
+ //# sourceMappingURL=TreeRovingPlugin.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/roving/TreeRovingPlugin.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const TreeRovingPlugin = 'tree-roving';\n"],
5
+ "mappings": "AAAA;ACAO,MAAM,mBAAmB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ export * from "./TreeRovingPlugin";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/roving/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './TreeRovingPlugin';\n"],
5
+ "mappings": "AAAA;ACAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ const SearchableTreePlugin = "tree-searchable";
3
+ export {
4
+ SearchableTreePlugin
5
+ };
6
+ //# sourceMappingURL=SearchableTreePlugin.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/searchable/SearchableTreePlugin.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const SearchableTreePlugin = 'tree-searchable';\n"],
5
+ "mappings": "AAAA;ACAO,MAAM,uBAAuB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ export * from "./SearchableTreePlugin";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/searchable/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './SearchableTreePlugin';\n"],
5
+ "mappings": "AAAA;ACAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ const SelectablePluginTree = "tree-selectable";
3
+ export {
4
+ SelectablePluginTree
5
+ };
6
+ //# sourceMappingURL=SelectablePluginTree.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/SelectablePluginTree.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const SelectablePluginTree = 'tree-selectable';\n"],
5
+ "mappings": "AAAA;ACAO,MAAM,uBAAuB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ export * from "./SelectablePluginTree";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './SelectablePluginTree';\n"],
5
+ "mappings": "AAAA;ACAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ const TreeToolbarPlugin = "tree-toolbar";
3
+ export {
4
+ TreeToolbarPlugin
5
+ };
6
+ //# sourceMappingURL=TreeToolbarPlugin.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/toolbar/TreeToolbarPlugin.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const TreeToolbarPlugin = 'tree-toolbar';\n"],
5
+ "mappings": "AAAA;ACAO,MAAM,oBAAoB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ export * from "./TreeToolbarPlugin";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/toolbar/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './TreeToolbarPlugin';\n"],
5
+ "mappings": "AAAA;ACAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ const TreePluginList = "tree-data";
3
+ export {
4
+ TreePluginList
5
+ };
6
+ //# sourceMappingURL=TreeDataPlugin.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/tree/TreeDataPlugin.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const TreePluginList = 'tree-data';\n"],
5
+ "mappings": "AAAA;ACAO,MAAM,iBAAiB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ export * from "./TreeDataPlugin";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/tree/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './TreeDataPlugin';\n"],
5
+ "mappings": "AAAA;ACAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ const TreeVirtualizationPlugin = "tree-virtualization";
3
+ export {
4
+ TreeVirtualizationPlugin
5
+ };
6
+ //# sourceMappingURL=TreeVirtualizationPlugin.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/virtualization/TreeVirtualizationPlugin.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const TreeVirtualizationPlugin = 'tree-virtualization';\n"],
5
+ "mappings": "AAAA;ACAO,MAAM,2BAA2B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ export * from "./TreeVirtualizationPlugin";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/virtualization/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './TreeVirtualizationPlugin';\n"],
5
+ "mappings": "AAAA;ACAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,56 @@
1
+ import * as React from "react";
2
+ import { PropTypes } from "react-desc";
3
+ const TreeViewPropTypes = {
4
+ data: PropTypes.arrayOf(PropTypes.shape({
5
+ children: PropTypes.arrayOf(PropTypes.object),
6
+ id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
7
+ isGroup: PropTypes.oneOfType([PropTypes.oneOf([void 0, null]), PropTypes.bool]),
8
+ name: PropTypes.string,
9
+ node: PropTypes.object
10
+ })).description("data to populate tree view").isRequired,
11
+ plugins: PropTypes.arrayOf(PropTypes.string).description("list of enabled plugins").defaultValue([]),
12
+ selection: PropTypes.object.description("pre selected items").defaultValue({}),
13
+ expanded: PropTypes.object.description("control what items are expanded").defaultValue(void 0),
14
+ instanceRef: PropTypes.shape({
15
+ current: PropTypes.oneOfType([
16
+ PropTypes.oneOf([null, void 0]),
17
+ PropTypes.shape({
18
+ actions: PropTypes.shape({
19
+ toggleExpandAll: PropTypes.func,
20
+ scrollTo: PropTypes.func
21
+ }).description("").isRequired
22
+ })
23
+ ])
24
+ }).description("instance ref"),
25
+ isItemDisabled: PropTypes.func.description("Function that receives an item, and returns whether that item should be disabled").defaultValue("() => false"),
26
+ disableIcons: PropTypes.bool.description("disable icons").defaultValue(false),
27
+ fluid: PropTypes.bool.description("whether is fluid or not").defaultValue(false),
28
+ isMultiSelect: PropTypes.bool.description("whether the tree view is multi select or not").defaultValue(false),
29
+ isSingleSelect: PropTypes.bool.description("wheter the tree view is single select or not").defaultValue(false),
30
+ isLoading: PropTypes.bool.description("wheter the tree should show the loading state or not").defaultValue(false),
31
+ getIsDropValid: PropTypes.func.description("Function that returns true if the drop is valid and false if it's not").defaultValue("() => true"),
32
+ restrictDragAndDrop: PropTypes.bool.description("whether to restrict DnD functionality or not").defaultValue(false),
33
+ showChildrenAmount: PropTypes.bool.description("whether to show the amount of children or not").defaultValue(false),
34
+ sortable: PropTypes.bool.description("whether the sortable functionality is active or not").defaultValue(false),
35
+ onItemClick: PropTypes.func.description("function executed when clicking on an item").defaultValue("() => {}"),
36
+ onItemFocus: PropTypes.func.description("function executed when focusing on an item").defaultValue("() => {}"),
37
+ onVisibleItemsChange: PropTypes.func.description("function executed when the visible items change").defaultValue("() => {}"),
38
+ onOrderChange: PropTypes.func.description("function executed when the items order changes").defaultValue("() => {}"),
39
+ onSelectionChange: PropTypes.func.description("function executed when the selection changes").defaultValue("() => {}"),
40
+ onExpandChange: PropTypes.func.description("function executed when expanding an item").defaultValue("() => {}"),
41
+ onInstanceRefInitialized: PropTypes.func.description("function executed when instanceRef has terminated instanciation").defaultValue("() => {}"),
42
+ rowSize: PropTypes.oneOf(["normal", "compact"]).description("size of the row").defaultValue("normal"),
43
+ labelOverflow: PropTypes.oneOf(["wrap", "wrap-all", "truncate"]).description("label truncation preference").defaultValue("wrap"),
44
+ width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("components width").defaultValue("100%"),
45
+ height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("components height").defaultValue("100%"),
46
+ groupIcon: PropTypes.node.description("icon for groups"),
47
+ itemIcon: PropTypes.node.description("icon for items"),
48
+ searchQuery: PropTypes.string.description("search query value"),
49
+ noItemsPlaceholder: PropTypes.string.description("message to be shown when there are no items in the treeview to be displayed").defaultValue("No items found"),
50
+ name: PropTypes.string.description("property key to identifier for items labels").defaultValue("name"),
51
+ highlightOnlyQuery: PropTypes.bool.description("whether to highlight results or not").defaultValue(false)
52
+ };
53
+ export {
54
+ TreeViewPropTypes
55
+ };
56
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { PropTypes } from 'react-desc';\nimport TreeModel from 'tree-model';\nimport { useVirtual } from 'react-virtual';\nexport declare namespace DSTreeviewT {\n export type StringOrNum = string | number;\n export type SelectionState = boolean | 'mixed';\n export type SelectionItems = Record<StringOrNum, SelectionState>;\n export type ScrollToFunc = ReturnType<typeof useVirtual>['scrollToIndex'];\n export type ScrollToItemOptions = Parameters<ReturnType<typeof useVirtual>['scrollToIndex']>[1];\n export type ScrollToItemFunc = (options: ScrollToItemOptions) => void;\n export type ExpandedItems = Record<StringOrNum, true>; // { [id]:true } -> e.g. {1:true; 2:true} // false are not listed\n export interface SimpleItem {\n [key: string]: unknown;\n name: string;\n children?: SimpleItem[];\n id: StringOrNum;\n }\n\n export interface Item extends SimpleItem {\n children: Item[];\n treeDepth?: number;\n virtualIndex?: number;\n isChecked?: boolean | 'mixed';\n isGroup?: boolean;\n isExpanded?: boolean;\n childrenMatchesSearchQuery?: boolean;\n matchesSearchQuery?: boolean;\n nodeItemRef?: React.RefObject<HTMLLIElement>;\n model: TreeModel.Node<Item>['model'];\n node: TreeModel.Node<Item> & { parent?: TreeModel.Node<Item> };\n nodePath: TreeModel.Node<Item>[];\n }\n\n export interface DndItem {\n uid: string;\n depth: number;\n realIndex: number;\n childrenCount: number;\n parentId: string | null;\n original: SimpleItem;\n }\n\n export interface Actions {\n toggleExpandAll: (isExpand: boolean) => Promise<DSTreeviewT.Item[]>;\n scrollTo: DSTreeviewT.ScrollToFunc;\n setSelectedItemByVirtualIndex: (index: number) => void;\n setFocusedItemByVirtualIndex: (\n index: number,\n scrollOpts: DSTreeviewT.ScrollToItemOptions & { withScroll?: boolean },\n ) => void;\n }\n export interface InstanceRef {\n actions: Actions;\n }\n\n export interface DefaultProps {\n plugins: string[];\n selection: SelectionItems;\n instanceRef: React.MutableRefObject<InstanceRef>;\n isItemDisabled: (item: Item) => boolean;\n disableIcons: boolean;\n fluid: boolean;\n isMultiSelect: boolean;\n isSingleSelect: boolean;\n getIsDropValid: (\n active: DndItem,\n over: DndItem,\n dropIndicatorPosition: 'none' | 'before' | 'after' | 'inside',\n ) => boolean;\n restrictDragAndDrop: boolean;\n showChildrenAmount: boolean;\n sortable: boolean;\n isLoading: boolean;\n highlightOnlyQuery: boolean;\n onItemClick: (item: Item, e: React.MouseEvent<HTMLLIElement>) => void;\n onItemFocus: (meta: { scrollToItem: ScrollToItemFunc; itemIndex: number; item: Item }) => void;\n onVisibleItemsChange: (newVisibleItems: Item[]) => void;\n onOrderChange: (newData: SimpleItem[], oldData: SimpleItem[], draggedItem: DndItem) => void;\n onSelectionChange: (\n selection: SelectionItems,\n item: Item,\n meta: { scrollToItem: ScrollToItemFunc; itemIndex: number },\n ) => void;\n onExpandChange: (expandedHashmap: ExpandedItems, itemToggled: Item | null | undefined) => void;\n onInstanceRefInitialized: (instanceRef: React.MutableRefObject<InstanceRef>) => void;\n rowSize: 'normal' | 'compact';\n labelOverflow: 'wrap' | 'wrap-all' | 'truncate';\n noItemsPlaceholder: string;\n nameKey: string;\n width: StringOrNum;\n height: StringOrNum;\n groupIcon: JSX.Element | null;\n itemIcon: JSX.Element | null;\n searchQuery: string;\n }\n export interface PropsOptional {\n expanded: ExpandedItems;\n rightAddons: ((item: Item) => React.ReactNode | React.ReactNode[]) | JSX.Element;\n }\n export interface PropsRequired {\n data: Item[];\n }\n export interface Props extends DefaultProps, PropsOptional, PropsRequired {}\n}\n\nexport const TreeViewPropTypes = {\n data: PropTypes.arrayOf(\n PropTypes.shape({\n children: PropTypes.arrayOf(PropTypes.object),\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n isGroup: PropTypes.oneOfType([PropTypes.oneOf([undefined, null]), PropTypes.bool]),\n name: PropTypes.string,\n node: PropTypes.object,\n }),\n ).description('data to populate tree view').isRequired,\n plugins: PropTypes.arrayOf(PropTypes.string).description('list of enabled plugins').defaultValue([]),\n selection: PropTypes.object.description('pre selected items').defaultValue({}),\n expanded: PropTypes.object.description('control what items are expanded').defaultValue(undefined),\n instanceRef: PropTypes.shape({\n current: PropTypes.oneOfType([\n PropTypes.oneOf([null, undefined]),\n PropTypes.shape({\n actions: PropTypes.shape({\n toggleExpandAll: PropTypes.func,\n scrollTo: PropTypes.func,\n }).description('').isRequired,\n }),\n ]),\n }).description('instance ref'),\n isItemDisabled: PropTypes.func\n .description('Function that receives an item, and returns whether that item should be disabled')\n .defaultValue('() => false'),\n disableIcons: PropTypes.bool.description('disable icons').defaultValue(false),\n fluid: PropTypes.bool.description('whether is fluid or not').defaultValue(false),\n isMultiSelect: PropTypes.bool.description('whether the tree view is multi select or not').defaultValue(false),\n isSingleSelect: PropTypes.bool.description('wheter the tree view is single select or not').defaultValue(false),\n isLoading: PropTypes.bool.description('wheter the tree should show the loading state or not').defaultValue(false),\n getIsDropValid: PropTypes.func\n .description(\"Function that returns true if the drop is valid and false if it's not\")\n .defaultValue('() => true'),\n restrictDragAndDrop: PropTypes.bool.description('whether to restrict DnD functionality or not').defaultValue(false),\n showChildrenAmount: PropTypes.bool.description('whether to show the amount of children or not').defaultValue(false),\n sortable: PropTypes.bool.description('whether the sortable functionality is active or not').defaultValue(false),\n onItemClick: PropTypes.func.description('function executed when clicking on an item').defaultValue('() => {}'),\n onItemFocus: PropTypes.func.description('function executed when focusing on an item').defaultValue('() => {}'),\n onVisibleItemsChange: PropTypes.func\n .description('function executed when the visible items change')\n .defaultValue('() => {}'),\n onOrderChange: PropTypes.func.description('function executed when the items order changes').defaultValue('() => {}'),\n onSelectionChange: PropTypes.func\n .description('function executed when the selection changes')\n .defaultValue('() => {}'),\n onExpandChange: PropTypes.func.description('function executed when expanding an item').defaultValue('() => {}'),\n onInstanceRefInitialized: PropTypes.func\n .description('function executed when instanceRef has terminated instanciation')\n .defaultValue('() => {}'),\n rowSize: PropTypes.oneOf(['normal', 'compact']).description('size of the row').defaultValue('normal'),\n labelOverflow: PropTypes.oneOf(['wrap', 'wrap-all', 'truncate'])\n .description('label truncation preference')\n .defaultValue('wrap'),\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('components width').defaultValue('100%'),\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('components height')\n .defaultValue('100%'),\n groupIcon: PropTypes.node.description('icon for groups'),\n itemIcon: PropTypes.node.description('icon for items'),\n searchQuery: PropTypes.string.description('search query value'),\n noItemsPlaceholder: PropTypes.string\n .description('message to be shown when there are no items in the treeview to be displayed')\n .defaultValue('No items found'),\n name: PropTypes.string.description('property key to identifier for items labels').defaultValue('name'),\n highlightOnlyQuery: PropTypes.bool.description('whether to highlight results or not').defaultValue(false),\n};\n"],
5
+ "mappings": "AAAA;ACCA;AAyGO,MAAM,oBAAoB;AAAA,EAC/B,MAAM,UAAU,QACd,UAAU,MAAM;AAAA,IACd,UAAU,UAAU,QAAQ,UAAU;AAAA,IACtC,IAAI,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU;AAAA,IACrD,SAAS,UAAU,UAAU,CAAC,UAAU,MAAM,CAAC,QAAW,QAAQ,UAAU;AAAA,IAC5E,MAAM,UAAU;AAAA,IAChB,MAAM,UAAU;AAAA,MAElB,YAAY,8BAA8B;AAAA,EAC5C,SAAS,UAAU,QAAQ,UAAU,QAAQ,YAAY,2BAA2B,aAAa;AAAA,EACjG,WAAW,UAAU,OAAO,YAAY,sBAAsB,aAAa;AAAA,EAC3E,UAAU,UAAU,OAAO,YAAY,mCAAmC,aAAa;AAAA,EACvF,aAAa,UAAU,MAAM;AAAA,IAC3B,SAAS,UAAU,UAAU;AAAA,MAC3B,UAAU,MAAM,CAAC,MAAM;AAAA,MACvB,UAAU,MAAM;AAAA,QACd,SAAS,UAAU,MAAM;AAAA,UACvB,iBAAiB,UAAU;AAAA,UAC3B,UAAU,UAAU;AAAA,WACnB,YAAY,IAAI;AAAA;AAAA;AAAA,KAGtB,YAAY;AAAA,EACf,gBAAgB,UAAU,KACvB,YAAY,oFACZ,aAAa;AAAA,EAChB,cAAc,UAAU,KAAK,YAAY,iBAAiB,aAAa;AAAA,EACvE,OAAO,UAAU,KAAK,YAAY,2BAA2B,aAAa;AAAA,EAC1E,eAAe,UAAU,KAAK,YAAY,gDAAgD,aAAa;AAAA,EACvG,gBAAgB,UAAU,KAAK,YAAY,gDAAgD,aAAa;AAAA,EACxG,WAAW,UAAU,KAAK,YAAY,wDAAwD,aAAa;AAAA,EAC3G,gBAAgB,UAAU,KACvB,YAAY,yEACZ,aAAa;AAAA,EAChB,qBAAqB,UAAU,KAAK,YAAY,gDAAgD,aAAa;AAAA,EAC7G,oBAAoB,UAAU,KAAK,YAAY,iDAAiD,aAAa;AAAA,EAC7G,UAAU,UAAU,KAAK,YAAY,uDAAuD,aAAa;AAAA,EACzG,aAAa,UAAU,KAAK,YAAY,8CAA8C,aAAa;AAAA,EACnG,aAAa,UAAU,KAAK,YAAY,8CAA8C,aAAa;AAAA,EACnG,sBAAsB,UAAU,KAC7B,YAAY,mDACZ,aAAa;AAAA,EAChB,eAAe,UAAU,KAAK,YAAY,kDAAkD,aAAa;AAAA,EACzG,mBAAmB,UAAU,KAC1B,YAAY,gDACZ,aAAa;AAAA,EAChB,gBAAgB,UAAU,KAAK,YAAY,4CAA4C,aAAa;AAAA,EACpG,0BAA0B,UAAU,KACjC,YAAY,mEACZ,aAAa;AAAA,EAChB,SAAS,UAAU,MAAM,CAAC,UAAU,YAAY,YAAY,mBAAmB,aAAa;AAAA,EAC5F,eAAe,UAAU,MAAM,CAAC,QAAQ,YAAY,aACjD,YAAY,+BACZ,aAAa;AAAA,EAChB,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,SAAS,YAAY,oBAAoB,aAAa;AAAA,EAC9G,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,SACtD,YAAY,qBACZ,aAAa;AAAA,EAChB,WAAW,UAAU,KAAK,YAAY;AAAA,EACtC,UAAU,UAAU,KAAK,YAAY;AAAA,EACrC,aAAa,UAAU,OAAO,YAAY;AAAA,EAC1C,oBAAoB,UAAU,OAC3B,YAAY,+EACZ,aAAa;AAAA,EAChB,MAAM,UAAU,OAAO,YAAY,+CAA+C,aAAa;AAAA,EAC/F,oBAAoB,UAAU,KAAK,YAAY,uCAAuC,aAAa;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,21 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { DSNavSearchBox } from "@elliemae/ds-form";
4
+ function TreeViewSearchBar(props) {
5
+ const { handleChange, onNext, onPrevious, onClear, currentResultIndex, totalResults, value } = props;
6
+ return /* @__PURE__ */ React2.createElement(DSNavSearchBox, {
7
+ onChange: (v) => {
8
+ handleChange({ target: { value: v } });
9
+ },
10
+ onNext,
11
+ onPrevious,
12
+ onClear,
13
+ currentResultIndex,
14
+ totalResults,
15
+ value
16
+ });
17
+ }
18
+ export {
19
+ TreeViewSearchBar
20
+ };
21
+ //# sourceMappingURL=TreeViewSearchBar.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/related-components/TreeViewSearchBar.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { DSNavSearchBox } from '@elliemae/ds-form';\n\ninterface PropsT {\n handleChange: (opt: { target: { value: string } }) => void;\n onNext: () => void;\n onPrevious: () => void;\n onClear: () => void;\n currentResultIndex: number;\n totalResults: number;\n value: string;\n}\n\nexport function TreeViewSearchBar(props: PropsT) {\n const { handleChange, onNext, onPrevious, onClear, currentResultIndex, totalResults, value } = props;\n\n return (\n <DSNavSearchBox\n onChange={(v: string) => {\n handleChange({ target: { value: v } });\n }}\n onNext={onNext}\n onPrevious={onPrevious}\n onClear={onClear}\n currentResultIndex={currentResultIndex}\n totalResults={totalResults}\n value={value}\n />\n );\n}\n\n// TreeViewSearchBar.propTypes = {\n// value: PropTypes.string.isRequired,\n// handleChange: PropTypes.func.isRequired,\n// onNext: PropTypes.func.isRequired,\n// onPrevious: PropTypes.func.isRequired,\n// onClear: PropTypes.func.isRequired,\n// currentResultIndex: PropTypes.number.isRequired,\n// totalResults: PropTypes.number.isRequired,\n// };\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AAYO,2BAA2B,OAAe;AAC/C,QAAM,EAAE,cAAc,QAAQ,YAAY,SAAS,oBAAoB,cAAc,UAAU;AAE/F,SACE,qCAAC,gBAAD;AAAA,IACE,UAAU,CAAC,MAAc;AACvB,mBAAa,EAAE,QAAQ,EAAE,OAAO;AAAA;AAAA,IAElC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import * as React from "react";
2
+ //# sourceMappingURL=sharedTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": "AAAA;",
6
+ "names": []
7
+ }
@@ -1,9 +1,6 @@
1
- import 'core-js/modules/web.dom-collections.iterator.js';
2
-
3
- // https://github.com/sindresorhus/array-move/blob/master/index.js
1
+ import * as React from "react";
4
2
  const arrayMoveMutate = (array, from, to) => {
5
3
  const startIndex = from < 0 ? array.length + from : from;
6
-
7
4
  if (startIndex >= 0 && startIndex < array.length) {
8
5
  const endIndex = to < 0 ? array.length + to : to;
9
6
  const [item] = array.splice(from, 1);
@@ -15,5 +12,8 @@ const arrayMove = (array, from, to) => {
15
12
  arrayMoveMutate(newArray, from, to);
16
13
  return newArray;
17
14
  };
18
-
19
- export { arrayMove, arrayMoveMutate };
15
+ export {
16
+ arrayMove,
17
+ arrayMoveMutate
18
+ };
19
+ //# sourceMappingURL=array-helpers.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/array-helpers.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// https://github.com/sindresorhus/array-move/blob/master/index.js\nexport const arrayMoveMutate = (array: unknown[], from: number, to: number) => {\n const startIndex = from < 0 ? array.length + from : from;\n\n if (startIndex >= 0 && startIndex < array.length) {\n const endIndex = to < 0 ? array.length + to : to;\n\n const [item] = array.splice(from, 1);\n array.splice(endIndex, 0, item);\n }\n};\n\nexport const arrayMove = (array: unknown[], from: number, to: number) => {\n const newArray = [...array];\n arrayMoveMutate(newArray, from, to);\n return newArray;\n};\n"],
5
+ "mappings": "AAAA;ACCO,MAAM,kBAAkB,CAAC,OAAkB,MAAc,OAAe;AAC7E,QAAM,aAAa,OAAO,IAAI,MAAM,SAAS,OAAO;AAEpD,MAAI,cAAc,KAAK,aAAa,MAAM,QAAQ;AAChD,UAAM,WAAW,KAAK,IAAI,MAAM,SAAS,KAAK;AAE9C,UAAM,CAAC,QAAQ,MAAM,OAAO,MAAM;AAClC,UAAM,OAAO,UAAU,GAAG;AAAA;AAAA;AAIvB,MAAM,YAAY,CAAC,OAAkB,MAAc,OAAe;AACvE,QAAM,WAAW,CAAC,GAAG;AACrB,kBAAgB,UAAU,MAAM;AAChC,SAAO;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,109 @@
1
+ import * as React from "react";
2
+ import { useCallback, useEffect } from "react";
3
+ const updateExpandedState = (treeRoot, onExpandChange) => {
4
+ const shouldContinueWalking = true;
5
+ const newExpandedHashMap = { __ds_tree_root: true };
6
+ treeRoot.walk((node) => {
7
+ if (!node.isRoot() && node.model.isGroup && node.model.isExpanded) {
8
+ newExpandedHashMap[node.model.id] = true;
9
+ }
10
+ return shouldContinueWalking;
11
+ });
12
+ if (onExpandChange)
13
+ onExpandChange(newExpandedHashMap, null);
14
+ };
15
+ const toggleItemExpand = (itemToToggle, triggerTreeRerender, updateUserExpandedState, scrollTo = () => {
16
+ }) => {
17
+ const {
18
+ node: {
19
+ model: { isExpanded }
20
+ },
21
+ virtualIndex
22
+ } = itemToToggle;
23
+ if (itemToToggle.node.model.isGroup) {
24
+ itemToToggle.node.model.isExpanded = !isExpanded;
25
+ triggerTreeRerender();
26
+ updateUserExpandedState();
27
+ setTimeout(() => {
28
+ if (typeof virtualIndex === "number")
29
+ scrollTo(virtualIndex, { align: "start" });
30
+ });
31
+ }
32
+ };
33
+ const expandItemModel = (modelToExpand) => {
34
+ if (modelToExpand.isGroup)
35
+ modelToExpand.isExpanded = true;
36
+ };
37
+ const collapseItemModel = (modelToCollapse) => {
38
+ if (modelToCollapse.isGroup)
39
+ modelToCollapse.isExpanded = false;
40
+ };
41
+ const expandAll = (treeRoot, triggerTreeRerender) => {
42
+ const shouldContinueWalking = true;
43
+ treeRoot.walk((node) => {
44
+ if (!node.isRoot())
45
+ expandItemModel(node.model);
46
+ return shouldContinueWalking;
47
+ });
48
+ triggerTreeRerender();
49
+ };
50
+ const collapseAll = (treeRoot, triggerTreeRerender) => {
51
+ const shouldContinueWalking = true;
52
+ treeRoot.walk((node) => {
53
+ if (!node.isRoot())
54
+ collapseItemModel(node.model);
55
+ return shouldContinueWalking;
56
+ });
57
+ triggerTreeRerender();
58
+ };
59
+ const getToggleExpandShouldExpand = (treeRoot) => {
60
+ let shouldExpand = false;
61
+ const shouldContinueWalking = true;
62
+ treeRoot.walk((node) => {
63
+ if (!node.isRoot()) {
64
+ if (!node.model.isExpanded && node.model.isGroup) {
65
+ shouldExpand = true;
66
+ return shouldContinueWalking;
67
+ }
68
+ }
69
+ return shouldContinueWalking;
70
+ });
71
+ return shouldExpand;
72
+ };
73
+ const toggleExpandAllHelper = (isExpand, treeRoot, triggerTreeRerender, setLatestToggledItem, updateUserExpandedState) => {
74
+ if (isExpand === true)
75
+ expandAll(treeRoot, triggerTreeRerender);
76
+ else if (isExpand === false)
77
+ collapseAll(treeRoot, triggerTreeRerender);
78
+ else {
79
+ const shouldExpand = getToggleExpandShouldExpand(treeRoot);
80
+ if (shouldExpand === true)
81
+ expandAll(treeRoot, triggerTreeRerender);
82
+ else
83
+ collapseAll(treeRoot, triggerTreeRerender);
84
+ }
85
+ setLatestToggledItem(null);
86
+ updateUserExpandedState();
87
+ };
88
+ const useNotifyExpandedChange = (propsWithDefaults, {
89
+ latestToggledItem,
90
+ expandedGroups
91
+ }) => {
92
+ const notifyExpandedChange = useCallback((expandedGroupHashmap) => propsWithDefaults?.onExpandChange(expandedGroupHashmap || {}, latestToggledItem), [propsWithDefaults, latestToggledItem]);
93
+ useEffect(() => {
94
+ if (!propsWithDefaults.expanded)
95
+ notifyExpandedChange(expandedGroups);
96
+ }, [expandedGroups, notifyExpandedChange, propsWithDefaults.expanded]);
97
+ };
98
+ export {
99
+ collapseAll,
100
+ collapseItemModel,
101
+ expandAll,
102
+ expandItemModel,
103
+ getToggleExpandShouldExpand,
104
+ toggleExpandAllHelper,
105
+ toggleItemExpand,
106
+ updateExpandedState,
107
+ useNotifyExpandedChange
108
+ };
109
+ //# sourceMappingURL=group-expands-helpers.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/group-expands-helpers.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport { useCallback, useEffect } from 'react';\nimport type { DSTreeviewT } from '../react-desc-prop-types';\nimport type { DSTreeviewInternalsT } from '../sharedTypes';\n\nexport const updateExpandedState = (\n treeRoot: DSTreeviewT.Item['node'],\n onExpandChange: DSTreeviewT.Props['onExpandChange'] | null | undefined,\n) => {\n const shouldContinueWalking = true;\n const newExpandedHashMap: DSTreeviewT.ExpandedItems = { __ds_tree_root: true };\n treeRoot.walk((node) => {\n if (!node.isRoot() && node.model.isGroup && node.model.isExpanded) {\n newExpandedHashMap[node.model.id] = true;\n }\n return shouldContinueWalking;\n });\n if (onExpandChange) onExpandChange(newExpandedHashMap, null);\n};\n\nexport const toggleItemExpand = (\n itemToToggle: DSTreeviewT.Item,\n triggerTreeRerender: () => void,\n updateUserExpandedState: DSTreeviewInternalsT.CTX['updateUserExpandedState'],\n scrollTo: DSTreeviewT.ScrollToFunc = () => {},\n) => {\n const {\n node: {\n model: { isExpanded },\n },\n virtualIndex,\n } = itemToToggle;\n if (itemToToggle.node.model.isGroup) {\n itemToToggle.node.model.isExpanded = !isExpanded;\n triggerTreeRerender();\n updateUserExpandedState();\n setTimeout(() => {\n if (typeof virtualIndex === 'number') scrollTo(virtualIndex, { align: 'start' });\n });\n }\n};\n\nexport const expandItemModel = (modelToExpand: DSTreeviewT.Item['model']) => {\n if (modelToExpand.isGroup) modelToExpand.isExpanded = true;\n};\n\nexport const collapseItemModel = (modelToCollapse: DSTreeviewT.Item['model']) => {\n if (modelToCollapse.isGroup) modelToCollapse.isExpanded = false;\n};\n\nexport const expandAll = (treeRoot: DSTreeviewT.Item['node'], triggerTreeRerender: () => void) => {\n const shouldContinueWalking = true;\n treeRoot.walk((node) => {\n if (!node.isRoot()) expandItemModel(node.model);\n return shouldContinueWalking;\n });\n triggerTreeRerender();\n};\n\nexport const collapseAll = (treeRoot: DSTreeviewT.Item['node'], triggerTreeRerender: () => void) => {\n const shouldContinueWalking = true; // tree-model ask we return true if we want to continue walking\n treeRoot.walk((node) => {\n if (!node.isRoot()) collapseItemModel(node.model);\n return shouldContinueWalking;\n });\n triggerTreeRerender();\n};\n\nexport const getToggleExpandShouldExpand = (treeRoot: DSTreeviewT.Item['node']) => {\n let shouldExpand = false;\n const shouldContinueWalking = true; // tree-model ask we return true if we want to continue walking\n treeRoot.walk((node) => {\n if (!node.isRoot()) {\n if (!node.model.isExpanded && node.model.isGroup) {\n shouldExpand = true;\n // eslint-disable-next-line no-useless-return\n return shouldContinueWalking;\n }\n }\n return shouldContinueWalking;\n });\n return shouldExpand;\n};\n\nexport const toggleExpandAllHelper = (\n isExpand: boolean | 'toggle',\n treeRoot: DSTreeviewT.Item['node'],\n triggerTreeRerender: () => void,\n setLatestToggledItem: DSTreeviewInternalsT.CTX['setLatestToggledItem'],\n updateUserExpandedState: DSTreeviewInternalsT.CTX['updateUserExpandedState'],\n) => {\n if (isExpand === true) expandAll(treeRoot, triggerTreeRerender);\n else if (isExpand === false) collapseAll(treeRoot, triggerTreeRerender);\n else {\n const shouldExpand = getToggleExpandShouldExpand(treeRoot);\n if (shouldExpand === true) expandAll(treeRoot, triggerTreeRerender);\n else collapseAll(treeRoot, triggerTreeRerender);\n }\n setLatestToggledItem(null);\n updateUserExpandedState();\n};\n\nexport const useNotifyExpandedChange = (\n propsWithDefaults: DSTreeviewT.Props,\n {\n latestToggledItem,\n expandedGroups,\n }: {\n latestToggledItem?: DSTreeviewInternalsT.CTX['latestToggledItem'];\n expandedGroups?: DSTreeviewInternalsT.CTX['expandedGroups'];\n },\n) => {\n const notifyExpandedChange = useCallback(\n (expandedGroupHashmap?: DSTreeviewInternalsT.CTX['expandedGroups']) =>\n propsWithDefaults?.onExpandChange(expandedGroupHashmap || {}, latestToggledItem),\n [propsWithDefaults, latestToggledItem],\n );\n\n useEffect(() => {\n if (!propsWithDefaults.expanded) notifyExpandedChange(expandedGroups);\n }, [expandedGroups, notifyExpandedChange, propsWithDefaults.expanded]);\n};\n"],
5
+ "mappings": "AAAA;ACCA;AAIO,MAAM,sBAAsB,CACjC,UACA,mBACG;AACH,QAAM,wBAAwB;AAC9B,QAAM,qBAAgD,EAAE,gBAAgB;AACxE,WAAS,KAAK,CAAC,SAAS;AACtB,QAAI,CAAC,KAAK,YAAY,KAAK,MAAM,WAAW,KAAK,MAAM,YAAY;AACjE,yBAAmB,KAAK,MAAM,MAAM;AAAA;AAEtC,WAAO;AAAA;AAET,MAAI;AAAgB,mBAAe,oBAAoB;AAAA;AAGlD,MAAM,mBAAmB,CAC9B,cACA,qBACA,yBACA,WAAqC,MAAM;AAAA,MACxC;AACH,QAAM;AAAA,IACJ,MAAM;AAAA,MACJ,OAAO,EAAE;AAAA;AAAA,IAEX;AAAA,MACE;AACJ,MAAI,aAAa,KAAK,MAAM,SAAS;AACnC,iBAAa,KAAK,MAAM,aAAa,CAAC;AACtC;AACA;AACA,eAAW,MAAM;AACf,UAAI,OAAO,iBAAiB;AAAU,iBAAS,cAAc,EAAE,OAAO;AAAA;AAAA;AAAA;AAKrE,MAAM,kBAAkB,CAAC,kBAA6C;AAC3E,MAAI,cAAc;AAAS,kBAAc,aAAa;AAAA;AAGjD,MAAM,oBAAoB,CAAC,oBAA+C;AAC/E,MAAI,gBAAgB;AAAS,oBAAgB,aAAa;AAAA;AAGrD,MAAM,YAAY,CAAC,UAAoC,wBAAoC;AAChG,QAAM,wBAAwB;AAC9B,WAAS,KAAK,CAAC,SAAS;AACtB,QAAI,CAAC,KAAK;AAAU,sBAAgB,KAAK;AACzC,WAAO;AAAA;AAET;AAAA;AAGK,MAAM,cAAc,CAAC,UAAoC,wBAAoC;AAClG,QAAM,wBAAwB;AAC9B,WAAS,KAAK,CAAC,SAAS;AACtB,QAAI,CAAC,KAAK;AAAU,wBAAkB,KAAK;AAC3C,WAAO;AAAA;AAET;AAAA;AAGK,MAAM,8BAA8B,CAAC,aAAuC;AACjF,MAAI,eAAe;AACnB,QAAM,wBAAwB;AAC9B,WAAS,KAAK,CAAC,SAAS;AACtB,QAAI,CAAC,KAAK,UAAU;AAClB,UAAI,CAAC,KAAK,MAAM,cAAc,KAAK,MAAM,SAAS;AAChD,uBAAe;AAEf,eAAO;AAAA;AAAA;AAGX,WAAO;AAAA;AAET,SAAO;AAAA;AAGF,MAAM,wBAAwB,CACnC,UACA,UACA,qBACA,sBACA,4BACG;AACH,MAAI,aAAa;AAAM,cAAU,UAAU;AAAA,WAClC,aAAa;AAAO,gBAAY,UAAU;AAAA,OAC9C;AACH,UAAM,eAAe,4BAA4B;AACjD,QAAI,iBAAiB;AAAM,gBAAU,UAAU;AAAA;AAC1C,kBAAY,UAAU;AAAA;AAE7B,uBAAqB;AACrB;AAAA;AAGK,MAAM,0BAA0B,CACrC,mBACA;AAAA,EACE;AAAA,EACA;AAAA,MAKC;AACH,QAAM,uBAAuB,YAC3B,CAAC,yBACC,mBAAmB,eAAe,wBAAwB,IAAI,oBAChE,CAAC,mBAAmB;AAGtB,YAAU,MAAM;AACd,QAAI,CAAC,kBAAkB;AAAU,2BAAqB;AAAA,KACrD,CAAC,gBAAgB,sBAAsB,kBAAkB;AAAA;",
6
+ "names": []
7
+ }