@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
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var TreeDndPlugin = require('./TreeDndPlugin.js');
6
-
7
-
8
-
9
- exports.TreeDndPlugin = TreeDndPlugin.TreeDndPlugin;
@@ -1,21 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var TreeDndPlugin = require('./dnd/TreeDndPlugin.js');
6
- var TreeRovingPlugin = require('./roving/TreeRovingPlugin.js');
7
- var SelectablePluginTree = require('./selectable/SelectablePluginTree.js');
8
- var TreeToolbarPlugin = require('./toolbar/TreeToolbarPlugin.js');
9
- var TreeDataPlugin = require('./tree/TreeDataPlugin.js');
10
- var TreeVirtualizationPlugin = require('./virtualization/TreeVirtualizationPlugin.js');
11
- var SearchableTreePlugin = require('./searchable/SearchableTreePlugin.js');
12
-
13
-
14
-
15
- exports.TreeDndPlugin = TreeDndPlugin.TreeDndPlugin;
16
- exports.TreeRovingPlugin = TreeRovingPlugin.TreeRovingPlugin;
17
- exports.SelectablePluginTree = SelectablePluginTree.SelectablePluginTree;
18
- exports.TreeToolbarPlugin = TreeToolbarPlugin.TreeToolbarPlugin;
19
- exports.TreePluginList = TreeDataPlugin.TreePluginList;
20
- exports.TreeVirtualizationPlugin = TreeVirtualizationPlugin.TreeVirtualizationPlugin;
21
- exports.SearchableTreePlugin = SearchableTreePlugin.SearchableTreePlugin;
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const TreeRovingPlugin = 'tree-roving';
6
-
7
- exports.TreeRovingPlugin = TreeRovingPlugin;
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var TreeRovingPlugin = require('./TreeRovingPlugin.js');
6
-
7
-
8
-
9
- exports.TreeRovingPlugin = TreeRovingPlugin.TreeRovingPlugin;
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const SearchableTreePlugin = 'tree-searchable';
6
-
7
- exports.SearchableTreePlugin = SearchableTreePlugin;
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var SearchableTreePlugin = require('./SearchableTreePlugin.js');
6
-
7
-
8
-
9
- exports.SearchableTreePlugin = SearchableTreePlugin.SearchableTreePlugin;
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const SelectablePluginTree = 'tree-selectable';
6
-
7
- exports.SelectablePluginTree = SelectablePluginTree;
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var SelectablePluginTree = require('./SelectablePluginTree.js');
6
-
7
-
8
-
9
- exports.SelectablePluginTree = SelectablePluginTree.SelectablePluginTree;
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const TreeToolbarPlugin = 'tree-toolbar';
6
-
7
- exports.TreeToolbarPlugin = TreeToolbarPlugin;
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var TreeToolbarPlugin = require('./TreeToolbarPlugin.js');
6
-
7
-
8
-
9
- exports.TreeToolbarPlugin = TreeToolbarPlugin.TreeToolbarPlugin;
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const TreePluginList = 'tree-data';
6
-
7
- exports.TreePluginList = TreePluginList;
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var TreeDataPlugin = require('./TreeDataPlugin.js');
6
-
7
-
8
-
9
- exports.TreePluginList = TreeDataPlugin.TreePluginList;
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const TreeVirtualizationPlugin = 'tree-virtualization';
6
-
7
- exports.TreeVirtualizationPlugin = TreeVirtualizationPlugin;
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var TreeVirtualizationPlugin = require('./TreeVirtualizationPlugin.js');
6
-
7
-
8
-
9
- exports.TreeVirtualizationPlugin = TreeVirtualizationPlugin.TreeVirtualizationPlugin;
@@ -1,56 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var reactDesc = require('react-desc');
6
-
7
- /* eslint-disable max-lines */
8
- const TreeViewPropTypes = {
9
- data: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.shape({
10
- children: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.object),
11
- id: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.number]),
12
- isGroup: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.oneOf([undefined, null]), reactDesc.PropTypes.bool]),
13
- name: reactDesc.PropTypes.string,
14
- node: reactDesc.PropTypes.object
15
- })).description('data to populate tree view').isRequired,
16
- plugins: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.string).description('list of enabled plugins').defaultValue([]),
17
- selection: reactDesc.PropTypes.object.description('pre selected items').defaultValue({}),
18
- expanded: reactDesc.PropTypes.object.description('control what items are expanded').defaultValue(undefined),
19
- instanceRef: reactDesc.PropTypes.shape({
20
- current: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.oneOf([null, undefined]), reactDesc.PropTypes.shape({
21
- actions: reactDesc.PropTypes.shape({
22
- toggleExpandAll: reactDesc.PropTypes.func,
23
- scrollTo: reactDesc.PropTypes.func
24
- }).description('').isRequired
25
- })])
26
- }).description('instance ref'),
27
- isItemDisabled: reactDesc.PropTypes.func.description('Function that receives an item, and returns whether that item should be disabled').defaultValue('() => false'),
28
- disableIcons: reactDesc.PropTypes.bool.description('disable icons').defaultValue(false),
29
- fluid: reactDesc.PropTypes.bool.description('whether is fluid or not').defaultValue(false),
30
- isMultiSelect: reactDesc.PropTypes.bool.description('whether the tree view is multi select or not').defaultValue(false),
31
- isSingleSelect: reactDesc.PropTypes.bool.description('wheter the tree view is single select or not').defaultValue(false),
32
- isLoading: reactDesc.PropTypes.bool.description('wheter the tree should show the loading state or not').defaultValue(false),
33
- getIsDropValid: reactDesc.PropTypes.func.description("Function that returns true if the drop is valid and false if it's not").defaultValue('() => true'),
34
- restrictDragAndDrop: reactDesc.PropTypes.bool.description('whether to restrict DnD functionality or not').defaultValue(false),
35
- showChildrenAmount: reactDesc.PropTypes.bool.description('whether to show the amount of children or not').defaultValue(false),
36
- sortable: reactDesc.PropTypes.bool.description('whether the sortable functionality is active or not').defaultValue(false),
37
- onItemClick: reactDesc.PropTypes.func.description('function executed when clicking on an item').defaultValue('() => {}'),
38
- onItemFocus: reactDesc.PropTypes.func.description('function executed when focusing on an item').defaultValue('() => {}'),
39
- onVisibleItemsChange: reactDesc.PropTypes.func.description('function executed when the visible items change').defaultValue('() => {}'),
40
- onOrderChange: reactDesc.PropTypes.func.description('function executed when the items order changes').defaultValue('() => {}'),
41
- onSelectionChange: reactDesc.PropTypes.func.description('function executed when the selection changes').defaultValue('() => {}'),
42
- onExpandChange: reactDesc.PropTypes.func.description('function executed when expanding an item').defaultValue('() => {}'),
43
- onInstanceRefInitialized: reactDesc.PropTypes.func.description('function executed when instanceRef has terminated instanciation').defaultValue('() => {}'),
44
- rowSize: reactDesc.PropTypes.oneOf(['normal', 'compact']).description('size of the row').defaultValue('normal'),
45
- labelOverflow: reactDesc.PropTypes.oneOf(['wrap', 'wrap-all', 'truncate']).description('label truncation preference').defaultValue('wrap'),
46
- width: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.number, reactDesc.PropTypes.string]).description('components width').defaultValue('100%'),
47
- height: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.number, reactDesc.PropTypes.string]).description('components height').defaultValue('100%'),
48
- groupIcon: reactDesc.PropTypes.node.description('icon for groups'),
49
- itemIcon: reactDesc.PropTypes.node.description('icon for items'),
50
- searchQuery: reactDesc.PropTypes.string.description('search query value'),
51
- noItemsPlaceholder: reactDesc.PropTypes.string.description('message to be shown when there are no items in the treeview to be displayed').defaultValue('No items found'),
52
- name: reactDesc.PropTypes.string.description('property key to identifier for items labels').defaultValue('name'),
53
- highlightOnlyQuery: reactDesc.PropTypes.bool.description('whether to highlight results or not').defaultValue(false)
54
- };
55
-
56
- exports.TreeViewPropTypes = TreeViewPropTypes;
@@ -1,48 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
6
- require('react');
7
- var dsForm = require('@elliemae/ds-form');
8
-
9
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
-
11
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
12
-
13
- function TreeViewSearchBar(props) {
14
- const {
15
- handleChange,
16
- onNext,
17
- onPrevious,
18
- onClear,
19
- currentResultIndex,
20
- totalResults,
21
- value
22
- } = props;
23
- return /*#__PURE__*/_jsx__default["default"](dsForm.DSNavSearchBox, {
24
- onChange: v => {
25
- handleChange({
26
- target: {
27
- value: v
28
- }
29
- });
30
- },
31
- onNext: onNext,
32
- onPrevious: onPrevious,
33
- onClear: onClear,
34
- currentResultIndex: currentResultIndex,
35
- totalResults: totalResults,
36
- value: value
37
- });
38
- } // TreeViewSearchBar.propTypes = {
39
- // value: PropTypes.string.isRequired,
40
- // handleChange: PropTypes.func.isRequired,
41
- // onNext: PropTypes.func.isRequired,
42
- // onPrevious: PropTypes.func.isRequired,
43
- // onClear: PropTypes.func.isRequired,
44
- // currentResultIndex: PropTypes.number.isRequired,
45
- // totalResults: PropTypes.number.isRequired,
46
- // };
47
-
48
- exports.TreeViewSearchBar = TreeViewSearchBar;
@@ -1,2 +0,0 @@
1
- 'use strict';
2
-
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- require('core-js/modules/web.dom-collections.iterator.js');
6
-
7
- // https://github.com/sindresorhus/array-move/blob/master/index.js
8
- const arrayMoveMutate = (array, from, to) => {
9
- const startIndex = from < 0 ? array.length + from : from;
10
-
11
- if (startIndex >= 0 && startIndex < array.length) {
12
- const endIndex = to < 0 ? array.length + to : to;
13
- const [item] = array.splice(from, 1);
14
- array.splice(endIndex, 0, item);
15
- }
16
- };
17
- const arrayMove = (array, from, to) => {
18
- const newArray = [...array];
19
- arrayMoveMutate(newArray, from, to);
20
- return newArray;
21
- };
22
-
23
- exports.arrayMove = arrayMove;
24
- exports.arrayMoveMutate = arrayMoveMutate;
@@ -1,111 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
-
7
- /* eslint-disable max-params */
8
- const updateExpandedState = (treeRoot, onExpandChange) => {
9
- const shouldContinueWalking = true;
10
- const newExpandedHashMap = {
11
- __ds_tree_root: true
12
- };
13
- treeRoot.walk(node => {
14
- if (!node.isRoot() && node.model.isGroup && node.model.isExpanded) {
15
- newExpandedHashMap[node.model.id] = true;
16
- }
17
-
18
- return shouldContinueWalking;
19
- });
20
- if (onExpandChange) onExpandChange(newExpandedHashMap, null);
21
- };
22
- const toggleItemExpand = function (itemToToggle, triggerTreeRerender, updateUserExpandedState) {
23
- let scrollTo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : () => {};
24
- const {
25
- node: {
26
- model: {
27
- isExpanded
28
- }
29
- },
30
- virtualIndex
31
- } = itemToToggle;
32
-
33
- if (itemToToggle.node.model.isGroup) {
34
- itemToToggle.node.model.isExpanded = !isExpanded;
35
- triggerTreeRerender();
36
- updateUserExpandedState();
37
- setTimeout(() => {
38
- if (typeof virtualIndex === 'number') scrollTo(virtualIndex, {
39
- align: 'start'
40
- });
41
- });
42
- }
43
- };
44
- const expandItemModel = modelToExpand => {
45
- if (modelToExpand.isGroup) modelToExpand.isExpanded = true;
46
- };
47
- const collapseItemModel = modelToCollapse => {
48
- if (modelToCollapse.isGroup) modelToCollapse.isExpanded = false;
49
- };
50
- const expandAll = (treeRoot, triggerTreeRerender) => {
51
- const shouldContinueWalking = true;
52
- treeRoot.walk(node => {
53
- if (!node.isRoot()) expandItemModel(node.model);
54
- return shouldContinueWalking;
55
- });
56
- triggerTreeRerender();
57
- };
58
- const collapseAll = (treeRoot, triggerTreeRerender) => {
59
- const shouldContinueWalking = true; // tree-model ask we return true if we want to continue walking
60
-
61
- treeRoot.walk(node => {
62
- if (!node.isRoot()) collapseItemModel(node.model);
63
- return shouldContinueWalking;
64
- });
65
- triggerTreeRerender();
66
- };
67
- const getToggleExpandShouldExpand = treeRoot => {
68
- let shouldExpand = false;
69
- const shouldContinueWalking = true; // tree-model ask we return true if we want to continue walking
70
-
71
- treeRoot.walk(node => {
72
- if (!node.isRoot()) {
73
- if (!node.model.isExpanded && node.model.isGroup) {
74
- shouldExpand = true; // eslint-disable-next-line no-useless-return
75
-
76
- return shouldContinueWalking;
77
- }
78
- }
79
-
80
- return shouldContinueWalking;
81
- });
82
- return shouldExpand;
83
- };
84
- const toggleExpandAllHelper = (isExpand, treeRoot, triggerTreeRerender, setLatestToggledItem, updateUserExpandedState) => {
85
- if (isExpand === true) expandAll(treeRoot, triggerTreeRerender);else if (isExpand === false) collapseAll(treeRoot, triggerTreeRerender);else {
86
- const shouldExpand = getToggleExpandShouldExpand(treeRoot);
87
- if (shouldExpand === true) expandAll(treeRoot, triggerTreeRerender);else collapseAll(treeRoot, triggerTreeRerender);
88
- }
89
- setLatestToggledItem(null);
90
- updateUserExpandedState();
91
- };
92
- const useNotifyExpandedChange = (propsWithDefaults, _ref) => {
93
- let {
94
- latestToggledItem,
95
- expandedGroups
96
- } = _ref;
97
- const notifyExpandedChange = React.useCallback(expandedGroupHashmap => propsWithDefaults === null || propsWithDefaults === void 0 ? void 0 : propsWithDefaults.onExpandChange(expandedGroupHashmap || {}, latestToggledItem), [propsWithDefaults, latestToggledItem]);
98
- React.useEffect(() => {
99
- if (!propsWithDefaults.expanded) notifyExpandedChange(expandedGroups);
100
- }, [expandedGroups, notifyExpandedChange, propsWithDefaults.expanded]);
101
- };
102
-
103
- exports.collapseAll = collapseAll;
104
- exports.collapseItemModel = collapseItemModel;
105
- exports.expandAll = expandAll;
106
- exports.expandItemModel = expandItemModel;
107
- exports.getToggleExpandShouldExpand = getToggleExpandShouldExpand;
108
- exports.toggleExpandAllHelper = toggleExpandAllHelper;
109
- exports.toggleItemExpand = toggleItemExpand;
110
- exports.updateExpandedState = updateExpandedState;
111
- exports.useNotifyExpandedChange = useNotifyExpandedChange;
@@ -1,175 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
- var TreeViewContext = require('../TreeViewContext.js');
7
- var treeHelpers = require('./tree-helpers.js');
8
- var groupExpandsHelpers = require('./group-expands-helpers.js');
9
-
10
- /* eslint-disable max-params */
11
- // 9 tab
12
- // 13 enter
13
- // 32 space
14
- // 37 left arrow
15
- // 38 up arrow
16
- // 39 right arrow
17
- // 40 down arrow
18
- // 35 end
19
- // 36 home
20
- // 56 number 8
21
- // 106 (NumPad) *
22
- const useOnItemKeyDown = (item, draggableProps) => {
23
- const ctx = React.useContext(TreeViewContext["default"]);
24
- const {
25
- props: {
26
- onItemFocus
27
- },
28
- triggerTreeRerender,
29
- visibleItems,
30
- setFocusedItem,
31
- setSelectedItem,
32
- setLatestToggledItem,
33
- updateUserExpandedState,
34
- virtualListHelpers: {
35
- scrollToIndex
36
- }
37
- } = ctx;
38
- const {
39
- isGroup,
40
- isExpanded
41
- } = item;
42
- const onItemFocusCurry = React.useCallback(newFocusItem => onItemFocus({
43
- itemIndex: newFocusItem.virtualIndex,
44
- scrollToItem: function () {
45
- let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
46
- align: 'start'
47
- };
48
- return scrollToIndex(newFocusItem.virtualIndex, opts);
49
- },
50
- item: newFocusItem
51
- }), [onItemFocus, scrollToIndex]);
52
- const onItemKeyDown = React.useCallback(e => {
53
- const {
54
- keyCode
55
- } = e;
56
-
57
- if (!(draggableProps && draggableProps.active)) {
58
- if (keyCode !== 9) e.preventDefault(); // allow tab/shift+tab
59
-
60
- if ((keyCode === 13 || keyCode === 32) && e.target.tagName === 'LI') {
61
- setSelectedItem(item);
62
- }
63
-
64
- if (keyCode === 37) {
65
- if (isGroup && isExpanded) {
66
- groupExpandsHelpers.toggleItemExpand(item, triggerTreeRerender, updateUserExpandedState, scrollToIndex);
67
- setLatestToggledItem(item);
68
- }
69
- }
70
-
71
- if (keyCode === 39) {
72
- if (isGroup && !isExpanded) {
73
- groupExpandsHelpers.toggleItemExpand(item, triggerTreeRerender, updateUserExpandedState, scrollToIndex);
74
- setLatestToggledItem(item);
75
- }
76
- }
77
-
78
- const {
79
- virtualIndex
80
- } = item;
81
-
82
- if (typeof virtualIndex === 'number') {
83
- const lastItemIndex = visibleItems.length - 1;
84
-
85
- if (keyCode === 38) {
86
- const isLoopedFocus = virtualIndex === 0;
87
- const newFocusIndex = isLoopedFocus ? lastItemIndex : virtualIndex - 1;
88
- const newFocusItem = visibleItems[newFocusIndex];
89
- scrollToIndex(newFocusIndex);
90
-
91
- if (isLoopedFocus) {
92
- // when looping the list from start to end we need to wait a bit before focusing
93
- setTimeout(() => {
94
- setFocusedItem(newFocusItem);
95
- treeHelpers.focusItem(newFocusItem);
96
- onItemFocusCurry(newFocusItem);
97
- }, 300);
98
- } else {
99
- setFocusedItem(newFocusItem);
100
- onItemFocusCurry(newFocusItem);
101
- treeHelpers.focusItem(newFocusItem);
102
- }
103
- }
104
-
105
- if (keyCode === 40) {
106
- const isLoopedFocus = virtualIndex === lastItemIndex;
107
- const newFocusIndex = isLoopedFocus ? 0 : virtualIndex + 1;
108
- const newFocusItem = visibleItems[newFocusIndex];
109
- scrollToIndex(newFocusIndex);
110
-
111
- if (isLoopedFocus) {
112
- // when looping the list from start to end we need to wait a bit before focusing
113
- setTimeout(() => {
114
- setFocusedItem(newFocusItem);
115
- onItemFocusCurry(newFocusItem);
116
- treeHelpers.focusItem(newFocusItem);
117
- }, 300);
118
- } else {
119
- setFocusedItem(newFocusItem);
120
- onItemFocusCurry(newFocusItem);
121
- treeHelpers.focusItem(newFocusItem);
122
- }
123
- }
124
-
125
- if (keyCode === 35) {
126
- if (virtualIndex !== lastItemIndex) {
127
- const newFocusItem = visibleItems[lastItemIndex];
128
- scrollToIndex(lastItemIndex);
129
- setTimeout(() => {
130
- setFocusedItem(newFocusItem);
131
- onItemFocusCurry(newFocusItem);
132
- treeHelpers.focusItem(newFocusItem);
133
- }, 300);
134
- }
135
- }
136
-
137
- if (keyCode === 36) {
138
- if (virtualIndex !== 0) {
139
- const newFocusItem = visibleItems[0];
140
- scrollToIndex(0);
141
- setTimeout(() => {
142
- setFocusedItem(newFocusItem);
143
- onItemFocusCurry(newFocusItem);
144
- treeHelpers.focusItem(newFocusItem);
145
- }, 300);
146
- }
147
- }
148
- }
149
- }
150
- }, [draggableProps, setSelectedItem, item, isGroup, isExpanded, triggerTreeRerender, updateUserExpandedState, scrollToIndex, setLatestToggledItem, visibleItems, setFocusedItem, onItemFocusCurry]);
151
- return onItemKeyDown;
152
- };
153
- const useGlobalKeyboardListener = func => {
154
- React.useEffect(() => {
155
- document.addEventListener('keydown', func);
156
- return () => document.removeEventListener('keydown', func);
157
- }, [func]);
158
- };
159
- const useGlobalToggleAllExpandShortcut = (treeRoot, triggerTreeRerender, setLatestToggledItem, updateUserExpandedState) => {
160
- const memoizedToggleAllKeyboardShortcut = React.useCallback(e => {
161
- const {
162
- shiftKey,
163
- keyCode
164
- } = e;
165
-
166
- if (shiftKey && keyCode === 56) {
167
- groupExpandsHelpers.toggleExpandAllHelper('toggle', treeRoot, triggerTreeRerender, setLatestToggledItem, updateUserExpandedState);
168
- }
169
- }, [setLatestToggledItem, treeRoot, triggerTreeRerender, updateUserExpandedState]);
170
- return useGlobalKeyboardListener(memoizedToggleAllKeyboardShortcut);
171
- };
172
-
173
- exports.useGlobalKeyboardListener = useGlobalKeyboardListener;
174
- exports.useGlobalToggleAllExpandShortcut = useGlobalToggleAllExpandShortcut;
175
- exports.useOnItemKeyDown = useOnItemKeyDown;
@@ -1,69 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- require('core-js/modules/esnext.async-iterator.for-each.js');
6
- require('core-js/modules/esnext.iterator.constructor.js');
7
- require('core-js/modules/esnext.iterator.for-each.js');
8
- require('core-js/modules/esnext.async-iterator.reduce.js');
9
- require('core-js/modules/esnext.iterator.reduce.js');
10
-
11
- /* eslint-disable no-sequences */
12
-
13
- /* eslint-disable no-return-assign */
14
-
15
- /* eslint-disable no-restricted-syntax */
16
-
17
- /* eslint-disable guard-for-in */
18
- function isObjectADate(o) {
19
- var _o$constructor;
20
-
21
- return (o === null || o === void 0 ? void 0 : (_o$constructor = o.constructor) === null || _o$constructor === void 0 ? void 0 : _o$constructor.name) === 'Date';
22
- }
23
-
24
- function isObjectAnArray(o) {
25
- return Array.isArray(o);
26
- }
27
-
28
- function isObjectAString(o) {
29
- return typeof o === 'object';
30
- }
31
-
32
- const unfreeze = o => {
33
- let oo;
34
-
35
- if (o === null) {
36
- oo = null;
37
- } else if (o === undefined) {
38
- oo = undefined;
39
- } else if (isObjectADate(o)) {
40
- oo = new Date(o);
41
- } else if (isObjectAnArray(o)) {
42
- oo = [];
43
- o.forEach(v => {
44
- oo.push(v);
45
- });
46
- } else if (isObjectAString(o)) {
47
- oo = String(o);
48
- } else if (isObjectAString(o)) {
49
- oo = {};
50
-
51
- for (const property in o) {
52
- oo[property] = o[property];
53
- }
54
- } else {
55
- oo = o;
56
- }
57
-
58
- return oo;
59
- };
60
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
61
- function filterObject(obj, predicate) {
62
- return Object.keys(obj).reduce((res, key) => {
63
- if (predicate(obj[key])) res[key] = obj[key];
64
- return res;
65
- }, {});
66
- }
67
-
68
- exports.filterObject = filterObject;
69
- exports.unfreeze = unfreeze;
@@ -1,31 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- require('core-js/modules/esnext.async-iterator.filter.js');
6
- require('core-js/modules/esnext.iterator.constructor.js');
7
- require('core-js/modules/esnext.iterator.filter.js');
8
- require('core-js/modules/esnext.async-iterator.for-each.js');
9
- require('core-js/modules/esnext.iterator.for-each.js');
10
-
11
- // allow multiple refs to be set to point to the same DOM element
12
- const setMultipleRefs = function () {
13
- for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
14
- refs[_key] = arguments[_key];
15
- }
16
-
17
- const filteredRefs = refs.filter(Boolean);
18
- if (!filteredRefs.length) return () => {};
19
- if (filteredRefs.length === 0) return () => {};
20
- return newRef => {
21
- filteredRefs.forEach(refToBeUpdated => {
22
- if (typeof refToBeUpdated === 'function') {
23
- refToBeUpdated(newRef);
24
- } else if (refToBeUpdated) {
25
- refToBeUpdated.current = newRef;
26
- }
27
- });
28
- };
29
- };
30
-
31
- exports.setMultipleRefs = setMultipleRefs;