@decisiv/ui-components 2.0.1-alpha.21 → 2.0.1-alpha.211

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 (630) hide show
  1. package/lib/atoms/BaseButton/index.d.ts.map +1 -1
  2. package/lib/atoms/BaseButton/index.js +1 -1
  3. package/lib/atoms/BooleanInput/elements.d.ts.map +1 -1
  4. package/lib/atoms/BooleanInput/elements.js +8 -3
  5. package/lib/atoms/BooleanInput/index.d.ts.map +1 -1
  6. package/lib/atoms/BooleanInput/index.js +26 -5
  7. package/lib/atoms/BooleanInput/index.test.js +17 -6
  8. package/lib/atoms/BooleanInput/types.d.ts +4 -0
  9. package/lib/atoms/BooleanInput/types.d.ts.map +1 -1
  10. package/lib/atoms/BooleanInput/types.js +5 -1
  11. package/lib/atoms/Calendar/hooks/useCalendar/index.d.ts.map +1 -1
  12. package/lib/atoms/Calendar/hooks/useCalendar/index.js +2 -1
  13. package/lib/atoms/Calendar/hooks/useCalendar/index.test.js +5 -6
  14. package/lib/atoms/Calendar/index.d.ts.map +1 -1
  15. package/lib/atoms/Calendar/index.js +46 -6
  16. package/lib/atoms/Calendar/index.test.js +68 -38
  17. package/lib/atoms/Calendar/types.d.ts +1 -1
  18. package/lib/atoms/Calendar/types.d.ts.map +1 -1
  19. package/lib/atoms/Calendar/types.js +5 -1
  20. package/lib/atoms/InputField/Containers.d.ts +12 -6
  21. package/lib/atoms/InputField/Containers.d.ts.map +1 -1
  22. package/lib/atoms/InputField/Containers.js +8 -6
  23. package/lib/atoms/InputField/HelpMessage.d.ts +1 -1
  24. package/lib/atoms/InputField/HelpMessage.d.ts.map +1 -1
  25. package/lib/atoms/InputField/HelpMessage.js +23 -7
  26. package/lib/atoms/InputField/InputLabel.d.ts +1 -0
  27. package/lib/atoms/InputField/InputLabel.d.ts.map +1 -1
  28. package/lib/atoms/InputField/InputLabel.js +2 -1
  29. package/lib/atoms/InputField/index.d.ts +8 -1
  30. package/lib/atoms/InputField/index.d.ts.map +1 -1
  31. package/lib/atoms/InputField/index.js +33 -9
  32. package/lib/atoms/InputField/index.test.js +144 -0
  33. package/lib/atoms/InputField/schema.d.ts.map +1 -1
  34. package/lib/atoms/InputField/schema.js +3 -2
  35. package/lib/atoms/OptionsList/Category/index.d.ts +4 -0
  36. package/lib/atoms/OptionsList/Category/index.d.ts.map +1 -0
  37. package/lib/atoms/OptionsList/{Category.js → Category/index.js} +13 -21
  38. package/lib/atoms/OptionsList/Category/styles.d.ts +6 -0
  39. package/lib/atoms/OptionsList/Category/styles.d.ts.map +1 -0
  40. package/lib/atoms/OptionsList/Category/styles.js +36 -0
  41. package/lib/atoms/OptionsList/{Option.d.ts → Option/index.d.ts} +2 -2
  42. package/lib/atoms/OptionsList/Option/index.d.ts.map +1 -0
  43. package/lib/atoms/OptionsList/Option/index.js +172 -0
  44. package/lib/atoms/OptionsList/Option/styles.d.ts +17 -0
  45. package/lib/atoms/OptionsList/Option/styles.d.ts.map +1 -0
  46. package/lib/atoms/OptionsList/Option/styles.js +86 -0
  47. package/lib/atoms/OptionsList/context.d.ts +1 -0
  48. package/lib/atoms/OptionsList/context.d.ts.map +1 -1
  49. package/lib/atoms/OptionsList/index.d.ts.map +1 -1
  50. package/lib/atoms/OptionsList/index.js +20 -9
  51. package/lib/atoms/OptionsList/index.test.js +249 -156
  52. package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
  53. package/lib/atoms/OptionsList/schema.js +4 -1
  54. package/lib/atoms/OptionsList/types.d.ts +25 -0
  55. package/lib/atoms/OptionsList/types.d.ts.map +1 -1
  56. package/lib/atoms/OptionsList/types.js +5 -1
  57. package/lib/atoms/RequiredIcon.d.ts +9 -0
  58. package/lib/atoms/RequiredIcon.d.ts.map +1 -0
  59. package/lib/atoms/{InputField/RequiredIcon.js → RequiredIcon.js} +7 -3
  60. package/lib/components/Accordion/types.js +5 -1
  61. package/lib/components/Accordion/useAccordion/types.js +5 -1
  62. package/lib/components/Alert/Container.d.ts +201 -0
  63. package/lib/components/Alert/Container.d.ts.map +1 -0
  64. package/lib/components/Alert/Container.js +26 -0
  65. package/lib/components/Alert/StyledButton.d.ts +5 -0
  66. package/lib/components/Alert/StyledButton.d.ts.map +1 -0
  67. package/lib/components/Alert/StyledButton.js +23 -0
  68. package/lib/components/Alert/index.d.ts +27 -0
  69. package/lib/components/Alert/index.d.ts.map +1 -0
  70. package/lib/components/Alert/index.js +112 -0
  71. package/lib/components/Alert/index.test.js +79 -0
  72. package/lib/components/Alert/intents.d.ts +13 -0
  73. package/lib/components/Alert/intents.d.ts.map +1 -0
  74. package/lib/components/Alert/intents.js +72 -0
  75. package/lib/components/{Tabs/schema.tab.d.ts → Alert/schema.d.ts} +1 -1
  76. package/lib/components/Alert/schema.d.ts.map +1 -0
  77. package/lib/components/Alert/schema.js +25 -0
  78. package/lib/components/Alert/types.d.ts +36 -0
  79. package/lib/components/Alert/types.d.ts.map +1 -0
  80. package/lib/components/Alert/types.js +32 -0
  81. package/lib/components/Avatar/AvatarContainer.d.ts +1 -13
  82. package/lib/components/Avatar/AvatarContainer.d.ts.map +1 -1
  83. package/lib/components/Avatar/AvatarContainer.js +12 -13
  84. package/lib/components/Avatar/AvatarContent.d.ts +2 -2
  85. package/lib/components/Avatar/AvatarContent.d.ts.map +1 -1
  86. package/lib/components/Avatar/AvatarContent.js +24 -20
  87. package/lib/components/Avatar/index.d.ts.map +1 -1
  88. package/lib/components/Avatar/index.js +39 -5
  89. package/lib/components/Avatar/index.test.js +4 -0
  90. package/lib/components/Avatar/schema.d.ts.map +1 -1
  91. package/lib/components/Avatar/schema.js +3 -1
  92. package/lib/components/Avatar/types.d.ts +15 -2
  93. package/lib/components/Avatar/types.d.ts.map +1 -1
  94. package/lib/components/Avatar/types.js +5 -1
  95. package/lib/components/Badge/constants.d.ts +2 -0
  96. package/lib/components/Badge/constants.d.ts.map +1 -0
  97. package/lib/components/Badge/constants.js +29 -0
  98. package/lib/components/Badge/index.d.ts.map +1 -1
  99. package/lib/components/Badge/index.js +3 -70
  100. package/lib/components/Badge/index.test.js +62 -8
  101. package/lib/components/Badge/schema.d.ts.map +1 -1
  102. package/lib/components/Badge/schema.js +2 -1
  103. package/lib/components/Badge/styles.d.ts +3 -0
  104. package/lib/components/Badge/styles.d.ts.map +1 -0
  105. package/lib/components/Badge/styles.js +96 -0
  106. package/lib/components/Badge/types.d.ts +3 -2
  107. package/lib/components/Badge/types.d.ts.map +1 -1
  108. package/lib/components/Badge/types.js +7 -3
  109. package/lib/components/Breadcrumbs/types.js +5 -1
  110. package/lib/components/Button/StyledButton.d.ts +3 -6
  111. package/lib/components/Button/StyledButton.d.ts.map +1 -1
  112. package/lib/components/Button/StyledButton.js +39 -11
  113. package/lib/components/Button/index.d.ts.map +1 -1
  114. package/lib/components/Button/index.js +51 -12
  115. package/lib/components/Button/index.test.js +43 -8
  116. package/lib/components/Button/schema.d.ts.map +1 -1
  117. package/lib/components/Button/schema.js +4 -1
  118. package/lib/components/Button/types.d.ts +4 -1
  119. package/lib/components/Button/types.d.ts.map +1 -1
  120. package/lib/components/Button/types.js +5 -1
  121. package/lib/components/Checkbox/index.d.ts.map +1 -1
  122. package/lib/components/Checkbox/index.js +3 -1
  123. package/lib/components/Checkbox/schema.d.ts.map +1 -1
  124. package/lib/components/Checkbox/schema.js +2 -0
  125. package/lib/components/CheckboxGroup/index.d.ts +1 -1
  126. package/lib/components/Combobox/Target.d.ts.map +1 -1
  127. package/lib/components/Combobox/Target.js +52 -14
  128. package/lib/components/Combobox/index.d.ts.map +1 -1
  129. package/lib/components/Combobox/index.js +231 -89
  130. package/lib/components/Combobox/index.test.js +425 -147
  131. package/lib/components/Combobox/schema.d.ts.map +1 -1
  132. package/lib/components/Combobox/schema.js +13 -3
  133. package/lib/components/Combobox/types.d.ts +13 -3
  134. package/lib/components/Combobox/types.d.ts.map +1 -1
  135. package/lib/components/Combobox/types.js +5 -1
  136. package/lib/components/Drawer/index.d.ts +22 -0
  137. package/lib/components/Drawer/index.d.ts.map +1 -0
  138. package/lib/components/Drawer/index.js +115 -0
  139. package/lib/components/Drawer/index.test.js +139 -0
  140. package/lib/components/Drawer/schema.d.ts +3 -0
  141. package/lib/components/Drawer/schema.d.ts.map +1 -0
  142. package/lib/components/Drawer/schema.js +32 -0
  143. package/lib/components/Drawer/styles.d.ts +11 -0
  144. package/lib/components/Drawer/styles.d.ts.map +1 -0
  145. package/lib/components/Drawer/styles.js +79 -0
  146. package/lib/components/DropdownList/index.d.ts +1 -0
  147. package/lib/components/DropdownList/index.d.ts.map +1 -1
  148. package/lib/components/DropdownList/index.js +70 -22
  149. package/lib/components/DropdownList/index.test.js +47 -15
  150. package/lib/components/DropdownList/propTypes.d.ts +4 -0
  151. package/lib/components/DropdownList/propTypes.d.ts.map +1 -0
  152. package/lib/components/DropdownList/propTypes.js +42 -0
  153. package/lib/components/DropdownList/schema.d.ts.map +1 -1
  154. package/lib/components/DropdownList/schema.js +2 -1
  155. package/lib/components/DropdownList/types.d.ts +2 -0
  156. package/lib/components/DropdownList/types.d.ts.map +1 -1
  157. package/lib/components/Filter/ActionFilter/index.d.ts +5 -0
  158. package/lib/components/Filter/ActionFilter/index.d.ts.map +1 -0
  159. package/lib/components/Filter/ActionFilter/index.js +43 -0
  160. package/lib/components/Filter/IconWrapper/index.d.ts +197 -0
  161. package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -0
  162. package/lib/components/Filter/IconWrapper/index.js +35 -0
  163. package/lib/components/Filter/SimplePrimary/index.d.ts +5 -0
  164. package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -0
  165. package/lib/components/Filter/SimplePrimary/index.js +46 -0
  166. package/lib/components/Filter/SimplePrimary/index.test.js +34 -0
  167. package/lib/components/Filter/StyledFilter.d.ts +4 -0
  168. package/lib/components/Filter/StyledFilter.d.ts.map +1 -0
  169. package/lib/components/Filter/StyledFilter.js +66 -0
  170. package/lib/components/Filter/StyledLabel/index.d.ts +8 -0
  171. package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -0
  172. package/lib/components/Filter/StyledLabel/index.js +38 -0
  173. package/lib/components/Filter/index.d.ts +6 -0
  174. package/lib/components/Filter/index.d.ts.map +1 -0
  175. package/lib/components/Filter/index.js +107 -0
  176. package/lib/components/Filter/index.test.js +70 -0
  177. package/lib/components/Filter/kind.d.ts +7 -0
  178. package/lib/components/Filter/kind.d.ts.map +1 -0
  179. package/lib/components/Filter/kind.js +43 -0
  180. package/lib/components/Filter/schema.d.ts +9 -0
  181. package/lib/components/Filter/schema.d.ts.map +1 -0
  182. package/lib/components/Filter/schema.js +37 -0
  183. package/lib/components/Filter/types.d.ts +31 -0
  184. package/lib/components/Filter/types.d.ts.map +1 -0
  185. package/lib/components/Filter/types.js +5 -0
  186. package/lib/components/JumpTo/JumpToMenu.d.ts +2 -2
  187. package/lib/components/JumpTo/JumpToMenu.d.ts.map +1 -1
  188. package/lib/components/JumpTo/JumpToMenu.js +53 -12
  189. package/lib/components/JumpTo/index.test.js +84 -0
  190. package/lib/components/JumpTo/schema.d.ts.map +1 -1
  191. package/lib/components/JumpTo/schema.js +2 -1
  192. package/lib/components/JumpTo/types.d.ts +1 -0
  193. package/lib/components/JumpTo/types.d.ts.map +1 -1
  194. package/lib/components/JumpTo/types.js +5 -1
  195. package/lib/components/JumpTo/utils.d.ts.map +1 -1
  196. package/lib/components/JumpTo/utils.js +3 -7
  197. package/lib/components/LeftNav/Item/ClickArea.js +1 -1
  198. package/lib/components/LeftNav/Item/ItemWrapper.d.ts.map +1 -1
  199. package/lib/components/LeftNav/Item/ItemWrapper.js +3 -1
  200. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts +7 -0
  201. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts.map +1 -0
  202. package/lib/components/LeftNav/Item/MenuItemWrapper.js +20 -0
  203. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.d.ts.map +1 -1
  204. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.js +7 -5
  205. package/lib/components/LeftNav/Item/NavExpandedItem/index.d.ts.map +1 -1
  206. package/lib/components/LeftNav/Item/NavExpandedItem/index.js +24 -13
  207. package/lib/components/LeftNav/Item/types.d.ts +1 -1
  208. package/lib/components/LeftNav/Item/types.d.ts.map +1 -1
  209. package/lib/components/LeftNav/Item/types.js +5 -1
  210. package/lib/components/LeftNav/index.test.js +13 -3
  211. package/lib/components/LeftNav/schema.d.ts.map +1 -1
  212. package/lib/components/LeftNav/schema.js +2 -0
  213. package/lib/components/LeftNav/types.d.ts +1 -0
  214. package/lib/components/LeftNav/types.d.ts.map +1 -1
  215. package/lib/components/LeftNav/types.js +5 -1
  216. package/lib/components/Link/DisabledLink.d.ts +7 -0
  217. package/lib/components/Link/DisabledLink.d.ts.map +1 -0
  218. package/lib/components/Link/DisabledLink.js +46 -0
  219. package/lib/components/Link/Link.d.ts +4 -0
  220. package/lib/components/Link/Link.d.ts.map +1 -0
  221. package/lib/components/Link/Link.js +67 -0
  222. package/lib/components/Link/index.d.ts +4 -23
  223. package/lib/components/Link/index.d.ts.map +1 -1
  224. package/lib/components/Link/index.js +20 -158
  225. package/lib/components/Link/index.test.js +63 -42
  226. package/lib/components/Link/schema.d.ts.map +1 -1
  227. package/lib/components/Link/schema.js +2 -1
  228. package/lib/components/Link/styles.d.ts +20 -0
  229. package/lib/components/Link/styles.d.ts.map +1 -0
  230. package/lib/components/Link/styles.js +131 -0
  231. package/lib/components/Link/types.d.ts +28 -0
  232. package/lib/components/Link/types.d.ts.map +1 -0
  233. package/lib/components/Link/types.js +5 -0
  234. package/lib/components/List/BaseCell/index.d.ts +6 -0
  235. package/lib/components/List/BaseCell/index.d.ts.map +1 -0
  236. package/lib/components/List/BaseCell/index.js +17 -0
  237. package/lib/components/List/BaseCell/index.test.js +33 -0
  238. package/lib/components/List/BaseCell/styles.d.ts +198 -0
  239. package/lib/components/List/BaseCell/styles.d.ts.map +1 -0
  240. package/lib/components/List/BaseCell/styles.js +26 -0
  241. package/lib/components/List/ContentContainer/index.d.ts +21 -0
  242. package/lib/components/List/ContentContainer/index.d.ts.map +1 -0
  243. package/lib/components/List/ContentContainer/index.js +82 -0
  244. package/lib/components/List/ContentContainer/index.test.js +102 -0
  245. package/lib/components/List/DefaultCell/index.d.ts +6 -0
  246. package/lib/components/List/DefaultCell/index.d.ts.map +1 -0
  247. package/lib/components/List/DefaultCell/index.js +26 -0
  248. package/lib/components/List/EditableCell/index.d.ts +13 -0
  249. package/lib/components/List/EditableCell/index.d.ts.map +1 -0
  250. package/lib/components/List/EditableCell/index.js +47 -0
  251. package/lib/components/List/EditableCell/styles.d.ts +204 -0
  252. package/lib/components/List/EditableCell/styles.d.ts.map +1 -0
  253. package/lib/components/List/EditableCell/styles.js +47 -0
  254. package/lib/components/List/LabelContainer/index.d.ts +9 -0
  255. package/lib/components/List/LabelContainer/index.d.ts.map +1 -0
  256. package/lib/components/List/LabelContainer/index.js +38 -0
  257. package/lib/components/List/LabelContainer/index.test.js +105 -0
  258. package/lib/components/List/LabelContainer/styles.d.ts +4 -0
  259. package/lib/components/List/LabelContainer/styles.d.ts.map +1 -0
  260. package/lib/components/List/LabelContainer/styles.js +28 -0
  261. package/lib/components/List/ListItem/index.d.ts +8 -0
  262. package/lib/components/List/ListItem/index.d.ts.map +1 -0
  263. package/lib/components/List/ListItem/index.js +43 -0
  264. package/lib/components/List/ListItem/index.test.js +76 -0
  265. package/lib/components/List/ListItem/schema.d.ts +4 -0
  266. package/lib/components/List/ListItem/schema.d.ts.map +1 -0
  267. package/lib/components/List/ListItem/schema.js +30 -0
  268. package/lib/components/List/ListItem/styles.d.ts +2 -0
  269. package/lib/components/List/ListItem/styles.d.ts.map +1 -0
  270. package/lib/components/List/ListItem/styles.js +23 -0
  271. package/lib/components/List/constants.d.ts +19 -0
  272. package/lib/components/List/constants.d.ts.map +1 -0
  273. package/lib/components/List/constants.js +28 -0
  274. package/lib/components/List/index.d.ts +15 -0
  275. package/lib/components/List/index.d.ts.map +1 -0
  276. package/lib/components/List/index.js +67 -0
  277. package/lib/components/List/index.test.js +64 -0
  278. package/lib/components/List/schema.d.ts +4 -0
  279. package/lib/components/List/schema.d.ts.map +1 -0
  280. package/lib/components/List/schema.js +26 -0
  281. package/lib/components/List/styles.d.ts +198 -0
  282. package/lib/components/List/styles.d.ts.map +1 -0
  283. package/lib/components/List/styles.js +34 -0
  284. package/lib/components/List/types.d.ts +15 -0
  285. package/lib/components/List/types.d.ts.map +1 -0
  286. package/lib/components/List/types.js +5 -0
  287. package/lib/components/Loading/Loading.d.ts +12 -0
  288. package/lib/components/Loading/Loading.d.ts.map +1 -0
  289. package/lib/components/Loading/Loading.js +70 -0
  290. package/lib/components/Loading/index.d.ts +4 -0
  291. package/lib/components/Loading/index.d.ts.map +1 -0
  292. package/lib/components/Loading/index.js +33 -0
  293. package/lib/components/Loading/index.test.js +55 -0
  294. package/lib/components/Loading/schema.d.ts +4 -0
  295. package/lib/components/Loading/schema.d.ts.map +1 -0
  296. package/lib/components/Loading/schema.js +31 -0
  297. package/lib/components/Loading/styles.d.ts +211 -0
  298. package/lib/components/Loading/styles.d.ts.map +1 -0
  299. package/lib/components/Loading/styles.js +77 -0
  300. package/lib/components/Loading/types.d.ts +10 -0
  301. package/lib/components/Loading/types.d.ts.map +1 -0
  302. package/lib/components/Loading/types.js +5 -0
  303. package/lib/components/Menu/types.js +5 -1
  304. package/lib/components/Modal/Manager.d.ts +6 -0
  305. package/lib/components/Modal/Manager.d.ts.map +1 -0
  306. package/lib/components/Modal/Manager.js +53 -0
  307. package/lib/components/Modal/ResponsiveModalWrapper.d.ts +11 -0
  308. package/lib/components/Modal/ResponsiveModalWrapper.d.ts.map +1 -0
  309. package/lib/components/Modal/ResponsiveModalWrapper.js +82 -0
  310. package/lib/components/Modal/components.d.ts +201 -3
  311. package/lib/components/Modal/components.d.ts.map +1 -1
  312. package/lib/components/Modal/components.js +16 -24
  313. package/lib/components/Modal/index.d.ts +8 -4
  314. package/lib/components/Modal/index.d.ts.map +1 -1
  315. package/lib/components/Modal/index.js +63 -95
  316. package/lib/components/Modal/index.test.js +89 -0
  317. package/lib/components/Modal/schema.d.ts.map +1 -1
  318. package/lib/components/Modal/schema.js +2 -1
  319. package/lib/components/Modal/types.d.ts +2 -1
  320. package/lib/components/Modal/types.d.ts.map +1 -1
  321. package/lib/components/Modal/types.js +5 -1
  322. package/lib/components/Modal/utils.d.ts +1 -1
  323. package/lib/components/Modal/utils.d.ts.map +1 -1
  324. package/lib/components/Modal/utils.js +7 -5
  325. package/lib/components/Notifications/Notification/components.d.ts +3 -3
  326. package/lib/components/Notifications/Notification/components.d.ts.map +1 -1
  327. package/lib/components/Notifications/Notification/components.js +12 -6
  328. package/lib/components/Notifications/Notification/index.d.ts +3 -6
  329. package/lib/components/Notifications/Notification/index.d.ts.map +1 -1
  330. package/lib/components/Notifications/Notification/index.js +19 -12
  331. package/lib/components/Notifications/Notification/index.test.js +38 -19
  332. package/lib/components/Notifications/NotificationsPanel/index.d.ts +2 -1
  333. package/lib/components/Notifications/NotificationsPanel/index.d.ts.map +1 -1
  334. package/lib/components/Notifications/NotificationsPanel/index.js +41 -22
  335. package/lib/components/Notifications/NotificationsPanel/schema.js +1 -1
  336. package/lib/components/Notifications/Notifier.test.js +79 -10
  337. package/lib/components/Notifications/constants.d.ts +2 -0
  338. package/lib/components/Notifications/constants.d.ts.map +1 -0
  339. package/lib/components/Notifications/constants.js +16 -0
  340. package/lib/components/Notifications/schema.d.ts.map +1 -1
  341. package/lib/components/Notifications/schema.js +2 -1
  342. package/lib/components/Notifications/useNotifications.d.ts +1 -0
  343. package/lib/components/Notifications/useNotifications.d.ts.map +1 -1
  344. package/lib/components/Notifications/useNotifications.test.js +7 -4
  345. package/lib/components/Pagination/Pages.d.ts +1 -7
  346. package/lib/components/Pagination/Pages.d.ts.map +1 -1
  347. package/lib/components/Pagination/Pages.js +17 -0
  348. package/lib/components/Pagination/Pagination.d.ts +13 -14
  349. package/lib/components/Pagination/Pagination.d.ts.map +1 -1
  350. package/lib/components/Pagination/Pagination.js +20 -5
  351. package/lib/components/Pagination/Pagination.test.js +14 -0
  352. package/lib/components/Pagination/paginate.d.ts +1 -1
  353. package/lib/components/Pagination/paginate.d.ts.map +1 -1
  354. package/lib/components/Pagination/paginate.js +4 -0
  355. package/lib/components/Pagination/paginate.test.js +38 -17
  356. package/lib/components/Pagination/schema.d.ts.map +1 -1
  357. package/lib/components/Pagination/schema.js +3 -1
  358. package/lib/components/Pagination/types.d.ts +24 -1
  359. package/lib/components/Pagination/types.d.ts.map +1 -1
  360. package/lib/components/Pagination/types.js +5 -1
  361. package/lib/components/PasswordField/IconWrapper.d.ts +198 -0
  362. package/lib/components/PasswordField/IconWrapper.d.ts.map +1 -0
  363. package/lib/components/PasswordField/IconWrapper.js +32 -0
  364. package/lib/components/PasswordField/Input.d.ts +6 -0
  365. package/lib/components/PasswordField/Input.d.ts.map +1 -0
  366. package/lib/components/PasswordField/Input.js +28 -0
  367. package/lib/components/PasswordField/ShowPasswordButton.d.ts +8 -0
  368. package/lib/components/PasswordField/ShowPasswordButton.d.ts.map +1 -0
  369. package/lib/components/PasswordField/ShowPasswordButton.js +48 -0
  370. package/lib/components/PasswordField/index.d.ts +14 -0
  371. package/lib/components/PasswordField/index.d.ts.map +1 -0
  372. package/lib/components/PasswordField/index.js +113 -0
  373. package/lib/components/PasswordField/index.test.js +217 -0
  374. package/lib/components/PasswordField/schema.d.ts +3 -0
  375. package/lib/components/PasswordField/schema.d.ts.map +1 -0
  376. package/lib/components/PasswordField/schema.js +27 -0
  377. package/lib/components/Popover/Arrow.d.ts +2 -2
  378. package/lib/components/Popover/index.d.ts.map +1 -1
  379. package/lib/components/Popover/index.js +19 -8
  380. package/lib/components/Popover/schema.d.ts.map +1 -1
  381. package/lib/components/Popover/schema.js +27 -20
  382. package/lib/components/Popover/types.d.ts +4 -2
  383. package/lib/components/Popover/types.d.ts.map +1 -1
  384. package/lib/components/Popover/utils.d.ts +1 -1
  385. package/lib/components/SearchInput/index.d.ts +11 -0
  386. package/lib/components/SearchInput/index.d.ts.map +1 -0
  387. package/lib/components/SearchInput/index.js +176 -0
  388. package/lib/components/SearchInput/index.test.js +660 -0
  389. package/lib/components/SearchInput/schema.d.ts +3 -0
  390. package/lib/components/SearchInput/schema.d.ts.map +1 -0
  391. package/lib/components/SearchInput/schema.js +37 -0
  392. package/lib/components/SearchInput/styles.d.ts +1176 -0
  393. package/lib/components/SearchInput/styles.d.ts.map +1 -0
  394. package/lib/components/SearchInput/styles.js +97 -0
  395. package/lib/components/SearchInput/types.d.ts +38 -0
  396. package/lib/components/SearchInput/types.d.ts.map +1 -0
  397. package/lib/components/SearchInput/types.js +5 -0
  398. package/lib/components/Select/Target.d.ts.map +1 -1
  399. package/lib/components/Select/Target.js +6 -2
  400. package/lib/components/Select/index.d.ts.map +1 -1
  401. package/lib/components/Select/index.js +26 -3
  402. package/lib/components/Select/index.test.js +106 -23
  403. package/lib/components/Select/schema.d.ts.map +1 -1
  404. package/lib/components/Select/schema.js +5 -0
  405. package/lib/components/Select/types.d.ts +6 -3
  406. package/lib/components/Select/types.d.ts.map +1 -1
  407. package/lib/components/Select/types.js +5 -1
  408. package/lib/components/SelectDate/Target.d.ts.map +1 -1
  409. package/lib/components/SelectDate/Target.js +6 -2
  410. package/lib/components/SelectDate/index.d.ts.map +1 -1
  411. package/lib/components/SelectDate/index.js +35 -4
  412. package/lib/components/SelectDate/index.test.js +108 -51
  413. package/lib/components/SelectDate/schema.d.ts.map +1 -1
  414. package/lib/components/SelectDate/schema.js +3 -0
  415. package/lib/components/SelectDate/types.d.ts +3 -0
  416. package/lib/components/SelectDate/types.d.ts.map +1 -1
  417. package/lib/components/SelectDate/types.js +5 -1
  418. package/lib/components/SelectDateRange/index.d.ts.map +1 -1
  419. package/lib/components/SelectDateRange/index.js +34 -3
  420. package/lib/components/SelectDateRange/index.test.js +115 -58
  421. package/lib/components/SelectDateRange/schema.d.ts.map +1 -1
  422. package/lib/components/SelectDateRange/schema.js +3 -0
  423. package/lib/components/SelectDateRange/types.js +5 -1
  424. package/lib/components/StepTracker/index.d.ts +11 -0
  425. package/lib/components/StepTracker/index.d.ts.map +1 -0
  426. package/lib/components/StepTracker/index.js +56 -0
  427. package/lib/components/StepTracker/index.test.js +89 -0
  428. package/lib/components/StepTracker/schema.d.ts +3 -0
  429. package/lib/components/StepTracker/schema.d.ts.map +1 -0
  430. package/lib/components/StepTracker/schema.js +19 -0
  431. package/lib/components/StepTracker/styles.d.ts +605 -0
  432. package/lib/components/StepTracker/styles.d.ts.map +1 -0
  433. package/lib/components/StepTracker/styles.js +114 -0
  434. package/lib/components/Table/Body.d.ts.map +1 -1
  435. package/lib/components/Table/Body.js +28 -17
  436. package/lib/components/Table/Container.d.ts.map +1 -1
  437. package/lib/components/Table/Container.js +6 -1
  438. package/lib/components/Table/DataRow.d.ts.map +1 -1
  439. package/lib/components/Table/DataRow.js +26 -18
  440. package/lib/components/Table/Head.d.ts +1 -1
  441. package/lib/components/Table/Head.d.ts.map +1 -1
  442. package/lib/components/Table/Head.js +10 -5
  443. package/lib/components/Table/HeaderCell/index.d.ts.map +1 -1
  444. package/lib/components/Table/HeaderCell/index.js +19 -6
  445. package/lib/components/Table/HeaderCell/types.d.ts +6 -1
  446. package/lib/components/Table/HeaderCell/types.d.ts.map +1 -1
  447. package/lib/components/Table/HeaderCell/types.js +5 -1
  448. package/lib/components/Table/Provider.d.ts +5 -5
  449. package/lib/components/Table/Provider.d.ts.map +1 -1
  450. package/lib/components/Table/Provider.js +10 -11
  451. package/lib/components/Table/index.d.ts.map +1 -1
  452. package/lib/components/Table/index.js +110 -20
  453. package/lib/components/Table/index.test.js +80 -33
  454. package/lib/components/Table/schema.columns.d.ts.map +1 -1
  455. package/lib/components/Table/schema.columns.js +6 -4
  456. package/lib/components/Table/schema.d.ts.map +1 -1
  457. package/lib/components/Table/schema.js +7 -6
  458. package/lib/components/Table/types.d.ts +19 -4
  459. package/lib/components/Table/types.d.ts.map +1 -1
  460. package/lib/components/Table/utils.d.ts +2 -8
  461. package/lib/components/Table/utils.d.ts.map +1 -1
  462. package/lib/components/Table/utils.js +21 -20
  463. package/lib/components/Tabs/Tab/index.d.ts +13 -0
  464. package/lib/components/Tabs/Tab/index.d.ts.map +1 -0
  465. package/lib/components/Tabs/Tab/index.js +94 -0
  466. package/lib/components/Tabs/Tab/schema.d.ts +3 -0
  467. package/lib/components/Tabs/Tab/schema.d.ts.map +1 -0
  468. package/lib/components/Tabs/Tab/styles.d.ts +7 -0
  469. package/lib/components/Tabs/Tab/styles.d.ts.map +1 -0
  470. package/lib/components/Tabs/Tab/styles.js +37 -0
  471. package/lib/components/Tabs/context.d.ts +2 -2
  472. package/lib/components/Tabs/context.d.ts.map +1 -1
  473. package/lib/components/Tabs/context.js +1 -1
  474. package/lib/components/Tabs/index.d.ts +17 -6
  475. package/lib/components/Tabs/index.d.ts.map +1 -1
  476. package/lib/components/Tabs/index.js +104 -163
  477. package/lib/components/Tabs/index.test.js +54 -2
  478. package/lib/components/Tabs/styles.d.ts +4 -0
  479. package/lib/components/Tabs/styles.d.ts.map +1 -0
  480. package/lib/components/Tabs/styles.js +35 -0
  481. package/lib/components/Tag/Action.d.ts +4 -0
  482. package/lib/components/Tag/Action.d.ts.map +1 -0
  483. package/lib/components/Tag/Action.js +39 -0
  484. package/lib/components/Tag/constants.d.ts +2 -2
  485. package/lib/components/Tag/constants.d.ts.map +1 -1
  486. package/lib/components/Tag/constants.js +4 -4
  487. package/lib/components/Tag/index.d.ts +1 -3
  488. package/lib/components/Tag/index.d.ts.map +1 -1
  489. package/lib/components/Tag/index.js +40 -97
  490. package/lib/components/Tag/index.test.js +239 -2
  491. package/lib/components/Tag/propTypes.d.ts +4 -1
  492. package/lib/components/Tag/propTypes.d.ts.map +1 -1
  493. package/lib/components/Tag/propTypes.js +5 -2
  494. package/lib/components/Tag/schema.d.ts.map +1 -1
  495. package/lib/components/Tag/schema.js +2 -0
  496. package/lib/components/Tag/styles.d.ts +13 -0
  497. package/lib/components/Tag/styles.d.ts.map +1 -0
  498. package/lib/components/Tag/styles.js +133 -0
  499. package/lib/components/Tag/types.d.ts +9 -10
  500. package/lib/components/Tag/types.d.ts.map +1 -1
  501. package/lib/components/Tag/types.js +5 -1
  502. package/lib/components/TagInput/index.d.ts +10 -0
  503. package/lib/components/TagInput/index.d.ts.map +1 -0
  504. package/lib/components/TagInput/index.js +217 -0
  505. package/lib/components/TagInput/index.test.js +1001 -0
  506. package/lib/components/TagInput/schema.d.ts +3 -0
  507. package/lib/components/TagInput/schema.d.ts.map +1 -0
  508. package/lib/components/TagInput/schema.js +30 -0
  509. package/lib/components/TagInput/styles.d.ts +10 -0
  510. package/lib/components/TagInput/styles.d.ts.map +1 -0
  511. package/lib/components/TagInput/styles.js +52 -0
  512. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  513. package/lib/components/TextArea/TextArea.js +1 -1
  514. package/lib/components/TextArea/index.js +1 -0
  515. package/lib/components/TextArea/index.test.js +5 -0
  516. package/lib/components/TextField/Input.js +1 -1
  517. package/lib/components/TextField/index.test.js +5 -0
  518. package/lib/components/Toggle/Fieldset.d.ts.map +1 -1
  519. package/lib/components/Toggle/Fieldset.js +20 -11
  520. package/lib/components/Toggle/Option.d.ts.map +1 -1
  521. package/lib/components/Toggle/Option.js +1 -1
  522. package/lib/components/Toggle/Slider.d.ts +1 -3
  523. package/lib/components/Toggle/Slider.d.ts.map +1 -1
  524. package/lib/components/Toggle/Slider.js +29 -24
  525. package/lib/components/Toggle/index.d.ts.map +1 -1
  526. package/lib/components/Toggle/index.js +6 -1
  527. package/lib/components/Toggle/index.test.js +39 -10
  528. package/lib/components/Toggle/propTypes.js +1 -1
  529. package/lib/components/Toggle/schema.js +1 -1
  530. package/lib/components/Toggle/types.d.ts +3 -2
  531. package/lib/components/Toggle/types.d.ts.map +1 -1
  532. package/lib/components/Toggle/types.js +5 -1
  533. package/lib/components/ToggleView/ToggleView.d.ts +5 -0
  534. package/lib/components/ToggleView/ToggleView.d.ts.map +1 -0
  535. package/lib/components/ToggleView/ToggleView.js +80 -0
  536. package/lib/components/ToggleView/index.d.ts +4 -0
  537. package/lib/components/ToggleView/index.d.ts.map +1 -0
  538. package/lib/components/ToggleView/index.js +33 -0
  539. package/lib/components/ToggleView/index.test.js +61 -0
  540. package/lib/components/ToggleView/schema.d.ts +3 -0
  541. package/lib/components/ToggleView/schema.d.ts.map +1 -0
  542. package/lib/components/ToggleView/schema.js +24 -0
  543. package/lib/components/ToggleView/styles.d.ts +6 -0
  544. package/lib/components/ToggleView/styles.d.ts.map +1 -0
  545. package/lib/components/ToggleView/styles.js +23 -0
  546. package/lib/components/ToggleView/types.d.ts +23 -0
  547. package/lib/components/ToggleView/types.d.ts.map +1 -0
  548. package/lib/components/ToggleView/types.js +12 -0
  549. package/lib/components/Tooltip/index.d.ts.map +1 -1
  550. package/lib/components/Tooltip/index.js +3 -13
  551. package/lib/components/Tooltip/schema.d.ts +3 -0
  552. package/lib/components/Tooltip/schema.d.ts.map +1 -0
  553. package/lib/components/Tooltip/schema.js +29 -0
  554. package/lib/components/TopNav/Menu/index.d.ts +1 -1
  555. package/lib/components/TopNav/index.d.ts +1 -1
  556. package/lib/components/Typography/withColors.d.ts +1 -1
  557. package/lib/components/Typography/withColors.d.ts.map +1 -1
  558. package/lib/components/Typography/withColors.js +1 -1
  559. package/lib/components/Wizard/index.d.ts +24 -0
  560. package/lib/components/Wizard/index.d.ts.map +1 -0
  561. package/lib/components/Wizard/index.js +146 -0
  562. package/lib/components/Wizard/index.test.js +591 -0
  563. package/lib/components/Wizard/schema.d.ts +3 -0
  564. package/lib/components/Wizard/schema.d.ts.map +1 -0
  565. package/lib/components/Wizard/schema.js +37 -0
  566. package/lib/components/Wizard/styles.d.ts +990 -0
  567. package/lib/components/Wizard/styles.d.ts.map +1 -0
  568. package/lib/components/Wizard/styles.js +79 -0
  569. package/lib/components/index.d.ts +12 -1
  570. package/lib/components/index.d.ts.map +1 -1
  571. package/lib/components/index.js +205 -1
  572. package/lib/modifiers/palette.d.ts +36 -0
  573. package/lib/modifiers/palette.d.ts.map +1 -0
  574. package/lib/modifiers/palette.js +88 -0
  575. package/lib/modifiers/spacingSchema.d.ts.map +1 -1
  576. package/lib/modifiers/spacingSchema.js +29 -16
  577. package/lib/providers/ConfigProvider/index.d.ts.map +1 -1
  578. package/lib/providers/ConfigProvider/index.js +5 -1
  579. package/lib/providers/ConfigProvider/utils/context.d.ts +1 -1
  580. package/lib/providers/ConfigProvider/utils/context.d.ts.map +1 -1
  581. package/lib/providers/ConfigProvider/utils/normalizer.d.ts.map +1 -1
  582. package/lib/providers/ConfigProvider/utils/normalizer.js +1 -1
  583. package/lib/providers/ConfigProvider/utils/translations.d.ts +42 -0
  584. package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
  585. package/lib/providers/ConfigProvider/utils/translations.js +43 -1
  586. package/lib/providers/NotificationsProvider/index.d.ts +6 -5
  587. package/lib/providers/NotificationsProvider/index.d.ts.map +1 -1
  588. package/lib/providers/NotificationsProvider/index.js +47 -28
  589. package/lib/providers/NotificationsProvider/types.d.ts +4 -1
  590. package/lib/providers/NotificationsProvider/types.d.ts.map +1 -1
  591. package/lib/types/index.d.ts +2 -0
  592. package/lib/types/index.d.ts.map +1 -0
  593. package/lib/types/index.js +5 -0
  594. package/lib/utils/commonUIColors.d.ts +351 -3
  595. package/lib/utils/commonUIColors.d.ts.map +1 -1
  596. package/lib/utils/commonUIColors.js +6 -2
  597. package/lib/utils/joinClassnames.d.ts +3 -0
  598. package/lib/utils/joinClassnames.d.ts.map +1 -0
  599. package/lib/utils/joinClassnames.js +26 -0
  600. package/lib/utils/useDebounce.d.ts +2 -0
  601. package/lib/utils/useDebounce.d.ts.map +1 -0
  602. package/lib/utils/useDebounce.js +37 -0
  603. package/lib/utils/useFirstMount.d.ts +2 -0
  604. package/lib/utils/useFirstMount.d.ts.map +1 -0
  605. package/lib/utils/useFirstMount.js +19 -0
  606. package/lib/utils/useStackingContext.d.ts +12 -0
  607. package/lib/utils/useStackingContext.d.ts.map +1 -0
  608. package/lib/utils/useStackingContext.js +46 -0
  609. package/lib/utils/useUpdateEffect.d.ts +4 -0
  610. package/lib/utils/useUpdateEffect.d.ts.map +1 -0
  611. package/lib/utils/useUpdateEffect.js +28 -0
  612. package/package.json +2 -2
  613. package/CHANGELOG.md +0 -796
  614. package/lib/atoms/InputField/RequiredIcon.d.ts +0 -4
  615. package/lib/atoms/InputField/RequiredIcon.d.ts.map +0 -1
  616. package/lib/atoms/OptionsList/Category.d.ts +0 -4
  617. package/lib/atoms/OptionsList/Category.d.ts.map +0 -1
  618. package/lib/atoms/OptionsList/Option.d.ts.map +0 -1
  619. package/lib/atoms/OptionsList/Option.js +0 -194
  620. package/lib/components/Tabs/Tab.d.ts +0 -5
  621. package/lib/components/Tabs/Tab.d.ts.map +0 -1
  622. package/lib/components/Tabs/Tab.js +0 -109
  623. package/lib/components/Tabs/schema.tab.d.ts.map +0 -1
  624. package/lib/components/Tabs/types.d.ts +0 -27
  625. package/lib/components/Tabs/types.d.ts.map +0 -1
  626. package/lib/components/Tabs/types.js +0 -1
  627. package/lib/components/Tag/ActionButton.d.ts +0 -5
  628. package/lib/components/Tag/ActionButton.d.ts.map +0 -1
  629. package/lib/components/Tag/ActionButton.js +0 -56
  630. /package/lib/components/Tabs/{schema.tab.js → Tab/schema.js} +0 -0
