@neo4j-ndl/react 0.1.0 → 0.1.3-alpha.19

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 (463) hide show
  1. package/lib/cjs/alert/Alert.js +102 -0
  2. package/lib/cjs/alert/Alert.js.map +1 -0
  3. package/lib/{alert → cjs/alert}/index.js +6 -10
  4. package/lib/cjs/alert/index.js.map +1 -0
  5. package/lib/cjs/button/Button.js +116 -0
  6. package/lib/cjs/button/Button.js.map +1 -0
  7. package/lib/{button → cjs/button}/index.js +6 -2
  8. package/lib/cjs/button/index.js.map +1 -0
  9. package/lib/{checkbox → cjs/checkbox}/Checkbox.js +13 -20
  10. package/lib/cjs/checkbox/Checkbox.js.map +1 -0
  11. package/lib/{checkbox → cjs/checkbox}/index.js +5 -9
  12. package/lib/cjs/checkbox/index.js.map +1 -0
  13. package/lib/cjs/context-menu/ContextMenu.js +218 -0
  14. package/lib/cjs/context-menu/ContextMenu.js.map +1 -0
  15. package/lib/{context-menu → cjs/context-menu}/index.js +6 -2
  16. package/lib/cjs/context-menu/index.js.map +1 -0
  17. package/lib/cjs/drag-and-drop/DragAndDrop.js +66 -0
  18. package/lib/cjs/drag-and-drop/DragAndDrop.js.map +1 -0
  19. package/lib/cjs/drag-and-drop/icons/CSV-file.js +6 -0
  20. package/lib/cjs/drag-and-drop/icons/CSV-file.js.map +1 -0
  21. package/lib/cjs/drag-and-drop/icons/Cloud.js +6 -0
  22. package/lib/cjs/drag-and-drop/icons/Cloud.js.map +1 -0
  23. package/lib/cjs/drag-and-drop/icons/File.js +6 -0
  24. package/lib/cjs/drag-and-drop/icons/File.js.map +1 -0
  25. package/lib/cjs/drag-and-drop/icons/InvalidFile.js +6 -0
  26. package/lib/cjs/drag-and-drop/icons/InvalidFile.js.map +1 -0
  27. package/lib/cjs/drag-and-drop/index.js +29 -0
  28. package/lib/cjs/drag-and-drop/index.js.map +1 -0
  29. package/lib/{helpers → cjs/helpers}/debounce.js +7 -13
  30. package/lib/cjs/helpers/debounce.js.map +1 -0
  31. package/lib/cjs/helpers/forwardRef.js +26 -0
  32. package/lib/cjs/helpers/forwardRef.js.map +1 -0
  33. package/lib/{helpers → cjs/helpers}/index.js +7 -2
  34. package/lib/cjs/helpers/index.js.map +1 -0
  35. package/lib/cjs/helpers/testing.js +46 -0
  36. package/lib/cjs/helpers/testing.js.map +1 -0
  37. package/lib/{helpers → cjs/helpers}/types.js +1 -1
  38. package/lib/cjs/helpers/types.js.map +1 -0
  39. package/lib/{icons → cjs/icons}/Custom.js +35 -45
  40. package/lib/cjs/icons/Custom.js.map +1 -0
  41. package/lib/cjs/icons/Hero.js +59 -0
  42. package/lib/cjs/icons/Hero.js.map +1 -0
  43. package/lib/cjs/icons/custom/Circle.js +6 -0
  44. package/lib/cjs/icons/custom/Circle.js.map +1 -0
  45. package/lib/cjs/icons/custom/CollapseExpand.js +6 -0
  46. package/lib/cjs/icons/custom/CollapseExpand.js.map +1 -0
  47. package/lib/cjs/icons/custom/DatabaseAddCircle.js +6 -0
  48. package/lib/cjs/icons/custom/DatabaseAddCircle.js.map +1 -0
  49. package/lib/cjs/icons/custom/Dbms.js +6 -0
  50. package/lib/cjs/icons/custom/Dbms.js.map +1 -0
  51. package/lib/cjs/icons/custom/Drag.js +6 -0
  52. package/lib/cjs/icons/custom/Drag.js.map +1 -0
  53. package/lib/cjs/icons/custom/Expand.js +6 -0
  54. package/lib/cjs/icons/custom/Expand.js.map +1 -0
  55. package/lib/cjs/icons/custom/ExternalLink.js +6 -0
  56. package/lib/cjs/icons/custom/ExternalLink.js.map +1 -0
  57. package/lib/cjs/icons/custom/FitToScreen.js +6 -0
  58. package/lib/cjs/icons/custom/FitToScreen.js.map +1 -0
  59. package/lib/cjs/icons/custom/FolderBookmark.js +6 -0
  60. package/lib/cjs/icons/custom/FolderBookmark.js.map +1 -0
  61. package/lib/cjs/icons/custom/Heirarchy2.js +6 -0
  62. package/lib/cjs/icons/custom/Heirarchy2.js.map +1 -0
  63. package/lib/cjs/icons/custom/Hierarchy1.js +6 -0
  64. package/lib/cjs/icons/custom/Hierarchy1.js.map +1 -0
  65. package/lib/cjs/icons/custom/Hierarchy2.js +6 -0
  66. package/lib/cjs/icons/custom/Hierarchy2.js.map +1 -0
  67. package/lib/cjs/icons/custom/NomLevel.js +6 -0
  68. package/lib/cjs/icons/custom/NomLevel.js.map +1 -0
  69. package/lib/cjs/icons/custom/Pin.js +6 -0
  70. package/lib/cjs/icons/custom/Pin.js.map +1 -0
  71. package/lib/cjs/icons/custom/Presentation.js +6 -0
  72. package/lib/cjs/icons/custom/Presentation.js.map +1 -0
  73. package/lib/cjs/icons/custom/QueryBrowser.js +6 -0
  74. package/lib/cjs/icons/custom/QueryBrowser.js.map +1 -0
  75. package/lib/cjs/icons/custom/Rhombus.js +6 -0
  76. package/lib/cjs/icons/custom/Rhombus.js.map +1 -0
  77. package/lib/cjs/icons/custom/ScienceMolecule.js +6 -0
  78. package/lib/cjs/icons/custom/ScienceMolecule.js.map +1 -0
  79. package/lib/cjs/icons/custom/Shrink.js +6 -0
  80. package/lib/cjs/icons/custom/Shrink.js.map +1 -0
  81. package/lib/cjs/icons/custom/Text.js +6 -0
  82. package/lib/cjs/icons/custom/Text.js.map +1 -0
  83. package/lib/cjs/icons/custom/Triangle.js +6 -0
  84. package/lib/cjs/icons/custom/Triangle.js.map +1 -0
  85. package/lib/cjs/icons/custom/VisualizeBloom.js +6 -0
  86. package/lib/cjs/icons/custom/VisualizeBloom.js.map +1 -0
  87. package/lib/cjs/icons/custom/index.js +71 -0
  88. package/lib/cjs/icons/custom/index.js.map +1 -0
  89. package/lib/{icons → cjs/icons}/index.js +6 -10
  90. package/lib/cjs/icons/index.js.map +1 -0
  91. package/lib/{index.js → cjs/index.js} +12 -2
  92. package/lib/cjs/index.js.map +1 -0
  93. package/lib/cjs/input/Input.js +60 -0
  94. package/lib/cjs/input/Input.js.map +1 -0
  95. package/lib/{input → cjs/input}/index.js +5 -9
  96. package/lib/cjs/input/index.js.map +1 -0
  97. package/lib/cjs/label/Label.js +103 -0
  98. package/lib/cjs/label/Label.js.map +1 -0
  99. package/lib/{label → cjs/label}/index.js +5 -9
  100. package/lib/cjs/label/index.js.map +1 -0
  101. package/lib/cjs/loading-spinner/LoadingSpinner.js +53 -0
  102. package/lib/cjs/loading-spinner/LoadingSpinner.js.map +1 -0
  103. package/lib/{loading-spinner → cjs/loading-spinner}/index.js +5 -9
  104. package/lib/cjs/loading-spinner/index.js.map +1 -0
  105. package/lib/{popover → cjs/popover}/Popover.js +86 -96
  106. package/lib/cjs/popover/Popover.js.map +1 -0
  107. package/lib/{popover → cjs/popover}/index.js +6 -2
  108. package/lib/cjs/popover/index.js.map +1 -0
  109. package/lib/cjs/progress-bar/ProgressBar.js +46 -0
  110. package/lib/cjs/progress-bar/ProgressBar.js.map +1 -0
  111. package/lib/{progress-bar → cjs/progress-bar}/index.js +5 -9
  112. package/lib/cjs/progress-bar/index.js.map +1 -0
  113. package/lib/{radio → cjs/radio}/Radio.js +11 -21
  114. package/lib/cjs/radio/Radio.js.map +1 -0
  115. package/lib/{radio → cjs/radio}/index.js +5 -9
  116. package/lib/cjs/radio/index.js.map +1 -0
  117. package/lib/{switch → cjs/switch}/Switch.js +10 -21
  118. package/lib/cjs/switch/Switch.js.map +1 -0
  119. package/lib/{switch → cjs/switch}/index.js +5 -9
  120. package/lib/cjs/switch/index.js.map +1 -0
  121. package/lib/cjs/table/Table.js +122 -0
  122. package/lib/cjs/table/Table.js.map +1 -0
  123. package/lib/cjs/table/TableNavigation.js +51 -0
  124. package/lib/cjs/table/TableNavigation.js.map +1 -0
  125. package/lib/cjs/table/helpers.js +107 -0
  126. package/lib/cjs/table/helpers.js.map +1 -0
  127. package/lib/cjs/table/hooks/hookCallbackTypes.js +23 -0
  128. package/lib/cjs/table/hooks/hookCallbackTypes.js.map +1 -0
  129. package/lib/cjs/table/hooks/index.js +40 -0
  130. package/lib/cjs/table/hooks/index.js.map +1 -0
  131. package/lib/cjs/table/hooks/useMultiRowSelect.js +84 -0
  132. package/lib/cjs/table/hooks/useMultiRowSelect.js.map +1 -0
  133. package/lib/cjs/table/hooks/useSingleRowSelect.js +61 -0
  134. package/lib/cjs/table/hooks/useSingleRowSelect.js.map +1 -0
  135. package/lib/cjs/table/index.js +44 -0
  136. package/lib/cjs/table/index.js.map +1 -0
  137. package/lib/cjs/tabs/Tabs.js +105 -0
  138. package/lib/cjs/tabs/Tabs.js.map +1 -0
  139. package/lib/{tabs → cjs/tabs}/index.js +6 -2
  140. package/lib/cjs/tabs/index.js.map +1 -0
  141. package/lib/cjs/tag/Tag.js +67 -0
  142. package/lib/cjs/tag/Tag.js.map +1 -0
  143. package/lib/{tag → cjs/tag}/index.js +5 -9
  144. package/lib/cjs/tag/index.js.map +1 -0
  145. package/lib/{tooltip → cjs/tooltip}/Tooltip.js +24 -34
  146. package/lib/cjs/tooltip/Tooltip.js.map +1 -0
  147. package/lib/{tooltip → cjs/tooltip}/index.js +5 -9
  148. package/lib/cjs/tooltip/index.js.map +1 -0
  149. package/lib/cjs/view-selector/ViewSelector.js +89 -0
  150. package/lib/cjs/view-selector/ViewSelector.js.map +1 -0
  151. package/lib/{view-selector → cjs/view-selector}/index.js +6 -2
  152. package/lib/cjs/view-selector/index.js.map +1 -0
  153. package/lib/esm/alert/Alert.js +95 -0
  154. package/lib/esm/alert/Alert.js.map +1 -0
  155. package/lib/esm/alert/index.js +22 -0
  156. package/lib/esm/alert/index.js.map +1 -0
  157. package/lib/esm/button/Button.js +108 -0
  158. package/lib/esm/button/Button.js.map +1 -0
  159. package/lib/esm/button/index.js +22 -0
  160. package/lib/esm/button/index.js.map +1 -0
  161. package/lib/esm/checkbox/Checkbox.js +47 -0
  162. package/lib/esm/checkbox/Checkbox.js.map +1 -0
  163. package/lib/esm/checkbox/index.js +22 -0
  164. package/lib/esm/checkbox/index.js.map +1 -0
  165. package/lib/esm/context-menu/ContextMenu.js +189 -0
  166. package/lib/esm/context-menu/ContextMenu.js.map +1 -0
  167. package/lib/esm/context-menu/index.js +22 -0
  168. package/lib/esm/context-menu/index.js.map +1 -0
  169. package/lib/esm/drag-and-drop/DragAndDrop.js +61 -0
  170. package/lib/esm/drag-and-drop/DragAndDrop.js.map +1 -0
  171. package/lib/esm/drag-and-drop/icons/CSV-file.js +4 -0
  172. package/lib/esm/drag-and-drop/icons/CSV-file.js.map +1 -0
  173. package/lib/esm/drag-and-drop/icons/Cloud.js +4 -0
  174. package/lib/esm/drag-and-drop/icons/Cloud.js.map +1 -0
  175. package/lib/esm/drag-and-drop/icons/File.js +4 -0
  176. package/lib/esm/drag-and-drop/icons/File.js.map +1 -0
  177. package/lib/esm/drag-and-drop/icons/InvalidFile.js +4 -0
  178. package/lib/esm/drag-and-drop/icons/InvalidFile.js.map +1 -0
  179. package/lib/esm/drag-and-drop/index.js +22 -0
  180. package/lib/esm/drag-and-drop/index.js.map +1 -0
  181. package/lib/{tooltip/Tooltip.d.ts → esm/helpers/debounce.js} +16 -8
  182. package/lib/esm/helpers/debounce.js.map +1 -0
  183. package/lib/esm/helpers/forwardRef.js +23 -0
  184. package/lib/esm/helpers/forwardRef.js.map +1 -0
  185. package/lib/esm/helpers/index.js +24 -0
  186. package/lib/esm/helpers/index.js.map +1 -0
  187. package/lib/esm/helpers/testing.js +42 -0
  188. package/lib/esm/helpers/testing.js.map +1 -0
  189. package/lib/esm/helpers/types.js +22 -0
  190. package/lib/esm/helpers/types.js.map +1 -0
  191. package/lib/esm/icons/Custom.js +41 -0
  192. package/lib/esm/icons/Custom.js.map +1 -0
  193. package/lib/esm/icons/Hero.js +33 -0
  194. package/lib/esm/icons/Hero.js.map +1 -0
  195. package/lib/esm/icons/custom/Circle.js +4 -0
  196. package/lib/esm/icons/custom/Circle.js.map +1 -0
  197. package/lib/esm/icons/custom/CollapseExpand.js +4 -0
  198. package/lib/esm/icons/custom/CollapseExpand.js.map +1 -0
  199. package/lib/esm/icons/custom/DatabaseAddCircle.js +4 -0
  200. package/lib/esm/icons/custom/DatabaseAddCircle.js.map +1 -0
  201. package/lib/esm/icons/custom/Dbms.js +4 -0
  202. package/lib/esm/icons/custom/Dbms.js.map +1 -0
  203. package/lib/esm/icons/custom/Drag.js +4 -0
  204. package/lib/esm/icons/custom/Drag.js.map +1 -0
  205. package/lib/esm/icons/custom/Expand.js +4 -0
  206. package/lib/esm/icons/custom/Expand.js.map +1 -0
  207. package/lib/esm/icons/custom/ExternalLink.js +4 -0
  208. package/lib/esm/icons/custom/ExternalLink.js.map +1 -0
  209. package/lib/esm/icons/custom/FitToScreen.js +4 -0
  210. package/lib/esm/icons/custom/FitToScreen.js.map +1 -0
  211. package/lib/esm/icons/custom/FolderBookmark.js +4 -0
  212. package/lib/esm/icons/custom/FolderBookmark.js.map +1 -0
  213. package/lib/esm/icons/custom/Heirarchy2.js +4 -0
  214. package/lib/esm/icons/custom/Heirarchy2.js.map +1 -0
  215. package/lib/esm/icons/custom/Hierarchy1.js +4 -0
  216. package/lib/esm/icons/custom/Hierarchy1.js.map +1 -0
  217. package/lib/esm/icons/custom/Hierarchy2.js +4 -0
  218. package/lib/esm/icons/custom/Hierarchy2.js.map +1 -0
  219. package/lib/esm/icons/custom/NomLevel.js +4 -0
  220. package/lib/esm/icons/custom/NomLevel.js.map +1 -0
  221. package/lib/esm/icons/custom/Pin.js +4 -0
  222. package/lib/esm/icons/custom/Pin.js.map +1 -0
  223. package/lib/esm/icons/custom/Presentation.js +4 -0
  224. package/lib/esm/icons/custom/Presentation.js.map +1 -0
  225. package/lib/esm/icons/custom/QueryBrowser.js +4 -0
  226. package/lib/esm/icons/custom/QueryBrowser.js.map +1 -0
  227. package/lib/esm/icons/custom/Rhombus.js +4 -0
  228. package/lib/esm/icons/custom/Rhombus.js.map +1 -0
  229. package/lib/esm/icons/custom/ScienceMolecule.js +4 -0
  230. package/lib/esm/icons/custom/ScienceMolecule.js.map +1 -0
  231. package/lib/esm/icons/custom/Shrink.js +4 -0
  232. package/lib/esm/icons/custom/Shrink.js.map +1 -0
  233. package/lib/esm/icons/custom/Text.js +4 -0
  234. package/lib/esm/icons/custom/Text.js.map +1 -0
  235. package/lib/esm/icons/custom/Triangle.js +4 -0
  236. package/lib/esm/icons/custom/Triangle.js.map +1 -0
  237. package/lib/esm/icons/custom/VisualizeBloom.js +4 -0
  238. package/lib/esm/icons/custom/VisualizeBloom.js.map +1 -0
  239. package/lib/esm/icons/custom/index.js +43 -0
  240. package/lib/esm/icons/custom/index.js.map +1 -0
  241. package/lib/esm/icons/index.js +23 -0
  242. package/lib/esm/icons/index.js.map +1 -0
  243. package/lib/esm/index.js +37 -0
  244. package/lib/esm/index.js.map +1 -0
  245. package/lib/esm/input/Input.js +55 -0
  246. package/lib/esm/input/Input.js.map +1 -0
  247. package/lib/esm/input/index.js +22 -0
  248. package/lib/esm/input/index.js.map +1 -0
  249. package/lib/esm/label/Label.js +97 -0
  250. package/lib/esm/label/Label.js.map +1 -0
  251. package/lib/esm/label/index.js +22 -0
  252. package/lib/esm/label/index.js.map +1 -0
  253. package/lib/esm/loading-spinner/LoadingSpinner.js +48 -0
  254. package/lib/esm/loading-spinner/LoadingSpinner.js.map +1 -0
  255. package/lib/esm/loading-spinner/index.js +22 -0
  256. package/lib/esm/loading-spinner/index.js.map +1 -0
  257. package/lib/esm/popover/Popover.js +184 -0
  258. package/lib/esm/popover/Popover.js.map +1 -0
  259. package/lib/esm/popover/index.js +22 -0
  260. package/lib/esm/popover/index.js.map +1 -0
  261. package/lib/esm/progress-bar/ProgressBar.js +41 -0
  262. package/lib/esm/progress-bar/ProgressBar.js.map +1 -0
  263. package/lib/esm/progress-bar/index.js +22 -0
  264. package/lib/esm/progress-bar/index.js.map +1 -0
  265. package/lib/{radio/Radio.d.ts → esm/radio/Radio.js} +7 -3
  266. package/lib/esm/radio/Radio.js.map +1 -0
  267. package/lib/esm/radio/index.js +22 -0
  268. package/lib/esm/radio/index.js.map +1 -0
  269. package/lib/{progress-bar/ProgressBar.d.ts → esm/switch/Switch.js} +22 -8
  270. package/lib/esm/switch/Switch.js.map +1 -0
  271. package/lib/esm/switch/index.js +22 -0
  272. package/lib/esm/switch/index.js.map +1 -0
  273. package/lib/esm/table/Table.js +115 -0
  274. package/lib/esm/table/Table.js.map +1 -0
  275. package/lib/esm/table/TableNavigation.js +44 -0
  276. package/lib/esm/table/TableNavigation.js.map +1 -0
  277. package/lib/esm/table/helpers.js +100 -0
  278. package/lib/esm/table/helpers.js.map +1 -0
  279. package/lib/esm/table/hooks/hookCallbackTypes.js +22 -0
  280. package/lib/esm/table/hooks/hookCallbackTypes.js.map +1 -0
  281. package/lib/esm/table/hooks/index.js +24 -0
  282. package/lib/esm/table/hooks/index.js.map +1 -0
  283. package/lib/esm/table/hooks/useMultiRowSelect.js +82 -0
  284. package/lib/esm/table/hooks/useMultiRowSelect.js.map +1 -0
  285. package/lib/esm/table/hooks/useSingleRowSelect.js +57 -0
  286. package/lib/esm/table/hooks/useSingleRowSelect.js.map +1 -0
  287. package/lib/esm/table/index.js +23 -0
  288. package/lib/esm/table/index.js.map +1 -0
  289. package/lib/esm/tabs/Tabs.js +76 -0
  290. package/lib/esm/tabs/Tabs.js.map +1 -0
  291. package/lib/esm/tabs/index.js +22 -0
  292. package/lib/esm/tabs/index.js.map +1 -0
  293. package/lib/esm/tag/Tag.js +62 -0
  294. package/lib/esm/tag/Tag.js.map +1 -0
  295. package/lib/esm/tag/index.js +22 -0
  296. package/lib/esm/tag/index.js.map +1 -0
  297. package/lib/esm/tooltip/Tooltip.js +41 -0
  298. package/lib/esm/tooltip/Tooltip.js.map +1 -0
  299. package/lib/esm/tooltip/index.js +22 -0
  300. package/lib/esm/tooltip/index.js.map +1 -0
  301. package/lib/esm/view-selector/ViewSelector.js +60 -0
  302. package/lib/esm/view-selector/ViewSelector.js.map +1 -0
  303. package/lib/esm/view-selector/index.js +22 -0
  304. package/lib/esm/view-selector/index.js.map +1 -0
  305. package/lib/types/alert/Alert.d.ts +75 -0
  306. package/lib/{alert → types/alert}/index.d.ts +0 -0
  307. package/lib/{button → types/button}/Button.d.ts +2 -2
  308. package/lib/{button → types/button}/index.d.ts +0 -0
  309. package/lib/{checkbox → types/checkbox}/Checkbox.d.ts +0 -0
  310. package/lib/{checkbox → types/checkbox}/index.d.ts +0 -0
  311. package/lib/types/context-menu/ContextMenu.d.ts +65 -0
  312. package/lib/{context-menu → types/context-menu}/index.d.ts +0 -0
  313. package/lib/types/drag-and-drop/DragAndDrop.d.ts +47 -0
  314. package/lib/types/drag-and-drop/icons/CSV-file.d.ts +23 -0
  315. package/lib/types/drag-and-drop/icons/Cloud.d.ts +23 -0
  316. package/lib/types/drag-and-drop/icons/File.d.ts +23 -0
  317. package/lib/types/drag-and-drop/icons/InvalidFile.d.ts +23 -0
  318. package/lib/types/drag-and-drop/index.d.ts +21 -0
  319. package/lib/{helpers → types/helpers}/debounce.d.ts +0 -0
  320. package/lib/types/helpers/forwardRef.d.ts +24 -0
  321. package/lib/{helpers → types/helpers}/index.d.ts +1 -0
  322. package/lib/types/helpers/testing.d.ts +28 -0
  323. package/lib/{helpers → types/helpers}/types.d.ts +1 -1
  324. package/lib/{icons → types/icons}/Custom.d.ts +2 -2
  325. package/lib/{icons → types/icons}/Hero.d.ts +2 -2
  326. package/lib/{icons → types/icons}/custom/Circle.d.ts +0 -0
  327. package/lib/types/icons/custom/CollapseExpand.d.ts +23 -0
  328. package/lib/{icons → types/icons}/custom/DatabaseAddCircle.d.ts +0 -0
  329. package/lib/types/icons/custom/Dbms.d.ts +23 -0
  330. package/lib/{icons → types/icons}/custom/Drag.d.ts +0 -0
  331. package/lib/{icons → types/icons}/custom/Expand.d.ts +0 -0
  332. package/lib/{icons → types/icons}/custom/ExternalLink.d.ts +0 -0
  333. package/lib/{icons → types/icons}/custom/FitToScreen.d.ts +0 -0
  334. package/lib/{icons → types/icons}/custom/FolderBookmark.d.ts +0 -0
  335. package/lib/{icons → types/icons}/custom/Heirarchy2.d.ts +0 -0
  336. package/lib/{icons → types/icons}/custom/Hierarchy1.d.ts +0 -0
  337. package/lib/types/icons/custom/Hierarchy2.d.ts +23 -0
  338. package/lib/types/icons/custom/NomLevel.d.ts +23 -0
  339. package/lib/{icons → types/icons}/custom/Pin.d.ts +0 -0
  340. package/lib/{icons → types/icons}/custom/Presentation.d.ts +0 -0
  341. package/lib/types/icons/custom/QueryBrowser.d.ts +23 -0
  342. package/lib/{icons → types/icons}/custom/Rhombus.d.ts +0 -0
  343. package/lib/types/icons/custom/ScienceMolecule.d.ts +23 -0
  344. package/lib/{icons → types/icons}/custom/Shrink.d.ts +0 -0
  345. package/lib/{icons → types/icons}/custom/Text.d.ts +0 -0
  346. package/lib/{icons → types/icons}/custom/Triangle.d.ts +0 -0
  347. package/lib/types/icons/custom/VisualizeBloom.d.ts +23 -0
  348. package/lib/{icons → types/icons}/custom/index.d.ts +7 -0
  349. package/lib/{icons → types/icons}/index.d.ts +0 -0
  350. package/lib/{index.d.ts → types/index.d.ts} +6 -0
  351. package/lib/{input → types/input}/Input.d.ts +0 -0
  352. package/lib/{input → types/input}/index.d.ts +0 -0
  353. package/lib/{label → types/label}/Label.d.ts +3 -3
  354. package/lib/{label → types/label}/index.d.ts +0 -0
  355. package/lib/{loading-spinner → types/loading-spinner}/LoadingSpinner.d.ts +2 -2
  356. package/lib/{loading-spinner → types/loading-spinner}/index.d.ts +0 -0
  357. package/lib/{popover → types/popover}/Popover.d.ts +0 -0
  358. package/lib/{popover → types/popover}/index.d.ts +0 -0
  359. package/lib/types/progress-bar/ProgressBar.d.ts +30 -0
  360. package/lib/{progress-bar → types/progress-bar}/index.d.ts +0 -0
  361. package/lib/types/radio/Radio.d.ts +39 -0
  362. package/lib/{radio → types/radio}/index.d.ts +0 -0
  363. package/lib/{switch → types/switch}/Switch.d.ts +0 -0
  364. package/lib/{switch → types/switch}/index.d.ts +0 -0
  365. package/lib/types/table/Table.d.ts +78 -0
  366. package/lib/types/table/TableNavigation.d.ts +39 -0
  367. package/lib/types/table/helpers.d.ts +51 -0
  368. package/lib/types/table/hooks/hookCallbackTypes.d.ts +27 -0
  369. package/lib/types/table/hooks/index.d.ts +23 -0
  370. package/lib/types/table/hooks/useMultiRowSelect.d.ts +42 -0
  371. package/lib/types/table/hooks/useSingleRowSelect.d.ts +37 -0
  372. package/lib/types/table/index.d.ts +22 -0
  373. package/lib/{tabs → types/tabs}/Tabs.d.ts +3 -3
  374. package/lib/{tabs → types/tabs}/index.d.ts +0 -0
  375. package/lib/{tag → types/tag}/Tag.d.ts +1 -1
  376. package/lib/{tag → types/tag}/index.d.ts +0 -0
  377. package/lib/types/tooltip/Tooltip.d.ts +29 -0
  378. package/lib/{tooltip → types/tooltip}/index.d.ts +0 -0
  379. package/lib/{view-selector → types/view-selector}/ViewSelector.d.ts +4 -11
  380. package/lib/{view-selector → types/view-selector}/index.d.ts +0 -0
  381. package/package.json +23 -10
  382. package/lib/alert/Alert.d.ts +0 -70
  383. package/lib/alert/Alert.js +0 -114
  384. package/lib/alert/Alert.js.map +0 -1
  385. package/lib/alert/index.js.map +0 -1
  386. package/lib/button/Button.js +0 -110
  387. package/lib/button/Button.js.map +0 -1
  388. package/lib/button/index.js.map +0 -1
  389. package/lib/checkbox/Checkbox.js.map +0 -1
  390. package/lib/checkbox/index.js.map +0 -1
  391. package/lib/context-menu/ContextMenu.d.ts +0 -65
  392. package/lib/context-menu/ContextMenu.js +0 -228
  393. package/lib/context-menu/ContextMenu.js.map +0 -1
  394. package/lib/context-menu/index.js.map +0 -1
  395. package/lib/helpers/debounce.js.map +0 -1
  396. package/lib/helpers/index.js.map +0 -1
  397. package/lib/helpers/types.js.map +0 -1
  398. package/lib/icons/Custom.js.map +0 -1
  399. package/lib/icons/Hero.js +0 -89
  400. package/lib/icons/Hero.js.map +0 -1
  401. package/lib/icons/custom/Circle.js +0 -57
  402. package/lib/icons/custom/Circle.js.map +0 -1
  403. package/lib/icons/custom/DatabaseAddCircle.js +0 -57
  404. package/lib/icons/custom/DatabaseAddCircle.js.map +0 -1
  405. package/lib/icons/custom/Drag.js +0 -62
  406. package/lib/icons/custom/Drag.js.map +0 -1
  407. package/lib/icons/custom/Expand.js +0 -57
  408. package/lib/icons/custom/Expand.js.map +0 -1
  409. package/lib/icons/custom/ExternalLink.js +0 -57
  410. package/lib/icons/custom/ExternalLink.js.map +0 -1
  411. package/lib/icons/custom/FitToScreen.js +0 -57
  412. package/lib/icons/custom/FitToScreen.js.map +0 -1
  413. package/lib/icons/custom/FolderBookmark.js +0 -57
  414. package/lib/icons/custom/FolderBookmark.js.map +0 -1
  415. package/lib/icons/custom/Heirarchy2.js +0 -57
  416. package/lib/icons/custom/Heirarchy2.js.map +0 -1
  417. package/lib/icons/custom/Hierarchy1.js +0 -57
  418. package/lib/icons/custom/Hierarchy1.js.map +0 -1
  419. package/lib/icons/custom/Pin.js +0 -57
  420. package/lib/icons/custom/Pin.js.map +0 -1
  421. package/lib/icons/custom/Presentation.js +0 -57
  422. package/lib/icons/custom/Presentation.js.map +0 -1
  423. package/lib/icons/custom/Rhombus.js +0 -57
  424. package/lib/icons/custom/Rhombus.js.map +0 -1
  425. package/lib/icons/custom/Shrink.js +0 -57
  426. package/lib/icons/custom/Shrink.js.map +0 -1
  427. package/lib/icons/custom/Text.js +0 -57
  428. package/lib/icons/custom/Text.js.map +0 -1
  429. package/lib/icons/custom/Triangle.js +0 -57
  430. package/lib/icons/custom/Triangle.js.map +0 -1
  431. package/lib/icons/custom/index.js +0 -61
  432. package/lib/icons/custom/index.js.map +0 -1
  433. package/lib/icons/index.js.map +0 -1
  434. package/lib/index.js.map +0 -1
  435. package/lib/input/Input.js +0 -92
  436. package/lib/input/Input.js.map +0 -1
  437. package/lib/input/index.js.map +0 -1
  438. package/lib/label/Label.js +0 -81
  439. package/lib/label/Label.js.map +0 -1
  440. package/lib/label/index.js.map +0 -1
  441. package/lib/loading-spinner/LoadingSpinner.js +0 -45
  442. package/lib/loading-spinner/LoadingSpinner.js.map +0 -1
  443. package/lib/loading-spinner/index.js.map +0 -1
  444. package/lib/popover/Popover.js.map +0 -1
  445. package/lib/popover/index.js.map +0 -1
  446. package/lib/progress-bar/ProgressBar.js +0 -40
  447. package/lib/progress-bar/ProgressBar.js.map +0 -1
  448. package/lib/progress-bar/index.js.map +0 -1
  449. package/lib/radio/Radio.js.map +0 -1
  450. package/lib/radio/index.js.map +0 -1
  451. package/lib/switch/Switch.js.map +0 -1
  452. package/lib/switch/index.js.map +0 -1
  453. package/lib/tabs/Tabs.js +0 -105
  454. package/lib/tabs/Tabs.js.map +0 -1
  455. package/lib/tabs/index.js.map +0 -1
  456. package/lib/tag/Tag.js +0 -60
  457. package/lib/tag/Tag.js.map +0 -1
  458. package/lib/tag/index.js.map +0 -1
  459. package/lib/tooltip/Tooltip.js.map +0 -1
  460. package/lib/tooltip/index.js.map +0 -1
  461. package/lib/view-selector/ViewSelector.js +0 -78
  462. package/lib/view-selector/ViewSelector.js.map +0 -1
  463. package/lib/view-selector/index.js.map +0 -1
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
2
7
  /**
3
8
  *
4
9
  * Copyright (c) "Neo4j"
@@ -19,23 +24,8 @@
19
24
  * You should have received a copy of the GNU General Public License
20
25
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
26
  */
