@elliemae/ds-treeview 2.3.1 → 3.0.0-alpha.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 (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 +163 -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 +134 -0
  14. package/dist/cjs/hoc/WithConditionalDnDContext.js.map +7 -0
  15. package/dist/cjs/hoc/WithDnDSortableItemContext.js +83 -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 +111 -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 +71 -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 +180 -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 +135 -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 +102 -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 +123 -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 +136 -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 +107 -0
  110. package/dist/esm/hoc/WithConditionalDnDContext.js.map +7 -0
  111. package/dist/esm/hoc/WithDnDSortableItemContext.js +56 -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 +84 -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 +44 -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 +153 -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 +108 -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 +75 -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 +96 -0
  192. package/dist/esm/utils/useTree.js.map +7 -0
  193. package/package.json +133 -123
  194. package/cjs/TreeView.js +0 -30
  195. package/cjs/TreeViewContext.js +0 -98
  196. package/cjs/config/cssClassesConstants.js +0 -13
  197. package/cjs/config/useTreeview.js +0 -127
  198. package/cjs/hoc/DnDTreeContext.js +0 -18
  199. package/cjs/hoc/SortableItemContext.js +0 -21
  200. package/cjs/hoc/WithConditionalDnDContext.js +0 -138
  201. package/cjs/hoc/WithDnDSortableItemContext.js +0 -70
  202. package/cjs/index.js +0 -26
  203. package/cjs/parts/CheckboxSelectable.js +0 -86
  204. package/cjs/parts/ChildrenCountDisplayer.js +0 -30
  205. package/cjs/parts/DnDHandle.js +0 -46
  206. package/cjs/parts/DropIndicator.js +0 -75
  207. package/cjs/parts/ExpandCaret.js +0 -94
  208. package/cjs/parts/Icon.js +0 -37
  209. package/cjs/parts/NestingSpace.js +0 -47
  210. package/cjs/parts/RadioSelectable.js +0 -59
  211. package/cjs/parts/TreeItem.js +0 -185
  212. package/cjs/parts/TreeItemText.js +0 -108
  213. package/cjs/parts/TreeList.js +0 -139
  214. package/cjs/plugins/dnd/TreeDndPlugin.js +0 -7
  215. package/cjs/plugins/dnd/index.js +0 -9
  216. package/cjs/plugins/index.js +0 -21
  217. package/cjs/plugins/roving/TreeRovingPlugin.js +0 -7
  218. package/cjs/plugins/roving/index.js +0 -9
  219. package/cjs/plugins/searchable/SearchableTreePlugin.js +0 -7
  220. package/cjs/plugins/searchable/index.js +0 -9
  221. package/cjs/plugins/selectable/SelectablePluginTree.js +0 -7
  222. package/cjs/plugins/selectable/index.js +0 -9
  223. package/cjs/plugins/toolbar/TreeToolbarPlugin.js +0 -7
  224. package/cjs/plugins/toolbar/index.js +0 -9
  225. package/cjs/plugins/tree/TreeDataPlugin.js +0 -7
  226. package/cjs/plugins/tree/index.js +0 -9
  227. package/cjs/plugins/virtualization/TreeVirtualizationPlugin.js +0 -7
  228. package/cjs/plugins/virtualization/index.js +0 -9
  229. package/cjs/react-desc-prop-types.js +0 -56
  230. package/cjs/related-components/TreeViewSearchBar.js +0 -48
  231. package/cjs/sharedTypes.js +0 -2
  232. package/cjs/utils/array-helpers.js +0 -24
  233. package/cjs/utils/group-expands-helpers.js +0 -111
  234. package/cjs/utils/keyboard-helpers.js +0 -175
  235. package/cjs/utils/object-helpers.js +0 -69
  236. package/cjs/utils/refs-helpers.js +0 -31
  237. package/cjs/utils/selectable-helper.js +0 -80
  238. package/cjs/utils/string-helpers.js +0 -7
  239. package/cjs/utils/tree-helpers.js +0 -220
  240. package/cjs/utils/useInstanceRefActions.js +0 -87
  241. package/cjs/utils/useTree.js +0 -108
  242. package/esm/TreeView.js +0 -21
  243. package/esm/config/cssClassesConstants.js +0 -6
  244. package/esm/config/useTreeview.js +0 -119
  245. package/esm/hoc/DnDTreeContext.js +0 -14
  246. package/esm/hoc/SortableItemContext.js +0 -17
  247. package/esm/hoc/WithConditionalDnDContext.js +0 -128
  248. package/esm/hoc/WithDnDSortableItemContext.js +0 -61
  249. package/esm/index.js +0 -9
  250. package/esm/parts/CheckboxSelectable.js +0 -78
  251. package/esm/parts/ChildrenCountDisplayer.js +0 -22
  252. package/esm/parts/DnDHandle.js +0 -38
  253. package/esm/parts/DropIndicator.js +0 -68
  254. package/esm/parts/ExpandCaret.js +0 -85
  255. package/esm/parts/Icon.js +0 -29
  256. package/esm/parts/NestingSpace.js +0 -39
  257. package/esm/parts/RadioSelectable.js +0 -53
  258. package/esm/parts/TreeItem.js +0 -173
  259. package/esm/parts/TreeItemText.js +0 -99
  260. package/esm/parts/TreeList.js +0 -127
  261. package/esm/plugins/dnd/TreeDndPlugin.js +0 -3
  262. package/esm/plugins/dnd/index.js +0 -1
  263. package/esm/plugins/index.js +0 -7
  264. package/esm/plugins/roving/TreeRovingPlugin.js +0 -3
  265. package/esm/plugins/roving/index.js +0 -1
  266. package/esm/plugins/searchable/SearchableTreePlugin.js +0 -3
  267. package/esm/plugins/searchable/index.js +0 -1
  268. package/esm/plugins/selectable/SelectablePluginTree.js +0 -3
  269. package/esm/plugins/selectable/index.js +0 -1
  270. package/esm/plugins/toolbar/TreeToolbarPlugin.js +0 -3
  271. package/esm/plugins/toolbar/index.js +0 -1
  272. package/esm/plugins/tree/TreeDataPlugin.js +0 -3
  273. package/esm/plugins/tree/index.js +0 -1
  274. package/esm/plugins/virtualization/TreeVirtualizationPlugin.js +0 -3
  275. package/esm/plugins/virtualization/index.js +0 -1
  276. package/esm/react-desc-prop-types.js +0 -52
  277. package/esm/related-components/TreeViewSearchBar.js +0 -40
  278. package/esm/sharedTypes.js +0 -1
  279. package/esm/utils/group-expands-helpers.js +0 -99
  280. package/esm/utils/object-helpers.js +0 -64
  281. package/esm/utils/refs-helpers.js +0 -27
  282. package/esm/utils/selectable-helper.js +0 -70
  283. package/esm/utils/string-helpers.js +0 -3
  284. package/esm/utils/tree-helpers.js +0 -205
  285. package/esm/utils/useTree.js +0 -99
  286. package/types/TreeView.d.ts +0 -13
  287. package/types/TreeViewContext.d.ts +0 -17
  288. package/types/config/cssClassesConstants.d.ts +0 -4
  289. package/types/config/useTreeview.d.ts +0 -7
  290. package/types/hoc/DnDTreeContext.d.ts +0 -14
  291. package/types/hoc/SortableItemContext.d.ts +0 -19
  292. package/types/hoc/WithConditionalDnDContext.d.ts +0 -4
  293. package/types/hoc/WithDnDSortableItemContext.d.ts +0 -4
  294. package/types/index.d.ts +0 -3
  295. package/types/parts/CheckboxSelectable.d.ts +0 -8
  296. package/types/parts/ChildrenCountDisplayer.d.ts +0 -7
  297. package/types/parts/DnDHandle.d.ts +0 -6
  298. package/types/parts/DropIndicator.d.ts +0 -10
  299. package/types/parts/ExpandCaret.d.ts +0 -7
  300. package/types/parts/Icon.d.ts +0 -7
  301. package/types/parts/NestingSpace.d.ts +0 -8
  302. package/types/parts/RadioSelectable.d.ts +0 -8
  303. package/types/parts/TreeItem.d.ts +0 -17
  304. package/types/parts/TreeItemText.d.ts +0 -7
  305. package/types/parts/TreeList.d.ts +0 -20
  306. package/types/plugins/dnd/TreeDndPlugin.d.ts +0 -1
  307. package/types/plugins/dnd/index.d.ts +0 -1
  308. package/types/plugins/index.d.ts +0 -7
  309. package/types/plugins/roving/TreeRovingPlugin.d.ts +0 -1
  310. package/types/plugins/roving/index.d.ts +0 -1
  311. package/types/plugins/searchable/SearchableTreePlugin.d.ts +0 -1
  312. package/types/plugins/searchable/index.d.ts +0 -1
  313. package/types/plugins/selectable/SelectablePluginTree.d.ts +0 -1
  314. package/types/plugins/selectable/index.d.ts +0 -1
  315. package/types/plugins/toolbar/TreeToolbarPlugin.d.ts +0 -1
  316. package/types/plugins/toolbar/index.d.ts +0 -1
  317. package/types/plugins/tree/TreeDataPlugin.d.ts +0 -1
  318. package/types/plugins/tree/index.d.ts +0 -1
  319. package/types/plugins/virtualization/TreeVirtualizationPlugin.d.ts +0 -1
  320. package/types/plugins/virtualization/index.d.ts +0 -1
  321. package/types/react-desc-prop-types.d.ts +0 -210
  322. package/types/related-components/TreeViewSearchBar.d.ts +0 -16
  323. package/types/sharedTypes.d.ts +0 -47
  324. package/types/utils/array-helpers.d.ts +0 -2
  325. package/types/utils/group-expands-helpers.d.ts +0 -14
  326. package/types/utils/keyboard-helpers.d.ts +0 -6
  327. package/types/utils/object-helpers.d.ts +0 -6
  328. package/types/utils/refs-helpers.d.ts +0 -4
  329. package/types/utils/selectable-helper.d.ts +0 -7
  330. package/types/utils/string-helpers.d.ts +0 -1
  331. package/types/utils/tree-helpers.d.ts +0 -28
  332. package/types/utils/useInstanceRefActions.d.ts +0 -3
  333. package/types/utils/useTree.d.ts +0 -14
@@ -0,0 +1,108 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ import * as React from "react";
18
+ import React2, { useContext } from "react";
19
+ import { aggregatedClasses } from "@elliemae/ds-classnames";
20
+ import { DSCircularProgressIndicator } from "@elliemae/ds-circular-progress-indicator";
21
+ import TreeViewContext from "../TreeViewContext";
22
+ import { DSTreeViewPrefix, treeListBlockName } from "../config/cssClassesConstants";
23
+ import TreeItem from "./TreeItem";
24
+ import { withConditionalDnDRowContext } from "../hoc/WithConditionalDnDContext";
25
+ import { DnDTreeContext } from "../hoc/DnDTreeContext";
26
+ const treeListNoItemsBn = `${treeListBlockName}-no-items`;
27
+ const TreeListNoItems = aggregatedClasses("div", {
28
+ "data-testid": treeListNoItemsBn
29
+ })(treeListNoItemsBn);
30
+ const TreeListWrapper = aggregatedClasses("ul", {
31
+ "data-testid": treeListBlockName,
32
+ role: "tree"
33
+ })(treeListBlockName, null, ({ rowSize }) => ({
34
+ [`rowsize-${rowSize}`]: rowSize
35
+ }));
36
+ const compactRowClass = `${DSTreeViewPrefix}-tv-row-size-compact`;
37
+ const normaRowClass = `${DSTreeViewPrefix}-tv-row-size-normal`;
38
+ const TreeListComp = () => {
39
+ const ctx = useContext(TreeViewContext);
40
+ const {
41
+ virtualListRef,
42
+ virtualListHelpers,
43
+ visibleItems: flattenedVisibleItems,
44
+ props: { width, height, rowSize, noItemsPlaceholder, isLoading }
45
+ } = ctx;
46
+ const { totalSize, virtualItems } = virtualListHelpers;
47
+ const className = `${rowSize === "compact" ? `${compactRowClass}` : `${normaRowClass}`}`;
48
+ const { visibleItems } = useContext(DnDTreeContext);
49
+ return /* @__PURE__ */ React2.createElement(TreeListWrapper, {
50
+ ref: virtualListRef,
51
+ className,
52
+ style: {
53
+ height: `${typeof height === "number" ? `${height}px` : height}`,
54
+ width: `${typeof width === "number" ? `${width}px` : width}`,
55
+ overflow: "auto"
56
+ }
57
+ }, isLoading ? /* @__PURE__ */ React2.createElement("div", {
58
+ style: {
59
+ width: "100%",
60
+ height: "100%",
61
+ display: "flex",
62
+ alignItems: "center",
63
+ justifyContent: "center"
64
+ }
65
+ }, /* @__PURE__ */ React2.createElement(DSCircularProgressIndicator, {
66
+ size: "xl",
67
+ loading: isLoading,
68
+ showLabel: true,
69
+ waiting: false,
70
+ showTooltip: false
71
+ })) : null, !isLoading && virtualItems.length === 0 ? /* @__PURE__ */ React2.createElement(TreeListNoItems, null, noItemsPlaceholder) : null, !isLoading && virtualItems.length !== 0 ? /* @__PURE__ */ React2.createElement("div", {
72
+ style: {
73
+ height: `${totalSize}px`,
74
+ width: "100%",
75
+ position: "relative"
76
+ }
77
+ }, virtualItems.map((virtualItem) => {
78
+ const { index, measureRef, start } = virtualItem;
79
+ const item = (visibleItems || flattenedVisibleItems)[index];
80
+ if (!item)
81
+ return null;
82
+ item.virtualIndex = index;
83
+ const { id } = item;
84
+ const style = {
85
+ position: "absolute",
86
+ top: `${start}px`,
87
+ left: 0,
88
+ width: "100%"
89
+ };
90
+ const listItemProps = {
91
+ key: `DS-TreeView-List-Item-${id}`,
92
+ virtualItemRef: measureRef,
93
+ index,
94
+ itemIndex: index,
95
+ item,
96
+ itemWrapperStyle: style
97
+ };
98
+ return /* @__PURE__ */ React2.createElement(TreeItem, __spreadValues({}, listItemProps));
99
+ })) : null);
100
+ };
101
+ const TreeList = withConditionalDnDRowContext(TreeListComp);
102
+ export {
103
+ TreeList,
104
+ TreeListNoItems,
105
+ TreeListWrapper,
106
+ treeListNoItemsBn
107
+ };
108
+ //# sourceMappingURL=TreeList.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/TreeList.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useContext } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DSCircularProgressIndicator } from '@elliemae/ds-circular-progress-indicator';\n\nimport TreeViewContext from '../TreeViewContext';\nimport { DSTreeViewPrefix, treeListBlockName } from '../config/cssClassesConstants';\nimport TreeItem from './TreeItem';\n\nimport type { DSTreeviewT } from '../react-desc-prop-types';\nimport { withConditionalDnDRowContext } from '../hoc/WithConditionalDnDContext';\nimport { DnDTreeContext } from '../hoc/DnDTreeContext';\n\nexport const treeListNoItemsBn = `${treeListBlockName}-no-items`;\nexport const TreeListNoItems = aggregatedClasses('div', {\n 'data-testid': treeListNoItemsBn,\n})(treeListNoItemsBn) as unknown as React.ComponentType<React.ComponentProps<'div'>>;\n\n// React.ComponentProps<'ul'> uses LegacyRef typings that existed pre-hook era\n// we omit the LegacyRef typings in favor of hook-era typings\ninterface UlProps extends Omit<React.ComponentProps<'ul'>, 'ref'> {\n ref: React.MutableRefObject<HTMLUListElement | undefined> | undefined;\n}\nexport const TreeListWrapper = aggregatedClasses('ul', {\n 'data-testid': treeListBlockName,\n role: 'tree',\n})(treeListBlockName, null, ({ rowSize }: { rowSize: 'normal' | 'compact' }) => ({\n [`rowsize-${rowSize}`]: rowSize,\n})) as unknown as React.ComponentType<UlProps>;\n\nconst compactRowClass = `${DSTreeViewPrefix}-tv-row-size-compact`;\nconst normaRowClass = `${DSTreeViewPrefix}-tv-row-size-normal`;\n\ninterface PropsT {\n onMouseDragOverItem?: (opts: {\n event: React.MouseEvent<HTMLLIElement>;\n item: DSTreeviewT.Item;\n itemIndex: number;\n setIsDraggingOverThis: React.Dispatch<React.SetStateAction<boolean>>;\n openFolderOnHoverTimeout: React.MutableRefObject<NodeJS.Timeout | null>;\n }) => void;\n}\n\nconst TreeListComp: React.ComponentType<PropsT> = () => {\n const ctx = useContext(TreeViewContext);\n const {\n virtualListRef,\n virtualListHelpers,\n visibleItems: flattenedVisibleItems,\n props: { width, height, rowSize, noItemsPlaceholder, isLoading },\n } = ctx;\n const { totalSize, virtualItems } = virtualListHelpers;\n const className = `${rowSize === 'compact' ? `${compactRowClass}` : `${normaRowClass}`}`;\n\n const { visibleItems } = useContext(DnDTreeContext);\n\n return (\n <TreeListWrapper\n ref={virtualListRef}\n className={className}\n style={{\n height: `${typeof height === 'number' ? `${height}px` : height}`,\n width: `${typeof width === 'number' ? `${width}px` : width}`,\n overflow: 'auto',\n }}\n >\n {isLoading ? (\n <div\n style={{\n width: '100%',\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n <DSCircularProgressIndicator size=\"xl\" loading={isLoading} showLabel waiting={false} showTooltip={false} />\n </div>\n ) : null}\n {!isLoading && virtualItems.length === 0 ? <TreeListNoItems>{noItemsPlaceholder}</TreeListNoItems> : null}\n {!isLoading && virtualItems.length !== 0 ? (\n <div\n style={{\n height: `${totalSize}px`,\n width: '100%',\n position: 'relative',\n }}\n >\n {virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const item = (visibleItems || flattenedVisibleItems)[index];\n if (!item) return null;\n item.virtualIndex = index;\n const { id } = item;\n\n const style = {\n position: 'absolute',\n top: `${start}px`,\n left: 0,\n width: '100%',\n };\n\n const listItemProps = {\n key: `DS-TreeView-List-Item-${id}`,\n virtualItemRef: measureRef,\n index, // this is consumed by the DnD HOC\n itemIndex: index,\n item,\n itemWrapperStyle: style,\n };\n\n return <TreeItem {...listItemProps} />;\n })}\n </div>\n ) : null}\n </TreeListWrapper>\n );\n};\n\nexport const TreeList = withConditionalDnDRowContext(TreeListComp);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AAEO,MAAM,oBAAoB,GAAG;AAC7B,MAAM,kBAAkB,kBAAkB,OAAO;AAAA,EACtD,eAAe;AAAA,GACd;AAOI,MAAM,kBAAkB,kBAAkB,MAAM;AAAA,EACrD,eAAe;AAAA,EACf,MAAM;AAAA,GACL,mBAAmB,MAAM,CAAC,EAAE,cAAkD;AAAA,GAC9E,WAAW,YAAY;AAAA;AAG1B,MAAM,kBAAkB,GAAG;AAC3B,MAAM,gBAAgB,GAAG;AAYzB,MAAM,eAA4C,MAAM;AACtD,QAAM,MAAM,WAAW;AACvB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd,OAAO,EAAE,OAAO,QAAQ,SAAS,oBAAoB;AAAA,MACnD;AACJ,QAAM,EAAE,WAAW,iBAAiB;AACpC,QAAM,YAAY,GAAG,YAAY,YAAY,GAAG,oBAAoB,GAAG;AAEvE,QAAM,EAAE,iBAAiB,WAAW;AAEpC,SACE,qCAAC,iBAAD;AAAA,IACE,KAAK;AAAA,IACL;AAAA,IACA,OAAO;AAAA,MACL,QAAQ,GAAG,OAAO,WAAW,WAAW,GAAG,aAAa;AAAA,MACxD,OAAO,GAAG,OAAO,UAAU,WAAW,GAAG,YAAY;AAAA,MACrD,UAAU;AAAA;AAAA,KAGX,YACC,qCAAC,OAAD;AAAA,IACE,OAAO;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,gBAAgB;AAAA;AAAA,KAGlB,qCAAC,6BAAD;AAAA,IAA6B,MAAK;AAAA,IAAK,SAAS;AAAA,IAAW,WAAS;AAAA,IAAC,SAAS;AAAA,IAAO,aAAa;AAAA,QAElG,MACH,CAAC,aAAa,aAAa,WAAW,IAAI,qCAAC,iBAAD,MAAkB,sBAAwC,MACpG,CAAC,aAAa,aAAa,WAAW,IACrC,qCAAC,OAAD;AAAA,IACE,OAAO;AAAA,MACL,QAAQ,GAAG;AAAA,MACX,OAAO;AAAA,MACP,UAAU;AAAA;AAAA,KAGX,aAAa,IAAI,CAAC,gBAAgB;AACjC,UAAM,EAAE,OAAO,YAAY,UAAU;AACrC,UAAM,OAAQ,iBAAgB,uBAAuB;AACrD,QAAI,CAAC;AAAM,aAAO;AAClB,SAAK,eAAe;AACpB,UAAM,EAAE,OAAO;AAEf,UAAM,QAAQ;AAAA,MACZ,UAAU;AAAA,MACV,KAAK,GAAG;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA;AAGT,UAAM,gBAAgB;AAAA,MACpB,KAAK,yBAAyB;AAAA,MAC9B,gBAAgB;AAAA,MAChB;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA,kBAAkB;AAAA;AAGpB,WAAO,qCAAC,UAAD,mBAAc;AAAA,QAGvB;AAAA;AAKH,MAAM,WAAW,6BAA6B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ const TreeDndPlugin = "tree-dnd";
3
+ export {
4
+ TreeDndPlugin
5
+ };
6
+ //# sourceMappingURL=TreeDndPlugin.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/dnd/TreeDndPlugin.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const TreeDndPlugin = 'tree-dnd';\n"],
5
+ "mappings": "AAAA;ACAO,MAAM,gBAAgB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ export * from "./TreeDndPlugin";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/dnd/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './TreeDndPlugin';\n"],
5
+ "mappings": "AAAA;ACAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ export * from "./dnd";
3
+ export * from "./roving";
4
+ export * from "./selectable";
5
+ export * from "./toolbar";
6
+ export * from "./tree";
7
+ export * from "./virtualization";
8
+ export * from "./searchable";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/plugins/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './dnd';\nexport * from './roving';\nexport * from './selectable';\nexport * from './toolbar';\nexport * from './tree';\nexport * from './virtualization';\nexport * from './searchable';\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;",
6
+ "names": []
7
+ }
@@ -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
+ }