@@ -63,6 +63,8 @@ var _types = require("./types");
63
63
 
64
64
  var _utils = require("./utils");
65
65
 
66
+ var _Grip = _interopRequireDefault(require("./Grip"));
67
+
66
68
  var _useSortableHeaders = require("./hooks/useSortableHeaders");
67
69
 
68
70
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
@@ -71,6 +73,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
71
73
 
72
74
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
73
75
 
76
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
77
+
78
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
79
+
80
+ function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
81
+
82
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
83
+
74
84
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }
75
85
 
76
86
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
@@ -94,9 +104,11 @@ function Table(props) {
94
104
  defaultSort = props.defaultSort,
95
105
  footer = props.footer,
96
106
  toolbar = props.toolbar,
97
- columns = props.columns,
107
+ columnsProp = props.columns,
98
108
  onDragEnd = props.onDragEnd,
99
- rest = _objectWithoutProperties(props, ["data", "defaultSort", "footer", "toolbar", "columns", "onDragEnd"]);
109
+ _props$dragVariant = props.dragVariant,
110
+ dragVariant = _props$dragVariant === void 0 ? 'row' : _props$dragVariant,
111
+ rest = _objectWithoutProperties(props, ["data", "defaultSort", "footer", "toolbar", "columns", "onDragEnd", "dragVariant"]);
100
112
 
101
113
  var _useState = (0, _react.useState)({}),
102
114
  _useState2 = _slicedToArray(_useState, 2),
@@ -108,19 +120,61 @@ function Table(props) {
108
120
  return _objectSpread({}, prevColumnsWidth, _defineProperty({}, name, width));
109
121
  });