22
- var __assign = (this && this.__assign) || function () {
23
- __assign = Object.assign || function(t) {
24
- for (var s, i = 1, n = arguments.length; i < n; i++) {
25
- s = arguments[i];
26
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
27
- t[p] = s[p];
28
- }
29
- return t;
30
- };
31
- return __assign.apply(this, arguments);
32
- };
33
- var __importDefault = (this && this.__importDefault) || function (mod) {
34
- return (mod && mod.__esModule) ? mod : { "default": mod };
35
- };
36
- exports.__esModule = true;
37
- var react_1 = __importDefault(require("react"));
38
- var input_1 = require("../input");
27
+ const react_1 = __importDefault(require("react"));
28
+ const input_1 = require("../input");
39
29
  /**
40
30
  *
41
31
  *
@@ -51,8 +41,8 @@ var input_1 = require("../input");
51
41
  *
52
42
  *
53
43
  */
54
- var Radio = function (props) {
55
- return react_1["default"].createElement(input_1.Input, __assign({}, props, { type: "radio", role: "radio" }));
56
- };
57
- exports["default"] = Radio;
44
+ const Radio = react_1.default.forwardRef(function Radio(props, ref) {
45
+ return (0, jsx_runtime_1.jsx)(input_1.Input, Object.assign({}, props, { type: "radio", role: "radio", ref: ref }));
46
+ });
47
+ exports.default = Radio;
58
48
  //# sourceMappingURL=Radio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../src/radio/Radio.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kDAA0B;AAC1B,oCAAiC;AAGjC;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,KAAK,GAAG,eAAK,CAAC,UAAU,CAAC,SAAS,KAAK,CAC3C,KAAiB,EACjB,GAAyC;IAEzC,OAAO,uBAAC,aAAK,oBAAK,KAAK,IAAE,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,EAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAClE,CAAC,CAAC,CAAC;AAEH,kBAAe,KAAK,CAAC"}
