@openedx/paragon 23.14.1 → 23.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. package/README.md +80 -14
  2. package/dist/ActionRow/index.d.ts +18 -0
  3. package/dist/ActionRow/index.js +6 -24
  4. package/dist/ActionRow/index.js.map +1 -1
  5. package/dist/Alert/index.js +21 -24
  6. package/dist/Alert/index.js.map +1 -1
  7. package/dist/Annotation/index.d.ts +13 -0
  8. package/dist/Annotation/index.js +11 -30
  9. package/dist/Annotation/index.js.map +1 -1
  10. package/dist/Avatar/index.d.ts +11 -0
  11. package/dist/Avatar/index.js +7 -21
  12. package/dist/Avatar/index.js.map +1 -1
  13. package/dist/AvatarButton/index.d.ts +17 -0
  14. package/dist/AvatarButton/index.js +11 -33
  15. package/dist/AvatarButton/index.js.map +1 -1
  16. package/dist/Breadcrumb/BreadcrumbLink.js +5 -6
  17. package/dist/Breadcrumb/BreadcrumbLink.js.map +1 -1
  18. package/dist/Breadcrumb/index.js +11 -12
  19. package/dist/Breadcrumb/index.js.map +1 -1
  20. package/dist/Bubble/index.d.ts +6 -2
  21. package/dist/Bubble/index.js +14 -39
  22. package/dist/Bubble/index.js.map +1 -1
  23. package/dist/Button/index.d.ts +42 -7
  24. package/dist/Button/index.js +43 -115
  25. package/dist/Button/index.js.map +1 -1
  26. package/dist/Card/BaseCard.js +11 -12
  27. package/dist/Card/BaseCard.js.map +1 -1
  28. package/dist/Card/CardBody.js +9 -12
  29. package/dist/Card/CardBody.js.map +1 -1
  30. package/dist/Card/CardCarousel/CardCarousel.js +13 -14
  31. package/dist/Card/CardCarousel/CardCarousel.js.map +1 -1
  32. package/dist/Card/CardCarousel/CardCarouselHeader.js +4 -5
  33. package/dist/Card/CardCarousel/CardCarouselHeader.js.map +1 -1
  34. package/dist/Card/CardCarousel/CardCarouselItems.js +3 -4
  35. package/dist/Card/CardCarousel/CardCarouselItems.js.map +1 -1
  36. package/dist/Card/CardCarousel/CardCarouselProvider.js +7 -8
  37. package/dist/Card/CardCarousel/CardCarouselProvider.js.map +1 -1
  38. package/dist/Card/CardCarousel/CardCarouselSubtitle.js +5 -6
  39. package/dist/Card/CardCarousel/CardCarouselSubtitle.js.map +1 -1
  40. package/dist/Card/CardCarousel/CardCarouselTitle.js +5 -6
  41. package/dist/Card/CardCarousel/CardCarouselTitle.js.map +1 -1
  42. package/dist/Card/CardCarousel/messages.d.ts +13 -0
  43. package/dist/Card/CardCarousel/messages.js +4 -5
  44. package/dist/Card/CardCarousel/messages.js.map +1 -0
  45. package/dist/Card/CardContext.js +6 -7
  46. package/dist/Card/CardContext.js.map +1 -1
  47. package/dist/Card/CardDeck.js +9 -10
  48. package/dist/Card/CardDeck.js.map +1 -1
  49. package/dist/Card/CardDivider.js +8 -11
  50. package/dist/Card/CardDivider.js.map +1 -1
  51. package/dist/Card/CardFooter.js +9 -10
  52. package/dist/Card/CardFooter.js.map +1 -1
  53. package/dist/Card/CardGrid.js +6 -7
  54. package/dist/Card/CardGrid.js.map +1 -1
  55. package/dist/Card/CardHeader.js +9 -10
  56. package/dist/Card/CardHeader.js.map +1 -1
  57. package/dist/Card/CardImageCap.js +15 -16
  58. package/dist/Card/CardImageCap.js.map +1 -1
  59. package/dist/Card/CardSection.js +9 -10
  60. package/dist/Card/CardSection.js.map +1 -1
  61. package/dist/Card/CardStatus.js +9 -10
  62. package/dist/Card/CardStatus.js.map +1 -1
  63. package/dist/Card/index.js +9 -10
  64. package/dist/Card/index.js.map +1 -1
  65. package/dist/Chip/ChipIcon.js +8 -9
  66. package/dist/Chip/ChipIcon.js.map +1 -1
  67. package/dist/Chip/index.d.ts +22 -0
  68. package/dist/Chip/index.js +15 -70
  69. package/dist/Chip/index.js.map +1 -1
  70. package/dist/ChipCarousel/index.js +49 -53
  71. package/dist/ChipCarousel/index.js.map +1 -1
  72. package/dist/ChipCarousel/messages.d.ts +13 -0
  73. package/dist/ChipCarousel/messages.js +4 -5
  74. package/dist/ChipCarousel/messages.js.map +1 -0
  75. package/dist/CloseButton/index.js.map +1 -1
  76. package/dist/Collapse/index.js.map +1 -1
  77. package/dist/Collapsible/CollapsibleBody.js +6 -7
  78. package/dist/Collapsible/CollapsibleBody.js.map +1 -1
  79. package/dist/Collapsible/CollapsibleTrigger.js +9 -10
  80. package/dist/Collapsible/CollapsibleTrigger.js.map +1 -1
  81. package/dist/Collapsible/CollapsibleVisible.js +5 -6
  82. package/dist/Collapsible/CollapsibleVisible.js.map +1 -1
  83. package/dist/ColorPicker/index.js +6 -7
  84. package/dist/ColorPicker/index.js.map +1 -1
  85. package/dist/Container/index.js +9 -12
  86. package/dist/Container/index.js.map +1 -1
  87. package/dist/DataTable/BulkActions.js +4 -5
  88. package/dist/DataTable/BulkActions.js.map +1 -1
  89. package/dist/DataTable/CardView.js +16 -18
  90. package/dist/DataTable/CardView.js.map +1 -1
  91. package/dist/DataTable/CollapsibleButtonGroup.js +5 -6
  92. package/dist/DataTable/CollapsibleButtonGroup.js.map +1 -1
  93. package/dist/DataTable/DataTableLayout.js +5 -6
  94. package/dist/DataTable/DataTableLayout.js.map +1 -1
  95. package/dist/DataTable/DropdownFilters.js +7 -2
  96. package/dist/DataTable/DropdownFilters.js.map +1 -1
  97. package/dist/DataTable/EmptyTable.js +5 -6
  98. package/dist/DataTable/EmptyTable.js.map +1 -1
  99. package/dist/DataTable/ExpandAll.js +4 -5
  100. package/dist/DataTable/ExpandAll.js.map +1 -1
  101. package/dist/DataTable/ExpandRow.js +3 -4
  102. package/dist/DataTable/ExpandRow.js.map +1 -1
  103. package/dist/DataTable/FilterStatus.js +8 -9
  104. package/dist/DataTable/FilterStatus.js.map +1 -1
  105. package/dist/DataTable/RowStatus.js +4 -5
  106. package/dist/DataTable/RowStatus.js.map +1 -1
  107. package/dist/DataTable/SidebarFilters.js +3 -4
  108. package/dist/DataTable/SidebarFilters.js.map +1 -1
  109. package/dist/DataTable/Table.js +3 -4
  110. package/dist/DataTable/Table.js.map +1 -1
  111. package/dist/DataTable/TableActions.js +3 -4
  112. package/dist/DataTable/TableActions.js.map +1 -1
  113. package/dist/DataTable/TableCell.js +5 -6
  114. package/dist/DataTable/TableCell.js.map +1 -1
  115. package/dist/DataTable/TableControlBar.js +3 -4
  116. package/dist/DataTable/TableControlBar.js.map +1 -1
  117. package/dist/DataTable/TableFilters.js +6 -7
  118. package/dist/DataTable/TableFilters.js.map +1 -1
  119. package/dist/DataTable/TableFooter.js +4 -5
  120. package/dist/DataTable/TableFooter.js.map +1 -1
  121. package/dist/DataTable/TableHeaderCell.js +13 -15
  122. package/dist/DataTable/TableHeaderCell.js.map +1 -1
  123. package/dist/DataTable/TableHeaderRow.js +3 -4
  124. package/dist/DataTable/TableHeaderRow.js.map +1 -1
  125. package/dist/DataTable/TableRow.js +3 -4
  126. package/dist/DataTable/TableRow.js.map +1 -1
  127. package/dist/DataTable/filters/CheckboxFilter.js +25 -29
  128. package/dist/DataTable/filters/CheckboxFilter.js.map +1 -1
  129. package/dist/DataTable/filters/DropdownFilter.js +16 -20
  130. package/dist/DataTable/filters/DropdownFilter.js.map +1 -1
  131. package/dist/DataTable/filters/MultiSelectDropdownFilter.js +25 -29
  132. package/dist/DataTable/filters/MultiSelectDropdownFilter.js.map +1 -1
  133. package/dist/DataTable/filters/TextFilter.js +8 -9
  134. package/dist/DataTable/filters/TextFilter.js.map +1 -1
  135. package/dist/DataTable/hooks.js +11 -13
  136. package/dist/DataTable/hooks.js.map +1 -1
  137. package/dist/DataTable/index.js +42 -36
  138. package/dist/DataTable/index.js.map +1 -1
  139. package/dist/DataTable/messages.d.ts +13 -0
  140. package/dist/DataTable/messages.js +7 -3
  141. package/dist/DataTable/messages.js.map +1 -0
  142. package/dist/DataTable/selection/BaseSelectionStatus.js +11 -12
  143. package/dist/DataTable/selection/BaseSelectionStatus.js.map +1 -1
  144. package/dist/DataTable/selection/ControlledSelect.js +3 -4
  145. package/dist/DataTable/selection/ControlledSelect.js.map +1 -1
  146. package/dist/DataTable/selection/ControlledSelectHeader.js +3 -4
  147. package/dist/DataTable/selection/ControlledSelectHeader.js.map +1 -1
  148. package/dist/DataTable/selection/ControlledSelectionStatus.js +4 -5
  149. package/dist/DataTable/selection/ControlledSelectionStatus.js.map +1 -1
  150. package/dist/DataTable/selection/SelectionStatus.js +4 -5
  151. package/dist/DataTable/selection/SelectionStatus.js.map +1 -1
  152. package/dist/DataTable/utils/getVisibleColumns.js +9 -13
  153. package/dist/DataTable/utils/getVisibleColumns.js.map +1 -1
  154. package/dist/Dropdown/index.js +17 -20
  155. package/dist/Dropdown/index.js.map +1 -1
  156. package/dist/Dropzone/DefaultContent.js +5 -6
  157. package/dist/Dropzone/DefaultContent.js.map +1 -1
  158. package/dist/Dropzone/DragError.js +3 -4
  159. package/dist/Dropzone/DragError.js.map +1 -1
  160. package/dist/Dropzone/GenericError.js +4 -5
  161. package/dist/Dropzone/GenericError.js.map +1 -1
  162. package/dist/Dropzone/UploadProgress.js +6 -7
  163. package/dist/Dropzone/UploadProgress.js.map +1 -1
  164. package/dist/Dropzone/index.js +14 -15
  165. package/dist/Dropzone/index.js.map +1 -1
  166. package/dist/Dropzone/messages.d.ts +53 -0
  167. package/dist/Dropzone/messages.js +12 -13
  168. package/dist/Dropzone/messages.js.map +1 -0
  169. package/dist/Fade/index.js.map +1 -1
  170. package/dist/Form/FormAutosuggest.js +18 -20
  171. package/dist/Form/FormAutosuggest.js.map +1 -1
  172. package/dist/Form/FormAutosuggestOption.js +6 -7
  173. package/dist/Form/FormAutosuggestOption.js.map +1 -1
  174. package/dist/Form/FormCheckbox.js +16 -18
  175. package/dist/Form/FormCheckbox.js.map +1 -1
  176. package/dist/Form/FormCheckboxSet.js +11 -12
  177. package/dist/Form/FormCheckboxSet.js.map +1 -1
  178. package/dist/Form/FormCheckboxSetContext.js +9 -10
  179. package/dist/Form/FormCheckboxSetContext.js.map +1 -1
  180. package/dist/Form/FormControl.js +12 -13
  181. package/dist/Form/FormControl.js.map +1 -1
  182. package/dist/Form/FormControlDecorator.js +4 -5
  183. package/dist/Form/FormControlDecorator.js.map +1 -1
  184. package/dist/Form/FormControlDecoratorGroup.js +8 -9
  185. package/dist/Form/FormControlDecoratorGroup.js.map +1 -1
  186. package/dist/Form/FormControlFeedback.js +4 -5
  187. package/dist/Form/FormControlFeedback.js.map +1 -1
  188. package/dist/Form/FormControlFloatingLabel.js +3 -4
  189. package/dist/Form/FormControlFloatingLabel.js.map +1 -1
  190. package/dist/Form/FormControlSet.js +7 -8
  191. package/dist/Form/FormControlSet.js.map +1 -1
  192. package/dist/Form/FormGroup.js +9 -10
  193. package/dist/Form/FormGroup.js.map +1 -1
  194. package/dist/Form/FormGroupContext.js +7 -8
  195. package/dist/Form/FormGroupContext.js.map +1 -1
  196. package/dist/Form/FormLabel.d.ts +2 -11
  197. package/dist/Form/FormLabel.js +5 -15
  198. package/dist/Form/FormLabel.js.map +1 -1
  199. package/dist/Form/FormRadio.js +28 -31
  200. package/dist/Form/FormRadio.js.map +1 -1
  201. package/dist/Form/FormRadioSet.js +11 -12
  202. package/dist/Form/FormRadioSet.js.map +1 -1
  203. package/dist/Form/FormRadioSetContext.js +9 -10
  204. package/dist/Form/FormRadioSetContext.js.map +1 -1
  205. package/dist/Form/FormSwitch.js +25 -29
  206. package/dist/Form/FormSwitch.js.map +1 -1
  207. package/dist/Form/FormText.js +16 -19
  208. package/dist/Form/FormText.js.map +1 -1
  209. package/dist/Form/fieldUtils.js +11 -22
  210. package/dist/Form/fieldUtils.js.map +1 -1
  211. package/dist/Form/useCheckboxSetValues.js +1 -2
  212. package/dist/Form/useCheckboxSetValues.js.map +1 -1
  213. package/dist/Hyperlink/index.js +17 -21
  214. package/dist/Hyperlink/index.js.map +1 -1
  215. package/dist/Icon/index.js +10 -11
  216. package/dist/Icon/index.js.map +1 -1
  217. package/dist/IconButton/index.d.ts +8 -304
  218. package/dist/IconButton/index.js +21 -84
  219. package/dist/IconButton/index.js.map +1 -1
  220. package/dist/IconButtonToggle/index.js +5 -6
  221. package/dist/IconButtonToggle/index.js.map +1 -1
  222. package/dist/Image/index.js.map +1 -1
  223. package/dist/Layout/index.js +4 -5
  224. package/dist/Layout/index.js.map +1 -1
  225. package/dist/Media/index.js.map +1 -1
  226. package/dist/Menu/MenuItem.js +8 -9
  227. package/dist/Menu/MenuItem.js.map +1 -1
  228. package/dist/Menu/SelectMenu.js +8 -9
  229. package/dist/Menu/SelectMenu.js.map +1 -1
  230. package/dist/Menu/index.js +6 -7
  231. package/dist/Menu/index.js.map +1 -1
  232. package/dist/Modal/AlertModal.js +6 -7
  233. package/dist/Modal/AlertModal.js.map +1 -1
  234. package/dist/Modal/FullscreenModal.js +7 -8
  235. package/dist/Modal/FullscreenModal.js.map +1 -1
  236. package/dist/Modal/MarketingModal.js +9 -10
  237. package/dist/Modal/MarketingModal.js.map +1 -1
  238. package/dist/Modal/ModalCloseButton.js +5 -6
  239. package/dist/Modal/ModalCloseButton.js.map +1 -1
  240. package/dist/Modal/ModalContext.js +6 -7
  241. package/dist/Modal/ModalContext.js.map +1 -1
  242. package/dist/Modal/ModalDialog.d.ts +6 -65
  243. package/dist/Modal/ModalDialog.js +16 -81
  244. package/dist/Modal/ModalDialog.js.map +1 -1
  245. package/dist/Modal/ModalDialogBody.js +5 -6
  246. package/dist/Modal/ModalDialogBody.js.map +1 -1
  247. package/dist/Modal/ModalDialogFooter.js +5 -6
  248. package/dist/Modal/ModalDialogFooter.js.map +1 -1
  249. package/dist/Modal/ModalDialogHeader.js +9 -12
  250. package/dist/Modal/ModalDialogHeader.js.map +1 -1
  251. package/dist/Modal/ModalDialogHero.js +5 -6
  252. package/dist/Modal/ModalDialogHero.js.map +1 -1
  253. package/dist/Modal/ModalDialogHeroBackground.js +6 -7
  254. package/dist/Modal/ModalDialogHeroBackground.js.map +1 -1
  255. package/dist/Modal/ModalDialogHeroContent.js +5 -6
  256. package/dist/Modal/ModalDialogHeroContent.js.map +1 -1
  257. package/dist/Modal/ModalDialogTitle.js +5 -6
  258. package/dist/Modal/ModalDialogTitle.js.map +1 -1
  259. package/dist/Modal/ModalLayer.d.ts +0 -25
  260. package/dist/Modal/ModalLayer.js +13 -35
  261. package/dist/Modal/ModalLayer.js.map +1 -1
  262. package/dist/Modal/ModalPopup.js +11 -12
  263. package/dist/Modal/ModalPopup.js.map +1 -1
  264. package/dist/Modal/PopperElement.js +7 -8
  265. package/dist/Modal/PopperElement.js.map +1 -1
  266. package/dist/Modal/StandardModal.js +7 -8
  267. package/dist/Modal/StandardModal.js.map +1 -1
  268. package/dist/OverflowScroll/OverflowScroll.js +12 -13
  269. package/dist/OverflowScroll/OverflowScroll.js.map +1 -1
  270. package/dist/OverflowScroll/OverflowScrollItems.js +3 -4
  271. package/dist/OverflowScroll/OverflowScrollItems.js.map +1 -1
  272. package/dist/Overlay/index.d.ts +2 -2
  273. package/dist/PageBanner/index.js +9 -10
  274. package/dist/PageBanner/index.js.map +1 -1
  275. package/dist/Pagination/PaginationContext.js +12 -13
  276. package/dist/Pagination/PaginationContext.js.map +1 -1
  277. package/dist/Pagination/subcomponents/PageButton.js +3 -4
  278. package/dist/Pagination/subcomponents/PageButton.js.map +1 -1
  279. package/dist/Popover/index.js +11 -14
  280. package/dist/Popover/index.js.map +1 -1
  281. package/dist/ProductTour/Checkpoint.js +12 -13
  282. package/dist/ProductTour/Checkpoint.js.map +1 -1
  283. package/dist/ProductTour/CheckpointActionRow.js +10 -11
  284. package/dist/ProductTour/CheckpointActionRow.js.map +1 -1
  285. package/dist/ProductTour/CheckpointBody.js +3 -4
  286. package/dist/ProductTour/CheckpointBody.js.map +1 -1
  287. package/dist/ProductTour/CheckpointHeader.js +7 -8
  288. package/dist/ProductTour/CheckpointHeader.js.map +1 -1
  289. package/dist/ProductTour/CheckpointTitle.js +6 -9
  290. package/dist/ProductTour/CheckpointTitle.js.map +1 -1
  291. package/dist/ProductTour/index.js +3 -4
  292. package/dist/ProductTour/index.js.map +1 -1
  293. package/dist/ProductTour/messages.d.ts +23 -0
  294. package/dist/ProductTour/messages.js +6 -7
  295. package/dist/ProductTour/messages.js.map +1 -0
  296. package/dist/ProgressBar/index.js +11 -12
  297. package/dist/ProgressBar/index.js.map +1 -1
  298. package/dist/ResponsiveEmbed/index.js.map +1 -1
  299. package/dist/Scrollable/index.js +4 -5
  300. package/dist/Scrollable/index.js.map +1 -1
  301. package/dist/SearchField/SearchFieldLabel.js +4 -5
  302. package/dist/SearchField/SearchFieldLabel.js.map +1 -1
  303. package/dist/SelectableBox/SelectableBoxSet.js +13 -14
  304. package/dist/SelectableBox/SelectableBoxSet.js.map +1 -1
  305. package/dist/SelectableBox/index.js +14 -15
  306. package/dist/SelectableBox/index.js.map +1 -1
  307. package/dist/Skeleton/index.js.map +1 -1
  308. package/dist/Spinner/index.d.ts +11 -0
  309. package/dist/Spinner/index.js +6 -17
  310. package/dist/Spinner/index.js.map +1 -1
  311. package/dist/Stack/index.js +12 -15
  312. package/dist/Stack/index.js.map +1 -1
  313. package/dist/StatefulButton/index.js +9 -10
  314. package/dist/StatefulButton/index.js.map +1 -1
  315. package/dist/Stepper/Stepper.js +4 -5
  316. package/dist/Stepper/Stepper.js.map +1 -1
  317. package/dist/Stepper/StepperActionRow.js +6 -7
  318. package/dist/Stepper/StepperActionRow.js.map +1 -1
  319. package/dist/Stepper/StepperContext.js +4 -5
  320. package/dist/Stepper/StepperContext.js.map +1 -1
  321. package/dist/Stepper/StepperHeader.js +23 -31
  322. package/dist/Stepper/StepperHeader.js.map +1 -1
  323. package/dist/Stepper/StepperHeaderStep.js +8 -9
  324. package/dist/Stepper/StepperHeaderStep.js.map +1 -1
  325. package/dist/Stepper/StepperStep.js +10 -11
  326. package/dist/Stepper/StepperStep.js.map +1 -1
  327. package/dist/Sticky/index.js +8 -12
  328. package/dist/Sticky/index.js.map +1 -1
  329. package/dist/Tabs/index.js +8 -9
  330. package/dist/Tabs/index.js.map +1 -1
  331. package/dist/Toast/ToastContainer.js +3 -4
  332. package/dist/Toast/ToastContainer.js.map +1 -1
  333. package/dist/Toast/index.d.ts +20 -41
  334. package/dist/Toast/index.js +11 -48
  335. package/dist/Toast/index.js.map +1 -1
  336. package/dist/ToggleButton/index.js.map +1 -1
  337. package/dist/Tooltip/index.js +11 -14
  338. package/dist/Tooltip/index.js.map +1 -1
  339. package/dist/Truncate/index.js +9 -10
  340. package/dist/Truncate/index.js.map +1 -1
  341. package/dist/asInput/index.js +9 -13
  342. package/dist/asInput/index.js.map +1 -1
  343. package/dist/hooks/useArrowKeyNavigationHook.js +17 -21
  344. package/dist/hooks/useArrowKeyNavigationHook.js.map +1 -1
  345. package/dist/hooks/useIsVisibleHook.js +4 -6
  346. package/dist/hooks/useIsVisibleHook.js.map +1 -1
  347. package/dist/hooks/useToggleHook.js +1 -3
  348. package/dist/hooks/useToggleHook.js.map +1 -1
  349. package/dist/index.d.ts +5 -5
  350. package/dist/index.js +5 -10
  351. package/dist/index.js.map +1 -1
  352. package/dist/theme-urls.json +6 -6
  353. package/dist/utils/newId.js +1 -2
  354. package/dist/utils/newId.js.map +1 -1
  355. package/package.json +2 -2
  356. package/src/ActionRow/{index.jsx → index.tsx} +14 -22
  357. package/src/Annotation/{index.jsx → index.tsx} +15 -22
  358. package/src/Avatar/{index.jsx → index.tsx} +13 -19
  359. package/src/AvatarButton/{index.jsx → index.tsx} +23 -31
  360. package/src/Bubble/index.tsx +12 -32
  361. package/src/Button/index.tsx +68 -93
  362. package/src/Chip/index.tsx +26 -59
  363. package/src/CloseButton/index.tsx +1 -0
  364. package/src/Collapse/index.tsx +1 -0
  365. package/src/DataTable/DropdownFilters.jsx +9 -2
  366. package/src/DataTable/README.md +19 -18
  367. package/src/DataTable/index.jsx +6 -1
  368. package/src/DataTable/{messages.js → messages.ts} +5 -0
  369. package/src/DataTable/tests/DataTable.test.jsx +51 -1
  370. package/src/DataTable/tests/DropdownFilters.test.jsx +11 -7
  371. package/src/Fade/index.tsx +1 -0
  372. package/src/Form/FormLabel.tsx +2 -10
  373. package/src/IconButton/index.tsx +17 -81
  374. package/src/Image/index.tsx +2 -0
  375. package/src/Media/index.tsx +1 -0
  376. package/src/Modal/ModalDialog.tsx +6 -66
  377. package/src/Modal/ModalLayer.tsx +0 -22
  378. package/src/Modal/modal-popup.mdx +1 -1
  379. package/src/ProductTour/ProductTour.test.jsx +0 -1
  380. package/src/ResponsiveEmbed/index.tsx +1 -0
  381. package/src/Skeleton/index.tsx +1 -0
  382. package/src/Spinner/{index.jsx → index.tsx} +10 -15
  383. package/src/Toast/index.tsx +21 -40
  384. package/src/ToggleButton/index.tsx +2 -0
  385. package/src/index.ts +5 -10
  386. /package/{src/CloseButton/index.jsx → dist/CloseButton/index.d.ts} +0 -0
  387. /package/{src/Collapse/index.jsx → dist/Collapse/index.d.ts} +0 -0
  388. /package/{src/Fade/index.jsx → dist/Fade/index.d.ts} +0 -0
  389. /package/{src/Image/index.jsx → dist/Image/index.d.ts} +0 -0
  390. /package/{src/Media/index.jsx → dist/Media/index.d.ts} +0 -0
  391. /package/{src/ResponsiveEmbed/index.jsx → dist/ResponsiveEmbed/index.d.ts} +0 -0
  392. /package/{src/Skeleton/index.jsx → dist/Skeleton/index.d.ts} +0 -0
  393. /package/{src/ToggleButton/index.jsx → dist/ToggleButton/index.d.ts} +0 -0
  394. /package/src/Card/CardCarousel/{messages.js → messages.ts} +0 -0
  395. /package/src/ChipCarousel/{messages.js → messages.ts} +0 -0
  396. /package/src/Dropzone/{messages.js → messages.ts} +0 -0
  397. /package/src/ProductTour/{messages.js → messages.ts} +0 -0
  398. /package/src/Spinner/{Spinner.test.jsx → Spinner.test.tsx} +0 -0
  399. /package/src/Spinner/__snapshots__/{Spinner.test.jsx.snap → Spinner.test.tsx.snap} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeaderCell.js","names":["React","PropTypes","classNames","Icon","ArrowDropDown","ArrowDropUp","ArrowDropUpDown","SortIndicator","_ref","isSorted","isSortedDesc","createElement","style","opacity","src","propTypes","bool","isRequired","TableHeaderCell","_ref2","getHeaderProps","render","canSort","getSortByToggleProps","headerClassName","toggleProps","className","defaultProps","func","string"],"sources":["../../src/DataTable/TableHeaderCell.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Icon from '../Icon';\nimport { ArrowDropDown, ArrowDropUp, ArrowDropUpDown } from '../../icons';\n\nexport function SortIndicator({ isSorted, isSortedDesc }) {\n if (!isSorted) {\n return <Icon style={{ opacity: 0.5 }} src={ArrowDropUpDown} data-testid=\"arrow-drop-up-down\" />;\n }\n\n if (isSortedDesc) {\n return <Icon src={ArrowDropDown} data-testid=\"arrow-drop-down\" />;\n }\n\n return <Icon src={ArrowDropUp} data-testid=\"arrow-drop-up\" />;\n}\n\nSortIndicator.propTypes = {\n isSorted: PropTypes.bool.isRequired,\n isSortedDesc: PropTypes.bool.isRequired,\n};\n\nfunction TableHeaderCell({\n getHeaderProps, render, canSort, getSortByToggleProps, isSorted, isSortedDesc, headerClassName,\n}) {\n const toggleProps = canSort && getSortByToggleProps ? getSortByToggleProps() : {};\n\n return (\n <th {...getHeaderProps(toggleProps)}>\n <span className={classNames('d-flex align-items-center', headerClassName)}>\n <span>{render('Header')}</span>\n {canSort && <SortIndicator isSorted={isSorted} isSortedDesc={isSortedDesc || false} />}\n </span>\n </th>\n );\n}\n\nTableHeaderCell.defaultProps = {\n headerClassName: null,\n isSorted: false,\n isSortedDesc: false,\n canSort: false,\n getSortByToggleProps: () => {},\n};\n\nTableHeaderCell.propTypes = {\n /** Returns props for the th element */\n getHeaderProps: PropTypes.func.isRequired,\n /** Indicates whether or not a column is sorted */\n isSorted: PropTypes.bool,\n /** Renders the header content. Passed the string 'Header' */\n render: PropTypes.func.isRequired,\n /** Indicates whether the column is sorted in descending order */\n isSortedDesc: PropTypes.bool,\n /** Gets props related to sorting that will be passed to th */\n getSortByToggleProps: PropTypes.func,\n /** Indicates whether a column is sortable */\n canSort: PropTypes.bool,\n /** Class(es) to be applied to header cells */\n headerClassName: PropTypes.string,\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,KAAA,CAAAW,aAAA;IAAMe,SAAS,EAAExB,UAAU,CAAC,2BAA2B,EAAEsB,eAAe;EAAE,gBACxExB,KAAA,CAAAW,aAAA,eAAOU,MAAM,CAAC,QAAQ,CAAQ,CAAC,EAC9BC,OAAO,iBAAItB,KAAA,CAAAW,aAAA,CAACJ,aAAa;IAACE,QAAQ,EAAEA,QAAS;IAACC,YAAY,EAAEA,YAAY,IAAI;EAAM,CAAE,CACjF,CACJ,CAAC;AAET;AAEAQ,eAAe,CAACS,YAAY,GAAG;EAC7BH,eAAe,EAAE,IAAI;EACrBf,QAAQ,EAAE,KAAK;EACfC,YAAY,EAAE,KAAK;EACnBY,OAAO,EAAE,KAAK;EACdC,oBAAoB,EAAEA,CAAA,KAAM,CAAC;AAC/B,CAAC;AAEDL,eAAe,CAACH,SAAS,GAAG;EAC1B;EACAK,cAAc,EAAEnB,SAAS,CAAC2B,IAAI,CAACX,UAAU;EACzC;EACAR,QAAQ,EAAER,SAAS,CAACe,IAAI;EACxB;EACAK,MAAM,EAAEpB,SAAS,CAAC2B,IAAI,CAACX,UAAU;EACjC;EACAP,YAAY,EAAET,SAAS,CAACe,IAAI;EAC5B;EACAO,oBAAoB,EAAEtB,SAAS,CAAC2B,IAAI;EACpC;EACAN,OAAO,EAAErB,SAAS,CAACe,IAAI;EACvB;EACAQ,eAAe,EAAEvB,SAAS,CAAC4B;AAC7B,CAAC;AAED,eAAeX,eAAe","ignoreList":[]}
1
+ {"version":3,"file":"TableHeaderCell.js","names":["React","PropTypes","classNames","Icon","ArrowDropDown","ArrowDropUp","ArrowDropUpDown","SortIndicator","isSorted","isSortedDesc","createElement","style","opacity","src","propTypes","bool","isRequired","TableHeaderCell","getHeaderProps","render","canSort","getSortByToggleProps","headerClassName","toggleProps","className","defaultProps","func","string"],"sources":["../../src/DataTable/TableHeaderCell.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Icon from '../Icon';\nimport { ArrowDropDown, ArrowDropUp, ArrowDropUpDown } from '../../icons';\n\nexport function SortIndicator({ isSorted, isSortedDesc }) {\n if (!isSorted) {\n return <Icon style={{ opacity: 0.5 }} src={ArrowDropUpDown} data-testid=\"arrow-drop-up-down\" />;\n }\n\n if (isSortedDesc) {\n return <Icon src={ArrowDropDown} data-testid=\"arrow-drop-down\" />;\n }\n\n return <Icon src={ArrowDropUp} data-testid=\"arrow-drop-up\" />;\n}\n\nSortIndicator.propTypes = {\n isSorted: PropTypes.bool.isRequired,\n isSortedDesc: PropTypes.bool.isRequired,\n};\n\nfunction TableHeaderCell({\n getHeaderProps, render, canSort, getSortByToggleProps, isSorted, isSortedDesc, headerClassName,\n}) {\n const toggleProps = canSort && getSortByToggleProps ? getSortByToggleProps() : {};\n\n return (\n <th {...getHeaderProps(toggleProps)}>\n <span className={classNames('d-flex align-items-center', headerClassName)}>\n <span>{render('Header')}</span>\n {canSort && <SortIndicator isSorted={isSorted} isSortedDesc={isSortedDesc || false} />}\n </span>\n </th>\n );\n}\n\nTableHeaderCell.defaultProps = {\n headerClassName: null,\n isSorted: false,\n isSortedDesc: false,\n canSort: false,\n getSortByToggleProps: () => {},\n};\n\nTableHeaderCell.propTypes = {\n /** Returns props for the th element */\n getHeaderProps: PropTypes.func.isRequired,\n /** Indicates whether or not a column is sorted */\n isSorted: PropTypes.bool,\n /** Renders the header content. Passed the string 'Header' */\n render: PropTypes.func.isRequired,\n /** Indicates whether the column is sorted in descending order */\n isSortedDesc: PropTypes.bool,\n /** Gets props related to sorting that will be passed to th */\n getSortByToggleProps: PropTypes.func,\n /** Indicates whether a column is sortable */\n canSort: PropTypes.bool,\n /** Class(es) to be applied to header cells */\n headerClassName: PropTypes.string,\n};\n\nexport default TableHeaderCell;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,IAAI,MAAM,SAAS;AAC1B,SAASC,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,YAAY,EAAEA,YAAY,IAAI;EAAM,CAAE,CACjF,CACJ,CAAC;AAET;AAEAQ,eAAe,CAACQ,YAAY,GAAG;EAC7BH,eAAe,EAAE,IAAI;EACrBd,QAAQ,EAAE,KAAK;EACfC,YAAY,EAAE,KAAK;EACnBW,OAAO,EAAE,KAAK;EACdC,oBAAoB,EAAEA,CAAA,KAAM,CAAC;AAC/B,CAAC;AAEDJ,eAAe,CAACH,SAAS,GAAG;EAC1B;EACAI,cAAc,EAAEjB,SAAS,CAACyB,IAAI,CAACV,UAAU;EACzC;EACAR,QAAQ,EAAEP,SAAS,CAACc,IAAI;EACxB;EACAI,MAAM,EAAElB,SAAS,CAACyB,IAAI,CAACV,UAAU;EACjC;EACAP,YAAY,EAAER,SAAS,CAACc,IAAI;EAC5B;EACAM,oBAAoB,EAAEpB,SAAS,CAACyB,IAAI;EACpC;EACAN,OAAO,EAAEnB,SAAS,CAACc,IAAI;EACvB;EACAO,eAAe,EAAErB,SAAS,CAAC0B;AAC7B,CAAC;AAED,eAAeV,eAAe","ignoreList":[]}
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import TableHeaderCell from './TableHeaderCell';
4
- function TableHeaderRow(_ref) {
5
- let {
6
- headerGroups
7
- } = _ref;
4
+ function TableHeaderRow({
5
+ headerGroups
6
+ }) {
8
7
  return /*#__PURE__*/React.createElement("thead", null, headerGroups.map(headerGroup => /*#__PURE__*/React.createElement("tr", {
9
8
  ...headerGroup.getHeaderGroupProps()
10
9
  }, headerGroup.headers.map(column => /*#__PURE__*/React.createElement(TableHeaderCell, {
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeaderRow.js","names":["React","PropTypes","TableHeaderCell","TableHeaderRow","_ref","headerGroups","createElement","map","headerGroup","getHeaderGroupProps","headers","column","getHeaderProps","propTypes","arrayOf","shape","func","isRequired"],"sources":["../../src/DataTable/TableHeaderRow.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport TableHeaderCell from './TableHeaderCell';\n\nfunction TableHeaderRow({ headerGroups }) {\n return (\n <thead>\n {headerGroups.map(headerGroup => (\n <tr {...headerGroup.getHeaderGroupProps()}>\n {headerGroup.headers.map(column => (\n <TableHeaderCell {...column} {...column.getHeaderProps()} />\n ))}\n </tr>\n ))}\n </thead>\n );\n}\n\nTableHeaderRow.propTypes = {\n headerGroups: PropTypes.arrayOf(PropTypes.shape({\n headers: PropTypes.arrayOf(PropTypes.shape({\n /** Props for the TableHeaderCell component. Must include a key */\n getHeaderProps: PropTypes.func.isRequired,\n })).isRequired,\n /** Returns props for the header tr element */\n getHeaderGroupProps: PropTypes.func.isRequired,\n })).isRequired,\n};\n\nexport default TableHeaderRow;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,SAASC,cAAcA,CAAAC,IAAA,EAAmB;EAAA,IAAlB;IAAEC;EAAa,CAAC,GAAAD,IAAA;EACtC,oBACEJ,KAAA,CAAAM,aAAA,gBACGD,YAAY,CAACE,GAAG,CAACC,WAAW,iBAC3BR,KAAA,CAAAM,aAAA;IAAA,GAAQE,WAAW,CAACC,mBAAmB,CAAC;EAAC,GACtCD,WAAW,CAACE,OAAO,CAACH,GAAG,CAACI,MAAM,iBAC7BX,KAAA,CAAAM,aAAA,CAACJ,eAAe;IAAA,GAAKS,MAAM;IAAA,GAAMA,MAAM,CAACC,cAAc,CAAC;EAAC,CAAG,CAC5D,CACC,CACL,CACI,CAAC;AAEZ;AAEAT,cAAc,CAACU,SAAS,GAAG;EACzBR,YAAY,EAAEJ,SAAS,CAACa,OAAO,CAACb,SAAS,CAACc,KAAK,CAAC;IAC9CL,OAAO,EAAET,SAAS,CAACa,OAAO,CAACb,SAAS,CAACc,KAAK,CAAC;MACzC;MACAH,cAAc,EAAEX,SAAS,CAACe,IAAI,CAACC;IACjC,CAAC,CAAC,CAAC,CAACA,UAAU;IACd;IACAR,mBAAmB,EAAER,SAAS,CAACe,IAAI,CAACC;EACtC,CAAC,CAAC,CAAC,CAACA;AACN,CAAC;AAED,eAAed,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"TableHeaderRow.js","names":["React","PropTypes","TableHeaderCell","TableHeaderRow","headerGroups","createElement","map","headerGroup","getHeaderGroupProps","headers","column","getHeaderProps","propTypes","arrayOf","shape","func","isRequired"],"sources":["../../src/DataTable/TableHeaderRow.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport TableHeaderCell from './TableHeaderCell';\n\nfunction TableHeaderRow({ headerGroups }) {\n return (\n <thead>\n {headerGroups.map(headerGroup => (\n <tr {...headerGroup.getHeaderGroupProps()}>\n {headerGroup.headers.map(column => (\n <TableHeaderCell {...column} {...column.getHeaderProps()} />\n ))}\n </tr>\n ))}\n </thead>\n );\n}\n\nTableHeaderRow.propTypes = {\n headerGroups: PropTypes.arrayOf(PropTypes.shape({\n headers: PropTypes.arrayOf(PropTypes.shape({\n /** Props for the TableHeaderCell component. Must include a key */\n getHeaderProps: PropTypes.func.isRequired,\n })).isRequired,\n /** Returns props for the header tr element */\n getHeaderGroupProps: PropTypes.func.isRequired,\n })).isRequired,\n};\n\nexport default TableHeaderRow;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,SAASC,cAAcA,CAAC;EAAEC;AAAa,CAAC,EAAE;EACxC,oBACEJ,KAAA,CAAAK,aAAA,gBACGD,YAAY,CAACE,GAAG,CAACC,WAAW,iBAC3BP,KAAA,CAAAK,aAAA;IAAA,GAAQE,WAAW,CAACC,mBAAmB,CAAC;EAAC,GACtCD,WAAW,CAACE,OAAO,CAACH,GAAG,CAACI,MAAM,iBAC7BV,KAAA,CAAAK,aAAA,CAACH,eAAe;IAAA,GAAKQ,MAAM;IAAA,GAAMA,MAAM,CAACC,cAAc,CAAC;EAAC,CAAG,CAC5D,CACC,CACL,CACI,CAAC;AAEZ;AAEAR,cAAc,CAACS,SAAS,GAAG;EACzBR,YAAY,EAAEH,SAAS,CAACY,OAAO,CAACZ,SAAS,CAACa,KAAK,CAAC;IAC9CL,OAAO,EAAER,SAAS,CAACY,OAAO,CAACZ,SAAS,CAACa,KAAK,CAAC;MACzC;MACAH,cAAc,EAAEV,SAAS,CAACc,IAAI,CAACC;IACjC,CAAC,CAAC,CAAC,CAACA,UAAU;IACd;IACAR,mBAAmB,EAAEP,SAAS,CAACc,IAAI,CAACC;EACtC,CAAC,CAAC,CAAC,CAACA;AACN,CAAC;AAED,eAAeb,cAAc","ignoreList":[]}
@@ -3,10 +3,9 @@ import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
4
  import TableCell from './TableCell';
5
5
  import DataTableContext from './DataTableContext';
6
- function TableRow(_ref) {
7
- let {
8
- row
9
- } = _ref;
6
+ function TableRow({
7
+ row
8
+ }) {
10
9
  const {
11
10
  getRowProps,
12
11
  cells,
@@ -1 +1 @@
1
- {"version":3,"file":"TableRow.js","names":["React","useContext","PropTypes","classNames","TableCell","DataTableContext","TableRow","_ref","row","getRowProps","cells","id","isSelected","isExpanded","renderRowSubComponent","visibleColumns","createElement","Fragment","className","map","cell","key","column","Header","colSpan","length","propTypes","shape","func","isRequired","arrayOf","string","bool"],"sources":["../../src/DataTable/TableRow.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport TableCell from './TableCell';\nimport DataTableContext from './DataTableContext';\n\nfunction TableRow({ row }) {\n const {\n getRowProps, cells, id, isSelected, isExpanded,\n } = row;\n const { renderRowSubComponent, visibleColumns } = useContext(DataTableContext);\n\n return (\n <>\n <tr {...getRowProps({\n className: classNames({\n 'pgn__data-table-row': true,\n 'is-selected': isSelected,\n }),\n })}\n >\n {cells.map(cell => <TableCell {...cell} key={`${cell.column.Header}${id}`} />)}\n </tr>\n {isExpanded && renderRowSubComponent ? (\n <tr>\n <td colSpan={visibleColumns.length}>\n {renderRowSubComponent({ row })}\n </td>\n </tr>\n ) : null}\n </>\n );\n}\n\nTableRow.propTypes = {\n /** Row data that is received from `react-table` API. */\n row: PropTypes.shape({\n /** props to include on the tr tag (must include id) */\n getRowProps: PropTypes.func.isRequired,\n /** cells in the row */\n cells: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n /** row id */\n id: PropTypes.string.isRequired,\n /** indicates if row has been selected */\n isSelected: PropTypes.bool,\n /** Indicates if row has been expanded. */\n isExpanded: PropTypes.bool,\n }).isRequired,\n};\n\nexport default TableRow;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,QAAQA,CAAAC,IAAA,EAAU;EAAA,IAAT;IAAEC;EAAI,CAAC,GAAAD,IAAA;EACvB,MAAM;IACJE,WAAW;IAAEC,KAAK;IAAEC,EAAE;IAAEC,UAAU;IAAEC;EACtC,CAAC,GAAGL,GAAG;EACP,MAAM;IAAEM,qBAAqB;IAAEC;EAAe,CAAC,GAAGd,UAAU,CAACI,gBAAgB,CAAC;EAE9E,oBACEL,KAAA,CAAAgB,aAAA,CAAAhB,KAAA,CAAAiB,QAAA,qBACEjB,KAAA,CAAAgB,aAAA;IAAA,GAAQP,WAAW,CAAC;MAClBS,SAAS,EAAEf,UAAU,CAAC;QACpB,qBAAqB,EAAE,IAAI;QAC3B,aAAa,EAAES;MACjB,CAAC;IACH,CAAC;EAAC,GAECF,KAAK,CAACS,GAAG,CAACC,IAAI,iBAAIpB,KAAA,CAAAgB,aAAA,CAACZ,SAAS;IAAA,GAAKgB,IAAI;IAAEC,GAAG,EAAE,GAAGD,IAAI,CAACE,MAAM,CAACC,MAAM,GAAGZ,EAAE;EAAG,CAAE,CAAC,CAC3E,CAAC,EACJE,UAAU,IAAIC,qBAAqB,gBAClCd,KAAA,CAAAgB,aAAA,0BACEhB,KAAA,CAAAgB,aAAA;IAAIQ,OAAO,EAAET,cAAc,CAACU;EAAO,GAChCX,qBAAqB,CAAC;IAAEN;EAAI,CAAC,CAC5B,CACF,CAAC,GACH,IACJ,CAAC;AAEP;AAEAF,QAAQ,CAACoB,SAAS,GAAG;EACnB;EACAlB,GAAG,EAAEN,SAAS,CAACyB,KAAK,CAAC;IACnB;IACAlB,WAAW,EAAEP,SAAS,CAAC0B,IAAI,CAACC,UAAU;IACtC;IACAnB,KAAK,EAAER,SAAS,CAAC4B,OAAO,CAAC5B,SAAS,CAACyB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAACE,UAAU;IACxD;IACAlB,EAAE,EAAET,SAAS,CAAC6B,MAAM,CAACF,UAAU;IAC/B;IACAjB,UAAU,EAAEV,SAAS,CAAC8B,IAAI;IAC1B;IACAnB,UAAU,EAAEX,SAAS,CAAC8B;EACxB,CAAC,CAAC,CAACH;AACL,CAAC;AAED,eAAevB,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"TableRow.js","names":["React","useContext","PropTypes","classNames","TableCell","DataTableContext","TableRow","row","getRowProps","cells","id","isSelected","isExpanded","renderRowSubComponent","visibleColumns","createElement","Fragment","className","map","cell","key","column","Header","colSpan","length","propTypes","shape","func","isRequired","arrayOf","string","bool"],"sources":["../../src/DataTable/TableRow.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport TableCell from './TableCell';\nimport DataTableContext from './DataTableContext';\n\nfunction TableRow({ row }) {\n const {\n getRowProps, cells, id, isSelected, isExpanded,\n } = row;\n const { renderRowSubComponent, visibleColumns } = useContext(DataTableContext);\n\n return (\n <>\n <tr {...getRowProps({\n className: classNames({\n 'pgn__data-table-row': true,\n 'is-selected': isSelected,\n }),\n })}\n >\n {cells.map(cell => <TableCell {...cell} key={`${cell.column.Header}${id}`} />)}\n </tr>\n {isExpanded && renderRowSubComponent ? (\n <tr>\n <td colSpan={visibleColumns.length}>\n {renderRowSubComponent({ row })}\n </td>\n </tr>\n ) : null}\n </>\n );\n}\n\nTableRow.propTypes = {\n /** Row data that is received from `react-table` API. */\n row: PropTypes.shape({\n /** props to include on the tr tag (must include id) */\n getRowProps: PropTypes.func.isRequired,\n /** cells in the row */\n cells: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n /** row id */\n id: PropTypes.string.isRequired,\n /** indicates if row has been selected */\n isSelected: PropTypes.bool,\n /** Indicates if row has been expanded. */\n isExpanded: PropTypes.bool,\n }).isRequired,\n};\n\nexport default TableRow;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,QAAQA,CAAC;EAAEC;AAAI,CAAC,EAAE;EACzB,MAAM;IACJC,WAAW;IAAEC,KAAK;IAAEC,EAAE;IAAEC,UAAU;IAAEC;EACtC,CAAC,GAAGL,GAAG;EACP,MAAM;IAAEM,qBAAqB;IAAEC;EAAe,CAAC,GAAGb,UAAU,CAACI,gBAAgB,CAAC;EAE9E,oBACEL,KAAA,CAAAe,aAAA,CAAAf,KAAA,CAAAgB,QAAA,qBACEhB,KAAA,CAAAe,aAAA;IAAA,GAAQP,WAAW,CAAC;MAClBS,SAAS,EAAEd,UAAU,CAAC;QACpB,qBAAqB,EAAE,IAAI;QAC3B,aAAa,EAAEQ;MACjB,CAAC;IACH,CAAC;EAAC,GAECF,KAAK,CAACS,GAAG,CAACC,IAAI,iBAAInB,KAAA,CAAAe,aAAA,CAACX,SAAS;IAAA,GAAKe,IAAI;IAAEC,GAAG,EAAE,GAAGD,IAAI,CAACE,MAAM,CAACC,MAAM,GAAGZ,EAAE;EAAG,CAAE,CAAC,CAC3E,CAAC,EACJE,UAAU,IAAIC,qBAAqB,gBAClCb,KAAA,CAAAe,aAAA,0BACEf,KAAA,CAAAe,aAAA;IAAIQ,OAAO,EAAET,cAAc,CAACU;EAAO,GAChCX,qBAAqB,CAAC;IAAEN;EAAI,CAAC,CAC5B,CACF,CAAC,GACH,IACJ,CAAC;AAEP;AAEAD,QAAQ,CAACmB,SAAS,GAAG;EACnB;EACAlB,GAAG,EAAEL,SAAS,CAACwB,KAAK,CAAC;IACnB;IACAlB,WAAW,EAAEN,SAAS,CAACyB,IAAI,CAACC,UAAU;IACtC;IACAnB,KAAK,EAAEP,SAAS,CAAC2B,OAAO,CAAC3B,SAAS,CAACwB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAACE,UAAU;IACxD;IACAlB,EAAE,EAAER,SAAS,CAAC4B,MAAM,CAACF,UAAU;IAC/B;IACAjB,UAAU,EAAET,SAAS,CAAC6B,IAAI;IAC1B;IACAnB,UAAU,EAAEV,SAAS,CAAC6B;EACxB,CAAC,CAAC,CAACH;AACL,CAAC;AAED,eAAetB,QAAQ","ignoreList":[]}
@@ -4,16 +4,15 @@ import Form, { FormLabel } from '../../Form';
4
4
  import Badge from '../../Badge';
5
5
  import Stack from '../../Stack';
6
6
  import { newId } from '../../utils';
7
- function CheckboxFilter(_ref) {
8
- let {
9
- column: {
10
- filterValue,
11
- setFilter,
12
- Header,
13
- filterChoices,
14
- getHeaderProps
15
- }
16
- } = _ref;
7
+ function CheckboxFilter({
8
+ column: {
9
+ filterValue,
10
+ setFilter,
11
+ Header,
12
+ filterChoices,
13
+ getHeaderProps
14
+ }
15
+ }) {
17
16
  // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom
18
17
  const ariaLabel = useRef(newId(`checkbox-filter-label-${getHeaderProps().key}-`));
19
18
  const checkedBoxes = filterValue || [];
@@ -35,25 +34,22 @@ function CheckboxFilter(_ref) {
35
34
  }, Header), /*#__PURE__*/React.createElement(Form.CheckboxSet, {
36
35
  name: Header,
37
36
  value: checkedBoxes
38
- }, filterChoices.map(_ref2 => {
39
- let {
40
- name,
41
- number,
42
- value
43
- } = _ref2;
44
- return /*#__PURE__*/React.createElement(Form.Checkbox, {
45
- key: `${headerBasedId}${name}`,
46
- value: name,
47
- checked: checkedBoxes.includes(value),
48
- onChange: () => changeCheckbox(value),
49
- "aria-label": name
50
- }, /*#__PURE__*/React.createElement(Stack, {
51
- direction: "horizontal",
52
- gap: 2
53
- }, name, " ", number !== undefined && /*#__PURE__*/React.createElement(Badge, {
54
- variant: "light"
55
- }, number)));
56
- })));
37
+ }, filterChoices.map(({
38
+ name,
39
+ number,
40
+ value
41
+ }) => /*#__PURE__*/React.createElement(Form.Checkbox, {
42
+ key: `${headerBasedId}${name}`,
43
+ value: name,
44
+ checked: checkedBoxes.includes(value),
45
+ onChange: () => changeCheckbox(value),
46
+ "aria-label": name
47
+ }, /*#__PURE__*/React.createElement(Stack, {
48
+ direction: "horizontal",
49
+ gap: 2
50
+ }, name, " ", number !== undefined && /*#__PURE__*/React.createElement(Badge, {
51
+ variant: "light"
52
+ }, number))))));
57
53
  }
58
54
  CheckboxFilter.propTypes = {
59
55
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxFilter.js","names":["React","useRef","useMemo","PropTypes","Form","FormLabel","Badge","Stack","newId","CheckboxFilter","_ref","column","filterValue","setFilter","Header","filterChoices","getHeaderProps","ariaLabel","key","checkedBoxes","changeCheckbox","value","includes","newCheckedBoxes","filter","val","push","headerBasedId","createElement","Group","role","current","id","className","CheckboxSet","name","map","_ref2","number","Checkbox","checked","onChange","direction","gap","undefined","variant","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/CheckboxFilter.jsx"],"sourcesContent":["import React, { useRef, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport Form, { FormLabel } from '../../Form';\nimport Badge from '../../Badge';\nimport Stack from '../../Stack';\nimport { newId } from '../../utils';\n\nfunction CheckboxFilter({\n column: {\n filterValue, setFilter, Header, filterChoices, getHeaderProps,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`checkbox-filter-label-${getHeaderProps().key}-`));\n\n const checkedBoxes = filterValue || [];\n const changeCheckbox = (value) => {\n if (checkedBoxes.includes(value)) {\n const newCheckedBoxes = checkedBoxes.filter((val) => val !== value);\n return setFilter(newCheckedBoxes);\n }\n checkedBoxes.push(value);\n return setFilter(checkedBoxes);\n };\n const headerBasedId = useMemo(() => `checkbox-filter-check-${getHeaderProps().key}-`, [getHeaderProps]);\n\n return (\n <Form.Group role=\"group\" aria-labelledby={ariaLabel.current}>\n <FormLabel id={ariaLabel.current} className=\"pgn__checkbox-filter-label\">{Header}</FormLabel>\n <Form.CheckboxSet name={Header} value={checkedBoxes}>\n {filterChoices.map(({ name, number, value }) => (\n <Form.Checkbox\n key={`${headerBasedId}${name}`}\n value={name}\n checked={checkedBoxes.includes(value)}\n onChange={() => changeCheckbox(value)}\n aria-label={name}\n >\n <Stack direction=\"horizontal\" gap={2}>\n {name} {number !== undefined && <Badge variant=\"light\">{number}</Badge>}\n </Stack>\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </Form.Group>\n );\n}\n\nCheckboxFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n number: PropTypes.number,\n })).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.arrayOf(PropTypes.string),\n }).isRequired,\n};\n\nexport default CheckboxFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,OAAO,QAAQ,OAAO;AAC9C,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,IAAIC,SAAS,QAAQ,YAAY;AAC5C,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,KAAK,MAAM,aAAa;AAC/B,SAASC,KAAK,QAAQ,aAAa;AAEnC,SAASC,cAAcA,CAAAC,IAAA,EAIpB;EAAA,IAJqB;IACtBC,MAAM,EAAE;MACNC,WAAW;MAAEC,SAAS;MAAEC,MAAM;MAAEC,aAAa;MAAEC;IACjD;EACF,CAAC,GAAAN,IAAA;EACC;EACA,MAAMO,SAAS,GAAGhB,MAAM,CAACO,KAAK,CAAC,yBAAyBQ,cAAc,CAAC,CAAC,CAACE,GAAG,GAAG,CAAC,CAAC;EAEjF,MAAMC,YAAY,GAAGP,WAAW,IAAI,EAAE;EACtC,MAAMQ,cAAc,GAAIC,KAAK,IAAK;IAChC,IAAIF,YAAY,CAACG,QAAQ,CAACD,KAAK,CAAC,EAAE;MAChC,MAAME,eAAe,GAAGJ,YAAY,CAACK,MAAM,CAAEC,GAAG,IAAKA,GAAG,KAAKJ,KAAK,CAAC;MACnE,OAAOR,SAAS,CAACU,eAAe,CAAC;IACnC;IACAJ,YAAY,CAACO,IAAI,CAACL,KAAK,CAAC;IACxB,OAAOR,SAAS,CAACM,YAAY,CAAC;EAChC,CAAC;EACD,MAAMQ,aAAa,GAAGzB,OAAO,CAAC,MAAM,yBAAyBc,cAAc,CAAC,CAAC,CAACE,GAAG,GAAG,EAAE,CAACF,cAAc,CAAC,CAAC;EAEvG,oBACEhB,KAAA,CAAA4B,aAAA,CAACxB,IAAI,CAACyB,KAAK;IAACC,IAAI,EAAC,OAAO;IAAC,mBAAiBb,SAAS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AC,CAAC,CAACH,UAAU;IAC/ElC,aAAa,EAAEZ,SAAS,CAACkD,OAAO,CAAClD,SAAS,CAAC4C,KAAK,CAAC;MAC/CZ,IAAI,EAAEhC,SAAS,CAACmD,MAAM,CAACL,UAAU;MACjC5B,KAAK,EAAElB,SAAS,CAAC+C,SAAS,CAAC,CAAC/C,SAAS,CAACmD,MAAM,EAAEnD,SAAS,CAACmC,MAAM,CAAC,CAAC;MAChEA,MAAM,EAAEnC,SAAS,CAACmC;IACpB,CAAC,CAAC,CAAC,CAACW,UAAU;IACdjC,cAAc,EAAEb,SAAS,CAAC6C,IAAI,CAACC,UAAU;IACzCrC,WAAW,EAAET,SAAS,CAACkD,OAAO,CAAClD,SAAS,CAACmD,MAAM;EACjD,CAAC,CAAC,CAACL;AACL,CAAC;AAED,eAAexC,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"CheckboxFilter.js","names":["React","useRef","useMemo","PropTypes","Form","FormLabel","Badge","Stack","newId","CheckboxFilter","column","filterValue","setFilter","Header","filterChoices","getHeaderProps","ariaLabel","key","checkedBoxes","changeCheckbox","value","includes","newCheckedBoxes","filter","val","push","headerBasedId","createElement","Group","role","current","id","className","CheckboxSet","name","map","number","Checkbox","checked","onChange","direction","gap","undefined","variant","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/CheckboxFilter.jsx"],"sourcesContent":["import React, { useRef, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport Form, { FormLabel } from '../../Form';\nimport Badge from '../../Badge';\nimport Stack from '../../Stack';\nimport { newId } from '../../utils';\n\nfunction CheckboxFilter({\n column: {\n filterValue, setFilter, Header, filterChoices, getHeaderProps,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`checkbox-filter-label-${getHeaderProps().key}-`));\n\n const checkedBoxes = filterValue || [];\n const changeCheckbox = (value) => {\n if (checkedBoxes.includes(value)) {\n const newCheckedBoxes = checkedBoxes.filter((val) => val !== value);\n return setFilter(newCheckedBoxes);\n }\n checkedBoxes.push(value);\n return setFilter(checkedBoxes);\n };\n const headerBasedId = useMemo(() => `checkbox-filter-check-${getHeaderProps().key}-`, [getHeaderProps]);\n\n return (\n <Form.Group role=\"group\" aria-labelledby={ariaLabel.current}>\n <FormLabel id={ariaLabel.current} className=\"pgn__checkbox-filter-label\">{Header}</FormLabel>\n <Form.CheckboxSet name={Header} value={checkedBoxes}>\n {filterChoices.map(({ name, number, value }) => (\n <Form.Checkbox\n key={`${headerBasedId}${name}`}\n value={name}\n checked={checkedBoxes.includes(value)}\n onChange={() => changeCheckbox(value)}\n aria-label={name}\n >\n <Stack direction=\"horizontal\" gap={2}>\n {name} {number !== undefined && <Badge variant=\"light\">{number}</Badge>}\n </Stack>\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </Form.Group>\n );\n}\n\nCheckboxFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n number: PropTypes.number,\n })).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.arrayOf(PropTypes.string),\n }).isRequired,\n};\n\nexport default CheckboxFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,OAAO,QAAQ,OAAO;AAC9C,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,IAAIC,SAAS,QAAQ,YAAY;AAC5C,OAAOC,KAAK,MAAM,aAAa;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IAAI,CAACC,UAAU;IACzCpC,WAAW,EAAER,SAAS,CAACgD,OAAO,CAAChD,SAAS,CAACiD,MAAM;EACjD,CAAC,CAAC,CAACL;AACL,CAAC;AAED,eAAetC,cAAc","ignoreList":[]}
@@ -3,15 +3,14 @@ import PropTypes from 'prop-types';
3
3
  import Form from '../../Form';
4
4
  import { newId } from '../../utils';
5
5
  const DEFAULT_VALUE = '';
6
- function DropdownFilter(_ref) {
7
- let {
8
- column: {
9
- setFilter,
10
- Header,
11
- filterChoices,
12
- getHeaderProps
13
- }
14
- } = _ref;
6
+ function DropdownFilter({
7
+ column: {
8
+ setFilter,
9
+ Header,
10
+ filterChoices,
11
+ getHeaderProps
12
+ }
13
+ }) {
15
14
  // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom
16
15
  const ariaLabel = useRef(newId(`dropdown-filter-label-${getHeaderProps().key}-`));
17
16
  const onChange = e => {
@@ -31,17 +30,14 @@ function DropdownFilter(_ref) {
31
30
  "aria-labelledby": ariaLabel.current
32
31
  }, /*#__PURE__*/React.createElement("option", {
33
32
  value: DEFAULT_VALUE
34
- }, Header), filterChoices.map(_ref2 => {
35
- let {
36
- name,
37
- number,
38
- value
39
- } = _ref2;
40
- return /*#__PURE__*/React.createElement("option", {
41
- key: value,
42
- value: value
43
- }, name, " ", number && `(${number})`);
44
- })));
33
+ }, Header), filterChoices.map(({
34
+ name,
35
+ number,
36
+ value
37
+ }) => /*#__PURE__*/React.createElement("option", {
38
+ key: value,
39
+ value: value
40
+ }, name, " ", number && `(${number})`))));
45
41
  }
46
42
  DropdownFilter.propTypes = {
47
43
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownFilter.js","names":["React","useRef","PropTypes","Form","newId","DEFAULT_VALUE","DropdownFilter","_ref","column","setFilter","Header","filterChoices","getHeaderProps","ariaLabel","key","onChange","e","target","value","undefined","createElement","Group","Label","id","current","className","Control","as","default","map","_ref2","name","number","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/DropdownFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Form from '../../Form';\nimport { newId } from '../../utils';\n\nconst DEFAULT_VALUE = '';\n\nfunction DropdownFilter({\n column: {\n setFilter, Header, filterChoices, getHeaderProps,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`dropdown-filter-label-${getHeaderProps().key}-`));\n const onChange = (e) => {\n if (e.target.value === DEFAULT_VALUE) {\n // setting undefined resets the filter\n return setFilter(undefined);\n }\n return setFilter(e.target.value);\n };\n\n return (\n <Form.Group>\n <Form.Label id={ariaLabel.current} className=\"sr-only\">{Header}</Form.Label>\n <Form.Control\n as=\"select\"\n default={DEFAULT_VALUE}\n onChange={onChange}\n aria-labelledby={ariaLabel.current}\n >\n <option value={DEFAULT_VALUE}>{Header}</option>\n {filterChoices.map(({ name, number, value }) => (<option key={value} value={value}>{name} {number && `(${number})`}</option>))}\n </Form.Control>\n </Form.Group>\n );\n}\n\nDropdownFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n number: PropTypes.number,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n })).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n }).isRequired,\n};\n\nexport default DropdownFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,YAAY;AAC7B,SA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A,MAAM,GAAY,CAAC;EAAA,CAAC,CACjH,CACJ,CAAC;AAEjB;AAEA1B,cAAc,CAAC2B,SAAS,GAAG;EACzB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEzB,MAAM,EAAEN,SAAS,CAACgC,KAAK,CAAC;IACtBzB,SAAS,EAAEP,SAAS,CAACiC,IAAI,CAACC,UAAU;IACpC1B,MAAM,EAAER,SAAS,CAACmC,SAAS,CAAC,CAACnC,SAAS,CAACoC,WAAW,EAAEpC,SAAS,CAACqC,IAAI,CAAC,CAAC,CAACH,UAAU;IAC/EzB,aAAa,EAAET,SAAS,CAACsC,OAAO,CAACtC,SAAS,CAACgC,KAAK,CAAC;MAC/CH,IAAI,EAAE7B,SAAS,CAACuC,MAAM,CAACL,UAAU;MACjCJ,MAAM,EAAE9B,SAAS,CAAC8B,MAAM;MACxBd,KAAK,EAAEhB,SAAS,CAACmC,SAAS,CAAC,CAACnC,SAAS,CAACuC,MAAM,EAAEvC,SAAS,CAAC8B,MAAM,CAAC,CAAC,CAACI;IACnE,CAAC,CAAC,CAAC,CAACA,UAAU;IACdxB,cAAc,EAAEV,SAAS,CAACiC,IAAI,CAACC;EACjC,CAAC,CAAC,CAACA;AACL,CAAC;AAED,eAAe9B,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"DropdownFilter.js","names":["React","useRef","PropTypes","Form","newId","DEFAULT_VALUE","DropdownFilter","column","setFilter","Header","filterChoices","getHeaderProps","ariaLabel","key","onChange","e","target","value","undefined","createElement","Group","Label","id","current","className","Control","as","default","map","name","number","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/DropdownFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Form from '../../Form';\nimport { newId } from '../../utils';\n\nconst DEFAULT_VALUE = '';\n\nfunction DropdownFilter({\n column: {\n setFilter, Header, filterChoices, getHeaderProps,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`dropdown-filter-label-${getHeaderProps().key}-`));\n const onChange = (e) => {\n if (e.target.value === DEFAULT_VALUE) {\n // setting undefined resets the filter\n return setFilter(undefined);\n }\n return setFilter(e.target.value);\n };\n\n return (\n <Form.Group>\n <Form.Label id={ariaLabel.current} className=\"sr-only\">{Header}</Form.Label>\n <Form.Control\n as=\"select\"\n default={DEFAULT_VALUE}\n onChange={onChange}\n aria-labelledby={ariaLabel.current}\n >\n <option value={DEFAULT_VALUE}>{Header}</option>\n {filterChoices.map(({ name, number, value }) => (<option key={value} value={value}>{name} {number && `(${number})`}</option>))}\n </Form.Control>\n </Form.Group>\n );\n}\n\nDropdownFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n number: PropTypes.number,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n })).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n }).isRequired,\n};\n\nexport default DropdownFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,YAAY;AAC7B,SAASC,KAAK,QAAQ,aAAa;AAEnC,MAAMC,aAAa,GAAG,EAAE;AAExB,SAASC,cAAcA,CAAC;EACtBC,MAAM,EAAE;IACNC,SAAS;IAAEC,MAAM;IAAEC,aAAa;IAAEC;EACpC;AACF,CAAC,EAAE;EACD;EACA,MAAMC,SAAS,GAAGX,MAAM,CAACG,KAAK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CAACjC,SAAS,CAACkC,WAAW,EAAElC,SAAS,CAACmC,IAAI,CAAC,CAAC,CAACH,UAAU;IAC/ExB,aAAa,EAAER,SAAS,CAACoC,OAAO,CAACpC,SAAS,CAAC8B,KAAK,CAAC;MAC/CH,IAAI,EAAE3B,SAAS,CAACqC,MAAM,CAACL,UAAU;MACjCJ,MAAM,EAAE5B,SAAS,CAAC4B,MAAM;MACxBb,KAAK,EAAEf,SAAS,CAACiC,SAAS,CAAC,CAACjC,SAAS,CAACqC,MAAM,EAAErC,SAAS,CAAC4B,MAAM,CAAC,CAAC,CAACI;IACnE,CAAC,CAAC,CAAC,CAACA,UAAU;IACdvB,cAAc,EAAET,SAAS,CAAC+B,IAAI,CAACC;EACjC,CAAC,CAAC,CAACA;AACL,CAAC;AAED,eAAe5B,cAAc","ignoreList":[]}
@@ -5,16 +5,15 @@ import Stack from '../../Stack';
5
5
  import { DropdownButton } from '../../Dropdown';
6
6
  import { newId } from '../../utils';
7
7
  import Form from '../../Form';
8
- function MultiSelectDropdownFilter(_ref) {
9
- let {
10
- column: {
11
- setFilter,
12
- Header,
13
- filterChoices,
14
- getHeaderProps,
15
- filterValue
16
- }
17
- } = _ref;
8
+ function MultiSelectDropdownFilter({
9
+ column: {
10
+ setFilter,
11
+ Header,
12
+ filterChoices,
13
+ getHeaderProps,
14
+ filterValue
15
+ }
16
+ }) {
18
17
  // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom
19
18
  const ariaLabel = useRef(newId(`multi-dropdown-filter-label-${getHeaderProps().key}-`));
20
19
  const checkedBoxes = filterValue || [];
@@ -34,25 +33,22 @@ function MultiSelectDropdownFilter(_ref) {
34
33
  className: "pgn__dropdown-filter-checkbox-group",
35
34
  name: Header,
36
35
  "aria-label": Header
37
- }, filterChoices.map(_ref2 => {
38
- let {
39
- name,
40
- number,
41
- value
42
- } = _ref2;
43
- return /*#__PURE__*/React.createElement(Form.Checkbox, {
44
- key: name,
45
- value: name,
46
- checked: checkedBoxes.includes(value),
47
- onChange: () => changeCheckbox(value),
48
- "aria-label": name
49
- }, /*#__PURE__*/React.createElement(Stack, {
50
- direction: "horizontal",
51
- gap: 2
52
- }, name, " ", number && /*#__PURE__*/React.createElement(Badge, {
53
- variant: "light"
54
- }, number)));
55
- })));
36
+ }, filterChoices.map(({
37
+ name,
38
+ number,
39
+ value
40
+ }) => /*#__PURE__*/React.createElement(Form.Checkbox, {
41
+ key: name,
42
+ value: name,
43
+ checked: checkedBoxes.includes(value),
44
+ onChange: () => changeCheckbox(value),
45
+ "aria-label": name
46
+ }, /*#__PURE__*/React.createElement(Stack, {
47
+ direction: "horizontal",
48
+ gap: 2
49
+ }, name, " ", number && /*#__PURE__*/React.createElement(Badge, {
50
+ variant: "light"
51
+ }, number))))));
56
52
  }
57
53
  MultiSelectDropdownFilter.propTypes = {
58
54
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelectDropdownFilter.js","names":["React","useRef","PropTypes","Badge","Stack","DropdownButton","newId","Form","MultiSelectDropdownFilter","_ref","column","setFilter","Header","filterChoices","getHeaderProps","filterValue","ariaLabel","key","checkedBoxes","changeCheckbox","value","includes","newCheckedBoxes","filter","val","push","createElement","variant","id","current","title","CheckboxSet","className","name","map","_ref2","number","Checkbox","checked","onChange","direction","gap","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/MultiSelectDropdownFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Badge from '../../Badge';\nimport Stack from '../../Stack';\nimport { DropdownButton } from '../../Dropdown';\nimport { newId } from '../../utils';\nimport Form from '../../Form';\n\nfunction MultiSelectDropdownFilter({\n column: {\n setFilter, Header, filterChoices, getHeaderProps, filterValue,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`multi-dropdown-filter-label-${getHeaderProps().key}-`));\n const checkedBoxes = filterValue || [];\n const changeCheckbox = (value) => {\n if (checkedBoxes.includes(value)) {\n const newCheckedBoxes = checkedBoxes.filter((val) => val !== value);\n return setFilter(newCheckedBoxes);\n }\n checkedBoxes.push(value);\n return setFilter(checkedBoxes);\n };\n\n return (\n <DropdownButton variant=\"outline-primary\" id={ariaLabel.current} title={Header}>\n <Form.CheckboxSet\n className=\"pgn__dropdown-filter-checkbox-group\"\n name={Header}\n aria-label={Header}\n >\n {filterChoices.map(({ name, number, value }) => (\n <Form.Checkbox\n key={name}\n value={name}\n checked={checkedBoxes.includes(value)}\n onChange={() => changeCheckbox(value)}\n aria-label={name}\n >\n <Stack direction=\"horizontal\" gap={2}>\n {name} {number && <Badge variant=\"light\">{number}</Badge>}\n </Stack>\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </DropdownButton>\n );\n}\n\nMultiSelectDropdownFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n /** Function to set the filter value */\n setFilter: PropTypes.func.isRequired,\n /** Column header used for labels and placeholders */\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n /** Names and values for the select options */\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n number: PropTypes.number,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n })).isRequired,\n /** Generates a key unique to the column being filtered */\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.arrayOf(PropTypes.string),\n }).isRequired,\n};\n\nexport default MultiSelectDropdownFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,KAAK,MAAM,aAA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ACL;AACL,CAAC;AAED,eAAerC,yBAAyB","ignoreList":[]}
1
+ {"version":3,"file":"MultiSelectDropdownFilter.js","names":["React","useRef","PropTypes","Badge","Stack","DropdownButton","newId","Form","MultiSelectDropdownFilter","column","setFilter","Header","filterChoices","getHeaderProps","filterValue","ariaLabel","key","checkedBoxes","changeCheckbox","value","includes","newCheckedBoxes","filter","val","push","createElement","variant","id","current","title","CheckboxSet","className","name","map","number","Checkbox","checked","onChange","direction","gap","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/MultiSelectDropdownFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Badge from '../../Badge';\nimport Stack from '../../Stack';\nimport { DropdownButton } from '../../Dropdown';\nimport { newId } from '../../utils';\nimport Form from '../../Form';\n\nfunction MultiSelectDropdownFilter({\n column: {\n setFilter, Header, filterChoices, getHeaderProps, filterValue,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`multi-dropdown-filter-label-${getHeaderProps().key}-`));\n const checkedBoxes = filterValue || [];\n const changeCheckbox = (value) => {\n if (checkedBoxes.includes(value)) {\n const newCheckedBoxes = checkedBoxes.filter((val) => val !== value);\n return setFilter(newCheckedBoxes);\n }\n checkedBoxes.push(value);\n return setFilter(checkedBoxes);\n };\n\n return (\n <DropdownButton variant=\"outline-primary\" id={ariaLabel.current} title={Header}>\n <Form.CheckboxSet\n className=\"pgn__dropdown-filter-checkbox-group\"\n name={Header}\n aria-label={Header}\n >\n {filterChoices.map(({ name, number, value }) => (\n <Form.Checkbox\n key={name}\n value={name}\n checked={checkedBoxes.includes(value)}\n onChange={() => changeCheckbox(value)}\n aria-label={name}\n >\n <Stack direction=\"horizontal\" gap={2}>\n {name} {number && <Badge variant=\"light\">{number}</Badge>}\n </Stack>\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </DropdownButton>\n );\n}\n\nMultiSelectDropdownFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n /** Function to set the filter value */\n setFilter: PropTypes.func.isRequired,\n /** Column header used for labels and placeholders */\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n /** Names and values for the select options */\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n number: PropTypes.number,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n })).isRequired,\n /** Generates a key unique to the column being filtered */\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.arrayOf(PropTypes.string),\n }).isRequired,\n};\n\nexport default MultiSelectDropdownFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,KAAK,MAAM,aAAa;AAC/B,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,KAAK,QAAQ,aAAa;AACnC,OAAOC,IAAI,MAAM,YAAY;AAE7B,SAASC,yBAAyBA,CAAC;EACjCC,MAAM,EAAE;IACNC,SAAS;IAAEC,MAAM;IAAEC,aAAa;IAAEC,cAAc;IAAEC;EACpD;AACF,CAAC,EAAE;EACD;EACA,MAAMC,SAAS,GAAGd,MAAM,CAACK,KAAK,CAAC,+BAA+BO,cAAc,CAAC,CAAC,CAACG,GAAG,GAAG,CAAC,CAAC;EACvF,MAAMC,YAAY,GAAGH,WAAW,IAAI,EAAE;EACtC,MAAMI,cAAc,GAAIC,KAAK,IAAK;IAChC,IAAIF,YAAY,CAACG,QAAQ,CAACD,KAAK,CAAC,EAAE;MAChC,MAAME,eAAe,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AER,SAAS,CAACwC,IAAI,CAACC,UAAU;IACpC;IACAhC,MAAM,EAAET,SAAS,CAAC0C,SAAS,CAAC,CAAC1C,SAAS,CAAC2C,WAAW,EAAE3C,SAAS,CAAC4C,IAAI,CAAC,CAAC,CAACH,UAAU;IAC/E;IACA/B,aAAa,EAAEV,SAAS,CAAC6C,OAAO,CAAC7C,SAAS,CAACuC,KAAK,CAAC;MAC/CT,IAAI,EAAE9B,SAAS,CAAC8C,MAAM,CAACL,UAAU;MACjCT,MAAM,EAAEhC,SAAS,CAACgC,MAAM;MACxBf,KAAK,EAAEjB,SAAS,CAAC0C,SAAS,CAAC,CAAC1C,SAAS,CAAC8C,MAAM,EAAE9C,SAAS,CAACgC,MAAM,CAAC,CAAC,CAACS;IACnE,CAAC,CAAC,CAAC,CAACA,UAAU;IACd;IACA9B,cAAc,EAAEX,SAAS,CAACwC,IAAI,CAACC,UAAU;IACzC7B,WAAW,EAAEZ,SAAS,CAAC6C,OAAO,CAAC7C,SAAS,CAAC8C,MAAM;EACjD,CAAC,CAAC,CAACL;AACL,CAAC;AAED,eAAenC,yBAAyB","ignoreList":[]}
@@ -11,15 +11,14 @@ const formatHeaderForLabel = header => {
11
11
  }
12
12
  return header;
13
13
  };
14
- function TextFilter(_ref) {
15
- let {
16
- column: {
17
- filterValue,
18
- setFilter,
19
- Header,
20
- getHeaderProps
21
- }
22
- } = _ref;
14
+ function TextFilter({
15
+ column: {
16
+ filterValue,
17
+ setFilter,
18
+ Header,
19
+ getHeaderProps
20
+ }
21
+ }) {
23
22
  const ariaLabel = useRef(newId(`text-filter-label-${getHeaderProps().key}-`));
24
23
  const formattedHeader = formatHeaderForLabel(Header);
25
24
  const inputText = /*#__PURE__*/React.isValidElement(formattedHeader) ? formattedHeader : `Search ${formattedHeader}`;
@@ -1 +1 @@
1
- {"version":3,"file":"TextFilter.js","names":["React","useRef","PropTypes","Form","newId","formatHeaderForLabel","header","toLowerCase","TextFilter","_ref","column","filterValue","setFilter","Header","getHeaderProps","ariaLabel","key","formattedHeader","inputText","isValidElement","createElement","Group","controlId","current","Label","className","Control","value","type","onChange","e","target","undefined","placeholder","propTypes","shape","func","isRequired","oneOfType","elementType","node","string"],"sources":["../../../src/DataTable/filters/TextFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Form from '../../Form';\nimport { newId } from '../../utils';\n\nconst formatHeaderForLabel = (header) => {\n if (typeof header === 'function') {\n return header();\n }\n if (typeof header === 'string') {\n return header.toLowerCase();\n }\n return header;\n};\n\nfunction TextFilter({\n column: {\n filterValue, setFilter, Header, getHeaderProps,\n },\n}) {\n const ariaLabel = useRef(newId(`text-filter-label-${getHeaderProps().key}-`));\n const formattedHeader = formatHeaderForLabel(Header);\n const inputText = React.isValidElement(formattedHeader) ? formattedHeader : `Search ${formattedHeader}`;\n return (\n <Form.Group controlId={ariaLabel.current}>\n <Form.Label className=\"sr-only\">{inputText}</Form.Label>\n <Form.Control\n value={filterValue || ''}\n type=\"text\"\n onChange={e => {\n setFilter(e.target.value || undefined); // Set undefined to remove the filter entirely\n }}\n placeholder={inputText}\n />\n </Form.Group>\n );\n}\n\nTextFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.string,\n }).isRequired,\n};\n\nexport default TextFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,YAAY;AAC7B,SAASC,KAAK,QAAQ,aAAa;AAEnC,MAAMC,oBAAoB,GAAIC,MAAM,IA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,SAAS,CAACiC,KAAK,CAAC;IACtBvB,SAAS,EAAEV,SAAS,CAACkC,IAAI,CAACC,UAAU;IACpCxB,MAAM,EAAEX,SAAS,CAACoC,SAAS,CAAC,CAACpC,SAAS,CAACqC,WAAW,EAAErC,SAAS,CAACsC,IAAI,CAAC,CAAC,CAACH,UAAU;IAC/EvB,cAAc,EAAEZ,SAAS,CAACkC,IAAI,CAACC,UAAU;IACzC1B,WAAW,EAAET,SAAS,CAACuC;EACzB,CAAC,CAAC,CAACJ;AACL,CAAC;AAED,eAAe7B,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"TextFilter.js","names":["React","useRef","PropTypes","Form","newId","formatHeaderForLabel","header","toLowerCase","TextFilter","column","filterValue","setFilter","Header","getHeaderProps","ariaLabel","key","formattedHeader","inputText","isValidElement","createElement","Group","controlId","current","Label","className","Control","value","type","onChange","e","target","undefined","placeholder","propTypes","shape","func","isRequired","oneOfType","elementType","node","string"],"sources":["../../../src/DataTable/filters/TextFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Form from '../../Form';\nimport { newId } from '../../utils';\n\nconst formatHeaderForLabel = (header) => {\n if (typeof header === 'function') {\n return header();\n }\n if (typeof header === 'string') {\n return header.toLowerCase();\n }\n return header;\n};\n\nfunction TextFilter({\n column: {\n filterValue, setFilter, Header, getHeaderProps,\n },\n}) {\n const ariaLabel = useRef(newId(`text-filter-label-${getHeaderProps().key}-`));\n const formattedHeader = formatHeaderForLabel(Header);\n const inputText = React.isValidElement(formattedHeader) ? formattedHeader : `Search ${formattedHeader}`;\n return (\n <Form.Group controlId={ariaLabel.current}>\n <Form.Label className=\"sr-only\">{inputText}</Form.Label>\n <Form.Control\n value={filterValue || ''}\n type=\"text\"\n onChange={e => {\n setFilter(e.target.value || undefined); // Set undefined to remove the filter entirely\n }}\n placeholder={inputText}\n />\n </Form.Group>\n );\n}\n\nTextFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.string,\n }).isRequired,\n};\n\nexport default TextFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,YAAY;AAC7B,SAASC,KAAK,QAAQ,aAAa;AAEnC,MAAMC,oBAAoB,GAAIC,MAAM,IAAK;EACvC,IAAI,OAAOA,MAAM,KAAK,UAAU,EAAE;IAChC,OAAOA,MAAM,CAAC,CAAC;EACjB;EACA,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAOA,MAAM,CAACC,WAAW,CAAC,CAAC;EAC7B;EACA,OAAOD,MAAM;AACf,CAAC;AAED,SAASE,UAAUA,CAAC;EAClBC,MAAM,EAAE;IACNC,WAAW;IAAEC,SAAS;IAAEC,MAAM;IAAEC;EAClC;AACF,CAAC,EAAE;EACD,MAAMC,SAAS,GAAGb,MAAM,CAACG,KAAK,CAAC,qBAAqBS,cAAc,CAAC,CAAC,CAACE,GAAG,GAAG,CAAC,CAAC;EAC7E,MAAMC,eAAe,GAAGX,oBAAoB,CAACO,MAAM,CAAC;EACpD,MAAMK,SAAS,GAAG,aAAAjB,KAAK,CAACkB,cAAc,CAACF,eAAe,CAAC,GAAGA,eAAe,GAAG,UAAUA,eAAe,EAAE;EACvG,oBACEhB,KAAA,CAAAmB,aAAA,CAAChB,IAAI,CAACiB,KAAK;IAACC,SAAS,EAAEP,SAAS,CAACQ;EAAQ,gBACvCtB,KAAA,CAAAmB,aAAA,CAAChB,IAAI,CAACoB,KAAK;IAACC,SAAS,EAAC;EAAS,GAAEP,SAAsB,CAAC,eACxDjB,KAAA,CAAAmB,aAAA,CAAChB,IAAI,CAACsB,OAAO;IACXC,KAAK,EAAEhB,WAAW,IAAI,EAAG;IACzBiB,IAAI,EAAC,MAAM;IACXC,QAAQ,EAAEC,CAAC,IAAI;MACblB,SAAS,CAACkB,CAAC,CAACC,MAAM,CAACJ,KAAK,IAAIK,SAAS,CAAC,CAAC,CAAC;IAC1C,CAAE;IACFC,WAAW,EAAEf;EAAU,CACxB,CACS,CAAC;AAEjB;AAEAT,UAAU,CAACyB,SAAS,GAAG;EACrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACExB,MAAM,EAAEP,SAAS,CAACgC,KAAK,CAAC;IACtBvB,SAAS,EAAET,SAAS,CAACiC,IAAI,CAACC,UAAU;IACpCxB,MAAM,EAAEV,SAAS,CAACmC,SAAS,CAAC,CAACnC,SAAS,CAACoC,WAAW,EAAEpC,SAAS,CAACqC,IAAI,CAAC,CAAC,CAACH,UAAU;IAC/EvB,cAAc,EAAEX,SAAS,CAACiC,IAAI,CAACC,UAAU;IACzC1B,WAAW,EAAER,SAAS,CAACsC;EACzB,CAAC,CAAC,CAACJ;AACL,CAAC;AAED,eAAe5B,UAAU","ignoreList":[]}
@@ -27,10 +27,9 @@ export const useRows = () => {
27
27
  * @param {Array} controlledTableSelections Selection Object and dispatch function
28
28
  * @returns
29
29
  */
30
- export const useSelectionActions = (_ref, controlledTableSelections) => {
31
- let {
32
- toggleAllRowsSelected
33
- } = _ref;
30
+ export const useSelectionActions = ({
31
+ toggleAllRowsSelected
32
+ }, controlledTableSelections) => {
34
33
  const [{
35
34
  selectedRows,
36
35
  isEntireTableSelected
@@ -53,15 +52,14 @@ export const useSelectionActions = (_ref, controlledTableSelections) => {
53
52
  * selections with API-driven data.
54
53
  *
55
54
  */
56
- export const useDataTableSelections = _ref2 => {
57
- let {
58
- selections,
59
- selectionsDispatch,
60
- itemCount,
61
- selectedRows,
62
- page,
63
- isAllPageRowsSelected
64
- } = _ref2;
55
+ export const useDataTableSelections = ({
56
+ selections,
57
+ selectionsDispatch,
58
+ itemCount,
59
+ selectedRows,
60
+ page,
61
+ isAllPageRowsSelected
62
+ }) => {
65
63
  // If "Select all" is explicitly opted in by the user, ensure that all unselected rows are selected
66
64
  // when the user navigates to a new page.
67
65
  useEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.js","names":["useContext","useEffect","DataTableContext","clearSelectionAction","setSelectedRowsAction","toggleIsEntireTableSelected","getRowIds","getUnselectedPageRows","useRows","getTableProps","prepareRow","page","rows","headerGroups","getTableBodyProps","displayRows","useSelectionActions","_ref","controlledTableSelections","toggleAllRowsSelected","selectedRows","isEntireTableSelected","dispatch","clearSelection","length","useDataTableSelections","_ref2","selections","selectionsDispatch","itemCount","isAllPageRowsSelected","isSelectAllEnabled","selectedRowIds","unselectedPageRows"],"sources":["../../src/DataTable/hooks.jsx"],"sourcesContent":["import { useContext, useEffect } from 'react';\nimport DataTableContext from './DataTableContext';\nimport { clearSelectionAction, setSelectedRowsAction, toggleIsEntireTableSelected } from './selection/data/actions';\nimport { getRowIds, getUnselectedPageRows } from './selection/data/helpers';\n\nexport const useRows = () => {\n const {\n getTableProps, prepareRow, page, rows, headerGroups, getTableBodyProps,\n } = useContext(DataTableContext);\n\n const displayRows = page || rows;\n\n return {\n getTableProps, prepareRow, displayRows, headerGroups, getTableBodyProps,\n };\n};\n\n/**\n * Hook that provides selection state functionality\n * @param {Object} param0 Table instance\n * @param {Array} controlledTableSelections Selection Object and dispatch function\n * @returns\n */\nexport const useSelectionActions = (\n { toggleAllRowsSelected },\n controlledTableSelections,\n) => {\n const [{ selectedRows, isEntireTableSelected }, dispatch] = controlledTableSelections;\n\n const clearSelection = () => {\n // if using controlled selection component DataTable.ControlledSelectionStatus\n if (selectedRows.length > 0 || isEntireTableSelected) {\n dispatch(clearSelectionAction());\n } else {\n toggleAllRowsSelected(false);\n }\n };\n\n return {\n clearSelection,\n };\n};\n\n/**\n * Provides business logic around managing selection state, notably for controlled\n * selections with API-driven data.\n *\n */\nexport const useDataTableSelections = ({\n selections,\n selectionsDispatch,\n itemCount,\n selectedRows,\n page,\n isAllPageRowsSelected,\n}) => {\n // If \"Select all\" is explicitly opted in by the user, ensure that all unselected rows are selected\n // when the user navigates to a new page.\n useEffect(\n () => {\n if (selections.isSelectAllEnabled && (itemCount > selectedRows.length || !isAllPageRowsSelected)) {\n const selectedRowIds = getRowIds(selectedRows);\n const unselectedPageRows = getUnselectedPageRows(selectedRowIds, page);\n if (unselectedPageRows.length) {\n selectionsDispatch(setSelectedRowsAction(unselectedPageRows, itemCount));\n }\n }\n },\n [selectedRows, itemCount, page, selectionsDispatch, selections.isSelectAllEnabled, isAllPageRowsSelected],\n );\n\n // When `selections.isSelectAllEnabled` is true, ensure `selections.isEntireTableSelected` is true.\n useEffect(() => {\n if (selections.isSelectAllEnabled && !selections.isEntireTableSelected) {\n selectionsDispatch(toggleIsEntireTableSelected());\n }\n }, [selectionsDispatch, selections.isEntireTableSelected, selections.isSelectAllEnabled]);\n\n // When `selections.isSelectAllEnabled` differs from `selections.isEntireTableSelected` and\n // `isAllPageRowsSelected` matches `selections.isSelectAllEnabled`, toggle `selections.isEntireTableSelected`.\n useEffect(() => {\n if (!selections.isSelectAllEnabled && selections.isEntireTableSelected && !isAllPageRowsSelected) {\n selectionsDispatch(toggleIsEntireTableSelected());\n }\n if (selections.isSelectAllEnabled && !selections.isEntireTableSelected && isAllPageRowsSelected) {\n selectionsDispatch(toggleIsEntireTableSelected());\n }\n }, [\n selectionsDispatch,\n isAllPageRowsSelected,\n selections.isEntireTableSelected,\n selections.isSelectAllEnabled,\n ]);\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,SAAS,QAAQ,OAAO;AAC7C,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,oBAAoB,EAAEC,qBAAqB,EAAEC,2BAA2B,QAAQ,0BAA0B;AACnH,SAASC,SAAS,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AAMa,kBAAkB,GAAG1B,qBAAqB,CAACyB,cAAc,EAAErB,IAAI,CAAC;MACtE,IAAIsB,kBAAkB,CAACT,MAAM,EAAE;QAC7BI,kBAAkB,CAACxB,qBAAqB,CAAC6B,kBAAkB,EAAEJ,SAAS,CAAC,CAAC;MAC1E;IACF;EACF,CAAC,EACD,CAACT,YAAY,EAAES,SAAS,EAAElB,IAAI,EAAEiB,kBAAkB,EAAED,UAAU,CAACI,kBAAkB,EAAED,qBAAqB,CAC1G,CAAC;;EAED;EACA7B,SAAS,CAAC,MAAM;IACd,IAAI0B,UAAU,CAACI,kBAAkB,IAAI,CAACJ,UAAU,CAACN,qBAAqB,EAAE;MACtEO,kBAAkB,CAACvB,2BAA2B,CAAC,CAAC,CAAC;IACnD;EACF,CAAC,EAAE,CAACuB,kBAAkB,EAAED,UAAU,CAACN,qBAAqB,EAAEM,UAAU,CAACI,kBAAkB,CAAC,CAAC;;EAEzF;EACA;EACA9B,SAAS,CAAC,MAAM;IACd,IAAI,CAAC0B,UAAU,CAACI,kBAAkB,IAAIJ,UAAU,CAACN,qBAAqB,IAAI,CAACS,qBAAqB,EAAE;MAChGF,kBAAkB,CAACvB,2BAA2B,CAAC,CAAC,CAAC;IACnD;IACA,IAAIsB,UAAU,CAACI,kBAAkB,IAAI,CAACJ,UAAU,CAACN,qBAAqB,IAAIS,qBAAqB,EAAE;MAC/FF,kBAAkB,CAACvB,2BAA2B,CAAC,CAAC,CAAC;IACnD;EACF,CAAC,EAAE,CACDuB,kBAAkB,EAClBE,qBAAqB,EACrBH,UAAU,CAACN,qBAAqB,EAChCM,UAAU,CAACI,kBAAkB,CAC9B,CAAC;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"hooks.js","names":["useContext","useEffect","DataTableContext","clearSelectionAction","setSelectedRowsAction","toggleIsEntireTableSelected","getRowIds","getUnselectedPageRows","useRows","getTableProps","prepareRow","page","rows","headerGroups","getTableBodyProps","displayRows","useSelectionActions","toggleAllRowsSelected","controlledTableSelections","selectedRows","isEntireTableSelected","dispatch","clearSelection","length","useDataTableSelections","selections","selectionsDispatch","itemCount","isAllPageRowsSelected","isSelectAllEnabled","selectedRowIds","unselectedPageRows"],"sources":["../../src/DataTable/hooks.jsx"],"sourcesContent":["import { useContext, useEffect } from 'react';\nimport DataTableContext from './DataTableContext';\nimport { clearSelectionAction, setSelectedRowsAction, toggleIsEntireTableSelected } from './selection/data/actions';\nimport { getRowIds, getUnselectedPageRows } from './selection/data/helpers';\n\nexport const useRows = () => {\n const {\n getTableProps, prepareRow, page, rows, headerGroups, getTableBodyProps,\n } = useContext(DataTableContext);\n\n const displayRows = page || rows;\n\n return {\n getTableProps, prepareRow, displayRows, headerGroups, getTableBodyProps,\n };\n};\n\n/**\n * Hook that provides selection state functionality\n * @param {Object} param0 Table instance\n * @param {Array} controlledTableSelections Selection Object and dispatch function\n * @returns\n */\nexport const useSelectionActions = (\n { toggleAllRowsSelected },\n controlledTableSelections,\n) => {\n const [{ selectedRows, isEntireTableSelected }, dispatch] = controlledTableSelections;\n\n const clearSelection = () => {\n // if using controlled selection component DataTable.ControlledSelectionStatus\n if (selectedRows.length > 0 || isEntireTableSelected) {\n dispatch(clearSelectionAction());\n } else {\n toggleAllRowsSelected(false);\n }\n };\n\n return {\n clearSelection,\n };\n};\n\n/**\n * Provides business logic around managing selection state, notably for controlled\n * selections with API-driven data.\n *\n */\nexport const useDataTableSelections = ({\n selections,\n selectionsDispatch,\n itemCount,\n selectedRows,\n page,\n isAllPageRowsSelected,\n}) => {\n // If \"Select all\" is explicitly opted in by the user, ensure that all unselected rows are selected\n // when the user navigates to a new page.\n useEffect(\n () => {\n if (selections.isSelectAllEnabled && (itemCount > selectedRows.length || !isAllPageRowsSelected)) {\n const selectedRowIds = getRowIds(selectedRows);\n const unselectedPageRows = getUnselectedPageRows(selectedRowIds, page);\n if (unselectedPageRows.length) {\n selectionsDispatch(setSelectedRowsAction(unselectedPageRows, itemCount));\n }\n }\n },\n [selectedRows, itemCount, page, selectionsDispatch, selections.isSelectAllEnabled, isAllPageRowsSelected],\n );\n\n // When `selections.isSelectAllEnabled` is true, ensure `selections.isEntireTableSelected` is true.\n useEffect(() => {\n if (selections.isSelectAllEnabled && !selections.isEntireTableSelected) {\n selectionsDispatch(toggleIsEntireTableSelected());\n }\n }, [selectionsDispatch, selections.isEntireTableSelected, selections.isSelectAllEnabled]);\n\n // When `selections.isSelectAllEnabled` differs from `selections.isEntireTableSelected` and\n // `isAllPageRowsSelected` matches `selections.isSelectAllEnabled`, toggle `selections.isEntireTableSelected`.\n useEffect(() => {\n if (!selections.isSelectAllEnabled && selections.isEntireTableSelected && !isAllPageRowsSelected) {\n selectionsDispatch(toggleIsEntireTableSelected());\n }\n if (selections.isSelectAllEnabled && !selections.isEntireTableSelected && isAllPageRowsSelected) {\n selectionsDispatch(toggleIsEntireTableSelected());\n }\n }, [\n selectionsDispatch,\n isAllPageRowsSelected,\n selections.isEntireTableSelected,\n selections.isSelectAllEnabled,\n ]);\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,SAAS,QAAQ,OAAO;AAC7C,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,oBAAoB,EAAEC,qBAAqB,EAAEC,2BAA2B,QAAQ,0BAA0B;AACnH,SAASC,SAAS,EAAEC,qBAAqB,QAAQ,0BAA0B;AAE3E,OAAO,MAAMC,OAAO,GAAGA,CAAA,KAAM;EAC3B,MAAM;IACJC,aAAa;IAAEC,UAAU;IAAEC,IAAI;IAAEC,IAAI;IAAEC,YAAY;IAAEC;EACvD,CAAC,GAAGd,UAAU,CAACE,gBAAgB,CAAC;EAEhC,MAAMa,WAAW,GAAGJ,IAAI,IAAIC,IAAI;EAEhC,OAAO;IACLH,aAAa;IAAEC,UAAU;IAAEK,WAAW;IAAEF,YAAY;IAAEC;EACxD,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,mBAAmB,GAAGA,CACjC;EAAEC;AAA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