110
122
  }, []);
123
+ var isDnDEnabled = !!onDragEnd;
124
+
125
+ var _useState3 = (0, _react.useState)(false),
126
+ _useState4 = _slicedToArray(_useState3, 2),
127
+ hasDragHandlers = _useState4[0],
128
+ setHasDragHandlers = _useState4[1];
129
+
130
+ var columns = (0, _react.useMemo)(function () {
131
+ if (isDnDEnabled && !hasDragHandlers) {
132
+ return [{
133
+ name: 'default-drag-handle',
134
+ DataCell: function DataCell(_ref) {
135
+ var DragHandle = _ref.DragHandle;
136
+
137
+ if (dragVariant === 'handle') {
138
+ var defaultHandle = _react.default.cloneElement(DragHandle, {
139
+ 'data-drag-handle-context-id': undefined
140
+ });
141
+
142
+ return defaultHandle;
143
+ }
144
+
145
+ return _react.default.createElement("div", null, _react.default.createElement(_Grip.default, null));
146
+ },
147
+ getHeaderCellAttrs: function getHeaderCellAttrs() {
148
+ return {
149
+ className: 'handle-container'
150
+ };
151
+ },
152
+ getCellAttrs: function getCellAttrs() {
153
+ return {
154
+ className: 'handle-container'
155
+ };
156
+ },
157
+ getCellKey: function getCellKey() {
158
+ return 'default-drag-handle';
159
+ },
160
+ fixed: columnsProp[0].fixed
161
+ }].concat(_toConsumableArray(columnsProp));
162
+ }
111
163
 
112
- var _useMemo = (0, _react.useMemo)(function () {
164
+ return columnsProp;
165
+ }, [isDnDEnabled, hasDragHandlers, columnsProp, dragVariant]);
166
+ var fixedColumns = (0, _react.useMemo)(function () {
113
167
  return (0, _utils.calculateOffsets)(columns, columnsWidth);
114
- }, [columns, columnsWidth]),
115
- leftColumnsOffset = _useMemo.leftColumnsOffset,
116
- rightColumnsOffset = _useMemo.rightColumnsOffset;
117
-
168
+ }, [columns, columnsWidth]);
118
169
  return _react.default.createElement(_Provider.default, {
119
170
  defaultSort: defaultSort,
120
171
  onColumnResize: onColumnResize,
121
- columnsOffset: _objectSpread({}, leftColumnsOffset, {}, rightColumnsOffset),
122
- isDnDEnabled: !!onDragEnd,
123
- columnsWidth: columnsWidth
172
+ columnsWidth: columnsWidth,
173
+ fixedColumns: fixedColumns,
174
+ isDnDEnabled: isDnDEnabled,
175
+ hasDragHandlers: hasDragHandlers,
176
+ setHasDragHandlers: setHasDragHandlers,
177
+ dragVariant: dragVariant
124
178
  }, _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_Toolbar.default, {
125
179
  kind: rest.kind,
126
180
  toolbar: toolbar
@@ -140,8 +194,8 @@ function Table(props) {
140
194
  }
141
195
 
142
196
  Table.propTypes = _objectSpread({}, _schema.default.propTypes, {
143
- GroupHeader: (0, _propTypes.requireIf)(_propTypes2.default.elementType, function (_ref) {
144
- var rowDataPath = _ref.rowDataPath;
197
+ GroupHeader: (0, _propTypes.requireIf)(_propTypes2.default.elementType, function (_ref2) {
198
+ var rowDataPath = _ref2.rowDataPath;
145
199
  return !!rowDataPath;
146
200
  }),
147
201
  // eslint-disable-next-line react/require-default-props
@@ -155,6 +209,34 @@ Table.propTypes = _objectSpread({}, _schema.default.propTypes, {
155
209
  return new Error("You have set a column as fixed but the Table doesn't have horizontal scroll, you need to enable it via scroll prop for this feature to work correctly");
156
210
  }
157
211
 
212
+ var previousColumn = null;
213
+ var isleColumnIndex = null;
214
+
215
+ for (var index = 0; index < columns.length; index += 1) {
216
+ var column = columns[index];
217
+
218
+ if (previousColumn && column.fixed && !previousColumn.fixed) {
219
+ isleColumnIndex = index;
220
+ break;
221
+ }
222
+
223
+ previousColumn = column;
224
+ }
225
+
226
+ previousColumn = null;
227
+
228
+ for (var _index = columns.length - 1; _index >= 0; _index -= 1) {
229
+ var _column = columns[_index];
230
+
231
+ if (previousColumn && _column.fixed && !previousColumn.fixed) {
232
+ if (isleColumnIndex && isleColumnIndex <= _index) {
233
+ return new Error("Column [".concat(_column.name, "] will not be fixed. Fixed columns must be consecutive, grouped at the beginning or at the end of the array."));
234
+ }
235
+ }
236
+
237
+ previousColumn = _column;
238
+ }
239
+
158
240
  _propTypes2.default.checkPropTypes({
159
241
  columns: _propTypes2.default.arrayOf(_propTypes2.default.shape({
160
242
  DataCell: _propTypes2.default.elementType.isRequired,
@@ -162,7 +244,7 @@ Table.propTypes = _objectSpread({}, _schema.default.propTypes, {
162
244
  name: _propTypes2.default.string.isRequired,
163
245
  sortBy: _propTypes2.default.func,
164
246
  title: _propTypes2.default.string,
165
- fixed: _propTypes2.default.oneOf(['right', 'left'])
247
+ fixed: _propTypes2.default.bool
166
248
  }))
167
249
  }, props, propName, componentName);
168
250
 
@@ -170,16 +252,24 @@ Table.propTypes = _objectSpread({}, _schema.default.propTypes, {
170
252
  },
171
253
  toolbar: _propTypes2.default.elementType,
172
254
  footer: _propTypes2.default.elementType,
173
- getRowKey: (0, _propTypes.requireIf)(_propTypes2.default.func, function (_ref2) {
174
- var data = _ref2.data;
175
- return !((0, _get.default)(data, '0.key') || (0, _get.default)(data, '0.id'));
255
+ getRowKey: (0, _propTypes.requireIf)(_propTypes2.default.func, function (_ref3) {
256
+ var data = _ref3.data;
257
+ return !!data && data.length > 0 && !((0, _get.default)(data, '0.key') || (0, _get.default)(data, '0.id'));
176
258
  }),
177
- height: (0, _propTypes.requireIf)(_propTypes2.default.string, function (_ref3) {
178
- var scroll = _ref3.scroll,
179
- size = _ref3.size;
259
+ height: (0, _propTypes.requireIf)(_propTypes2.default.string, function (_ref4) {
260
+ var scroll = _ref4.scroll,
261
+ size = _ref4.size;
180
262
  return (0, _modifiersPropApplies.default)('y', scroll, size);
181
263
  }),
182
- scroll: _propTypes2.default.oneOfType([_propTypes2.default.oneOf(['x', 'y']), _propTypes2.default.arrayOf(_propTypes2.default.oneOf(['x', 'y'])), _propTypes2.default.objectOf(_propTypes2.default.oneOfType([_propTypes2.default.oneOf(['x', 'y']), _propTypes2.default.arrayOf(_propTypes2.default.oneOf(['x', 'y']))]))])
264
+ scroll: _propTypes2.default.oneOfType([_propTypes2.default.oneOf(['x', 'y']), _propTypes2.default.arrayOf(_propTypes2.default.oneOf(['x', 'y'])), _propTypes2.default.objectOf(_propTypes2.default.oneOfType([_propTypes2.default.oneOf(['x', 'y']), _propTypes2.default.arrayOf(_propTypes2.default.oneOf(['x', 'y']))]))]),
265
+ // eslint-disable-next-line react/require-default-props
266
+ dragVariant: function dragVariant(_ref5) {
267
+ var onDragEnd = _ref5.onDragEnd,
268
+ props = _objectWithoutProperties(_ref5, ["onDragEnd"]);
269
+
270
+ if (!onDragEnd && 'dragVariant' in props) return new Error('You have set dragVariant prop but Drag-and-Drop sorting is not enabled, you can enable it by passing [onDragEnd] callback');
271
+ return null;
272
+ }
183
273
  });
184
274
  Table.defaultProps = {
185
275
  GroupHeader: undefined,
@@ -10,6 +10,14 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
10
10
 
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
 
13
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
14
+
15
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
16
+
17
+ function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
18
+
19
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
20
+
13
21
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
14
22
 
15
23
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -281,29 +289,49 @@ describe('Table', function () {
281
289
  });
282
290
  });
283
291
  describe('fixed columns', function () {
284
- var columnsFixed = [].concat(columns);
285
- var firstColumn = columnsFixed[0];
286
- columnsFixed[0] = _objectSpread({}, firstColumn, {
287
- fixed: 'left'
288
- });
289
- var lastIndex = columnsFixed.length - 1;
290
- var lastColumn = columnsFixed[lastIndex];
291
- columnsFixed[lastIndex] = _objectSpread({}, lastColumn, {
292
- fixed: 'right'
292
+ it('renders columns with sticky styles', function () {
293
+ var columnsFixed = [].concat(columns);
294
+ var firstColumn = columnsFixed[0];
295
+ columnsFixed[0] = _objectSpread({}, firstColumn, {
296
+ fixed: true
297
+ });
298
+ var lastIndex = columnsFixed.length - 1;
299
+ var lastColumn = columnsFixed[lastIndex];
300
+ columnsFixed[lastIndex] = _objectSpread({}, lastColumn, {
301
+ fixed: true
302
+ });
303
+
304
+ var _render9 = (0, _react2.render)(_react.default.createElement(_.default, {
305
+ columns: columnsFixed,
306
+ data: data
307
+ })),
308
+ getByText = _render9.getByText,
309
+ container = _render9.container;
310
+
311
+ expect(getByText(firstColumn.title).closest('th')).toHaveStyle("\n position: sticky;\n left: 0px;\n ");
312
+ expect(getByText(lastColumn.title).closest('th')).toHaveStyle("\n position: sticky;\n right: 0px;\n ");
313
+ var firstRow = container.querySelector('tbody tr:first-child');
314
+ expect((0, _react2.getByText)(firstRow, data[0][firstColumn.name]).closest('td')).toHaveStyle("\n position: sticky;\n left: 0px;\n ");
315
+ expect((0, _react2.getByText)(firstRow, data[0][lastColumn.name]).closest('td')).toHaveStyle("\n position: sticky;\n right: 0px;\n ");
293
316
  });
317
+ it('ignores columns in the middle', function () {
318
+ var columnsFixed = [].concat(columns);
319
+ var middleIndex = Math.trunc(columns.length / 2);
320
+ var middleColumn = columnsFixed[middleIndex];
321
+ columnsFixed[middleIndex] = _objectSpread({}, middleColumn, {
322
+ fixed: true
323
+ });
294
324
 
295
- var _render9 = (0, _react2.render)(_react.default.createElement(_.default, {
296
- columns: columnsFixed,
297
- data: data
298
- })),
299
- getByText = _render9.getByText,
300
- container = _render9.container;
301
-
302
- expect(getByText(firstColumn.title).closest('th')).toHaveStyle("\n position: sticky;\n left: 0px;\n ");
303
- expect(getByText(lastColumn.title).closest('th')).toHaveStyle("\n position: sticky;\n right: 0px;\n ");
304
- var firstRow = container.querySelector('tbody tr:first-child');
305
- expect((0, _react2.getByText)(firstRow, data[0][firstColumn.name]).closest('td')).toHaveStyle("\n position: sticky;\n left: 0px;\n ");
306
- expect((0, _react2.getByText)(firstRow, data[0][lastColumn.name]).closest('td')).toHaveStyle("\n position: sticky;\n right: 0px;\n ");
325
+ var _render10 = (0, _react2.render)(_react.default.createElement(_.default, {
326
+ columns: columnsFixed,
327
+ data: data,
328
+ scroll: "x"
329
+ })),
330
+ container = _render10.container;
331
+
332
+ var firstRow = container.querySelector('tbody tr:first-child');
333
+ expect((0, _react2.getByText)(firstRow, data[0][middleColumn.name]).closest('td')).not.toHaveStyle("\n position: sticky;\n ");
334
+ });
307
335
  });
308
336
  describe('Drag-and-Drop sorting', function () {
309
337
  var dragItem = /*#__PURE__*/function () {
@@ -377,18 +405,18 @@ describe('Table', function () {
377
405
  }();
378
406
 
379
407
  it('calls onDragEnd prop when sorting with DnD', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
380
- var onDragEnd, _render10, getByText;
408
+ var onDragEnd, _render11, getByText;
381
409
 
382
410
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
383
411
  while (1) {
384
412
  switch (_context2.prev = _context2.next) {
385
413
  case 0:
386
414
  onDragEnd = jest.fn();
387
- _render10 = (0, _react2.render)(_react.default.createElement(_.default, {
415
+ _render11 = (0, _react2.render)(_react.default.createElement(_.default, {
388
416
  columns: columns,
389
417
  data: data,
390
418
  onDragEnd: onDragEnd
391
- })), getByText = _render10.getByText;
419
+ })), getByText = _render11.getByText;
392
420
  _context2.next = 4;
393
421
  return dragItem(getByText('Avatar'), 2, 'down', getByText);
394
422
 
@@ -405,14 +433,14 @@ describe('Table', function () {
405
433
  describe('grouped data', function () {
406
434
  // the beginning of the table is outside any group
407
435
  it('does not call onDragEnd prop when moving item to the beginning', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
408
- var onDragEnd, _render11, getByText;
436
+ var onDragEnd, _render12, getByText;
409
437
 
410
438
  return regeneratorRuntime.wrap(function _callee3$(_context3) {
411
439
  while (1) {
412
440
  switch (_context3.prev = _context3.next) {
413
441
  case 0:
414
442
  onDragEnd = jest.fn();
415
- _render11 = (0, _react2.render)(_react.default.createElement(_.default, {
443
+ _render12 = (0, _react2.render)(_react.default.createElement(_.default, {
416
444
  columns: groupColumns,
417
445
  data: groupData,
418
446
  onDragEnd: onDragEnd,
@@ -421,7 +449,7 @@ describe('Table', function () {
421
449
  var name = _ref10.groupData.name;
422
450
  return _react.default.createElement("span", null, name);
423
451
  }
424
- })), getByText = _render11.getByText;
452
+ })), getByText = _render12.getByText;
425
453
  _context3.next = 4;
426
454
  return dragItem(getByText('garlic'), 2, 'up', getByText);
427
455
 
@@ -436,14 +464,14 @@ describe('Table', function () {
436
464
  }, _callee3);
437
465
  })));
438
466
  it('calls onDragEnd prop when moving item to a group before', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
439
- var onDragEnd, _render12, getByText;
467
+ var onDragEnd, _render13, getByText;
440
468
 
441
469
  return regeneratorRuntime.wrap(function _callee4$(_context4) {
442
470
  while (1) {
443
471
  switch (_context4.prev = _context4.next) {
444
472
  case 0:
445
473
  onDragEnd = jest.fn();
446
- _render12 = (0, _react2.render)(_react.default.createElement(_.default, {
474
+ _render13 = (0, _react2.render)(_react.default.createElement(_.default, {
447
475
  columns: groupColumns,
448
476
  data: groupData,
449
477
  onDragEnd: onDragEnd,
@@ -452,7 +480,7 @@ describe('Table', function () {
452
480
  var name = _ref12.groupData.name;
453
481
  return _react.default.createElement("span", null, name);
454
482
  }
455
- })), getByText = _render12.getByText;
483
+ })), getByText = _render13.getByText;
456
484
  _context4.next = 4;
457
485
  return dragItem(getByText('kale'), 2, 'up', getByText);
458
486
 
@@ -467,14 +495,14 @@ describe('Table', function () {
467
495
  }, _callee4);
468
496
  })));
469
497
  it('calls onDragEnd prop when moving item to a group after', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
470
- var onDragEnd, _render13, getByText;
498
+ var onDragEnd, _render14, getByText;
471
499
 
472
500
  return regeneratorRuntime.wrap(function _callee5$(_context5) {
473
501
  while (1) {
474
502
  switch (_context5.prev = _context5.next) {
475
503
  case 0:
476
504
  onDragEnd = jest.fn();
477
- _render13 = (0, _react2.render)(_react.default.createElement(_.default, {
505
+ _render14 = (0, _react2.render)(_react.default.createElement(_.default, {
478
506
  columns: groupColumns,
479
507
  data: groupData,
480
508
  onDragEnd: onDragEnd,
@@ -483,7 +511,7 @@ describe('Table', function () {
483
511
  var name = _ref14.groupData.name;
484
512
  return _react.default.createElement("span", null, name);
485
513
  }
486
- })), getByText = _render13.getByText;
514
+ })), getByText = _render14.getByText;
487
515
  _context5.next = 4;
488
516
  return dragItem(getByText('onion'), 2, 'down', getByText);
489
517
 
@@ -499,4 +527,23 @@ describe('Table', function () {
499
527
  })));
500
528
  });
501
529
  });
530
+ describe('rendering custom header', function () {
531
+ it('renders a custom header', function () {
532
+ var firstColumn = columns[0],
533
+ rest = columns.slice(1);
534
+ var headerTitle = 'Custom header';
535
+
536
+ var _render15 = (0, _react2.render)(_react.default.createElement(_.default, {
537
+ columns: [_objectSpread({
538
+ HeaderCell: function HeaderCell() {
539
+ return _react.default.createElement("span", null, headerTitle);
540
+ }
541
+ }, firstColumn)].concat(_toConsumableArray(rest)),
542
+ data: data
543
+ })),
544
+ getByText = _render15.getByText;
545
+
546
+ expect(getByText(headerTitle)).toBeTruthy();
547
+ });
548
+ });
502
549
  });
@@ -1 +1 @@
1
- {"version":3,"file":"schema.columns.d.ts","sourceRoot":"","sources":["../../../src/components/Table/schema.columns.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAqC,CAAC;AA4BlD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"schema.columns.d.ts","sourceRoot":"","sources":["../../../src/components/Table/schema.columns.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAqC,CAAC;AAoClD,eAAe,MAAM,CAAC"}
@@ -12,13 +12,15 @@ var schema = (0, _reactDesc.describe)({
12
12
  displayName: 'Table'
13
13
  });
14
14
  schema.propTypes = {
15
- DataCell: _reactDesc.PropTypes.any.description("A React Component used to render data inside one of the column's data cells.").format('React Component').isRequired,
16
- getCellAttrs: _reactDesc.PropTypes.func.description('A function that returns additional attributes for the rendered `<td>`.'),
17
- getCellKey: _reactDesc.PropTypes.func.description("A function that returns a unique, stable key for each cell based on the row's data and the column's name. Defaults to `rowData[columnName]`."),
15
+ HeaderCell: _reactDesc.PropTypes.any.description('A React Component used to render a custom column header cell. See below for more details.').format('React Component'),
16
+ DataCell: _reactDesc.PropTypes.any.description("A React Component used to render data inside one of the column's data cells. See below for more details.").format('React Component').isRequired,
17
+ getCellAttrs: _reactDesc.PropTypes.func.description("A function that returns additional attributes for the rendered `<td>`. Receives the row's data and the column's name as arguments. See below for function signature."),
18
+ getHeaderCellAttrs: _reactDesc.PropTypes.func.description('A function that returns additional attributes for the rendered `<th>` within the `<thead>`. Receives the column name as argument. See below for function signature.'),
19
+ getCellKey: _reactDesc.PropTypes.func.description("A function that returns a unique, stable key for each cell based on the row's data and the column's name. Receives the row's data and the column's name as arguments. Defaults to `columnName`. See below for function signature."),
18
20
  name: _reactDesc.PropTypes.string.description('The name of this column. Must be unique to the table.').isRequired,
19
21
  sortBy: _reactDesc.PropTypes.func.description("If included (with a title), makes a column sortable. Will be called with the new sorting type when a user clicks on the column's header. Should cause the data provided to the table to update based on the new sorting type."),
20
22
  title: _reactDesc.PropTypes.string.description("The text displayed in a column's header."),
21
- fixed: _reactDesc.PropTypes.oneOf(['right', 'left']).description('If included, the column will be kept visible when scrolling, sticking to the side defined. Horizontal scroll in table is required')
23
+ fixed: _reactDesc.PropTypes.bool.description('If true the column will be kept visible when scrolling horizontally, it will stick to the left when the column is at the beginning of the array and to the right when at the end. Fixed columns can be grouped at the beginning or at the end of the array, if set to a column in the middle it will be ignored. Horizontal scroll in table is required.')
22
24
  };
23
25
  var _default = schema;
24
26
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Table/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAAqC,CAAC;AA6DlD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Table/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAAqC,CAAC;AAkElD,eAAe,MAAM,CAAC"}
@@ -23,7 +23,7 @@ var schema = (0, _reactDesc.describe)({
23
23
  displayName: 'Table'
24
24
  });
25
25
  schema.propTypes = {
26
- GroupHeader: _reactDesc.PropTypes.any.description('A React Component used to render a header within the table for grouped data. Required if `rowDataPath` is provided.').format('React Component'),
26
+ GroupHeader: _reactDesc.PropTypes.any.description('A React Component used to render a header within the table for grouped data. Required if `rowDataPath` is provided. Receives `groupData` as prop.').format('React Component'),
27
27
  columns: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.object).description('An array of column configuration objects (described in more detail below). Columns will be displayed in the order of the array.').isRequired,
28
28
  data: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.object).description('An array of row data objects. Row data can contain basically anything. Rows will be displayed in the order of the array.').isRequired,
29
29
  defaultSort: _reactDesc.PropTypes.shape({
@@ -31,16 +31,17 @@ schema.propTypes = {
31
31
  sortingType: _reactDesc.PropTypes.oneOf([_useSortableHeaders.ASCENDING, _useSortableHeaders.DESCENDING, _useSortableHeaders.UNSORTED]).description('The initial sort type.')
32
32
  }).description("Indicates that the provided data is initially sorted on the given column, in the specified direction. The column's onSort handler will NOT be called; it is assumed that the data has been sorted prior to the initial render."),
33
33
  footer: _reactDesc.PropTypes.any.description("A React Component used to render a footer area beneath the table rows. This component is not included in the 'height' if set.").format('React Component'),
34
- getGroupHeaderAttrs: _reactDesc.PropTypes.func.description('A function that returns additional attributes for the `<th>` rendered as a row group header.'),
35
- getRowAttrs: _reactDesc.PropTypes.func.description('A function that returns additional attributes for the rendered `<tr>` within the `<tbody>`.'),
36
- getRowKey: _reactDesc.PropTypes.func.description("A function that returns a unique, stable key for each row based on that row's data. Defaults to `rowData['key']` or `rowData['id']`."),
34
+ getGroupHeaderAttrs: _reactDesc.PropTypes.func.description("A function that returns additional attributes for the `<th>` rendered as a row group header. Receives the row's data as argument. See below for function signature."),
35
+ getRowAttrs: _reactDesc.PropTypes.func.description("A function that returns additional attributes for the rendered `<tr>` within the `<tbody>`. Receives 2 arguments: the row's data and an options object. See below for function signature."),
36
+ getRowKey: _reactDesc.PropTypes.func.description("A function that returns a unique, stable key for each row based on that row's data. Receives 2 arguments: the row's data and an options object. Defaults to `rowData['key']` or `rowData['id']`. See below for function signature."),
37
37
  height: _reactDesc.PropTypes.string.description('A pass through CSS value for the height of the table.'),
38
38
  kind: _reactDesc.PropTypes.oneOf(['primary', 'secondary']).description('A flag controlling the kind of table displayed.').defaultValue('primary'),
39
39
  rowDataPath: _reactDesc.PropTypes.string.description('A valid path to an array of rowData objects within a groupData object. Required if `GroupHeader` is provided.'),
40
- scroll: _reactDesc.PropTypes.oneOf(['x', 'y']).description('A responsive modifier used to control scrolling on the table. '),
40
+ scroll: _reactDesc.PropTypes.oneOf(['x', 'y']).description('A responsive modifier used to control scrolling on the table.'),
41
41
  size: _reactDesc.PropTypes.oneOf(['_'].concat(_toConsumableArray(Object.keys(_breakpointObserver.sizes)))).description('Defines the breakpoint to use (for use in reactive design).'),
42
42
  variant: _reactDesc.PropTypes.oneOf(['comfortable', 'compact']).description('A flag controlling the variant of the table displayed.').defaultValue('comfortable'),
43
- onDragEnd: _reactDesc.PropTypes.func.description("If present enables Drag-and-Drop sorting. A function called after the order of rows changes when a row is dragged and dropped, it is called with 2 arguments: the index from where it's dragged and the index to where it's dropped, if there are grouped rows each argument is an array where the first element is the group index and the second the row index inside the group")
43
+ onDragEnd: _reactDesc.PropTypes.func.description("If present enables Drag-and-Drop sorting. A function called after the order of rows changes when a row is dragged and dropped, it is called with 2 arguments: the index from where it's dragged and the index to where it's dropped, if there are grouped rows each argument is an array where the first element is the group index and the second the row index inside the group. See below for function signature."),
44
+ dragVariant: _reactDesc.PropTypes.oneOf(['handle', 'row']).description('When Drag-and-Drop sorting is enabled, defines if the rows should be dragged only from the default handle or from anywhere in the row. This flag is ignored when a `DragHandle` node is rendered in a `DataCell`.').defaultValue('row')
44
45
  };
45
46
  var _default = schema;
46
47
  exports.default = _default;
@@ -5,17 +5,27 @@ import { ModifiersProp } from 'styled-components-modifiers';
5
5
  import { DroppableProvided, DroppableStateSnapshot, DraggableProvided, DraggableStateSnapshot, DropResult } from 'react-beautiful-dnd';
6
6
  import { KindModifiers, ScrollModifiersConfig, VariantModifiers } from './Container';
7
7
  import { SortableState, SortingTypes } from './hooks/useSortableHeaders';
8
+ import { CustomHeaderCellProps } from './HeaderCell/types';
8
9
  export { KindModifiers, ScrollModifiers, VariantModifiers } from './Container';
9
10
  export interface Column<TData> {
11
+ HeaderCell?: (props: CustomHeaderCellProps) => JSX.Element;
10
12
  DataCell: (props: DataCellProps<TData>) => JSX.Element;
11
13
  getCellAttrs?: (rowData: TData, columnName: string) => object | undefined;
14
+ getHeaderCellAttrs?: (columnName: string) => object | undefined;
12
15
  getCellKey?: (rowData: TData, columnName: string) => string;
13
16
  name: string;
14
17
  sortBy?: (sortingType: SortingTypes) => void;
15
18
  title?: string;
16
- fixed?: 'left' | 'right';
19
+ fixed?: boolean;
17
20
  }
21
+ export declare type DragVariant = 'handle' | 'row';
18
22
  export declare type Columns<TData> = Column<TData>[];
23
+ export interface FixedColumns {
24
+ [name: string]: {
25
+ offset: number;
26
+ alignment: string;
27
+ };
28
+ }
19
29
  export interface HeadProps<TData> {
20
30
  columns: Columns<TData>;
21
31
  kind?: KindModifiers;
@@ -24,7 +34,7 @@ export interface HeadProps<TData> {
24
34
  export interface DataRowProps<TData> {
25
35
  className?: 'group-data-row';
26
36
  columns: Columns<TData>;
27
- getRowAttrs?: (rowData: TData, isGroupHeaderRow?: boolean) => object | undefined;
37
+ getRowAttrs?: TableProps<TData>['getRowAttrs'];
28
38
  groupData?: TData;
29
39
  groupId?: string | undefined;
30
40
  kind?: KindModifiers;
@@ -69,13 +79,18 @@ export interface TableProps<TData extends RowData> extends HeadProps<TData>, Too
69
79
  data: TData[];
70
80
  defaultSort?: SortableState;
71
81
  getGroupHeaderAttrs?: (groupData: TData) => object | undefined;
72
- getRowAttrs?: (rowData: TData, isGroupHeaderRow?: boolean) => object | undefined;
73
- getRowKey?: (rowData: TData) => string;
82
+ getRowAttrs?: (rowData: TData, options: {
83
+ isGroupHeaderRow?: boolean;
84
+ }) => object | undefined;
85
+ getRowKey?: (rowData: TData, options: {
86
+ isGroupHeaderRow?: boolean;
87
+ }) => string;
74
88
  height?: HeightProperty<string>;
75
89
  rowDataPath?: string;
76
90
  scroll?: ModifiersProp<ScrollModifiersConfig, typeof sizes>;
77
91
  size?: keyof typeof sizes;
78
92
  onDragEnd?: (from: number | number[], to: number | number[]) => void;
93
+ dragVariant?: DragVariant;
79
94
  }
80
95
  export interface DroppableWrapperProps {
81
96
  children(provided?: DroppableProvided, snapshot?: DroppableStateSnapshot):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;IACnC,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACxC,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IACpC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CACN,QAAQ,CAAC,EAAE,iBAAiB,EAC5B,QAAQ,CAAC,EAAE,sBAAsB,GAChC,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;CACpC"}
@@ -1,14 +1,8 @@
1
- import { RowData, TableProps, WrapperProps, Columns } from './types';
1
+ import { RowData, TableProps, WrapperProps, Columns, FixedColumns } from './types';
2
2
  export declare function defaultGetRowKey({ key, id }: RowData): string | undefined;
3
3
  export declare function isGroupData<TData>(dataObj: TData, { rowDataPath, GroupHeader }: TableProps<TData>): boolean;
4
4
  export declare const Wrapper: import("styled-components").StyledComponent<"div", any, WrapperProps, never>;
5
- export interface ColumnsOffset {
6
- [name: string]: number;
7
- }
8
5
  export declare function calculateOffsets<T>(columns: Columns<T>, columnsWidth: {
9
6
  [name: string]: number;
10
- }): {
11
- leftColumnsOffset: ColumnsOffset;
12
- rightColumnsOffset: ColumnsOffset;
13
- };
7
+ }): FixedColumns;
14
8
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Table/utils.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAErE,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAEzE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAC/B,OAAO,EAAE,KAAK,EACd,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,UAAU,CAAC,KAAK,CAAC,GAC9C,OAAO,CAMT;AAaD,eAAO,MAAM,OAAO,8EAQnB,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,YAAY,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GACvC;IACD,iBAAiB,EAAE,aAAa,CAAC;IACjC,kBAAkB,EAAE,aAAa,CAAC;CACnC,CA6BA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Table/utils.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,OAAO,EACP,UAAU,EACV,YAAY,EACZ,OAAO,EACP,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAEzE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAC/B,OAAO,EAAE,KAAK,EACd,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,UAAU,CAAC,KAAK,CAAC,GAC9C,OAAO,CAMT;AAaD,eAAO,MAAM,OAAO,8EAQnB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,YAAY,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GACvC,YAAY,CA4Bd"}
@@ -61,26 +61,27 @@ exports.Wrapper = Wrapper;
61
61
  function calculateOffsets(columns, columnsWidth) {
62
62
  var leftOffset = 0;
63
63
  var rightOffset = 0;
64
- var leftOffsets = {};
65
- var rightOffsets = {};
66
-
67
- for (var indexLeft = 0, indexRight = columns.length - 1; indexLeft < columns.length; indexLeft += 1, indexRight -= 1) {
68
- var leftColumn = columns[indexLeft];
69
- var rightColumn = columns[indexRight];
70
-
71
- if (leftColumn.fixed === 'left') {
72
- leftOffsets[leftColumn.name] = leftOffset;
73
- leftOffset += Math.floor(columnsWidth[leftColumn.name] || 0);
74
- }
75
-
76
- if (rightColumn.fixed === 'right') {
77
- rightOffsets[rightColumn.name] = rightOffset;
78
- rightOffset += Math.floor(columnsWidth[rightColumn.name] || 0);
79
- }
64
+ var fixedColumns = {};
65
+
66
+ for (var index = 0; index < columns.length; index += 1) {
67
+ var column = columns[index];
68
+ if (!column.fixed) break;
69
+ fixedColumns[column.name] = {
70
+ alignment: 'left',
71
+ offset: leftOffset
72
+ };
73
+ leftOffset += Math.floor(columnsWidth[column.name] || 0);
80
74
  }
81
75
 
82
- return {
83
- leftColumnsOffset: leftOffsets,
84
- rightColumnsOffset: rightOffsets
85
- };
76
+ for (var _index = columns.length - 1; _index >= 0; _index -= 1) {
77
+ var _column = columns[_index];
78
+ if (!_column.fixed) break;
79
+ fixedColumns[_column.name] = {
80
+ alignment: 'right',
81
+ offset: rightOffset
82
+ };
83
+ rightOffset += Math.floor(columnsWidth[_column.name] || 0);
84
+ }
85
+
86
+ return fixedColumns;
86
87
  }