@@ -19,15 +19,11 @@
19
19
  * You should have received a copy of the GNU General Public License
20
20
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
21
  */
22
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23
- if (k2 === undefined) k2 = k;
24
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
25
- }) : (function(o, m, k, k2) {
26
- if (k2 === undefined) k2 = k;
27
- o[k2] = m[k];
28
- }));
29
- exports.__esModule = true;
22
+ var __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
30
26
  exports.Radio = void 0;
31
27
  var Radio_1 = require("./Radio");
32
- __createBinding(exports, Radio_1, "default", "Radio");
28
+ Object.defineProperty(exports, "Radio", { enumerable: true, get: function () { return __importDefault(Radio_1).default; } });
33
29
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/radio/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,iCAA2C;AAAlC,+GAAA,OAAO,OAAS"}
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
2
7
  /**
3
8
  *
4
9
  * Copyright (c) "Neo4j"
@@ -19,23 +24,8 @@
19
24
  * You should have received a copy of the GNU General Public License
20
25
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
26
  */
22
- var __assign = (this && this.__assign) || function () {
23
- __assign = Object.assign || function(t) {
24
- for (var s, i = 1, n = arguments.length; i < n; i++) {
25
- s = arguments[i];
26
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
27
- t[p] = s[p];
28
- }
29
- return t;
30
- };
31
- return __assign.apply(this, arguments);
32
- };
33
- var __importDefault = (this && this.__importDefault) || function (mod) {
34
- return (mod && mod.__esModule) ? mod : { "default": mod };
35
- };
36
- exports.__esModule = true;
37
- var react_1 = __importDefault(require("react"));
38
- var input_1 = require("../input");
27
+ const react_1 = __importDefault(require("react"));
28
+ const input_1 = require("../input");
39
29
  /**
40
30
  *
41
31
  *
@@ -51,9 +41,8 @@ var input_1 = require("../input");
51
41
  *
52
42
  *
53
43
  */
54
- var Switch = react_1["default"].forwardRef(function (props, ref) {
55
- return react_1["default"].createElement(input_1.Input, __assign({}, props, { ref: ref, type: "checkbox", role: "switch" }));
44
+ const Switch = react_1.default.forwardRef(function Switch(props, ref) {
45
+ return (0, jsx_runtime_1.jsx)(input_1.Input, Object.assign({}, props, { ref: ref, type: "checkbox", role: "switch" }));
56
46
  });
57
- Switch.displayName = 'Switch';
58
- exports["default"] = Switch;
47
+ exports.default = Switch;
59
48
  //# sourceMappingURL=Switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../src/switch/Switch.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kDAA0B;AAC1B,oCAAiC;AAGjC;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,MAAM,GAAG,eAAK,CAAC,UAAU,CAAC,SAAS,MAAM,CAC7C,KAAiB,EACjB,GAAyC;IAEzC,OAAO,uBAAC,aAAK,oBAAK,KAAK,IAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,QAAQ,IAAG,CAAC;AACtE,CAAC,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
@@ -19,15 +19,11 @@
19
19
  * You should have received a copy of the GNU General Public License
20
20
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
21
  */
22
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23
- if (k2 === undefined) k2 = k;
24
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
25
- }) : (function(o, m, k, k2) {
26
- if (k2 === undefined) k2 = k;
27
- o[k2] = m[k];
28
- }));
29
- exports.__esModule = true;
22
+ var __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
30
26
  exports.Switch = void 0;
31
27
  var Switch_1 = require("./Switch");
32
- __createBinding(exports, Switch_1, "default", "Switch");
28
+ Object.defineProperty(exports, "Switch", { enumerable: true, get: function () { return __importDefault(Switch_1).default; } });
33
29
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/switch/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,mCAA6C;AAApC,iHAAA,OAAO,OAAU"}
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fixedHeight = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ /**
9
+ *
10
+ * Copyright (c) "Neo4j"
11
+ * Neo4j Sweden AB [http://neo4j.com]
12
+ *
13
+ * This file is part of Neo4j.
14
+ *
15
+ * Neo4j is free software: you can redistribute it and/or modify
16
+ * it under the terms of the GNU General Public License as published by
17
+ * the Free Software Foundation, either version 3 of the License, or
18
+ * (at your option) any later version.
19
+ *
20
+ * This program is distributed in the hope that it will be useful,
21
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ * GNU General Public License for more details.
24
+ *
25
+ * You should have received a copy of the GNU General Public License
26
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+ const classnames_1 = __importDefault(require("classnames"));
29
+ const helpers_1 = require("./helpers");
30
+ const TableNavigation_1 = __importDefault(require("./TableNavigation"));
31
+ /** Table results per page, with the first option being the default */
32
+ const TABLE_RESULTS = {
33
+ DEFAULT: 10,
34
+ values: [10, 25, 50, 100],
35
+ };
36
+ /**
37
+ *
38
+ * Small Utilities
39
+ * for table styling and functionality
40
+ *
41
+ */
42
+ /** For fixed row height tables, we should have a fixed body size */
43
+ const fixedHeight = (items, height) => ({
44
+ style: { height: `${height * items}px` },
45
+ });
46
+ exports.fixedHeight = fixedHeight;
47
+ const DefaultHeader = ({ headerGroups, }) => ((0, jsx_runtime_1.jsx)("thead", { children:
48
+ // Loop over the header rows
49
+ headerGroups.map((headerGroup) => (
50
+ // Apply the header row props
51
+ // Key is defined from getHeaderGroupProps so we can ignore the false-negative
52
+ // eslint-disable-next-line react/jsx-key
53
+ (0, jsx_runtime_1.jsx)("tr", Object.assign({}, headerGroup.getHeaderGroupProps(), { children:
54
+ // Loop over the headers in each row
55
+ headerGroup.headers.map((column) => {
56
+ const castedColumn = column;
57
+ const sortable = !!castedColumn.getSortByToggleProps;
58
+ // Dont use "group" class inside the @apply component
59
+ // https://github.com/tailwindlabs/tailwindcss/issues/2848#issuecomment-734523233
60
+ const headerClasses = (0, classnames_1.default)('group', 'table-column-styling', {
61
+ sortable,
62
+ });
63
+ return (
64
+ // Apply the header cell props
65
+ // Key is defined from getHeaderGroupProps so we can ignore the false-negative
66
+ // eslint-disable-next-line react/jsx-key
67
+ (0, jsx_runtime_1.jsxs)("th", Object.assign({}, castedColumn.getHeaderProps(sortable && castedColumn.getSortByToggleProps()), { style: Object.assign(Object.assign({}, castedColumn.getHeaderProps().style), {
68
+ /** 0.25px */
69
+ letterSpacing: '0.25px' }), scope: "col", className: headerClasses }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "n-inline-flex n-items-center n-gap-x-1 n-h-full" }, { children: [castedColumn.render('Header'), castedColumn.canSort && ((0, jsx_runtime_1.jsx)(helpers_1.SortIcon, { isSortedDesc: castedColumn.isSortedDesc }))] })), 'canResize' in castedColumn &&
70
+ 'getResizerProps' in castedColumn && ((0, jsx_runtime_1.jsx)(helpers_1.ResizingBar, Object.assign({}, castedColumn.getResizerProps())))] })));
71
+ }) })))) }));
72
+ const DefaultBody = ({ getTableBodyProps, page, prepareRow, actionsButtons, rows, }) => {
73
+ // Page is defined when using the usePagination plugin, otherwise rows is defined
74
+ const iterable = page !== null && page !== void 0 ? page : rows;
75
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: iterable.length > 0 ? ((0, jsx_runtime_1.jsx)("tbody", Object.assign({}, getTableBodyProps(), { className: "n-bg-light-neutral-bg-weak" }, { children: iterable.length > 0 &&
76
+ iterable.map((row) => {
77
+ prepareRow(row);
78
+ return (
79
+ // Key is defined from getHeaderGroupProps so we can ignore the false-negative
80
+ // eslint-disable-next-line react/jsx-key
81
+ (0, jsx_runtime_1.jsxs)("tr", Object.assign({ className: "table-row" }, row.getRowProps(), { children: [row.cells.map((cell) => (
82
+ // Key is defined from getHeaderGroupProps so we can ignore the false-negative
83
+ // eslint-disable-next-line react/jsx-key
84
+ (0, jsx_runtime_1.jsx)("td", Object.assign({ className: "table-cell" }, cell.getCellProps(), { children: cell.render('Cell') })))), actionsButtons && actionsButtons(row)] })));
85
+ }) }))) : ((0, jsx_runtime_1.jsx)("tr", { children: (0, jsx_runtime_1.jsx)("h6", Object.assign({ className: "n-my-5 n-w-full n-text-center n-h-10 n-relative n-left-full n-flex n-justify-center n-items-center" }, { children: "No data present" })) })) }));
86
+ };
87
+ const DefaultNavigation = ({ state, rows, page, canPreviousPage, nextPage, pageOptions, pageCount, gotoPage, canNextPage, previousPage, setPageSize, }) => {
88
+ // Navigation is only needed if pagination exists
89
+ if (!page || !state.pageIndex || !state.pageSize) {
90
+ return null;
91
+ }
92
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "n-flex n-flex-row n-flex-wrap n-gap-2 n-justify-between n-items-center n-px-7 n-py-4 n-bg-light-neutral-bg-weak" }, { children: [(0, jsx_runtime_1.jsx)(helpers_1.TableResults, { pageIndex: state.pageIndex, rowsLength: rows.length, pageLength: page.length }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "n-flex n-flex-row n-flex-wrap n-gap-2 n-justify-between n-items-center n-gap-x-10" }, { children: [pageCount > 1 && ((0, jsx_runtime_1.jsx)(TableNavigation_1.default, { canPreviousPage: canPreviousPage, canNextPage: canNextPage, onPageClick: gotoPage, previousPage: previousPage, nextPage: nextPage, pageIndex: state.pageIndex, pageOptions: pageOptions })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "n-flex n-flex-row n-justify-between n-items-center n-gap-x-4 n-text-light-neutral-text-weaker" }, { children: ["Show", (0, jsx_runtime_1.jsx)("select", Object.assign({ onChange: (e) => setPageSize(parseInt(e.target.value, 10)), className: "ndl-table-select", value: state.pageSize, "aria-label": "Select page size" }, { children: [...new Set([...TABLE_RESULTS.values, state.pageSize])]
93
+ .sort((a, b) => a - b)
94
+ .map((option) => ((0, jsx_runtime_1.jsx)("option", Object.assign({ value: `${option}` }, { children: option }), `${option}`))) }))] }))] }))] })));
95
+ };
96
+ /**
97
+ * Table Skeleton to keep most section logic DRY
98
+ *
99
+ * How the table component is divided into sections:
100
+ *
101
+ * @example
102
+ * +----------------+
103
+ * | Table Controls |
104
+ * | (ex: Search) |
105
+ * +----------------+
106
+ * | Header |
107
+ * +----------------+
108
+ * | Body (data) |
109
+ * +----------------+
110
+ * | Navigation |
111
+ * +----------------+
112
+ *
113
+ */
114
+ const Table = (props) => {
115
+ const { controls, getTableProps, header, body, navigation, styling, className = '', style = {}, role, } = props;
116
+ if (!getTableProps) {
117
+ throw new Error('getTableProps is required');
118
+ }
119
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)('ndl-table n-rounded-3xl n-overflow-hidden n-flex n-flex-col n-divide-y n-divide-light-neutral-border-strong n-bg-light-neutral-bg-weak n-shadow-l3', className, { 'n-rounded-tl-[0px]': styling === null || styling === void 0 ? void 0 : styling.tabed }), style: style, role: role }, { children: [controls && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "n-px-7 n-py-6 n-flex n-flex-row n-items-center" }, { children: controls }))), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "n-overflow-x-auto" }, { children: (0, jsx_runtime_1.jsxs)("table", Object.assign({}, getTableProps(), { className: "n-w-full n-min-w-full n-divide-y n-divide-light-neutral-border-strong n-bg-light-neutral-bg-weak" }, { children: [header || (0, jsx_runtime_1.jsx)(DefaultHeader, Object.assign({}, props)), body || (0, jsx_runtime_1.jsx)(DefaultBody, Object.assign({}, props))] })) })), navigation || ((0, jsx_runtime_1.jsx)(DefaultNavigation, Object.assign({}, props)))] })));
120
+ };
121
+ exports.default = Table;
122
+ //# sourceMappingURL=Table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.js","sourceRoot":"","sources":["../../../src/table/Table.tsx"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4DAAoC;AAiBpC,uCAAgE;AAChE,wEAAgD;AAGhD,sEAAsE;AACtE,MAAM,aAAa,GAAG;IACpB,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;CACjB,CAAC;AAOX;;;;;GAKG;AAEH,oEAAoE;AAC7D,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,MAAc,EAAE,EAAE,CAAC,CAAC;IAC7D,KAAK,EAAE,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,KAAK,IAAI,EAAE;CACzC,CAAC,CAAC;AAFU,QAAA,WAAW,eAErB;AAwBH,MAAM,aAAa,GAAG,CAAmB,EACvC,YAAY,GACU,EAAE,EAAE,CAAC,CAC3B;IAEI,4BAA4B;IAC5B,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;IAChC,6BAA6B;IAC7B,8EAA8E;IAC9E,yCAAyC;IACzC,+CAAQ,WAAW,CAAC,mBAAmB,EAAE;QAErC,oCAAoC;QACpC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACjC,MAAM,YAAY,GAAG,MAAmC,CAAC;YAEzD,MAAM,QAAQ,GAAG,CAAC,CAAC,YAAY,CAAC,oBAAoB,CAAC;YACrD,qD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AAI,EAAE,IAAI,iBAGT,QAAQ,IAAI,CACX,8CAAK,SAAS,EAAC,gDAAgD,gBAC5D,QAAQ,IACL,CACP,EAED,8CAAK,SAAS,EAAC,mBAAmB,gBAEhC,mDACM,aAAa,EAAE,IACnB,SAAS,EAAC,kGAAkG,iBAG3G,MAAM,IAAI,uBAAC,aAAa,oBAAM,KAA+B,EAAI,EAEjE,IAAI,IAAI,uBAAC,WAAW,oBAAM,KAA6B,EAAI,KACtD,IACJ,EAEL,UAAU,IAAI,CACb,uBAAC,iBAAiB,oBAAM,KAAmC,EAAI,CAChE,KACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,KAAK,CAAC"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TableNavigation = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ /**
9
+ *
10
+ * Copyright (c) "Neo4j"
11
+ * Neo4j Sweden AB [http://neo4j.com]
12
+ *
13
+ * This file is part of Neo4j.
14
+ *
15
+ * Neo4j is free software: you can redistribute it and/or modify
16
+ * it under the terms of the GNU General Public License as published by
17
+ * the Free Software Foundation, either version 3 of the License, or
18
+ * (at your option) any later version.
19
+ *
20
+ * This program is distributed in the hope that it will be useful,
21
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ * GNU General Public License for more details.
24
+ *
25
+ * You should have received a copy of the GNU General Public License
26
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+ const classnames_1 = __importDefault(require("classnames"));
29
+ const helpers_1 = require("./helpers");
30
+ const icons_1 = require("../icons");
31
+ const NavigationArrowButtonClasses = `
32
+ body-medium n-relative n-inline-flex n-items-center
33
+ n-px-2 n-py-2 n-rounded-xl
34
+ n-text-light-neutral-text-weaker
35
+ hover:n-bg-light-primary-bg-strong hover:n-bg-opacity-10
36
+ `;
37
+ const NavigationIconClasses = `
38
+ n-w-5 n-h-5 n-text-light-neutral-text-weak
39
+ `;
40
+ const TableNavigation = ({ canPreviousPage, canNextPage, onPageClick, previousPage, nextPage, pageIndex, pageOptions, }) => ((0, jsx_runtime_1.jsxs)("nav", Object.assign({ className: "n-relative n-z-0 n-inline-flex n-max-w-min n-rounded-md n-gap-x-2", "aria-label": "Pagination" }, { children: [canPreviousPage ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("button", Object.assign({ onClick: () => previousPage(), className: NavigationArrowButtonClasses }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "n-sr-only" }, { children: "Previous" })), (0, jsx_runtime_1.jsx)(icons_1.HeroIcon, { iconName: "ChevronLeftIcon", className: NavigationIconClasses })] })) })) : null, (0, helpers_1.userFriendlyPagination)(pageIndex + 1, pageOptions.length).map((option, idx) => ((0, jsx_runtime_1.jsx)("button", Object.assign({ "data-testid": `table-${option}`, className: (0, classnames_1.default)('n-relative n-inline-flex n-items-center n-justify-center n-px-3 n-py-0.5 body-medium n-rounded-xl n-leading-8', {
41
+ 'n-cursor-pointer hover:n-bg-light-neutral-bg-strong': typeof option === 'number' && option !== pageIndex + 1,
42
+ 'n-bg-light-primary-bg-strong n-text-light-neutral-text-inverse': option === pageIndex + 1,
43
+ 'n-text-light-neutral-text-weaker': option !== pageIndex + 1,
44
+ }), style: {
45
+ minWidth: '36px',
46
+ maxHeight: '36px',
47
+ minHeight: '36px',
48
+ }, onClick: () => typeof option === 'number' && onPageClick(option - 1) }, { children: option }), `${option}-${idx}`))), canNextPage ? ((0, jsx_runtime_1.jsxs)("button", Object.assign({ onClick: () => nextPage(), className: NavigationArrowButtonClasses }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "n-sr-only" }, { children: "Next" })), (0, jsx_runtime_1.jsx)(icons_1.HeroIcon, { iconName: "ChevronRightIcon", className: NavigationIconClasses })] }))) : null] })));
49
+ exports.TableNavigation = TableNavigation;
50
+ exports.default = exports.TableNavigation;
51
+ //# sourceMappingURL=TableNavigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableNavigation.js","sourceRoot":"","sources":["../../../src/table/TableNavigation.tsx"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4DAAoC;AACpC,uCAAmD;AACnD,oCAAoC;AAmBpC,MAAM,4BAA4B,GAAG;;;;;CAKpC,CAAC;AAEF,MAAM,qBAAqB,GAAG;;CAE7B,CAAC;AAEK,MAAM,eAAe,GAAG,CAAC,EAC9B,eAAe,EACf,WAAW,EACX,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,WAAW,GACU,EAAE,EAAE,CAAC,CAC1B,+CACE,SAAS,EAAC,mEAAmE,gBAClE,YAAY,iBAEtB,eAAe,CAAC,CAAC,CAAC,CACjB,2DACE,kDACE,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,EAAE,EAC7B,SAAS,EAAE,4BAA4B,iBAEvC,+CAAM,SAAS,EAAC,WAAW,8BAAgB,EAC3C,uBAAC,gBAAQ,IACP,QAAQ,EAAC,iBAAiB,EAC1B,SAAS,EAAE,qBAAqB,GAChC,KACK,GACR,CACJ,CAAC,CAAC,CAAC,IAAI,EAEP,IAAA,gCAAsB,EAAC,SAAS,GAAG,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,CAC5D,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CACf,gEAIe,SAAS,MAAM,EAAE,EAC9B,SAAS,EAAE,IAAA,oBAAU,EACnB,+GAA+G,EAC/G;gBACE,qDAAqD,EACnD,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,SAAS,GAAG,CAAC;gBACxD,gEAAgE,EAC9D,MAAM,KAAK,SAAS,GAAG,CAAC;gBAC1B,kCAAkC,EAAE,MAAM,KAAK,SAAS,GAAG,CAAC;aAC7D,CACF,EACD,KAAK,EAAE;gBACL,QAAQ,EAAE,MAAM;gBAChB,SAAS,EAAE,MAAM;gBACjB,SAAS,EAAE,MAAM;aAClB,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,gBAEnE,MAAM,KAnBF,GAAG,MAAM,IAAI,GAAG,EAAE,CAoBhB,CACV,CACF,EAEA,WAAW,CAAC,CAAC,CAAC,CACb,kDACE,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,EACzB,SAAS,EAAE,4BAA4B,iBAEvC,+CAAM,SAAS,EAAC,WAAW,0BAAY,EACvC,uBAAC,gBAAQ,IACP,QAAQ,EAAC,kBAAkB,EAC3B,SAAS,EAAE,qBAAqB,GAChC,KACK,CACV,CAAC,CAAC,CAAC,IAAI,KACJ,CACP,CAAC;AAtEW,QAAA,eAAe,mBAsE1B;AAEF,kBAAe,uBAAe,CAAC"}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toggleRowSelection = exports.userFriendlyPagination = exports.TableResults = exports.ResizingBar = exports.SortIcon = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ /**
6
+ *
7
+ * Copyright (c) "Neo4j"
8
+ * Neo4j Sweden AB [http://neo4j.com]
9
+ *
10
+ * This file is part of Neo4j.
11
+ *
12
+ * Neo4j is free software: you can redistribute it and/or modify
13
+ * it under the terms of the GNU General Public License as published by
14
+ * the Free Software Foundation, either version 3 of the License, or
15
+ * (at your option) any later version.
16
+ *
17
+ * This program is distributed in the hope that it will be useful,
18
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
+ * GNU General Public License for more details.
21
+ *
22
+ * You should have received a copy of the GNU General Public License
23
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
24
+ */
25
+ const icons_1 = require("../icons");
26
+ const react_1 = require("react");
27
+ /**
28
+ *
29
+ * React Table helper to display sorting icon
30
+ * Source:
31
+ * https://react-table.tanstack.com/docs/api/useSortBy#column-properties
32
+ *
33
+ */
34
+ const SortIcon = ({ isSortedDesc, }) => {
35
+ switch (true) {
36
+ case isSortedDesc === true:
37
+ return ((0, jsx_runtime_1.jsx)(icons_1.HeroIcon, { className: "n-w-4 n-h-4", type: "outline", iconName: "SortDescendingIcon" }));
38
+ case isSortedDesc === false:
39
+ return ((0, jsx_runtime_1.jsx)(icons_1.HeroIcon, { className: "n-w-4 n-h-4", type: "outline", iconName: "SortAscendingIcon" }));
40
+ default:
41
+ return ((0, jsx_runtime_1.jsx)(icons_1.HeroIcon, { className: "n-w-4 n-h-4", type: "outline", iconName: "MenuAlt1Icon" }));
42
+ }
43
+ };
44
+ exports.SortIcon = SortIcon;
45
+ exports.ResizingBar = (0, react_1.memo)(function ResizingBarMemoed(props) {
46
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, props, { className: "n-right-0 n-h-full n-absolute n-top-0 hover:n-bg-light-neutral-bg-strongest n-cursor-col-resize", style: {
47
+ width: '2px',
48
+ zIndex: 1,
49
+ // prevents from scrolling while dragging on touch devices
50
+ touchAction: 'none',
51
+ } })));
52
+ });
53
+ /**
54
+ * The left section of the bottom navigation
55
+ * that is showing the current page and how many results we can see
56
+ */
57
+ const TableResults = ({ pageIndex, pageLength, rowsLength, }) => ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: "n-text-light-neutral-text-weaker body-medium n-whitespace-nowrap" }, { children: (0, jsx_runtime_1.jsxs)("span", { children: ["Showing", ' ', (0, jsx_runtime_1.jsxs)("b", { children: [pageIndex * 10, "-", pageIndex * 10 + pageLength] }), ' ', "of ", (0, jsx_runtime_1.jsx)("b", { children: rowsLength }), " results"] }) })));
58
+ exports.TableResults = TableResults;
59
+ /**
60
+ * Modified from here: https://gist.github.com/kottenator/9d936eb3e4e3c3e02598
61
+ *
62
+ * @param current Current Index
63
+ * @param max Max Index
64
+ * @returns
65
+ */
66
+ const userFriendlyPagination = (current, max) => {
67
+ const last = max;
68
+ const delta = 2;
69
+ const left = current - delta;
70
+ const right = current + delta + 1;
71
+ const range = [];
72
+ const rangeWithDots = [];
73
+ let l;
74
+ for (let i = 1; i <= last; i += 1) {
75
+ if (i === 1 || i === last || (i >= left && i < right)) {
76
+ range.push(i);
77
+ }
78
+ }
79
+ for (let i = 0; i < range.length; i += 1) {
80
+ if (l) {
81
+ if (range[i] - l === 2) {
82
+ rangeWithDots.push(l + 1);
83
+ }
84
+ else if (range[i] - l !== 1) {
85
+ rangeWithDots.push('...');
86
+ }
87
+ }
88
+ rangeWithDots.push(range[i]);
89
+ l = range[i];
90
+ }
91
+ return rangeWithDots;
92
+ };
93
+ exports.userFriendlyPagination = userFriendlyPagination;
94
+ /**
95
+ * Small helper to get handle the Checkbox
96
+ * functionality in tables
97
+ */
98
+ const toggleRowSelection = (list, idx) => {
99
+ // Removing from the list
100
+ if (list.includes(idx)) {
101
+ return list.filter((o) => o !== idx);
102
+ }
103
+ // Adding to the list
104
+ return [...list, idx];
105
+ };
106
+ exports.toggleRowSelection = toggleRowSelection;
107
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/table/helpers.tsx"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,oCAAoC;AACpC,iCAA6B;AAG7B;;;;;;GAMG;AACI,MAAM,QAAQ,GAAG,CAAC,EACvB,YAAY,GAGb,EAAE,EAAE;IACH,QAAQ,IAAI,EAAE;QACZ,KAAK,YAAY,KAAK,IAAI;YACxB,OAAO,CACL,uBAAC,gBAAQ,IACP,SAAS,EAAC,aAAa,EACvB,IAAI,EAAC,SAAS,EACd,QAAQ,EAAC,o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C;AACxB,CAAC,CAAC;AAPW,QAAA,kBAAkB,sBAO7B"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ //# sourceMappingURL=hookCallbackTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hookCallbackTypes.js","sourceRoot":"","sources":["../../../../src/table/hooks/hookCallbackTypes.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ var desc = Object.getOwnPropertyDescriptor(m, k);
25
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
26
+ desc = { enumerable: true, get: function() { return m[k]; } };
27
+ }
28
+ Object.defineProperty(o, k2, desc);
29
+ }) : (function(o, m, k, k2) {
30
+ if (k2 === undefined) k2 = k;
31
+ o[k2] = m[k];
32
+ }));
33
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
34
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ __exportStar(require("./useMultiRowSelect"), exports);
38
+ __exportStar(require("./useSingleRowSelect"), exports);
39
+ __exportStar(require("./hookCallbackTypes"), exports);
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table/hooks/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,sDAAoC;AACpC,uDAAqC;AACrC,sDAAoC"}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ /**
5
+ *
6
+ * Copyright (c) "Neo4j"
7
+ * Neo4j Sweden AB [http://neo4j.com]
8
+ *
9
+ * This file is part of Neo4j.
10
+ *
11
+ * Neo4j is free software: you can redistribute it and/or modify
12
+ * it under the terms of the GNU General Public License as published by
13
+ * the Free Software Foundation, either version 3 of the License, or
14
+ * (at your option) any later version.
15
+ *
16
+ * This program is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License
22
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
23
+ */
24
+ const react_1 = require("react");
25
+ const react_table_1 = require("react-table");
26
+ const checkbox_1 = require("../../checkbox");
27
+ /**
28
+ * A react-table plugin to support controlled selected row state for multiple rows
29
+ *
30
+ * Required options provided to useTable:
31
+ *
32
+ * `onAllRowSelect`: A callback that is called when the all rows checkbox is toggled
33
+ * `onRowSelect`: A callback that is called when a rows checkbox is toggled
34
+ *
35
+ * Required fields on `data` provided to useTable:
36
+ *
37
+ * `isSelected`: a boolean that indicates if the row is selected. This key can be changed
38
+ * from `isSelected` to something else by setting the `manualRowSelectedKey` option
39
+ * in the useTable options. See the useRowSelect plugin docs for more details.
40
+ */
41
+ const useMultiRowSelect = (hooks) => {
42
+ (0, react_table_1.useRowSelect)(hooks);
43
+ /*
44
+ Used for the indeterminate
45
+ state of the checkbox
46
+ */
47
+ hooks.useControlledState.push((state, { instance }) => {
48
+ const { data } = instance;
49
+ const isSelectedKey = 'isSelected';
50
+ // eslint-disable-next-line react-hooks/rules-of-hooks
51
+ const newState = (0, react_1.useMemo)(() => (Object.assign(Object.assign({}, state), { selectedRowIds: data.reduce((acc, curr, index) => {
52
+ if (curr[isSelectedKey]) {
53
+ return Object.assign(Object.assign({}, acc), { [index]: true });
54
+ }
55
+ return acc;
56
+ }, {}) })), [state, data, isSelectedKey]);
57
+ return newState;
58
+ });
59
+ hooks.visibleColumns.push((columns, { instance }) => [
60
+ // Let's make a column for selection
61
+ {
62
+ id: 'ndl-checkbox-selection',
63
+ // The header can use the table's getToggleAllRowsSelectedProps method
64
+ // to render a checkbox
65
+ Header: ({ getToggleAllRowsSelectedProps, }) => {
66
+ const checkboxRef = (0, react_1.useRef)(null);
67
+ (0, react_1.useEffect)(() => {
68
+ if (checkboxRef && checkboxRef.current) {
69
+ checkboxRef.current.indeterminate =
70
+ getToggleAllRowsSelectedProps().indeterminate || false;
71
+ }
72
+ }, [checkboxRef, getToggleAllRowsSelectedProps]);
73
+ return ((0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, Object.assign({ "aria-label": "all-rows-select", onClick: () => instance.onAllRowSelect() }, getToggleAllRowsSelectedProps(), { ref: checkboxRef })));
74
+ },
75
+ // The cell can use the individual row's getToggleRowSelectedProps method
76
+ // to the render a checkbox
77
+ Cell: ({ row }) => ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, Object.assign({ "aria-label": `row-${row.index}`, onClick: () => instance.onRowSelect(row.original, row.index) }, row.getToggleRowSelectedProps())) })),
78
+ },
79
+ ...columns,
80
+ ]);
81
+ };
82
+ useMultiRowSelect.pluginName = 'useMultiRowSelect';
83
+ exports.default = useMultiRowSelect;
84
+ //# sourceMappingURL=useMultiRowSelect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMultiRowSelect.js","sourceRoot":"","sources":["../../../../src/table/hooks/useMultiRowSelect.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,iCAAmD;AACnD,6CASqB;AACrB,6CAA0C;AAW1C;;;;;;;;;;;;;GAaG;AACH,MAAM,iBAAiB,GAAG,CACxB,KAAe,EACf,EAAE;IACF,IAAA,0BAAY,EAAC,KAAK,CAAC,CAAC;IAEpB;;;MAGE;IACF,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;QACpD,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;QAE1B,MAAM,aAAa,GAAG,YAAY,CAAC;QACnC,sDAAsD;QACtD,MAAM,QAAQ,GAAG,IAAA,eAAO,EACtB,GAAG,EAAE,CAAC,iCACD,KAAK,KACR,cAAc,EAAE,IAAI,CAAC,MAAM,CACzB,CACE,GAA4B,EAC5B,IAA6B,EAC7B,KAAa,EACb,EAAE;gBACF,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE;oBACvB,uCAAY,G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