@gen3/frontend 0.11.1 → 0.11.12

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 (258) hide show
  1. package/dist/cjs/index.js +1068 -749
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/dts/components/Buttons/ActionButton.js +1 -1
  4. package/dist/dts/components/Buttons/ActionButton.js.map +1 -1
  5. package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.js +1 -1
  6. package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.js.map +1 -1
  7. package/dist/dts/components/Buttons/DropdownButtons/DropdownButton.js +1 -1
  8. package/dist/dts/components/Buttons/DropdownButtons/DropdownButton.js.map +1 -1
  9. package/dist/dts/components/Buttons/UploadJSONButton.js +1 -1
  10. package/dist/dts/components/Buttons/UploadJSONButton.js.map +1 -1
  11. package/dist/dts/components/MessageCards/ErrorMessage.js +1 -1
  12. package/dist/dts/components/MessageCards/ErrorMessage.js.map +1 -1
  13. package/dist/dts/components/Providers/Gen3Provider.js +1 -1
  14. package/dist/dts/components/Providers/Gen3Provider.js.map +1 -1
  15. package/dist/dts/components/charts/Charts.js +1 -1
  16. package/dist/dts/components/charts/Charts.js.map +1 -1
  17. package/dist/dts/components/charts/echarts/HorizontalBarChart.d.ts +1 -1
  18. package/dist/dts/components/charts/echarts/HorizontalBarChart.d.ts.map +1 -1
  19. package/dist/dts/components/charts/echarts/HorizontalBarChart.js +8 -4
  20. package/dist/dts/components/charts/echarts/HorizontalBarChart.js.map +1 -1
  21. package/dist/dts/components/counts/CountsValue.d.ts.map +1 -1
  22. package/dist/dts/components/counts/CountsValue.js +2 -2
  23. package/dist/dts/components/counts/CountsValue.js.map +1 -1
  24. package/dist/dts/components/facets/FacetControlsHeader.js +1 -1
  25. package/dist/dts/components/facets/FacetControlsHeader.js.map +1 -1
  26. package/dist/dts/components/facets/FacetEnumList.js +1 -1
  27. package/dist/dts/components/facets/FacetEnumList.js.map +1 -1
  28. package/dist/dts/components/facets/FacetSelectionModal.d.ts +1 -2
  29. package/dist/dts/components/facets/FacetSelectionModal.d.ts.map +1 -1
  30. package/dist/dts/components/facets/FacetSelectionModal.js.map +1 -1
  31. package/dist/dts/components/facets/FacetSelector.d.ts +1 -2
  32. package/dist/dts/components/facets/FacetSelector.d.ts.map +1 -1
  33. package/dist/dts/components/facets/FacetSelector.js +1 -1
  34. package/dist/dts/components/facets/FacetSelector.js.map +1 -1
  35. package/dist/dts/components/facets/FacetTabs.d.ts +1 -2
  36. package/dist/dts/components/facets/FacetTabs.d.ts.map +1 -1
  37. package/dist/dts/components/facets/FacetTabs.js +1 -1
  38. package/dist/dts/components/facets/FacetTabs.js.map +1 -1
  39. package/dist/dts/components/facets/FiltersPanel.d.ts +9 -0
  40. package/dist/dts/components/facets/FiltersPanel.d.ts.map +1 -0
  41. package/dist/dts/{features/CohortBuilder → components/facets}/FiltersPanel.js +3 -2
  42. package/dist/dts/components/facets/FiltersPanel.js.map +1 -0
  43. package/dist/dts/components/facets/Panels/AccordianPanel.d.ts.map +1 -0
  44. package/dist/dts/{features/CohortBuilder → components/facets}/Panels/AccordianPanel.js +2 -2
  45. package/dist/dts/components/facets/Panels/AccordianPanel.js.map +1 -0
  46. package/dist/dts/components/facets/Panels/DropdownPanel.d.ts.map +1 -0
  47. package/dist/dts/{features/CohortBuilder → components/facets}/Panels/DropdownPanel.js +4 -4
  48. package/dist/dts/components/facets/Panels/DropdownPanel.js.map +1 -0
  49. package/dist/dts/components/facets/Panels/TabbedPanel.d.ts +4 -0
  50. package/dist/dts/components/facets/Panels/TabbedPanel.d.ts.map +1 -0
  51. package/dist/dts/{features/CohortBuilder → components/facets}/Panels/TabbedPanel.js +3 -2
  52. package/dist/dts/components/facets/Panels/TabbedPanel.js.map +1 -0
  53. package/dist/dts/components/facets/Panels/index.d.ts +5 -0
  54. package/dist/dts/components/facets/Panels/index.d.ts.map +1 -0
  55. package/dist/dts/components/facets/Panels/index.js +5 -0
  56. package/dist/dts/components/facets/Panels/index.js.map +1 -0
  57. package/dist/dts/{features/CohortBuilder → components/facets}/Panels/types.d.ts +4 -3
  58. package/dist/dts/components/facets/Panels/types.d.ts.map +1 -0
  59. package/dist/dts/components/facets/Panels/types.js.map +1 -0
  60. package/dist/dts/components/facets/createFacetCard.d.ts +1 -2
  61. package/dist/dts/components/facets/createFacetCard.d.ts.map +1 -1
  62. package/dist/dts/components/facets/createFacetCard.js.map +1 -1
  63. package/dist/dts/components/facets/createFacetCards.d.ts +1 -2
  64. package/dist/dts/components/facets/createFacetCards.d.ts.map +1 -1
  65. package/dist/dts/components/facets/createFacetCards.js.map +1 -1
  66. package/dist/dts/components/facets/index.d.ts +6 -1
  67. package/dist/dts/components/facets/index.d.ts.map +1 -1
  68. package/dist/dts/components/facets/index.js +6 -1
  69. package/dist/dts/components/facets/index.js.map +1 -1
  70. package/dist/dts/components/facets/types.d.ts +13 -2
  71. package/dist/dts/components/facets/types.d.ts.map +1 -1
  72. package/dist/dts/components/facets/utils.d.ts +2 -2
  73. package/dist/dts/components/facets/utils.d.ts.map +1 -1
  74. package/dist/dts/components/facets/utils.js +1 -1
  75. package/dist/dts/components/facets/utils.js.map +1 -1
  76. package/dist/dts/features/Analysis/AnalysisCard.js +1 -1
  77. package/dist/dts/features/Analysis/AnalysisCard.js.map +1 -1
  78. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts +16 -16
  79. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts.map +1 -1
  80. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.js +1 -1
  81. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.js.map +1 -1
  82. package/dist/dts/features/CohortBuilder/CohortPanel.d.ts.map +1 -1
  83. package/dist/dts/features/CohortBuilder/CohortPanel.js +1 -1
  84. package/dist/dts/features/CohortBuilder/CohortPanel.js.map +1 -1
  85. package/dist/dts/features/CohortBuilder/CohortSelector.js +1 -1
  86. package/dist/dts/features/CohortBuilder/CohortSelector.js.map +1 -1
  87. package/dist/dts/features/CohortBuilder/DownloadsPanel.js +1 -1
  88. package/dist/dts/features/CohortBuilder/DownloadsPanel.js.map +1 -1
  89. package/dist/dts/features/CohortBuilder/ExplorerTable/ArrayCellRenderer.d.ts +1 -1
  90. package/dist/dts/features/CohortBuilder/ExplorerTable/SubTables/ExpandingSubtable.js +1 -1
  91. package/dist/dts/features/CohortBuilder/ExplorerTable/SubTables/ExpandingSubtable.js.map +1 -1
  92. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.js +1 -1
  93. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.js.map +1 -1
  94. package/dist/dts/features/CohortBuilder/TabbedCohortBuilder.d.ts.map +1 -1
  95. package/dist/dts/features/CohortBuilder/TabbedCohortBuilder.js +32 -41
  96. package/dist/dts/features/CohortBuilder/TabbedCohortBuilder.js.map +1 -1
  97. package/dist/dts/features/CohortBuilder/types.d.ts +2 -2
  98. package/dist/dts/features/CohortBuilder/types.d.ts.map +1 -1
  99. package/dist/dts/features/CohortBuilder/types.js.map +1 -1
  100. package/dist/dts/features/CohortDiscovery/ChartsAndFacetsPanel.d.ts +2 -1
  101. package/dist/dts/features/CohortDiscovery/ChartsAndFacetsPanel.d.ts.map +1 -1
  102. package/dist/dts/features/CohortDiscovery/ChartsAndFacetsPanel.js.map +1 -1
  103. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortManager.js +1 -1
  104. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortManager.js.map +1 -1
  105. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortManagerSelectors.d.ts +16 -16
  106. package/dist/dts/features/CohortDiscovery/FacetDefinitionsSlice.d.ts +1 -1
  107. package/dist/dts/features/CohortDiscovery/FacetDefinitionsSlice.d.ts.map +1 -1
  108. package/dist/dts/features/CohortDiscovery/FilterPanels/EnumFacetPanel.d.ts +1 -2
  109. package/dist/dts/features/CohortDiscovery/FilterPanels/EnumFacetPanel.d.ts.map +1 -1
  110. package/dist/dts/features/CohortDiscovery/FilterPanels/EnumFacetPanel.js.map +1 -1
  111. package/dist/dts/features/CohortDiscovery/FilterPanels/createFacetPanel.d.ts +2 -2
  112. package/dist/dts/features/CohortDiscovery/FilterPanels/createFacetPanel.d.ts.map +1 -1
  113. package/dist/dts/features/CohortDiscovery/FilterPanels/createFacetPanel.js.map +1 -1
  114. package/dist/dts/features/CohortDiscovery/RequestManagerSlice.d.ts +7 -7
  115. package/dist/dts/features/CohortDiscovery/SavedCohorts/SavedCohortsTable.js +1 -1
  116. package/dist/dts/features/CohortDiscovery/SavedCohorts/SavedCohortsTable.js.map +1 -1
  117. package/dist/dts/features/CohortDiscovery/appApi.d.ts +2 -2
  118. package/dist/dts/features/DataLibrary/DatasetAccordionControl.js +1 -1
  119. package/dist/dts/features/DataLibrary/DatasetAccordionControl.js.map +1 -1
  120. package/dist/dts/features/DataLibrary/SearchAndActions.js +1 -1
  121. package/dist/dts/features/DataLibrary/SearchAndActions.js.map +1 -1
  122. package/dist/dts/features/DataLibrary/modals/SelectedItemsModal.js +1 -1
  123. package/dist/dts/features/DataLibrary/modals/SelectedItemsModal.js.map +1 -1
  124. package/dist/dts/features/DataLibrary/tables/SelectedItemsTable.js +1 -1
  125. package/dist/dts/features/DataLibrary/tables/SelectedItemsTable.js.map +1 -1
  126. package/dist/dts/features/Dictionary/CategoryHeader.js +1 -1
  127. package/dist/dts/features/Dictionary/CategoryHeader.js.map +1 -1
  128. package/dist/dts/features/Discovery/types.d.ts +1 -0
  129. package/dist/dts/features/Discovery/types.d.ts.map +1 -1
  130. package/dist/dts/features/Discovery/types.js.map +1 -1
  131. package/dist/dts/features/Navigation/NavigationBarButton.d.ts.map +1 -1
  132. package/dist/dts/features/Navigation/NavigationBarButton.js +3 -3
  133. package/dist/dts/features/Navigation/NavigationBarButton.js.map +1 -1
  134. package/dist/dts/features/Navigation/TopBar/AccountButton.d.ts.map +1 -1
  135. package/dist/dts/features/Navigation/TopBar/AccountButton.js.map +1 -1
  136. package/dist/dts/features/Navigation/TopBar/IconButton.js +1 -1
  137. package/dist/dts/features/Navigation/TopBar/IconButton.js.map +1 -1
  138. package/dist/dts/features/Workspace/NotebookCard.js +1 -1
  139. package/dist/dts/features/Workspace/NotebookCard.js.map +1 -1
  140. package/dist/dts/index.d.ts +3 -1
  141. package/dist/dts/index.d.ts.map +1 -1
  142. package/dist/dts/index.js +3 -1
  143. package/dist/dts/index.js.map +1 -1
  144. package/dist/dts/pages/TabbedCohortBuilder/TabbedCohortBuilderPage.d.ts.map +1 -1
  145. package/dist/dts/pages/TabbedCohortBuilder/TabbedCohortBuilderPage.js +4 -2
  146. package/dist/dts/pages/TabbedCohortBuilder/TabbedCohortBuilderPage.js.map +1 -1
  147. package/dist/dts/utils/strings.d.ts +1 -0
  148. package/dist/dts/utils/strings.d.ts.map +1 -1
  149. package/dist/dts/utils/strings.js +29 -0
  150. package/dist/dts/utils/strings.js.map +1 -1
  151. package/dist/esm/index.js +1068 -756
  152. package/dist/esm/index.js.map +1 -1
  153. package/dist/index.d.ts +136 -5
  154. package/dist/tsconfig.tsbuildinfo +1 -1
  155. package/package.json +5 -5
  156. package/dist/dts/api/staticNotebook/index.d.ts +0 -4
  157. package/dist/dts/api/staticNotebook/index.d.ts.map +0 -1
  158. package/dist/dts/api/staticNotebook/index.js +0 -118
  159. package/dist/dts/api/staticNotebook/index.js.map +0 -1
  160. package/dist/dts/api/staticNotebooks/index.d.ts +0 -4
  161. package/dist/dts/api/staticNotebooks/index.d.ts.map +0 -1
  162. package/dist/dts/api/staticNotebooks/index.js +0 -118
  163. package/dist/dts/api/staticNotebooks/index.js.map +0 -1
  164. package/dist/dts/features/CohortBuilder/FiltersPanel.d.ts +0 -10
  165. package/dist/dts/features/CohortBuilder/FiltersPanel.d.ts.map +0 -1
  166. package/dist/dts/features/CohortBuilder/FiltersPanel.js.map +0 -1
  167. package/dist/dts/features/CohortBuilder/Panels/AccordianPanel.d.ts.map +0 -1
  168. package/dist/dts/features/CohortBuilder/Panels/AccordianPanel.js.map +0 -1
  169. package/dist/dts/features/CohortBuilder/Panels/DropdownPanel.d.ts.map +0 -1
  170. package/dist/dts/features/CohortBuilder/Panels/DropdownPanel.js.map +0 -1
  171. package/dist/dts/features/CohortBuilder/Panels/TabbedPanel.d.ts +0 -3
  172. package/dist/dts/features/CohortBuilder/Panels/TabbedPanel.d.ts.map +0 -1
  173. package/dist/dts/features/CohortBuilder/Panels/TabbedPanel.js.map +0 -1
  174. package/dist/dts/features/CohortBuilder/Panels/types.d.ts.map +0 -1
  175. package/dist/dts/features/CohortBuilder/Panels/types.js.map +0 -1
  176. package/dist/dts/features/CohortDiscovery/CohortManager.d.ts +0 -6
  177. package/dist/dts/features/CohortDiscovery/CohortManager.d.ts.map +0 -1
  178. package/dist/dts/features/CohortDiscovery/CohortManager.js +0 -55
  179. package/dist/dts/features/CohortDiscovery/CohortManager.js.map +0 -1
  180. package/dist/dts/features/CohortDiscovery/CohortManagerSlice.d.ts +0 -135
  181. package/dist/dts/features/CohortDiscovery/CohortManagerSlice.d.ts.map +0 -1
  182. package/dist/dts/features/CohortDiscovery/CohortManagerSlice.js +0 -40
  183. package/dist/dts/features/CohortDiscovery/CohortManagerSlice.js.map +0 -1
  184. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.d.ts +0 -3
  185. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.d.ts.map +0 -1
  186. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.js +0 -9
  187. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.js.map +0 -1
  188. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.d.ts +0 -7
  189. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.d.ts.map +0 -1
  190. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.js +0 -101
  191. package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.js.map +0 -1
  192. package/dist/dts/features/CohortDiscovery/appApiRTKQ.d.ts +0 -1
  193. package/dist/dts/features/CohortDiscovery/appApiRTKQ.d.ts.map +0 -1
  194. package/dist/dts/features/CohortDiscovery/appApiRTKQ.js +0 -101
  195. package/dist/dts/features/CohortDiscovery/appApiRTKQ.js.map +0 -1
  196. package/dist/dts/features/Discovery/Charts/ChartsPanel.d.ts +0 -9
  197. package/dist/dts/features/Discovery/Charts/ChartsPanel.d.ts.map +0 -1
  198. package/dist/dts/features/Discovery/Charts/ChartsPanel.js +0 -24
  199. package/dist/dts/features/Discovery/Charts/ChartsPanel.js.map +0 -1
  200. package/dist/dts/features/Discovery/Charts/CollapsableChartsPanel.d.ts +0 -9
  201. package/dist/dts/features/Discovery/Charts/CollapsableChartsPanel.d.ts.map +0 -1
  202. package/dist/dts/features/Discovery/Charts/CollapsableChartsPanel.js +0 -24
  203. package/dist/dts/features/Discovery/Charts/CollapsableChartsPanel.js.map +0 -1
  204. package/dist/dts/features/Discovery/StudyDetails/DetailsAuthorizationIcon.d.ts +0 -9
  205. package/dist/dts/features/Discovery/StudyDetails/DetailsAuthorizationIcon.d.ts.map +0 -1
  206. package/dist/dts/features/Discovery/StudyDetails/DetailsAuthorizationIcon.js +0 -12
  207. package/dist/dts/features/Discovery/StudyDetails/DetailsAuthorizationIcon.js.map +0 -1
  208. package/dist/dts/features/Discovery/StudyDetails/RendererFactory.d.ts +0 -19
  209. package/dist/dts/features/Discovery/StudyDetails/RendererFactory.d.ts.map +0 -1
  210. package/dist/dts/features/Discovery/StudyDetails/RendererFactory.js +0 -56
  211. package/dist/dts/features/Discovery/StudyDetails/RendererFactory.js.map +0 -1
  212. package/dist/dts/features/Discovery/StudyDetails/SinglePageStudyDetailsPanel.d.ts +0 -14
  213. package/dist/dts/features/Discovery/StudyDetails/SinglePageStudyDetailsPanel.d.ts.map +0 -1
  214. package/dist/dts/features/Discovery/StudyDetails/SinglePageStudyDetailsPanel.js +0 -44
  215. package/dist/dts/features/Discovery/StudyDetails/SinglePageStudyDetailsPanel.js.map +0 -1
  216. package/dist/dts/features/Discovery/StudyDetails/StudyDetails.d.ts +0 -3
  217. package/dist/dts/features/Discovery/StudyDetails/StudyDetails.d.ts.map +0 -1
  218. package/dist/dts/features/Discovery/StudyDetails/StudyDetails.js +0 -37
  219. package/dist/dts/features/Discovery/StudyDetails/StudyDetails.js.map +0 -1
  220. package/dist/dts/features/Discovery/StudyDetails/StudyDetailsPanel.d.ts +0 -10
  221. package/dist/dts/features/Discovery/StudyDetails/StudyDetailsPanel.d.ts.map +0 -1
  222. package/dist/dts/features/Discovery/StudyDetails/StudyDetailsPanel.js +0 -19
  223. package/dist/dts/features/Discovery/StudyDetails/StudyDetailsPanel.js.map +0 -1
  224. package/dist/dts/features/Discovery/StudyDetails/StudyGroup.d.ts +0 -8
  225. package/dist/dts/features/Discovery/StudyDetails/StudyGroup.d.ts.map +0 -1
  226. package/dist/dts/features/Discovery/StudyDetails/StudyGroup.js +0 -31
  227. package/dist/dts/features/Discovery/StudyDetails/StudyGroup.js.map +0 -1
  228. package/dist/dts/features/Discovery/StudyDetails/StudyGroupPanel.d.ts +0 -9
  229. package/dist/dts/features/Discovery/StudyDetails/StudyGroupPanel.d.ts.map +0 -1
  230. package/dist/dts/features/Discovery/StudyDetails/StudyGroupPanel.js +0 -11
  231. package/dist/dts/features/Discovery/StudyDetails/StudyGroupPanel.js.map +0 -1
  232. package/dist/dts/features/Discovery/StudyDetails/StudyItems.d.ts +0 -5
  233. package/dist/dts/features/Discovery/StudyDetails/StudyItems.d.ts.map +0 -1
  234. package/dist/dts/features/Discovery/StudyDetails/StudyItems.js +0 -283
  235. package/dist/dts/features/Discovery/StudyDetails/StudyItems.js.map +0 -1
  236. package/dist/dts/features/Discovery/StudyPage/DownloadLinksPanel.d.ts +0 -10
  237. package/dist/dts/features/Discovery/StudyPage/DownloadLinksPanel.d.ts.map +0 -1
  238. package/dist/dts/features/Discovery/StudyPage/DownloadLinksPanel.js +0 -45
  239. package/dist/dts/features/Discovery/StudyPage/DownloadLinksPanel.js.map +0 -1
  240. package/dist/dts/features/Discovery/StudyPage/StudyPage.d.ts +0 -10
  241. package/dist/dts/features/Discovery/StudyPage/StudyPage.d.ts.map +0 -1
  242. package/dist/dts/features/Discovery/StudyPage/StudyPage.js +0 -11
  243. package/dist/dts/features/Discovery/StudyPage/StudyPage.js.map +0 -1
  244. package/dist/dts/features/Discovery/StudyPage/StudyPageGroup.d.ts +0 -9
  245. package/dist/dts/features/Discovery/StudyPage/StudyPageGroup.d.ts.map +0 -1
  246. package/dist/dts/features/Discovery/StudyPage/StudyPageGroup.js +0 -8
  247. package/dist/dts/features/Discovery/StudyPage/StudyPageGroup.js.map +0 -1
  248. package/dist/dts/features/StaticNotebook/StaticNotebook.d.ts +0 -4
  249. package/dist/dts/features/StaticNotebook/StaticNotebook.d.ts.map +0 -1
  250. package/dist/dts/features/StaticNotebook/StaticNotebook.js +0 -79
  251. package/dist/dts/features/StaticNotebook/StaticNotebook.js.map +0 -1
  252. package/dist/dts/lib/notebooks/index.d.ts +0 -3
  253. package/dist/dts/lib/notebooks/index.d.ts.map +0 -1
  254. package/dist/dts/lib/notebooks/index.js +0 -96
  255. package/dist/dts/lib/notebooks/index.js.map +0 -1
  256. /package/dist/dts/{features/CohortBuilder → components/facets}/Panels/AccordianPanel.d.ts +0 -0
  257. /package/dist/dts/{features/CohortBuilder → components/facets}/Panels/DropdownPanel.d.ts +0 -0
  258. /package/dist/dts/{features/CohortBuilder → components/facets}/Panels/types.js +0 -0
package/dist/esm/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import React__default, { createContext, useState, useMemo, useEffect, useCallback, useContext, useRef, createElement, forwardRef, useReducer } from 'react';
4
- import { useUserAuth, useCoreSelector, selectUserDetails, useGetAuthzMappingsQuery, fetchFence, isFetchError, WorkspaceStatus, useGetWorkspaceStatusQuery, useGetWorkspacePayModelsQuery, useTerminateWorkspaceMutation, selectRequestedWorkspaceStatus, selectRequestedWorkspaceStatusTimestamp, useCoreDispatch, setActiveWorkspaceStatus, RequestedWorkspaceStatus, setRequestedWorkspaceStatus, isTimeGreaterThan, useGetCSRFQuery, useLazyFetchUserDetailsQuery, selectUserAuthStatus, GEN3_REDIRECT_URL, GEN3_FENCE_API, showModal, Modals, isAuthenticated, useGetLoginProvidersQuery, hideModal, selectCurrentModal, fieldNameToTitle, isOperationWithField, selectShouldShareFilters, selectSharedFilters, updateCohortFilter as updateCohortFilter$1, selectIndexedFilterByName, isUnion, isOperatorWithFieldAndArrayOfOperands, extractEnumFilterValue, removeCohortFilter as removeCohortFilter$1, trimFirstFieldNameToTitle, useIsUserLoggedIn, GEN3_DOMAIN, useDataLibrary, DataLibraryStoreMode, buildListItemsGroupedByDataset, extractFileDatasetsInRecords, useGetMDSQuery, selectAuthzMappingData, useGetAggMDSQuery, useAskQuestionMutation, useGetIndexAggMDSQuery, useGetTagsQuery, setCohortFilter as setCohortFilter$1, clearCohortFilters as clearCohortFilters$1, handleOperation, selectAvailableCohorts, selectCurrentCohortId as selectCurrentCohortId$1, selectCohortFilters, selectCurrentCohortModified, selectCurrentCohortSaved, setCohortIndexFilters, setActiveCohort, toggleCohortBuilderCategoryFilter, selectCohortFilterExpanded, setCohortFilterCombineMode, selectCohortFilterCombineMode, selectCurrentCohortName as selectCurrentCohortName$1, useGeneralGQLQuery, selectIndexFilters, useGetRawDataAndTotalCountsQuery, isJSONValue, downloadFromGuppyToBlob, downloadJSONDataFromGuppy, Accessibility, selectAllCohortFiltersCollapsed, toggleCohortBuilderAllFilters, setShouldShareFilters, useGetAggsQuery, useGetAggsNoFilterSelfQuery, isIntersection, useGetCountsQuery, setSharedFilters, usePrevious, selectHeadersWithCSRFToken, GEN3_GUPPY_API, useLaunchWorkspaceMutation, selectActiveWorkspaceStatus, isFetchBaseQueryError, setActiveWorkspace, getCurrentTimestamp, selectWorkspaceStatusFromService, selectActiveWorkspaceId, useGetWorkspaceOptionsQuery, GEN3_WORKSPACE_API, useGetExternalLoginsQuery, useSetCurrentPayModelMutation, PodStatus, PodConditionType, isWorkspaceRunningOrStopping, GEN3_API, GEN3_COMMONS_NAME, getTimestamp, createAppStore, getRemoteSupportServiceRegistry, isHttpStatusError, MissingServiceConfigurationError, useLazyGetAggsNoFilterSelfQuery, useCreateRequestMutation, buildGetAggregationQuery, processHistogramResponse, roundHistogramResponse, selectCSRFToken, useUserRequestQuery, getGen3AppId, createGen3AppWithOwnStore, createAppApiForRTKQ, useGetDictionaryQuery, useGetMetadataByIdQuery, createGen3App, CoreProvider, fetchJSONDataFromURL, HttpMethod, groupSharedFields, useGetCredentialsQuery, useRemoveCredentialMutation, useAddNewCredentialMutation, useGetProjectsDetailsQuery, useGetSubmissionsQuery, isCohortItem, isFileItem, fetchFencePresignedURL, HTTPError, getFederatedLoginStatus, queryMultipleMDSRecords, GEN3_MANIFEST_API, extractIndexFromDataLibraryCohort, isFilterSet, getNumberOfItemsInDatalist, isAdditionalDataItem, useLazyGetCrosswalkDataQuery } from '@gen3/core';
5
- import { LoadingOverlay, Card, Group, Avatar, Text, Checkbox, Stack, Center, Loader, Tooltip, UnstyledButton, ThemeIcon, Box, Select, Button, Divider, Textarea, FileButton, Anchor, Modal, Grid, Table, ColorSwatch, useMantineTheme, Accordion, Switch, ActionIcon, Badge, TextInput, SegmentedControl, NumberInput, RangeSlider, MultiSelect, SimpleGrid, Highlight, MantineProvider, Tabs, Flex, Menu, Alert, Drawer, CopyButton, factory, useProps, getStyleObject, Paper, useCombobox, Combobox, ScrollArea, Autocomplete, Title, Transition, rem, Stepper, Image as Image$1, NavLink, List, createTheme, Pagination, FileInput, CloseButton } from '@mantine/core';
4
+ import { useUserAuth, useCoreSelector, selectUserDetails, useGetAuthzMappingsQuery, fetchFence, isFetchError, WorkspaceStatus, useGetWorkspaceStatusQuery, useGetWorkspacePayModelsQuery, useTerminateWorkspaceMutation, selectRequestedWorkspaceStatus, selectRequestedWorkspaceStatusTimestamp, useCoreDispatch, setActiveWorkspaceStatus, RequestedWorkspaceStatus, setRequestedWorkspaceStatus, isTimeGreaterThan, useGetCSRFQuery, useLazyFetchUserDetailsQuery, selectUserAuthStatus, GEN3_REDIRECT_URL, GEN3_FENCE_API, showModal, Modals, isAuthenticated, useGetLoginProvidersQuery, hideModal, selectCurrentModal, fieldNameToTitle, isOperationWithField, selectShouldShareFilters, selectSharedFilters, updateCohortFilter as updateCohortFilter$1, selectIndexedFilterByName, isUnion, isOperatorWithFieldAndArrayOfOperands, extractEnumFilterValue, removeCohortFilter as removeCohortFilter$1, trimFirstFieldNameToTitle, selectAllCohortFiltersCollapsed, Accessibility, toggleCohortBuilderAllFilters, setShouldShareFilters, useIsUserLoggedIn, GEN3_DOMAIN, useDataLibrary, DataLibraryStoreMode, buildListItemsGroupedByDataset, extractFileDatasetsInRecords, useGetMDSQuery, selectAuthzMappingData, useGetAggMDSQuery, useAskQuestionMutation, useGetIndexAggMDSQuery, useGetTagsQuery, setCohortFilter as setCohortFilter$1, clearCohortFilters as clearCohortFilters$1, handleOperation, selectAvailableCohorts, selectCurrentCohortId as selectCurrentCohortId$1, selectCohortFilters, selectCurrentCohortModified, selectCurrentCohortSaved, setCohortIndexFilters, setActiveCohort, setCohortFilterCombineMode, selectCohortFilterCombineMode, toggleCohortBuilderCategoryFilter, selectCohortFilterExpanded, selectCurrentCohortName as selectCurrentCohortName$1, useGeneralGQLQuery, selectIndexFilters, useGetRawDataAndTotalCountsQuery, isJSONValue, downloadFromGuppyToBlob, downloadJSONDataFromGuppy, useGetAggsQuery, useGetAggsNoFilterSelfQuery, isIntersection, useGetCountsQuery, setSharedFilters, usePrevious, selectHeadersWithCSRFToken, GEN3_GUPPY_API, useLaunchWorkspaceMutation, selectActiveWorkspaceStatus, isFetchBaseQueryError, setActiveWorkspace, getCurrentTimestamp, selectWorkspaceStatusFromService, selectActiveWorkspaceId, useGetWorkspaceOptionsQuery, GEN3_WORKSPACE_API, useGetExternalLoginsQuery, useSetCurrentPayModelMutation, PodStatus, PodConditionType, isWorkspaceRunningOrStopping, GEN3_API, GEN3_COMMONS_NAME, getTimestamp, createAppStore, getRemoteSupportServiceRegistry, isHttpStatusError, MissingServiceConfigurationError, useLazyGetAggsNoFilterSelfQuery, useCreateRequestMutation, buildGetAggregationQuery, processHistogramResponse, roundHistogramResponse, selectCSRFToken, useUserRequestQuery, getGen3AppId, createGen3AppWithOwnStore, createAppApiForRTKQ, useGetDictionaryQuery, useGetMetadataByIdQuery, createGen3App, CoreProvider, fetchJSONDataFromURL, HttpMethod, groupSharedFields, useGetCredentialsQuery, useRemoveCredentialMutation, useAddNewCredentialMutation, useGetProjectsDetailsQuery, useGetSubmissionsQuery, isCohortItem, isFileItem, fetchFencePresignedURL, HTTPError, getFederatedLoginStatus, queryMultipleMDSRecords, GEN3_MANIFEST_API, extractIndexFromDataLibraryCohort, isFilterSet, getNumberOfItemsInDatalist, isAdditionalDataItem, useLazyGetCrosswalkDataQuery } from '@gen3/core';
5
+ import { LoadingOverlay, Card, Group, Avatar, Text, Checkbox, Stack, Center, Loader, Tooltip, UnstyledButton, ThemeIcon, Box, Select, Button, Divider, Textarea, FileButton, Anchor, Modal, Grid, Table, ColorSwatch, useMantineTheme, Accordion, Switch, SegmentedControl as SegmentedControl$1, ActionIcon, Badge, TextInput, NumberInput, RangeSlider, MultiSelect, Tabs, SimpleGrid, Highlight, MantineProvider, Flex, Menu, Alert, Drawer, CopyButton, factory, useProps, getStyleObject, Paper, useCombobox, Combobox, ScrollArea, Autocomplete, Title, Transition, rem, Stepper, Image as Image$1, NavLink, List, createTheme, Pagination, FileInput, CloseButton } from '@mantine/core';
6
6
  import { useDeepCompareEffect, useDeepCompareMemo, useDeepCompareCallback } from 'use-deep-compare';
7
7
  import { useRouter } from 'next/router';
8
8
  import { usePathname } from 'next/navigation';
9
- import { MdLogin, MdClose, MdExpandLess, MdExpandMore, MdSearch, MdFlip, MdAddCircle, MdRemoveCircle, MdLockOutline, MdLibraryAdd, MdAdd, MdKeyboardDoubleArrowLeft, MdUndo, MdInfo, MdOutlineArrowBack, MdOutlineArrowForward, MdKeyboardArrowDown, MdKeyboardArrowUp, MdDownload, MdGroup, MdOutlineBarChart, MdOutlineSearch, MdFormatQuote, MdDelete, MdOutlineRemoveCircle } from 'react-icons/md';
9
+ import { MdLogin, MdClose, MdAddCircle, MdRemoveCircle, MdExpandLess, MdExpandMore, MdSearch, MdFlip, MdLockOutline, MdLibraryAdd, MdAdd, MdKeyboardDoubleArrowLeft, MdUndo, MdInfo, MdOutlineArrowBack, MdOutlineArrowForward, MdKeyboardArrowDown, MdKeyboardArrowUp, MdDownload, MdGroup, MdOutlineBarChart, MdOutlineSearch, MdFormatQuote, MdDelete, MdOutlineRemoveCircle } from 'react-icons/md';
10
10
  import { getCookie, deleteCookie, setCookie } from 'cookies-next';
11
11
  import useSWR from 'swr';
12
12
  import { errors, importSPKI, jwtVerify, decodeJwt } from 'jose';
@@ -22,13 +22,15 @@ import { useCookies } from 'react-cookie';
22
22
  import FileSaver from 'file-saver';
23
23
  import { useClipboard, useResizeObserver, useDisclosure, useElementSize, useDidUpdate, mergeRefs, useReducedMotion, useMediaQuery, useFullscreen, useLocalStorage, useScrollIntoView, getHotkeyHandler } from '@mantine/hooks';
24
24
  import { defaultComposer } from 'default-composer';
25
- import { Icon, addCollection } from '@iconify/react';
25
+ import { Icon, addCollection } from '@iconify-icon/react';
26
26
  import { init, getInstanceByDom, graphic } from 'echarts';
27
27
  import { VictoryChart, VictoryTheme, VictoryAxis, VictoryStack, VictoryBar, Bar, VictoryTooltip, VictoryContainer } from 'victory';
28
- import { FaUndo, FaPlus, FaExternalLinkAlt, FaExclamationTriangle, FaExclamation, FaQuestion, FaUser, FaExclamationCircle, FaRegStopCircle, FaChartPie, FaCircle, FaCheck, FaVideo, FaRegQuestionCircle, FaGraduationCap, FaRedo, FaUpload, FaDownload } from 'react-icons/fa';
29
28
  import tw from 'tailwind-styled-components';
29
+ import { useForm, isEmail, isNotEmpty } from '@mantine/form';
30
30
  import { RiCloseCircleLine } from 'react-icons/ri';
31
+ import { FaUndo, FaPlus, FaExternalLinkAlt, FaExclamationTriangle, FaExclamation, FaQuestion, FaUser, FaExclamationCircle, FaRegStopCircle, FaChartPie, FaCircle, FaCheck, FaVideo, FaRegQuestionCircle, FaGraduationCap, FaRedo, FaUpload, FaDownload } from 'react-icons/fa';
31
32
  import { PiCaretUpFill, PiCaretDownFill, PiCaretUpDownFill, PiDotsThreeCircleThin, PiTrash, PiSparkleFill, PiCaretCircleDownFill } from 'react-icons/pi';
33
+ import { modals, ModalsProvider } from '@mantine/modals';
32
34
  import Image from 'next/image';
33
35
  import Link from 'next/link';
34
36
  import { AiOutlineLogin } from 'react-icons/ai';
@@ -44,7 +46,6 @@ import uniq from 'lodash/uniq';
44
46
  import sum from 'lodash/sum';
45
47
  import { LuCircleSlash, LuClock, LuLock, LuUnlock } from 'react-icons/lu';
46
48
  import 'universal-cookie';
47
- import { modals, ModalsProvider } from '@mantine/modals';
48
49
  import GraphiQL from 'graphiql';
49
50
  import { useRouter as useRouter$1 } from 'next/dist/client/router';
50
51
  import fs from 'fs';
@@ -55,7 +56,6 @@ import { combineReducers } from 'redux';
55
56
  import { createSlice, nanoid, createEntityAdapter, createAsyncThunk, createSelector } from '@reduxjs/toolkit';
56
57
  import { openDB } from 'idb';
57
58
  import createWebStorage from 'redux-persist/lib/storage/createWebStorage';
58
- import { useForm, isEmail, isNotEmpty } from '@mantine/form';
59
59
  import dynamic from 'next/dynamic';
60
60
  import YAML from 'yaml';
61
61
  import { filesize } from 'filesize';
@@ -609,6 +609,27 @@ const toDisplayName = (field)=>{
609
609
  if (!fieldName) return 'NotSet';
610
610
  return fieldName.split('_').map((w)=>capitalize$1(w)).join(' ');
611
611
  };
612
+ /*
613
+ Function to convert counts to a string with units
614
+ For example: count = 100 units = 'cases' => '100 Cases'
615
+ Function should handle pluralization
616
+ */ const toCountsString = (counts, units)=>{
617
+ if (!counts) return `No ${capitalize$1(pluralize(units))}`;
618
+ // return a string with counts and units handling pluralization
619
+ const unitDisplay = counts === 1 ? units : pluralize(units);
620
+ return `${counts.toLocaleString()} ${capitalize$1(unitDisplay)}`;
621
+ };
622
+ // Helper function to handle basic pluralization
623
+ const pluralize = (word)=>{
624
+ // Handle special cases
625
+ if (word.endsWith('y')) {
626
+ return word.slice(0, -1) + 'ies';
627
+ } else if (word.endsWith('s') || word.endsWith('x') || word.endsWith('z') || word.endsWith('ch') || word.endsWith('sh')) {
628
+ return word + 'es';
629
+ } else {
630
+ return word + 's';
631
+ }
632
+ };
612
633
 
613
634
  const isArrayOfString = (value)=>{
614
635
  return Array.isArray(value) && value.every((element)=>typeof element === 'string');
@@ -2476,10 +2497,11 @@ const HorizontalBarChart = ({ data, valueType, total, showLegendInChart = true }
2476
2497
  const chartDefinition = useMemo(()=>{
2477
2498
  return {
2478
2499
  tooltip: {
2479
- trigger: 'axis',
2480
- axisPointer: {
2481
- // Use axis to trigger tooltip
2482
- type: 'shadow'
2500
+ trigger: 'item',
2501
+ formatter: function(param) {
2502
+ const p = isArray(param) && param.length > 0 ? param[0] : param;
2503
+ const colorSquare = `<span style="display:inline-block; width:10px; height:10px; background-color:${p.color}; margin-right:5px;"></span>`;
2504
+ return `${colorSquare}${p.seriesName}: <b>${p.value}</b>`;
2483
2505
  }
2484
2506
  },
2485
2507
  legend: {
@@ -3375,6 +3397,173 @@ const DEFAULT_MAXIMUM = 100;
3375
3397
  const BAD_DATA_MESSAGE = 'No data for this field';
3376
3398
  const DAYS_IN_YEAR = 365.25;
3377
3399
 
3400
+ const SegmentedControl = (props)=>{
3401
+ return /*#__PURE__*/ jsx(SegmentedControl$1, {
3402
+ classNames: {
3403
+ root: 'bg-base-max h-fit p-0',
3404
+ indicator: 'opacity-0',
3405
+ control: 'z-0 rounded-none border-0 [&:nth-child(2)>label]:rounded-l-md [&:last-child>label]:rounded-r-md [&:last-child>label]:border-r-1',
3406
+ label: `${props?.padding ? `p-${props.padding}` : 'p-0'} text-primary font-semibold data-active:text-base-max data-active:bg-primary data-disabled:bg-base-lightest data-disabled:text-base-lighter
3407
+ border-1 border-r-0 !border-primary rounded-none data-disabled:!border-base-lighter`
3408
+ },
3409
+ ...props
3410
+ });
3411
+ };
3412
+
3413
+ const ExpanderLabel = tw.div`
3414
+ text-accent-content-darker
3415
+ p-1
3416
+ font-bold
3417
+ cursor-pointer
3418
+ text-xs
3419
+ font-content
3420
+ `;
3421
+ /**
3422
+ * Component which manages the compact/expanded state of a FacetCard
3423
+ * @param remainingValues - number of remaining values when compact "show 4"
3424
+ * @param isGroupExpanded - true if expanded, false if compact
3425
+ * @param onShowChanged - callback to call when the expand/compact button is clicked
3426
+ */ const FacetExpander = ({ remainingValues, isGroupExpanded, onShowChanged })=>{
3427
+ return /*#__PURE__*/ jsx("div", {
3428
+ className: `mt-3 flex flex-row justify-end ${remainingValues > 0 && 'border-t-2'} p-1.5`,
3429
+ children: remainingValues > 0 && !isGroupExpanded ? /*#__PURE__*/ jsx("button", {
3430
+ onClick: ()=>onShowChanged(!isGroupExpanded),
3431
+ "data-testid": "plus-icon",
3432
+ children: /*#__PURE__*/ jsxs("div", {
3433
+ className: "flex flex-row flex-nowrap items-center ",
3434
+ children: [
3435
+ /*#__PURE__*/ jsx(MdAddCircle, {
3436
+ className: "text-accent",
3437
+ size: "1rem",
3438
+ "aria-hidden": "true"
3439
+ }, "show-more"),
3440
+ /*#__PURE__*/ jsxs(ExpanderLabel, {
3441
+ children: [
3442
+ remainingValues,
3443
+ " more"
3444
+ ]
3445
+ })
3446
+ ]
3447
+ })
3448
+ }) : isGroupExpanded ? /*#__PURE__*/ jsx("button", {
3449
+ onClick: ()=>onShowChanged(!isGroupExpanded),
3450
+ "data-testid": "minus-icon",
3451
+ children: /*#__PURE__*/ jsxs("div", {
3452
+ className: "flex flex-row flex-nowrap items-center",
3453
+ children: [
3454
+ /*#__PURE__*/ jsx(MdRemoveCircle, {
3455
+ className: "text-accent",
3456
+ size: "1rem",
3457
+ onClick: ()=>onShowChanged(!isGroupExpanded),
3458
+ "aria-hidden": "true"
3459
+ }, "show-less"),
3460
+ /*#__PURE__*/ jsx(ExpanderLabel, {
3461
+ children: "show less"
3462
+ })
3463
+ ]
3464
+ })
3465
+ }) : null
3466
+ });
3467
+ };
3468
+
3469
+ const sortTypeToAriaDescription = (sortTypeAndDirection, valueLabel, field)=>{
3470
+ if (sortTypeAndDirection.type === 'alpha') {
3471
+ return sortTypeAndDirection.direction === 'asc' ? `The ${field} names are now sorted alphabetically ascending` : `The ${field} names are now sorted alphabetically descending`;
3472
+ } else {
3473
+ return sortTypeAndDirection.direction === 'asc' ? `The ${field} ${valueLabel} are now sorted numerically ascending` : `The ${field} ${valueLabel} are now sorted numerically descending`;
3474
+ }
3475
+ };
3476
+ /**
3477
+ * FacetCards "sort" header supporting sort by A-Z or by Value both ascending and descending
3478
+ * @param sortType - current sort type
3479
+ * @param valueLabel - Value labels, typically "case" "file"
3480
+ * @param setSort - sets the sort type and direction
3481
+ * @param field - specifies the facet table name
3482
+ */ const FacetSortPanel = ({ sortType, valueLabel, setSort, field })=>{
3483
+ const liveRegionRef = useRef(null);
3484
+ const [sortingStatus, setSortingStatus] = useState('');
3485
+ useEffect(()=>{
3486
+ if (sortingStatus && liveRegionRef?.current) {
3487
+ liveRegionRef.current.textContent = sortingStatus;
3488
+ }
3489
+ }, [
3490
+ sortingStatus
3491
+ ]);
3492
+ const [NameSortIcon, nameIconSize] = sortType.type === 'alpha' ? sortType.direction === 'asc' ? [
3493
+ PiCaretUpFill,
3494
+ '0.75rem'
3495
+ ] : [
3496
+ PiCaretDownFill,
3497
+ '0.75rem'
3498
+ ] : [
3499
+ PiCaretUpDownFill,
3500
+ '1rem'
3501
+ ];
3502
+ const [ValueSortIcon, valueIconSize] = sortType.type === 'value' ? sortType.direction === 'asc' ? [
3503
+ PiCaretUpFill,
3504
+ '0.75rem'
3505
+ ] : [
3506
+ PiCaretDownFill,
3507
+ '0.75rem'
3508
+ ] : [
3509
+ PiCaretUpDownFill,
3510
+ '1rem'
3511
+ ];
3512
+ return /*#__PURE__*/ jsxs("div", {
3513
+ className: "flex flex-row items-center justify-between flex-wrap py-1 px-2 mb-1 border-b-2",
3514
+ children: [
3515
+ /*#__PURE__*/ jsx(Button, {
3516
+ className: "pl-0 ml-0 api-hovered:accent",
3517
+ variant: "transparent",
3518
+ size: "compact-xs",
3519
+ color: "base-contrast.5",
3520
+ onClick: ()=>{
3521
+ const direction = sortType.type === 'alpha' && sortType.direction === 'asc' ? 'dsc' : 'asc';
3522
+ const sortObj = {
3523
+ type: 'alpha',
3524
+ direction
3525
+ };
3526
+ setSort(sortObj);
3527
+ setSortingStatus(sortTypeToAriaDescription(sortObj, 'Name', field));
3528
+ },
3529
+ rightSection: /*#__PURE__*/ jsx(NameSortIcon, {
3530
+ size: nameIconSize,
3531
+ "aria-hidden": "true"
3532
+ }),
3533
+ "aria-label": "Sort name alphabetically",
3534
+ children: "Name"
3535
+ }),
3536
+ /*#__PURE__*/ jsx(Button, {
3537
+ className: "pr-0 mr-0",
3538
+ variant: "transparent",
3539
+ size: "compact-xs",
3540
+ color: "base-contrast.5",
3541
+ onClick: ()=>{
3542
+ const direction = sortType.type === 'value' && sortType.direction === 'asc' ? 'dsc' : 'asc';
3543
+ const sortObj = {
3544
+ type: 'value',
3545
+ direction
3546
+ };
3547
+ setSort(sortObj);
3548
+ setSortingStatus(sortTypeToAriaDescription(sortObj, valueLabel, field));
3549
+ },
3550
+ rightSection: /*#__PURE__*/ jsx(ValueSortIcon, {
3551
+ size: valueIconSize,
3552
+ "aria-hidden": "true"
3553
+ }),
3554
+ "aria-label": `Sort ${valueLabel} numerically`,
3555
+ children: valueLabel
3556
+ }),
3557
+ /*#__PURE__*/ jsx("span", {
3558
+ id: `${field}-liveRegion`,
3559
+ "aria-live": "polite",
3560
+ ref: liveRegionRef,
3561
+ className: "sr-only"
3562
+ })
3563
+ ]
3564
+ });
3565
+ };
3566
+
3378
3567
  const FacetIconButton = tw.button`
3379
3568
  text-base-max
3380
3569
  font-bold
@@ -3581,217 +3770,63 @@ flex items-start justify-between items-center flex-nowrap bg-secondary px-1.5 ro
3581
3770
  });
3582
3771
  };
3583
3772
 
3584
- const sortTypeToAriaDescription = (sortTypeAndDirection, valueLabel, field)=>{
3585
- if (sortTypeAndDirection.type === 'alpha') {
3586
- return sortTypeAndDirection.direction === 'asc' ? `The ${field} names are now sorted alphabetically ascending` : `The ${field} names are now sorted alphabetically descending`;
3587
- } else {
3588
- return sortTypeAndDirection.direction === 'asc' ? `The ${field} ${valueLabel} are now sorted numerically ascending` : `The ${field} ${valueLabel} are now sorted numerically descending`;
3589
- }
3773
+ const OverflowTooltippedLabel = ({ children, label, className = 'flex-grow font-heading text-md pt-0.5' })=>{
3774
+ const [showTooltip, setShowTooltip] = useState(false);
3775
+ return /*#__PURE__*/ jsx(Tooltip, {
3776
+ label: label,
3777
+ disabled: !showTooltip,
3778
+ position: "top-start",
3779
+ offset: 5,
3780
+ multiline: true,
3781
+ withArrow: true,
3782
+ arrowOffset: 20,
3783
+ classNames: {
3784
+ tooltip: 'bg-base-min bg-opacity-90 text-base-contrast-min shadow-lg font-content font-medium text-xs',
3785
+ arrow: 'bg-base-min bg-opacity-90'
3786
+ },
3787
+ children: /*#__PURE__*/ jsx("div", {
3788
+ className: `${className} truncate ... `,
3789
+ ref: (el)=>{
3790
+ if (el) {
3791
+ if (el.clientWidth < el.scrollWidth) {
3792
+ setShowTooltip(true);
3793
+ } else {
3794
+ setShowTooltip(false);
3795
+ }
3796
+ }
3797
+ },
3798
+ children: children
3799
+ })
3800
+ });
3590
3801
  };
3591
- /**
3592
- * FacetCards "sort" header supporting sort by A-Z or by Value both ascending and descending
3593
- * @param sortType - current sort type
3594
- * @param valueLabel - Value labels, typically "case" "file"
3595
- * @param setSort - sets the sort type and direction
3596
- * @param field - specifies the facet table name
3597
- */ const FacetSortPanel = ({ sortType, valueLabel, setSort, field })=>{
3598
- const liveRegionRef = useRef(null);
3599
- const [sortingStatus, setSortingStatus] = useState('');
3802
+
3803
+ const FacetEnumList = ({ field, facetName, hooks, valueLabel, isSettings = false, isFacetView = true, isSearching = false, showPercent = false, hideIfEmpty = false, showSorting = true, sort = 'value-dsc' })=>{
3804
+ const [isGroupExpanded, setIsGroupExpanded] = useState(false);
3805
+ const cardRef = useRef(null);
3806
+ const searchInputRef = useRef(null);
3807
+ const settingRef = useRef(null);
3808
+ const [searchTerm, setSearchTerm] = useState('');
3809
+ // const [combineMode, setCombineMode] = useState<'or' | 'and'>('or');
3810
+ const { data, enumFilters, combineMode, isSuccess, error } = hooks.useGetFacetData(field);
3811
+ const [selectedEnums, setSelectedEnums] = useState(enumFilters ?? []);
3812
+ const totalCount = hooks?.useTotalCounts ? hooks.useTotalCounts() : 1;
3813
+ const clearFilters = hooks.useClearFilter();
3814
+ const updateFacetFilters = hooks.useUpdateFacetFilters();
3815
+ const isFilterExpanded = hooks?.useFilterExpanded && hooks.useFilterExpanded(field);
3816
+ const showFilters = isFilterExpanded === undefined || isFilterExpanded;
3817
+ const [sortedData, setSortedData] = useState([]);
3818
+ const [sortType, setSortType] = useState(mapFacetSortToSortType(sort));
3819
+ const theme = useMantineTheme();
3820
+ const updateVisibleValues = hooks?.updateVisibleValues;
3600
3821
  useEffect(()=>{
3601
- if (sortingStatus && liveRegionRef?.current) {
3602
- liveRegionRef.current.textContent = sortingStatus;
3822
+ if (isSearching) {
3823
+ searchInputRef?.current?.focus();
3824
+ } else if (searchTerm.length > 0) {
3825
+ setSearchTerm('');
3603
3826
  }
3604
3827
  }, [
3605
- sortingStatus
3606
- ]);
3607
- const [NameSortIcon, nameIconSize] = sortType.type === 'alpha' ? sortType.direction === 'asc' ? [
3608
- PiCaretUpFill,
3609
- '0.75rem'
3610
- ] : [
3611
- PiCaretDownFill,
3612
- '0.75rem'
3613
- ] : [
3614
- PiCaretUpDownFill,
3615
- '1rem'
3616
- ];
3617
- const [ValueSortIcon, valueIconSize] = sortType.type === 'value' ? sortType.direction === 'asc' ? [
3618
- PiCaretUpFill,
3619
- '0.75rem'
3620
- ] : [
3621
- PiCaretDownFill,
3622
- '0.75rem'
3623
- ] : [
3624
- PiCaretUpDownFill,
3625
- '1rem'
3626
- ];
3627
- return /*#__PURE__*/ jsxs("div", {
3628
- className: "flex flex-row items-center justify-between flex-wrap py-1 px-2 mb-1 border-b-2",
3629
- children: [
3630
- /*#__PURE__*/ jsx(Button, {
3631
- className: "pl-0 ml-0 api-hovered:accent",
3632
- variant: "transparent",
3633
- size: "compact-xs",
3634
- color: "base-contrast.5",
3635
- onClick: ()=>{
3636
- const direction = sortType.type === 'alpha' && sortType.direction === 'asc' ? 'dsc' : 'asc';
3637
- const sortObj = {
3638
- type: 'alpha',
3639
- direction
3640
- };
3641
- setSort(sortObj);
3642
- setSortingStatus(sortTypeToAriaDescription(sortObj, 'Name', field));
3643
- },
3644
- rightSection: /*#__PURE__*/ jsx(NameSortIcon, {
3645
- size: nameIconSize,
3646
- "aria-hidden": "true"
3647
- }),
3648
- "aria-label": "Sort name alphabetically",
3649
- children: "Name"
3650
- }),
3651
- /*#__PURE__*/ jsx(Button, {
3652
- className: "pr-0 mr-0",
3653
- variant: "transparent",
3654
- size: "compact-xs",
3655
- color: "base-contrast.5",
3656
- onClick: ()=>{
3657
- const direction = sortType.type === 'value' && sortType.direction === 'asc' ? 'dsc' : 'asc';
3658
- const sortObj = {
3659
- type: 'value',
3660
- direction
3661
- };
3662
- setSort(sortObj);
3663
- setSortingStatus(sortTypeToAriaDescription(sortObj, valueLabel, field));
3664
- },
3665
- rightSection: /*#__PURE__*/ jsx(ValueSortIcon, {
3666
- size: valueIconSize,
3667
- "aria-hidden": "true"
3668
- }),
3669
- "aria-label": `Sort ${valueLabel} numerically`,
3670
- children: valueLabel
3671
- }),
3672
- /*#__PURE__*/ jsx("span", {
3673
- id: `${field}-liveRegion`,
3674
- "aria-live": "polite",
3675
- ref: liveRegionRef,
3676
- className: "sr-only"
3677
- })
3678
- ]
3679
- });
3680
- };
3681
-
3682
- const OverflowTooltippedLabel = ({ children, label, className = 'flex-grow font-heading text-md pt-0.5' })=>{
3683
- const [showTooltip, setShowTooltip] = useState(false);
3684
- return /*#__PURE__*/ jsx(Tooltip, {
3685
- label: label,
3686
- disabled: !showTooltip,
3687
- position: "top-start",
3688
- offset: 5,
3689
- multiline: true,
3690
- withArrow: true,
3691
- arrowOffset: 20,
3692
- classNames: {
3693
- tooltip: 'bg-base-min bg-opacity-90 text-base-contrast-min shadow-lg font-content font-medium text-xs',
3694
- arrow: 'bg-base-min bg-opacity-90'
3695
- },
3696
- children: /*#__PURE__*/ jsx("div", {
3697
- className: `${className} truncate ... `,
3698
- ref: (el)=>{
3699
- if (el) {
3700
- if (el.clientWidth < el.scrollWidth) {
3701
- setShowTooltip(true);
3702
- } else {
3703
- setShowTooltip(false);
3704
- }
3705
- }
3706
- },
3707
- children: children
3708
- })
3709
- });
3710
- };
3711
-
3712
- const ExpanderLabel = tw.div`
3713
- text-accent-content-darker
3714
- p-1
3715
- font-bold
3716
- cursor-pointer
3717
- text-xs
3718
- font-content
3719
- `;
3720
- /**
3721
- * Component which manages the compact/expanded state of a FacetCard
3722
- * @param remainingValues - number of remaining values when compact "show 4"
3723
- * @param isGroupExpanded - true if expanded, false if compact
3724
- * @param onShowChanged - callback to call when the expand/compact button is clicked
3725
- */ const FacetExpander = ({ remainingValues, isGroupExpanded, onShowChanged })=>{
3726
- return /*#__PURE__*/ jsx("div", {
3727
- className: `mt-3 flex flex-row justify-end ${remainingValues > 0 && 'border-t-2'} p-1.5`,
3728
- children: remainingValues > 0 && !isGroupExpanded ? /*#__PURE__*/ jsx("button", {
3729
- onClick: ()=>onShowChanged(!isGroupExpanded),
3730
- "data-testid": "plus-icon",
3731
- children: /*#__PURE__*/ jsxs("div", {
3732
- className: "flex flex-row flex-nowrap items-center ",
3733
- children: [
3734
- /*#__PURE__*/ jsx(MdAddCircle, {
3735
- className: "text-accent",
3736
- size: "1rem",
3737
- "aria-hidden": "true"
3738
- }, "show-more"),
3739
- /*#__PURE__*/ jsxs(ExpanderLabel, {
3740
- children: [
3741
- remainingValues,
3742
- " more"
3743
- ]
3744
- })
3745
- ]
3746
- })
3747
- }) : isGroupExpanded ? /*#__PURE__*/ jsx("button", {
3748
- onClick: ()=>onShowChanged(!isGroupExpanded),
3749
- "data-testid": "minus-icon",
3750
- children: /*#__PURE__*/ jsxs("div", {
3751
- className: "flex flex-row flex-nowrap items-center",
3752
- children: [
3753
- /*#__PURE__*/ jsx(MdRemoveCircle, {
3754
- className: "text-accent",
3755
- size: "1rem",
3756
- onClick: ()=>onShowChanged(!isGroupExpanded),
3757
- "aria-hidden": "true"
3758
- }, "show-less"),
3759
- /*#__PURE__*/ jsx(ExpanderLabel, {
3760
- children: "show less"
3761
- })
3762
- ]
3763
- })
3764
- }) : null
3765
- });
3766
- };
3767
-
3768
- const FacetEnumList = ({ field, facetName, hooks, valueLabel, isSettings = false, isFacetView = true, isSearching = false, showPercent = false, hideIfEmpty = false, showSorting = true, sort = 'value-dsc' })=>{
3769
- const [isGroupExpanded, setIsGroupExpanded] = useState(false);
3770
- const cardRef = useRef(null);
3771
- const searchInputRef = useRef(null);
3772
- const settingRef = useRef(null);
3773
- const [searchTerm, setSearchTerm] = useState('');
3774
- // const [combineMode, setCombineMode] = useState<'or' | 'and'>('or');
3775
- const { data, enumFilters, combineMode, isSuccess, error } = hooks.useGetFacetData(field);
3776
- const [selectedEnums, setSelectedEnums] = useState(enumFilters ?? []);
3777
- const totalCount = hooks?.useTotalCounts ? hooks.useTotalCounts() : 1;
3778
- const clearFilters = hooks.useClearFilter();
3779
- const updateFacetFilters = hooks.useUpdateFacetFilters();
3780
- const isFilterExpanded = hooks?.useFilterExpanded && hooks.useFilterExpanded(field);
3781
- const showFilters = isFilterExpanded === undefined || isFilterExpanded;
3782
- const [sortedData, setSortedData] = useState([]);
3783
- const [sortType, setSortType] = useState(mapFacetSortToSortType(sort));
3784
- const theme = useMantineTheme();
3785
- const updateVisibleValues = hooks?.updateVisibleValues;
3786
- useEffect(()=>{
3787
- if (isSearching) {
3788
- searchInputRef?.current?.focus();
3789
- } else if (searchTerm.length > 0) {
3790
- setSearchTerm('');
3791
- }
3792
- }, [
3793
- isSearching,
3794
- searchTerm
3828
+ isSearching,
3829
+ searchTerm
3795
3830
  ]);
3796
3831
  useEffect(()=>{
3797
3832
  if (isSettings) {
@@ -3953,7 +3988,7 @@ const FacetEnumList = ({ field, facetName, hooks, valueLabel, isSettings = false
3953
3988
  children: /*#__PURE__*/ jsxs("div", {
3954
3989
  className: "flex items-center space-x-1 mt-1",
3955
3990
  children: [
3956
- /*#__PURE__*/ jsx(SegmentedControl, {
3991
+ /*#__PURE__*/ jsx(SegmentedControl$1, {
3957
3992
  classNames: {
3958
3993
  root: 'border-1 border-accent rounded-l-md rounded-r-md',
3959
3994
  control: 'p-0 m-0',
@@ -4181,194 +4216,54 @@ const EnumFacet = ({ field, hooks, valueLabel, description, facetName, showPerce
4181
4216
  });
4182
4217
  };
4183
4218
 
4184
- const instanceOfIncludesExcludes$1 = (op)=>[
4185
- 'in'
4186
- ].includes(op.operator); // TODO: Guppy does not support excludes
4187
- /**
4188
- * Extracts the operands if the operation isIncludes or Excludes. Returns an empty Array
4189
- * if filter is not the correct type.
4190
- * @param operation - filters to extract values from
4191
- */ const extractValues = (operation)=>{
4192
- if (operation && instanceOfIncludesExcludes$1(operation)) {
4193
- return operation.operands;
4194
- }
4195
- return [];
4196
- };
4197
- /**
4198
- * Exact value facet component
4199
- * @param field - field to facet on
4200
- * @param description - description of the facet
4201
- * @param facetName - name of the facet
4202
- * @param dismissCallback - callback function to dismiss the facet
4203
- * @param width - width of the facet
4204
- * @param hooks - hooks to use for the facet
4205
- * @param header - header components
4206
- * @category Facets
4207
- */ const ExactValueFacet = ({ field, description, facetName = undefined, dismissCallback = undefined, width = undefined, hooks, header = {
4219
+ const createBucket = (field, lower, upper)=>({
4220
+ operator: 'and',
4221
+ operands: [
4222
+ {
4223
+ field,
4224
+ operator: '>=',
4225
+ operand: lower
4226
+ },
4227
+ {
4228
+ field,
4229
+ operator: '<=',
4230
+ operand: upper
4231
+ }
4232
+ ]
4233
+ });
4234
+ const RangeFacet = ({ field, hooks, valueLabel, description, facetName, minimum = DEFAULT_MINIMUM, maximum = DEFAULT_MAXIMUM, showSearch = false, showFlip = false, showSettings = false, dismissCallback = undefined, width = undefined, header = {
4208
4235
  Panel: FacetHeader,
4209
4236
  Label: FacetText,
4210
4237
  iconStyle: controlsIconStyle
4211
4238
  } })=>{
4212
- const [textValue, setTextValue] = useState(''); // Handle the state of the TextInput
4213
- const clearFilters = hooks.useClearFilter();
4214
- const updateFacetFilters = hooks.useUpdateFacetFilters();
4215
- const facetTitle = facetName ? facetName : trimFirstFieldNameToTitle(field, true);
4216
- const facetValue = hooks.useGetFacetFilters(field);
4217
- const textValues = useMemo(()=>extractValues(facetValue), [
4218
- facetValue
4219
- ]);
4220
- const isFilterExpanded = hooks.useFilterExpanded && hooks.useFilterExpanded(field);
4221
- const showFilters = isFilterExpanded === undefined || isFilterExpanded;
4222
- const setValues = (values)=>{
4223
- if (values.length > 0) {
4224
- if (facetValue && instanceOfIncludesExcludes$1(facetValue)) {
4225
- // updating facet value
4226
- updateFacetFilters(field, {
4227
- ...facetValue,
4228
- operands: values
4229
- });
4230
- }
4231
- if (facetValue === undefined) {
4232
- // TODO: Assuming Includes by default but this might change to Include|Excludes
4233
- updateFacetFilters(field, {
4234
- operator: 'in',
4235
- field: field,
4236
- operands: values
4237
- });
4238
- }
4239
- } else {
4240
- clearFilters(field);
4241
- }
4242
- };
4243
- const addValue = (s)=>{
4244
- if (s === '') return;
4245
- if (textValues.includes(s)) return;
4246
- setTextValue('');
4247
- setValues([
4248
- ...textValues,
4249
- s
4250
- ]);
4251
- };
4252
- const removeButton = (x)=>{
4253
- return /*#__PURE__*/ jsx(ActionIcon, {
4254
- size: "xs",
4255
- color: "white",
4256
- radius: "xl",
4257
- variant: "transparent",
4258
- onClick: ()=>setValues(textValues.filter((i)=>i !== x)),
4259
- children: /*#__PURE__*/ jsx(MdClose, {
4260
- size: 10,
4261
- "aria-label": "remove value from filter"
4262
- })
4263
- });
4264
- };
4265
- return /*#__PURE__*/ jsxs("div", {
4266
- className: `flex flex-col ${width ? width : 'mx-0'} bg-base-max relative border-base-lighter border-1 rounded-md text-xs transition`,
4267
- children: [
4268
- /*#__PURE__*/ jsx(FacetControlsHeader, {
4269
- field: field,
4270
- description: description,
4271
- hooks: hooks,
4272
- facetName: facetName,
4273
- dismissCallback: dismissCallback,
4274
- header: header
4275
- }),
4276
- /*#__PURE__*/ jsxs("div", {
4277
- className: showFilters ? 'h-full' : 'h-0 invisible',
4278
- "aria-hidden": !showFilters,
4279
- children: [
4280
- /*#__PURE__*/ jsxs("div", {
4281
- className: "flex flex-nowrap items-center p-2",
4282
- children: [
4283
- /*#__PURE__*/ jsx(TextInput, {
4284
- "data-testid": "textbox-add-filter-value",
4285
- size: "sm",
4286
- placeholder: `Enter ${facetTitle}`,
4287
- classNames: {
4288
- root: 'grow',
4289
- input: 'border-r-0 rounded-r-none py-1'
4290
- },
4291
- "aria-label": "enter value to add filter",
4292
- value: textValue,
4293
- onChange: (event)=>setTextValue(event.currentTarget.value)
4294
- }),
4295
- /*#__PURE__*/ jsx(ActionIcon, {
4296
- size: "lg",
4297
- "aria-label": "add string value",
4298
- className: "bg-accent text-accent-contrast border-base-min border-1 rounded-l-none h-[30px]",
4299
- onClick: ()=>{
4300
- if (textValue.length > 0) addValue(textValue.trim());
4301
- },
4302
- children: /*#__PURE__*/ jsx(FaPlus, {})
4303
- })
4304
- ]
4305
- }),
4306
- /*#__PURE__*/ jsx(Group, {
4307
- gap: "xs",
4308
- className: "px-2 py-2 max-h-96 overflow-y-auto",
4309
- "data-testid": "values group",
4310
- children: textValues.map((x)=>/*#__PURE__*/ jsx(Badge, {
4311
- size: "sm",
4312
- variant: "filled",
4313
- color: "accent",
4314
- rightSection: removeButton(x),
4315
- children: x
4316
- }, x))
4317
- })
4318
- ]
4319
- })
4320
- ]
4321
- });
4322
- };
4323
-
4324
- const createBucket = (field, lower, upper)=>({
4325
- operator: 'and',
4326
- operands: [
4327
- {
4328
- field,
4329
- operator: '>=',
4330
- operand: lower
4331
- },
4332
- {
4333
- field,
4334
- operator: '<=',
4335
- operand: upper
4336
- }
4337
- ]
4338
- });
4339
- const RangeFacet = ({ field, hooks, valueLabel, description, facetName, minimum = DEFAULT_MINIMUM, maximum = DEFAULT_MAXIMUM, showSearch = false, showFlip = false, showSettings = false, dismissCallback = undefined, width = undefined, header = {
4340
- Panel: FacetHeader,
4341
- Label: FacetText,
4342
- iconStyle: controlsIconStyle
4343
- } })=>{
4344
- const { data, rangeFilters, isSuccess } = hooks.useGetFacetData(field);
4345
- const [minMaxValue, setMinMaxValue] = React__default.useState({
4346
- from: minimum,
4347
- to: maximum
4348
- });
4349
- const clearRangeFilterFromCohort = hooks.useClearFilter();
4350
- useCallback(()=>{
4351
- setMinMaxValue({
4352
- from: minimum,
4353
- to: maximum
4354
- });
4355
- clearRangeFilterFromCohort(field);
4356
- }, [
4357
- clearRangeFilterFromCohort,
4358
- field,
4359
- maximum,
4360
- minimum
4361
- ]);
4362
- const updateRangeFilter = hooks.useUpdateFacetFilters();
4363
- const updateFilters = useCallback((from, to)=>{
4364
- updateRangeFilter(field, createBucket(field, from, to));
4365
- setMinMaxValue({
4366
- from: from,
4367
- to: to
4368
- });
4369
- }, [
4370
- field,
4371
- updateRangeFilter
4239
+ const { data, rangeFilters, isSuccess } = hooks.useGetFacetData(field);
4240
+ const [minMaxValue, setMinMaxValue] = React__default.useState({
4241
+ from: minimum,
4242
+ to: maximum
4243
+ });
4244
+ const clearRangeFilterFromCohort = hooks.useClearFilter();
4245
+ useCallback(()=>{
4246
+ setMinMaxValue({
4247
+ from: minimum,
4248
+ to: maximum
4249
+ });
4250
+ clearRangeFilterFromCohort(field);
4251
+ }, [
4252
+ clearRangeFilterFromCohort,
4253
+ field,
4254
+ maximum,
4255
+ minimum
4256
+ ]);
4257
+ const updateRangeFilter = hooks.useUpdateFacetFilters();
4258
+ const updateFilters = useCallback((from, to)=>{
4259
+ updateRangeFilter(field, createBucket(field, from, to));
4260
+ setMinMaxValue({
4261
+ from: from,
4262
+ to: to
4263
+ });
4264
+ }, [
4265
+ field,
4266
+ updateRangeFilter
4372
4267
  ]);
4373
4268
  const isFilterExpanded = hooks.useFilterExpanded && hooks.useFilterExpanded(field);
4374
4269
  const showFilters = isFilterExpanded === undefined || isFilterExpanded;
@@ -4449,7 +4344,7 @@ const RangeFacet = ({ field, hooks, valueLabel, description, facetName, minimum
4449
4344
  });
4450
4345
  };
4451
4346
 
4452
- const instanceOfIncludesExcludes = (op)=>[
4347
+ const instanceOfIncludesExcludes$1 = (op)=>[
4453
4348
  'in'
4454
4349
  ].includes(op.operator); // TODO: Guppy does not support excludes
4455
4350
  const isOperandsObject = (obj)=>{
@@ -4498,7 +4393,7 @@ const isFacetEmpty = (op)=>{
4498
4393
  useDeepCompareEffect(()=>{
4499
4394
  if (!facetValue || isFacetEmpty(facetValue)) {
4500
4395
  setSelectedValues([]);
4501
- } else if (instanceOfIncludesExcludes(facetValue)) {
4396
+ } else if (instanceOfIncludesExcludes$1(facetValue)) {
4502
4397
  const filters = facetValue.operands.map((x)=>x.toString());
4503
4398
  setSelectedValues(filters);
4504
4399
  }
@@ -4558,6 +4453,554 @@ const isFacetEmpty = (op)=>{
4558
4453
  });
4559
4454
  };
4560
4455
 
4456
+ const instanceOfIncludesExcludes = (op)=>[
4457
+ 'in'
4458
+ ].includes(op.operator); // TODO: Guppy does not support excludes
4459
+ /**
4460
+ * Extracts the operands if the operation isIncludes or Excludes. Returns an empty Array
4461
+ * if filter is not the correct type.
4462
+ * @param operation - filters to extract values from
4463
+ */ const extractValues = (operation)=>{
4464
+ if (operation && instanceOfIncludesExcludes(operation)) {
4465
+ return operation.operands;
4466
+ }
4467
+ return [];
4468
+ };
4469
+ /**
4470
+ * Exact value facet component
4471
+ * @param field - field to facet on
4472
+ * @param description - description of the facet
4473
+ * @param facetName - name of the facet
4474
+ * @param dismissCallback - callback function to dismiss the facet
4475
+ * @param width - width of the facet
4476
+ * @param hooks - hooks to use for the facet
4477
+ * @param header - header components
4478
+ * @category Facets
4479
+ */ const ExactValueFacet = ({ field, description, facetName = undefined, dismissCallback = undefined, width = undefined, hooks, header = {
4480
+ Panel: FacetHeader,
4481
+ Label: FacetText,
4482
+ iconStyle: controlsIconStyle
4483
+ } })=>{
4484
+ const [textValue, setTextValue] = useState(''); // Handle the state of the TextInput
4485
+ const clearFilters = hooks.useClearFilter();
4486
+ const updateFacetFilters = hooks.useUpdateFacetFilters();
4487
+ const facetTitle = facetName ? facetName : trimFirstFieldNameToTitle(field, true);
4488
+ const facetValue = hooks.useGetFacetFilters(field);
4489
+ const textValues = useMemo(()=>extractValues(facetValue), [
4490
+ facetValue
4491
+ ]);
4492
+ const isFilterExpanded = hooks.useFilterExpanded && hooks.useFilterExpanded(field);
4493
+ const showFilters = isFilterExpanded === undefined || isFilterExpanded;
4494
+ const setValues = (values)=>{
4495
+ if (values.length > 0) {
4496
+ if (facetValue && instanceOfIncludesExcludes(facetValue)) {
4497
+ // updating facet value
4498
+ updateFacetFilters(field, {
4499
+ ...facetValue,
4500
+ operands: values
4501
+ });
4502
+ }
4503
+ if (facetValue === undefined) {
4504
+ // TODO: Assuming Includes by default but this might change to Include|Excludes
4505
+ updateFacetFilters(field, {
4506
+ operator: 'in',
4507
+ field: field,
4508
+ operands: values
4509
+ });
4510
+ }
4511
+ } else {
4512
+ clearFilters(field);
4513
+ }
4514
+ };
4515
+ const addValue = (s)=>{
4516
+ if (s === '') return;
4517
+ if (textValues.includes(s)) return;
4518
+ setTextValue('');
4519
+ setValues([
4520
+ ...textValues,
4521
+ s
4522
+ ]);
4523
+ };
4524
+ const removeButton = (x)=>{
4525
+ return /*#__PURE__*/ jsx(ActionIcon, {
4526
+ size: "xs",
4527
+ color: "white",
4528
+ radius: "xl",
4529
+ variant: "transparent",
4530
+ onClick: ()=>setValues(textValues.filter((i)=>i !== x)),
4531
+ children: /*#__PURE__*/ jsx(MdClose, {
4532
+ size: 10,
4533
+ "aria-label": "remove value from filter"
4534
+ })
4535
+ });
4536
+ };
4537
+ return /*#__PURE__*/ jsxs("div", {
4538
+ className: `flex flex-col ${width ? width : 'mx-0'} bg-base-max relative border-base-lighter border-1 rounded-md text-xs transition`,
4539
+ children: [
4540
+ /*#__PURE__*/ jsx(FacetControlsHeader, {
4541
+ field: field,
4542
+ description: description,
4543
+ hooks: hooks,
4544
+ facetName: facetName,
4545
+ dismissCallback: dismissCallback,
4546
+ header: header
4547
+ }),
4548
+ /*#__PURE__*/ jsxs("div", {
4549
+ className: showFilters ? 'h-full' : 'h-0 invisible',
4550
+ "aria-hidden": !showFilters,
4551
+ children: [
4552
+ /*#__PURE__*/ jsxs("div", {
4553
+ className: "flex flex-nowrap items-center p-2",
4554
+ children: [
4555
+ /*#__PURE__*/ jsx(TextInput, {
4556
+ "data-testid": "textbox-add-filter-value",
4557
+ size: "sm",
4558
+ placeholder: `Enter ${facetTitle}`,
4559
+ classNames: {
4560
+ root: 'grow',
4561
+ input: 'border-r-0 rounded-r-none py-1'
4562
+ },
4563
+ "aria-label": "enter value to add filter",
4564
+ value: textValue,
4565
+ onChange: (event)=>setTextValue(event.currentTarget.value)
4566
+ }),
4567
+ /*#__PURE__*/ jsx(ActionIcon, {
4568
+ size: "lg",
4569
+ "aria-label": "add string value",
4570
+ className: "bg-accent text-accent-contrast border-base-min border-1 rounded-l-none h-[30px]",
4571
+ onClick: ()=>{
4572
+ if (textValue.length > 0) addValue(textValue.trim());
4573
+ },
4574
+ children: /*#__PURE__*/ jsx(FaPlus, {})
4575
+ })
4576
+ ]
4577
+ }),
4578
+ /*#__PURE__*/ jsx(Group, {
4579
+ gap: "xs",
4580
+ className: "px-2 py-2 max-h-96 overflow-y-auto",
4581
+ "data-testid": "values group",
4582
+ children: textValues.map((x)=>/*#__PURE__*/ jsx(Badge, {
4583
+ size: "sm",
4584
+ variant: "filled",
4585
+ color: "accent",
4586
+ rightSection: removeButton(x),
4587
+ children: x
4588
+ }, x))
4589
+ })
4590
+ ]
4591
+ })
4592
+ ]
4593
+ });
4594
+ };
4595
+
4596
+ const createFacetCard = ({ facetDefinition, valueLabel, hooks: dataFunctions, facetNameFormatter, idPrefix, hideIfEmpty = false, width, showPercent = false, queryOptions })=>{
4597
+ const { field, type, description, label } = facetDefinition;
4598
+ const facetLabel = label ?? facetNameFormatter(facetDefinition.field);
4599
+ const valueTypeLabel = valueLabel === undefined || typeof valueLabel === 'string' ? valueLabel : valueLabel(queryOptions);
4600
+ return /*#__PURE__*/ jsx("div", {
4601
+ children: {
4602
+ enum: /*#__PURE__*/ jsx(EnumFacet, {
4603
+ valueLabel: valueTypeLabel,
4604
+ field: field,
4605
+ facetName: facetLabel,
4606
+ description: description,
4607
+ hideIfEmpty: hideIfEmpty,
4608
+ width: width,
4609
+ hooks: dataFunctions,
4610
+ showPercent: showPercent,
4611
+ sharedWithIndices: facetDefinition?.sharedWithIndices
4612
+ }, `${idPrefix}-enum-${field}`),
4613
+ range: /*#__PURE__*/ jsx(RangeFacet, {
4614
+ valueLabel: valueTypeLabel,
4615
+ field: field,
4616
+ facetName: facetLabel,
4617
+ description: description,
4618
+ hideIfEmpty: hideIfEmpty,
4619
+ width: width,
4620
+ hooks: dataFunctions,
4621
+ minimum: facetDefinition.range?.minimum,
4622
+ maximum: facetDefinition.range?.maximum,
4623
+ showSettings: showPercent,
4624
+ sharedWithIndices: facetDefinition?.sharedWithIndices
4625
+ }, `${idPrefix}-range-${field}`),
4626
+ exact: /*#__PURE__*/ jsx(ExactValueFacet, {
4627
+ field: field,
4628
+ facetName: facetLabel,
4629
+ description: description,
4630
+ hideIfEmpty: hideIfEmpty,
4631
+ width: width,
4632
+ hooks: dataFunctions,
4633
+ sharedWithIndices: facetDefinition?.sharedWithIndices
4634
+ }, `${idPrefix}-exact-${field}`),
4635
+ multiselect: /*#__PURE__*/ jsx(MultiSelectValueFacet, {
4636
+ field: field,
4637
+ facetName: facetLabel,
4638
+ description: description,
4639
+ hideIfEmpty: hideIfEmpty,
4640
+ width: width,
4641
+ hooks: dataFunctions,
4642
+ sharedWithIndices: facetDefinition?.sharedWithIndices
4643
+ }, `${idPrefix}-exact-${field}`)
4644
+ }[type]
4645
+ }, `${idPrefix}-facet-${field}`);
4646
+ };
4647
+
4648
+ const FiltersPanel = ({ fields, dataFunctions, valueLabel })=>{
4649
+ return /*#__PURE__*/ jsx("div", {
4650
+ "data-testid": "filters-facets",
4651
+ className: "flex flex-col gap-y-4 w-full",
4652
+ children: fields.map((facetDefinition)=>{
4653
+ if (facetDefinition?.type === undefined) {
4654
+ console.warn('Facet definition missing type', facetDefinition);
4655
+ return null;
4656
+ }
4657
+ if (!(facetDefinition.type in dataFunctions)) return null;
4658
+ return createFacetCard({
4659
+ facetDefinition,
4660
+ valueLabel,
4661
+ hooks: dataFunctions[facetDefinition.type],
4662
+ facetNameFormatter: fieldNameToTitle,
4663
+ idPrefix: 'filters-panel',
4664
+ showPercent: false
4665
+ });
4666
+ })
4667
+ });
4668
+ };
4669
+
4670
+ const AccordionPanel = ({ index, filters, tabTitle, facetDefinitions, facetDataHooks, onAccessChange = (value)=>null, accessLevel = Accessibility.ALL, showAccessLevel = false })=>{
4671
+ const coreDispatch = useCoreDispatch();
4672
+ const sharedFilters = useCoreSelector((state)=>selectSharedFilters(state));
4673
+ const theme = useMantineTheme();
4674
+ const shareFilters = useCoreSelector((state)=>selectShouldShareFilters(state));
4675
+ const allFiltersCollapsed = useCoreSelector((state)=>selectAllCohortFiltersCollapsed(state, index));
4676
+ const toggleAllFiltersExpanded = (expand)=>{
4677
+ coreDispatch(toggleCohortBuilderAllFilters({
4678
+ expand,
4679
+ index
4680
+ }));
4681
+ };
4682
+ const handleSharedFiltersChange = (value)=>{
4683
+ modals.openConfirmModal({
4684
+ title: 'Confirm change of shared filters mode',
4685
+ children: /*#__PURE__*/ jsx(Text, {
4686
+ size: "sm",
4687
+ children: value ? 'Switching to Shared Filters mode will apply all selected filters across all indices.' : 'Switching to Unshared Filters mode will stop syncing filters but will not remove them.'
4688
+ }),
4689
+ labels: {
4690
+ confirm: 'Confirm',
4691
+ cancel: 'Cancel'
4692
+ },
4693
+ onConfirm: ()=>coreDispatch(setShouldShareFilters(value))
4694
+ });
4695
+ };
4696
+ return /*#__PURE__*/ jsxs(Stack, {
4697
+ align: "flex-start",
4698
+ children: [
4699
+ /*#__PURE__*/ jsxs(Group, {
4700
+ justify: "space-between",
4701
+ className: "w-full",
4702
+ children: [
4703
+ /*#__PURE__*/ jsx(Text, {
4704
+ size: "xl",
4705
+ fw: 800,
4706
+ children: "Filters"
4707
+ }),
4708
+ /*#__PURE__*/ jsx("button", {
4709
+ className: "text-primary text-sm font-normal",
4710
+ onClick: ()=>toggleAllFiltersExpanded(allFiltersCollapsed),
4711
+ children: allFiltersCollapsed ? 'Expand All' : 'Collapse All'
4712
+ })
4713
+ ]
4714
+ }),
4715
+ /*#__PURE__*/ jsxs(Stack, {
4716
+ className: "bg-base-max py-4 px-2 h-full w-full",
4717
+ children: [
4718
+ Object.keys(sharedFilters).length > 0 && /*#__PURE__*/ jsxs(Group, {
4719
+ gap: "xs",
4720
+ justify: "space-between",
4721
+ children: [
4722
+ /*#__PURE__*/ jsxs("div", {
4723
+ className: "flex items-center space-x-1",
4724
+ children: [
4725
+ /*#__PURE__*/ jsx(Icon, {
4726
+ icon: "gen3:share",
4727
+ height: 16,
4728
+ width: 16,
4729
+ color: theme.colors.accent[4]
4730
+ }),
4731
+ /*#__PURE__*/ jsx(Text, {
4732
+ size: "sm",
4733
+ children: "Set the shared filters for all"
4734
+ }),
4735
+ /*#__PURE__*/ jsx(Icon, {
4736
+ icon: "gen3:info",
4737
+ height: 12,
4738
+ width: 12,
4739
+ color: theme.colors.accent[4]
4740
+ })
4741
+ ]
4742
+ }),
4743
+ /*#__PURE__*/ jsx(Switch, {
4744
+ checked: shareFilters,
4745
+ onChange: (event)=>handleSharedFiltersChange(event.currentTarget.checked)
4746
+ })
4747
+ ]
4748
+ }),
4749
+ /*#__PURE__*/ jsx(Accordion, {
4750
+ chevronPosition: "left",
4751
+ multiple: true,
4752
+ defaultValue: [
4753
+ filters?.tabs[0].title ?? 'Filters'
4754
+ ],
4755
+ children: filters.tabs.map((tab)=>{
4756
+ return /*#__PURE__*/ jsxs(Accordion.Item, {
4757
+ value: tab.title,
4758
+ children: [
4759
+ /*#__PURE__*/ jsx(Accordion.Control, {
4760
+ children: tab.title
4761
+ }),
4762
+ /*#__PURE__*/ jsx(Accordion.Panel, {
4763
+ classNames: {
4764
+ panel: 'p-0 m-0'
4765
+ },
4766
+ children: Object.keys(facetDefinitions).length > 0 ? /*#__PURE__*/ jsx(FiltersPanel, {
4767
+ fields: tab.fields.reduce((acc, field)=>{
4768
+ return [
4769
+ ...acc,
4770
+ facetDefinitions[field]
4771
+ ];
4772
+ }, []),
4773
+ dataFunctions: facetDataHooks,
4774
+ valueLabel: tabTitle
4775
+ }) : null
4776
+ })
4777
+ ]
4778
+ }, `${tab.title}`);
4779
+ })
4780
+ })
4781
+ ]
4782
+ })
4783
+ ]
4784
+ });
4785
+ };
4786
+
4787
+ const AccessData = [
4788
+ {
4789
+ value: Accessibility.ALL,
4790
+ label: 'All'
4791
+ },
4792
+ {
4793
+ value: Accessibility.ACCESSIBLE,
4794
+ label: 'Accessible'
4795
+ },
4796
+ {
4797
+ value: Accessibility.UNACCESSIBLE,
4798
+ label: 'Not Accessible'
4799
+ }
4800
+ ];
4801
+ const AccessLevelControl = ({ onChange, accessLevel })=>{
4802
+ const theme = useMantineTheme();
4803
+ return /*#__PURE__*/ jsx(SegmentedControl$1, {
4804
+ color: theme.colors.accent[5],
4805
+ data: AccessData,
4806
+ value: accessLevel,
4807
+ onChange: (val)=>{
4808
+ const accessibilityValue = AccessData.find((item)=>item.value === val)?.value || Accessibility.ALL;
4809
+ onChange(accessibilityValue);
4810
+ }
4811
+ });
4812
+ };
4813
+
4814
+ const DropdownPanel = ({ index, filters, tabTitle, facetDefinitions, facetDataHooks, onAccessChange = (value)=>null, accessLevel = Accessibility.ALL, showAccessLevel = false })=>{
4815
+ const [value, setValue] = useState('0');
4816
+ const allFiltersCollapsed = useCoreSelector((state)=>selectAllCohortFiltersCollapsed(state, index));
4817
+ const sharedFilters = useCoreSelector((state)=>selectSharedFilters(state));
4818
+ const shareFilters = useCoreSelector((state)=>selectShouldShareFilters(state));
4819
+ const theme = useMantineTheme();
4820
+ const coreDispatch = useCoreDispatch();
4821
+ const toggleAllFiltersExpanded = (expand)=>{
4822
+ coreDispatch(toggleCohortBuilderAllFilters({
4823
+ expand,
4824
+ index
4825
+ }));
4826
+ };
4827
+ const items = useDeepCompareMemo(()=>filters.tabs.map((tab, idx)=>{
4828
+ return {
4829
+ label: tab.title,
4830
+ value: idx.toString()
4831
+ };
4832
+ }), [
4833
+ filters.tabs
4834
+ ]);
4835
+ const fields = filters.tabs[Number(value)].fields.reduce((acc, field)=>{
4836
+ return [
4837
+ ...acc,
4838
+ facetDefinitions[field]
4839
+ ];
4840
+ }, []);
4841
+ const handleSharedFiltersChange = (value)=>{
4842
+ modals.openConfirmModal({
4843
+ title: 'Confirm change of shared filters mode',
4844
+ children: /*#__PURE__*/ jsx(Text, {
4845
+ size: "sm",
4846
+ children: value ? 'Switching to Shared Filters mode will apply all selected filters across all indices.' : 'Switching to Unshared Filters mode will stop syncing filters but will not remove them.'
4847
+ }),
4848
+ labels: {
4849
+ confirm: 'Confirm',
4850
+ cancel: 'Cancel'
4851
+ },
4852
+ onConfirm: ()=>coreDispatch(setShouldShareFilters(value))
4853
+ });
4854
+ };
4855
+ return /*#__PURE__*/ jsxs(Stack, {
4856
+ align: "flex-start",
4857
+ children: [
4858
+ /*#__PURE__*/ jsxs(Group, {
4859
+ justify: "space-between",
4860
+ className: "w-full",
4861
+ children: [
4862
+ /*#__PURE__*/ jsx(Text, {
4863
+ size: "xl",
4864
+ fw: 800,
4865
+ children: "Filters"
4866
+ }),
4867
+ /*#__PURE__*/ jsx("button", {
4868
+ className: "text-primary text-sm font-normal",
4869
+ onClick: ()=>toggleAllFiltersExpanded(allFiltersCollapsed),
4870
+ children: allFiltersCollapsed ? 'Expand All' : 'Collapse All'
4871
+ })
4872
+ ]
4873
+ }),
4874
+ showAccessLevel ? /*#__PURE__*/ jsx(AccessLevelControl, {
4875
+ onChange: onAccessChange,
4876
+ accessLevel: accessLevel
4877
+ }) : null,
4878
+ /*#__PURE__*/ jsxs(Stack, {
4879
+ className: "bg-base-max py-4 px-2 h-full w-full",
4880
+ children: [
4881
+ Object.keys(sharedFilters).length > 0 && /*#__PURE__*/ jsxs(Group, {
4882
+ gap: "xs",
4883
+ justify: "space-between",
4884
+ children: [
4885
+ /*#__PURE__*/ jsxs("div", {
4886
+ className: "flex items-center space-x-1",
4887
+ children: [
4888
+ /*#__PURE__*/ jsx(Icon, {
4889
+ icon: "gen3:share",
4890
+ height: 16,
4891
+ width: 16,
4892
+ color: theme.colors.accent[4]
4893
+ }),
4894
+ /*#__PURE__*/ jsx(Text, {
4895
+ size: "sm",
4896
+ children: "Set the shared filters for all"
4897
+ }),
4898
+ /*#__PURE__*/ jsx(Tooltip, {
4899
+ label: "If enabled any filter set on this tab will be applied to every tab where occurs.",
4900
+ position: "top",
4901
+ withArrow: true,
4902
+ children: /*#__PURE__*/ jsx(Icon, {
4903
+ icon: "gen3:info",
4904
+ height: 12,
4905
+ width: 12,
4906
+ color: theme.colors.accent[4]
4907
+ })
4908
+ })
4909
+ ]
4910
+ }),
4911
+ /*#__PURE__*/ jsx(Switch, {
4912
+ checked: shareFilters,
4913
+ onChange: (event)=>handleSharedFiltersChange(event.currentTarget.checked)
4914
+ })
4915
+ ]
4916
+ }),
4917
+ filters.tabs.length > 1 && /*#__PURE__*/ jsx(Select, {
4918
+ classNames: {
4919
+ options: 'border-1 border-base-dark',
4920
+ option: 'hover:bg-primary-lightest'
4921
+ },
4922
+ withCheckIcon: false,
4923
+ data: items,
4924
+ value: value === null ? '0' : value,
4925
+ onChange: setValue
4926
+ }),
4927
+ Object.keys(facetDefinitions).length > 0 ? /*#__PURE__*/ jsx(FiltersPanel, {
4928
+ fields: fields,
4929
+ dataFunctions: facetDataHooks,
4930
+ valueLabel: tabTitle
4931
+ }) : null
4932
+ ]
4933
+ })
4934
+ ]
4935
+ });
4936
+ };
4937
+
4938
+ const VerticalTabbedPanel = ({ index, filters, tabTitle, facetDefinitions, facetDataHooks, onAccessChange = (value)=>null, accessLevel = Accessibility.ALL, showAccessLevel = false })=>{
4939
+ return /*#__PURE__*/ jsx("div", {
4940
+ children: /*#__PURE__*/ jsxs(Tabs, {
4941
+ variant: "pills",
4942
+ orientation: "vertical",
4943
+ keepMounted: false,
4944
+ defaultValue: filters?.tabs[0].title ?? 'Filters',
4945
+ children: [
4946
+ /*#__PURE__*/ jsx(Tabs.List, {
4947
+ children: filters.tabs.map((tab)=>{
4948
+ return /*#__PURE__*/ jsx(Tabs.Tab, {
4949
+ value: tab.title,
4950
+ children: tab.title
4951
+ }, `${tab.title}-tab`);
4952
+ })
4953
+ }),
4954
+ filters.tabs.map((tab)=>{
4955
+ return /*#__PURE__*/ jsx(Tabs.Panel, {
4956
+ value: tab.title,
4957
+ className: "w-1/4",
4958
+ children: Object.keys(facetDefinitions).length > 0 ? /*#__PURE__*/ jsx(FiltersPanel, {
4959
+ fields: tab.fields.reduce((acc, field)=>{
4960
+ return [
4961
+ ...acc,
4962
+ facetDefinitions[field]
4963
+ ];
4964
+ }, []),
4965
+ dataFunctions: facetDataHooks,
4966
+ valueLabel: tabTitle
4967
+ }) : null
4968
+ }, `filter-${tab.title}-tabPanel`);
4969
+ })
4970
+ ]
4971
+ })
4972
+ });
4973
+ };
4974
+ const SinglePanel = ({ filters, tabTitle, facetDefinitions, facetDataHooks })=>{
4975
+ return /*#__PURE__*/ jsx("div", {
4976
+ children: Object.keys(facetDefinitions).length > 0 ? /*#__PURE__*/ jsx(FiltersPanel, {
4977
+ fields: filters.tabs[0].fields.reduce((acc, field)=>{
4978
+ return [
4979
+ ...acc,
4980
+ facetDefinitions[field]
4981
+ ];
4982
+ }, []),
4983
+ dataFunctions: facetDataHooks,
4984
+ valueLabel: tabTitle
4985
+ }) : null
4986
+ });
4987
+ };
4988
+ const TabbedPanel = ({ index, filters, tabTitle, facetDefinitions, facetDataHooks })=>{
4989
+ return filters.tabs.length > 1 ? /*#__PURE__*/ jsx(VerticalTabbedPanel, {
4990
+ index: index,
4991
+ filters: filters,
4992
+ tabTitle: tabTitle,
4993
+ facetDefinitions: facetDefinitions,
4994
+ facetDataHooks: facetDataHooks
4995
+ }) : /*#__PURE__*/ jsx(SinglePanel, {
4996
+ index: index,
4997
+ filters: filters,
4998
+ tabTitle: tabTitle,
4999
+ facetDefinitions: facetDefinitions,
5000
+ facetDataHooks: facetDataHooks
5001
+ });
5002
+ };
5003
+
4561
5004
  /**
4562
5005
  * Scrolls to hash in url when component mounts and removes hash from url when component unmounts
4563
5006
  * @param valid_hashes - what hashes in url should trigger scroll
@@ -4579,58 +5022,6 @@ const isFacetEmpty = (op)=>{
4579
5022
  }, []);
4580
5023
  };
4581
5024
 
4582
- const createFacetCard = ({ facetDefinition, valueLabel, hooks: dataFunctions, facetNameFormatter, idPrefix, hideIfEmpty = false, width, showPercent = false, queryOptions })=>{
4583
- const { field, type, description, label } = facetDefinition;
4584
- const facetLabel = label ?? facetNameFormatter(facetDefinition.field);
4585
- const valueTypeLabel = valueLabel === undefined || typeof valueLabel === 'string' ? valueLabel : valueLabel(queryOptions);
4586
- return /*#__PURE__*/ jsx("div", {
4587
- children: {
4588
- enum: /*#__PURE__*/ jsx(EnumFacet, {
4589
- valueLabel: valueTypeLabel,
4590
- field: field,
4591
- facetName: facetLabel,
4592
- description: description,
4593
- hideIfEmpty: hideIfEmpty,
4594
- width: width,
4595
- hooks: dataFunctions,
4596
- showPercent: showPercent,
4597
- sharedWithIndices: facetDefinition?.sharedWithIndices
4598
- }, `${idPrefix}-enum-${field}`),
4599
- range: /*#__PURE__*/ jsx(RangeFacet, {
4600
- valueLabel: valueTypeLabel,
4601
- field: field,
4602
- facetName: facetLabel,
4603
- description: description,
4604
- hideIfEmpty: hideIfEmpty,
4605
- width: width,
4606
- hooks: dataFunctions,
4607
- minimum: facetDefinition.range?.minimum,
4608
- maximum: facetDefinition.range?.maximum,
4609
- showSettings: showPercent,
4610
- sharedWithIndices: facetDefinition?.sharedWithIndices
4611
- }, `${idPrefix}-range-${field}`),
4612
- exact: /*#__PURE__*/ jsx(ExactValueFacet, {
4613
- field: field,
4614
- facetName: facetLabel,
4615
- description: description,
4616
- hideIfEmpty: hideIfEmpty,
4617
- width: width,
4618
- hooks: dataFunctions,
4619
- sharedWithIndices: facetDefinition?.sharedWithIndices
4620
- }, `${idPrefix}-exact-${field}`),
4621
- multiselect: /*#__PURE__*/ jsx(MultiSelectValueFacet, {
4622
- field: field,
4623
- facetName: facetLabel,
4624
- description: description,
4625
- hideIfEmpty: hideIfEmpty,
4626
- width: width,
4627
- hooks: dataFunctions,
4628
- sharedWithIndices: facetDefinition?.sharedWithIndices
4629
- }, `${idPrefix}-exact-${field}`)
4630
- }[type]
4631
- }, `${idPrefix}-facet-${field}`);
4632
- };
4633
-
4634
5025
  const createFacetCards = ({ facets, hooks, facetNameFormatter, idPrefix, valueLabel, dismissCallback, hideIfEmpty, Chart, showPercent })=>{
4635
5026
  return facets.map((facetDefinition)=>{
4636
5027
  return createFacetCard({
@@ -4822,7 +5213,7 @@ const FacetGroup = ({ facets, children })=>{
4822
5213
  const availableFields = facets.map((f)=>f.field);
4823
5214
  useScrollToHash(availableFields, false);
4824
5215
  return /*#__PURE__*/ jsx("div", {
4825
- className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 3xl:grid-cols-5 w-content gap-4 my-4 ml-2 w-full",
5216
+ className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 3xl:grid-cols-5 w-content gap-4 ml-2 w-full",
4826
5217
  "data-testid": "title-cohort-builder-facet-groups",
4827
5218
  children: children
4828
5219
  });
@@ -5688,11 +6079,10 @@ const NavigationLogo = ({ src, title, description, width, height, divider = fals
5688
6079
  * @param iconHeight - the height of the icon
5689
6080
  * @param classNames - the class names to use for root, label, icon/tooltip and arrow'
5690
6081
  * @param noBasePath - set to true to avoid prepending a basePath to the link
5691
- */ const NavigationBarButton = ({ tooltip, icon, href, name, iconHeight = '27px', classNames = {}, noBasePath = false })=>{
6082
+ */ const NavigationBarButton = ({ tooltip, icon, href, name, iconHeight = '32px', classNames = {}, noBasePath = false })=>{
5692
6083
  const classNamesDefaults = {
5693
- root: 'flex flex-col flex-nowrap px-3 py-2 pt-4 items-center align-center text-primary hover:text-accent opacity-80 hover:opacity-100',
6084
+ root: 'flex flex-col flex-nowrap px-3 py-2 pt-4 justify-between items-center align-center text-primary hover:text-accent opacity-80 hover:opacity-100',
5694
6085
  label: 'pt-1.5 body-typo font-heading text-sm text-nowrap',
5695
- icon: 'mt-0.5 ml-1',
5696
6086
  ...TooltipStyle
5697
6087
  };
5698
6088
  const mergedClassnames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
@@ -7468,7 +7858,7 @@ const AdvancedSearch = ({ advSearchFilters, setAdvancedSearchFilters })=>{
7468
7858
  /*#__PURE__*/ jsxs("div", {
7469
7859
  className: "flex flex-row justify-between items-center",
7470
7860
  children: [
7471
- /*#__PURE__*/ jsx(SegmentedControl, {
7861
+ /*#__PURE__*/ jsx(SegmentedControl$1, {
7472
7862
  data: [
7473
7863
  {
7474
7864
  label: 'AND',
@@ -11594,7 +11984,7 @@ const CountsValue = ({ label, isSuccess, counts })=>{
11594
11984
  p: "xs",
11595
11985
  withBorder: true,
11596
11986
  className: "bg-primary text-primary-contrast font-heading text-md font-semibold",
11597
- children: `${counts?.toLocaleString() ?? '...'} ${label}`
11987
+ children: toCountsString(counts, label)
11598
11988
  })
11599
11989
  ]
11600
11990
  });
@@ -12113,247 +12503,74 @@ const DownloadsPanel = ({ dropdowns, buttons, loginForDownload, index, totalCoun
12113
12503
  let dropdownsToRender = dropdowns;
12114
12504
  if (loginRequired && !isUserLoggedIn) {
12115
12505
  dropdownsToRender = Object.entries(dropdowns ?? {}).reduce((acc, [key, dropdown])=>{
12116
- return {
12117
- ...acc,
12118
- [key]: {
12119
- ...dropdown,
12120
- title: `${dropdown.title} (Login Required)`,
12121
- buttons: dropdown.dropdownItems?.map((button)=>({
12122
- ...button,
12123
- title: `${button.title} (Login Required)`,
12124
- enabled: false
12125
- }))
12126
- }
12127
- };
12128
- }, {});
12129
- }
12130
- return dropdownsToRender;
12131
- }, [
12132
- dropdowns,
12133
- loginRequired,
12134
- isUserLoggedIn
12135
- ]);
12136
- return dropdowns || buttons ? /*#__PURE__*/ jsxs("div", {
12137
- className: "flex space-x-1",
12138
- children: [
12139
- Object.values(dropdownsToRender).map((dropdown)=>{
12140
- return createDownloadMenuButton(dropdown, {
12141
- type: index,
12142
- totalCount,
12143
- fields,
12144
- filter,
12145
- accessibility: accessibility ?? Accessibility.ALL
12146
- });
12147
- }),
12148
- buttons.map((button)=>{
12149
- let disabled = false;
12150
- let actionFunction = NullButtonAction;
12151
- let actionArgs = {};
12152
- const buttonAction = button.action ?? button.type;
12153
- if (buttonAction) {
12154
- const actionItem = findButtonAction(buttonAction);
12155
- if (actionItem) {
12156
- const funcArgs = actionItem.args ?? {};
12157
- const func = actionItem.action;
12158
- actionFunction = func;
12159
- actionArgs = funcArgs ?? {};
12160
- }
12161
- }
12162
- if (loginRequired && !isUserLoggedIn) {
12163
- disabled = true;
12164
- }
12165
- return /*#__PURE__*/ jsx(CohortActionButton, {
12166
- activeText: 'Downloading...',
12167
- inactiveText: button.title,
12168
- tooltipText: button.tooltipText,
12169
- disabled: disabled || !button.enabled,
12170
- actionFunction: actionFunction,
12171
- actionArgs: {
12172
- ...actionArgs,
12173
- ...button.actionArgs ?? {},
12174
- type: index,
12175
- totalCount,
12176
- fields,
12177
- filter,
12178
- accessibility: accessibility ?? Accessibility.ALL
12179
- }
12180
- }, button.title);
12181
- })
12182
- ]
12183
- }) : /*#__PURE__*/ jsx(React__default.Fragment, {});
12184
- };
12185
-
12186
- const FiltersPanel = ({ fields, dataFunctions, valueLabel })=>{
12187
- return /*#__PURE__*/ jsx("div", {
12188
- "data-testid": "filters-facets",
12189
- className: "flex flex-col gap-y-4 w-full",
12190
- children: fields.map((facetDefinition)=>{
12191
- if (facetDefinition?.type === undefined) {
12192
- console.warn('Facet definition missing type', facetDefinition);
12193
- return null;
12194
- }
12195
- if (!(facetDefinition.type in dataFunctions)) return null;
12196
- return createFacetCard({
12197
- facetDefinition,
12198
- valueLabel,
12199
- hooks: dataFunctions[facetDefinition.type],
12200
- facetNameFormatter: fieldNameToTitle,
12201
- idPrefix: 'filters-panel',
12202
- showPercent: false
12203
- });
12204
- })
12205
- });
12206
- };
12207
-
12208
- const AccessData = [
12209
- {
12210
- value: Accessibility.ALL,
12211
- label: 'All'
12212
- },
12213
- {
12214
- value: Accessibility.ACCESSIBLE,
12215
- label: 'Accessible'
12216
- },
12217
- {
12218
- value: Accessibility.UNACCESSIBLE,
12219
- label: 'Not Accessible'
12220
- }
12221
- ];
12222
- const AccessLevelControl = ({ onChange, accessLevel })=>{
12223
- const theme = useMantineTheme();
12224
- return /*#__PURE__*/ jsx(SegmentedControl, {
12225
- color: theme.colors.accent[5],
12226
- data: AccessData,
12227
- value: accessLevel,
12228
- onChange: (val)=>{
12229
- const accessibilityValue = AccessData.find((item)=>item.value === val)?.value || Accessibility.ALL;
12230
- onChange(accessibilityValue);
12231
- }
12232
- });
12233
- };
12234
-
12235
- const DropdownPanel = ({ index, filters, tabTitle, facetDefinitions, facetDataHooks, onAccessChange = (value)=>null, accessLevel = Accessibility.ALL, showAccessLevel = false })=>{
12236
- const [value, setValue] = useState('0');
12237
- const allFiltersCollapsed = useCoreSelector((state)=>selectAllCohortFiltersCollapsed(state, index));
12238
- const sharedFilters = useCoreSelector((state)=>selectSharedFilters(state));
12239
- const shareFilters = useCoreSelector((state)=>selectShouldShareFilters(state));
12240
- const theme = useMantineTheme();
12241
- const coreDispatch = useCoreDispatch();
12242
- const toggleAllFiltersExpanded = (expand)=>{
12243
- coreDispatch(toggleCohortBuilderAllFilters({
12244
- expand,
12245
- index
12246
- }));
12247
- };
12248
- const items = useDeepCompareMemo(()=>filters.tabs.map((tab, idx)=>{
12249
- return {
12250
- label: tab.title,
12251
- value: idx.toString()
12252
- };
12253
- }), [
12254
- filters.tabs
12255
- ]);
12256
- const fields = filters.tabs[Number(value)].fields.reduce((acc, field)=>{
12257
- return [
12258
- ...acc,
12259
- facetDefinitions[field]
12260
- ];
12261
- }, []);
12262
- const handleSharedFiltersChange = (value)=>{
12263
- modals.openConfirmModal({
12264
- title: 'Confirm change of shared filters mode',
12265
- children: /*#__PURE__*/ jsx(Text, {
12266
- size: "sm",
12267
- children: value ? 'Switching to Shared Filters mode will apply all selected filters across all indices.' : 'Switching to Unshared Filters mode will stop syncing filters but will not remove them.'
12268
- }),
12269
- labels: {
12270
- confirm: 'Confirm',
12271
- cancel: 'Cancel'
12272
- },
12273
- onConfirm: ()=>coreDispatch(setShouldShareFilters(value))
12274
- });
12275
- };
12276
- return /*#__PURE__*/ jsxs(Stack, {
12277
- align: "flex-start",
12506
+ return {
12507
+ ...acc,
12508
+ [key]: {
12509
+ ...dropdown,
12510
+ title: `${dropdown.title} (Login Required)`,
12511
+ buttons: dropdown.dropdownItems?.map((button)=>({
12512
+ ...button,
12513
+ title: `${button.title} (Login Required)`,
12514
+ enabled: false
12515
+ }))
12516
+ }
12517
+ };
12518
+ }, {});
12519
+ }
12520
+ return dropdownsToRender;
12521
+ }, [
12522
+ dropdowns,
12523
+ loginRequired,
12524
+ isUserLoggedIn
12525
+ ]);
12526
+ return dropdowns || buttons ? /*#__PURE__*/ jsxs("div", {
12527
+ className: "flex space-x-1",
12278
12528
  children: [
12279
- /*#__PURE__*/ jsxs(Group, {
12280
- justify: "space-between",
12281
- className: "w-full",
12282
- children: [
12283
- /*#__PURE__*/ jsx(Text, {
12284
- size: "xl",
12285
- fw: 800,
12286
- children: "Filters"
12287
- }),
12288
- /*#__PURE__*/ jsx("button", {
12289
- className: "text-primary text-sm font-normal",
12290
- onClick: ()=>toggleAllFiltersExpanded(allFiltersCollapsed),
12291
- children: allFiltersCollapsed ? 'Expand All' : 'Collapse All'
12292
- })
12293
- ]
12529
+ Object.values(dropdownsToRender).map((dropdown)=>{
12530
+ return createDownloadMenuButton(dropdown, {
12531
+ type: index,
12532
+ totalCount,
12533
+ fields,
12534
+ filter,
12535
+ accessibility: accessibility ?? Accessibility.ALL
12536
+ });
12294
12537
  }),
12295
- showAccessLevel ? /*#__PURE__*/ jsx(AccessLevelControl, {
12296
- onChange: onAccessChange,
12297
- accessLevel: accessLevel
12298
- }) : null,
12299
- /*#__PURE__*/ jsxs(Stack, {
12300
- className: "bg-base-max py-4 px-2 h-full w-full",
12301
- children: [
12302
- Object.keys(sharedFilters).length > 0 && /*#__PURE__*/ jsxs(Group, {
12303
- gap: "xs",
12304
- justify: "space-between",
12305
- children: [
12306
- /*#__PURE__*/ jsxs("div", {
12307
- className: "flex items-center space-x-1",
12308
- children: [
12309
- /*#__PURE__*/ jsx(Icon, {
12310
- icon: "gen3:share",
12311
- height: 16,
12312
- width: 16,
12313
- color: theme.colors.accent[4]
12314
- }),
12315
- /*#__PURE__*/ jsx(Text, {
12316
- size: "sm",
12317
- children: "Set the shared filters for all"
12318
- }),
12319
- /*#__PURE__*/ jsx(Tooltip, {
12320
- label: "If enabled any filter set on this tab will be applied to every tab where occurs.",
12321
- position: "top",
12322
- withArrow: true,
12323
- children: /*#__PURE__*/ jsx(Icon, {
12324
- icon: "gen3:info",
12325
- height: 12,
12326
- width: 12,
12327
- color: theme.colors.accent[4]
12328
- })
12329
- })
12330
- ]
12331
- }),
12332
- /*#__PURE__*/ jsx(Switch, {
12333
- checked: shareFilters,
12334
- onChange: (event)=>handleSharedFiltersChange(event.currentTarget.checked)
12335
- })
12336
- ]
12337
- }),
12338
- filters.tabs.length > 1 && /*#__PURE__*/ jsx(Select, {
12339
- classNames: {
12340
- options: 'border-1 border-base-dark',
12341
- option: 'hover:bg-primary-lightest'
12342
- },
12343
- withCheckIcon: false,
12344
- data: items,
12345
- value: value === null ? '0' : value,
12346
- onChange: setValue
12347
- }),
12348
- Object.keys(facetDefinitions).length > 0 ? /*#__PURE__*/ jsx(FiltersPanel, {
12349
- fields: fields,
12350
- dataFunctions: facetDataHooks,
12351
- valueLabel: tabTitle
12352
- }) : null
12353
- ]
12538
+ buttons.map((button)=>{
12539
+ let disabled = false;
12540
+ let actionFunction = NullButtonAction;
12541
+ let actionArgs = {};
12542
+ const buttonAction = button.action ?? button.type;
12543
+ if (buttonAction) {
12544
+ const actionItem = findButtonAction(buttonAction);
12545
+ if (actionItem) {
12546
+ const funcArgs = actionItem.args ?? {};
12547
+ const func = actionItem.action;
12548
+ actionFunction = func;
12549
+ actionArgs = funcArgs ?? {};
12550
+ }
12551
+ }
12552
+ if (loginRequired && !isUserLoggedIn) {
12553
+ disabled = true;
12554
+ }
12555
+ return /*#__PURE__*/ jsx(CohortActionButton, {
12556
+ activeText: 'Downloading...',
12557
+ inactiveText: button.title,
12558
+ tooltipText: button.tooltipText,
12559
+ disabled: disabled || !button.enabled,
12560
+ actionFunction: actionFunction,
12561
+ actionArgs: {
12562
+ ...actionArgs,
12563
+ ...button.actionArgs ?? {},
12564
+ type: index,
12565
+ totalCount,
12566
+ fields,
12567
+ filter,
12568
+ accessibility: accessibility ?? Accessibility.ALL
12569
+ }
12570
+ }, button.title);
12354
12571
  })
12355
12572
  ]
12356
- });
12573
+ }) : /*#__PURE__*/ jsx(React__default.Fragment, {});
12357
12574
  };
12358
12575
 
12359
12576
  const EmptyData = {};
@@ -12709,6 +12926,11 @@ const TabbedCohortBuilder = ({ index, tabsConfiguration })=>{
12709
12926
  filters: cohortFilters,
12710
12927
  accessibility: accessLevel
12711
12928
  });
12929
+ const { data: counts, isSuccess: isCountSuccess, isError } = useGetCountsQuery({
12930
+ type: index,
12931
+ filters: cohortFilters,
12932
+ accessibility: accessLevel
12933
+ });
12712
12934
  const [facetDefinitions, setFacetDefinitions] = useState({});
12713
12935
  useEffect(()=>{
12714
12936
  // Check if the router initiated the change
@@ -12786,6 +13008,18 @@ const TabbedCohortBuilder = ({ index, tabsConfiguration })=>{
12786
13008
  cohortFilters.root,
12787
13009
  isSuccess
12788
13010
  ]);
13011
+ const EnumHookInstances = {
13012
+ useGetFacetData: getEnumFacetData,
13013
+ useUpdateFacetFilters: partial(useUpdateFilters$1, index),
13014
+ useGetFacetFilters: partial(useGetFacetFilters$1, index),
13015
+ useClearFilter: partial(useClearFilters$1, index),
13016
+ useFilterExpanded: partial(useFilterExpandedState$1, index),
13017
+ useToggleExpandFilter: partial(useToggleExpandFilter$1, index),
13018
+ useGetCombineMode: partial(useCohortFilterCombineState, index),
13019
+ useSetCombineMode: partial(useSetCohortFilterCombineState, index),
13020
+ useFieldNameToTitle: useFieldNameToTitle,
13021
+ useTotalCounts: undefined
13022
+ };
12789
13023
  const RangeHookInstances = {
12790
13024
  useGetFacetData: getRangeFacetData,
12791
13025
  useUpdateFacetFilters: partial(useUpdateFilters$1, index),
@@ -12800,38 +13034,9 @@ const TabbedCohortBuilder = ({ index, tabsConfiguration })=>{
12800
13034
  const facetDataHooks = useDeepCompareMemo(()=>{
12801
13035
  return {
12802
13036
  // TODO: see if there a better way to do this
12803
- enum: {
12804
- useGetFacetData: getEnumFacetData,
12805
- useUpdateFacetFilters: partial(useUpdateFilters$1, index),
12806
- useGetFacetFilters: partial(useGetFacetFilters$1, index),
12807
- useClearFilter: partial(useClearFilters$1, index),
12808
- useFilterExpanded: partial(useFilterExpandedState$1, index),
12809
- useToggleExpandFilter: partial(useToggleExpandFilter$1, index),
12810
- useGetCombineMode: partial(useCohortFilterCombineState, index),
12811
- useSetCombineMode: partial(useSetCohortFilterCombineState, index),
12812
- useFieldNameToTitle: useFieldNameToTitle,
12813
- useTotalCounts: undefined
12814
- },
12815
- exact: {
12816
- useGetFacetData: getEnumFacetData,
12817
- useUpdateFacetFilters: partial(useUpdateFilters$1, index),
12818
- useGetFacetFilters: partial(useGetFacetFilters$1, index),
12819
- useClearFilter: partial(useClearFilters$1, index),
12820
- useFilterExpanded: partial(useFilterExpandedState$1, index),
12821
- useToggleExpandFilter: partial(useToggleExpandFilter$1, index),
12822
- useFieldNameToTitle: useFieldNameToTitle,
12823
- useTotalCounts: undefined
12824
- },
12825
- multiselect: {
12826
- useGetFacetData: getEnumFacetData,
12827
- useUpdateFacetFilters: partial(useUpdateFilters$1, index),
12828
- useGetFacetFilters: partial(useGetFacetFilters$1, index),
12829
- useClearFilter: partial(useClearFilters$1, index),
12830
- useFilterExpanded: partial(useFilterExpandedState$1, index),
12831
- useToggleExpandFilter: partial(useToggleExpandFilter$1, index),
12832
- useFieldNameToTitle: useFieldNameToTitle,
12833
- useTotalCounts: undefined
12834
- },
13037
+ enum: EnumHookInstances,
13038
+ exact: EnumHookInstances,
13039
+ multiselect: EnumHookInstances,
12835
13040
  range: RangeHookInstances,
12836
13041
  age: RangeHookInstances,
12837
13042
  year: RangeHookInstances,
@@ -12839,32 +13044,50 @@ const TabbedCohortBuilder = ({ index, tabsConfiguration })=>{
12839
13044
  days: RangeHookInstances,
12840
13045
  percent: RangeHookInstances,
12841
13046
  datetime: RangeHookInstances,
12842
- toggle: RangeHookInstances
13047
+ toggle: RangeHookInstances,
13048
+ upload: EnumHookInstances
12843
13049
  };
12844
13050
  }, [
12845
13051
  getEnumFacetData,
12846
13052
  getRangeFacetData,
12847
13053
  index
12848
13054
  ]);
12849
- return /*#__PURE__*/ jsx(FacetTabs, {
12850
- activeTab: activeTab,
12851
- setActiveTab: setActiveTab,
12852
- facetDefinitions: facetDefinitions,
12853
- tabsConfig: tabsConfig,
12854
- usedFacets: cohortBuilderFilters,
12855
- hooks: facetDataHooks,
12856
- customFacetHooks: {
12857
- useCustomFacets,
12858
- useAvailableCustomFacets: (usedFacets, onlyFiltersWithValues, queryOptions)=>({
12859
- data: {},
12860
- isSuccess: true
12861
- }),
12862
- useAddCustomFilter: ()=>(filter)=>{},
12863
- useRemoveCustomFilter: ()=>(filter)=>{}
13055
+ return /*#__PURE__*/ jsxs(Stack, {
13056
+ gap: "xs",
13057
+ align: "stretch",
13058
+ classNames: {
13059
+ root: 'w-full'
12864
13060
  },
12865
- getFacetLabel: ()=>'Cases',
12866
- cardScrollMargin: calculateStickyHeaderHeight(),
12867
- useFieldNameToTitle: useFieldNameToTitle
13061
+ children: [
13062
+ /*#__PURE__*/ jsx(Group, {
13063
+ justify: "flex-end",
13064
+ children: /*#__PURE__*/ jsx(CountsValue, {
13065
+ label: index,
13066
+ counts: counts,
13067
+ isSuccess: isCountSuccess
13068
+ })
13069
+ }),
13070
+ /*#__PURE__*/ jsx(FacetTabs, {
13071
+ activeTab: activeTab,
13072
+ setActiveTab: setActiveTab,
13073
+ facetDefinitions: facetDefinitions,
13074
+ tabsConfig: tabsConfig,
13075
+ usedFacets: cohortBuilderFilters,
13076
+ hooks: facetDataHooks,
13077
+ customFacetHooks: {
13078
+ useCustomFacets,
13079
+ useAvailableCustomFacets: (usedFacets, onlyFiltersWithValues, queryOptions)=>({
13080
+ data: {},
13081
+ isSuccess: true
13082
+ }),
13083
+ useAddCustomFilter: ()=>(filter)=>{},
13084
+ useRemoveCustomFilter: ()=>(filter)=>{}
13085
+ },
13086
+ getFacetLabel: ()=>'Cases',
13087
+ cardScrollMargin: calculateStickyHeaderHeight(),
13088
+ useFieldNameToTitle: useFieldNameToTitle
13089
+ })
13090
+ ]
12868
13091
  });
12869
13092
  };
12870
13093
 
@@ -13834,7 +14057,7 @@ const AnalysisCard = ({ title, description, type, icon, image, hasDemo, loginReq
13834
14057
  className: "h-full",
13835
14058
  children: [
13836
14059
  /*#__PURE__*/ jsx("div", {
13837
- className: "p-0 rounded-sm h-1/2 h-max-1/2",
14060
+ className: "p-0 rounded-sm h-1/2 h-max-1/2 flex justify-center items-center overflow-hidden",
13838
14061
  children: /*#__PURE__*/ jsx(Image$1, {
13839
14062
  component: Image,
13840
14063
  src: `${image}`,
@@ -17307,7 +17530,7 @@ const ComparisonCard = ({ config, groundData, groundLabel, comparisonData, compa
17307
17530
  fw: 600,
17308
17531
  children: fieldNameToTitle(field)
17309
17532
  }),
17310
- /*#__PURE__*/ jsx(SegmentedControl, {
17533
+ /*#__PURE__*/ jsx(SegmentedControl$1, {
17311
17534
  value: viewType,
17312
17535
  onChange: setViewType,
17313
17536
  data: [
@@ -19088,6 +19311,77 @@ const registerMetadataSchemaApp = ()=>createGen3App({
19088
19311
  requiredEntityTypes: []
19089
19312
  });
19090
19313
 
19314
+ const DropdownWithIcon = ({ disableTargetWidth, LeftIcon, RightIcon = /*#__PURE__*/ jsx(IoMdArrowDropdown, {
19315
+ size: "1.25em",
19316
+ "aria-hidden": "true",
19317
+ "data-testid": "dropdown-icon"
19318
+ }), TargetButtonChildren, targetButtonDisabled, dropdownElements, menuLabelText, menuLabelCustomClass, customPosition, fullHeight, zIndex = undefined, customDataTestId = undefined, tooltip = undefined, buttonAriaLabel = undefined })=>{
19319
+ return /*#__PURE__*/ jsxs(Menu, {
19320
+ width: disableTargetWidth ?? 'target',
19321
+ ...customPosition && {
19322
+ position: customPosition
19323
+ },
19324
+ "data-testid": customDataTestId ?? 'menu-elem',
19325
+ zIndex: zIndex,
19326
+ children: [
19327
+ /*#__PURE__*/ jsx(Menu.Target, {
19328
+ children: /*#__PURE__*/ jsx(Button, {
19329
+ variant: "outline",
19330
+ color: "primary",
19331
+ className: `bg-base-max border-primary data-disabled:opacity-50 data-disabled:bg-base-max data-disabled:text-primary ${focusStyles}`,
19332
+ ...LeftIcon && {
19333
+ leftIcon: LeftIcon
19334
+ },
19335
+ rightSection: RightIcon,
19336
+ disabled: targetButtonDisabled,
19337
+ classNames: {
19338
+ // rightIcon: 'border-l pl-1 -mr-2',
19339
+ root: fullHeight ? 'h-full' : undefined
19340
+ },
19341
+ "aria-label": buttonAriaLabel,
19342
+ children: /*#__PURE__*/ jsx("div", {
19343
+ children: tooltip?.length && !targetButtonDisabled ? /*#__PURE__*/ jsx("div", {
19344
+ children: /*#__PURE__*/ jsx(Tooltip, {
19345
+ label: tooltip,
19346
+ children: /*#__PURE__*/ jsx("div", {
19347
+ children: TargetButtonChildren
19348
+ })
19349
+ })
19350
+ }) : /*#__PURE__*/ jsx("div", {
19351
+ children: TargetButtonChildren
19352
+ })
19353
+ })
19354
+ })
19355
+ }),
19356
+ /*#__PURE__*/ jsxs(Menu.Dropdown, {
19357
+ "data-testid": "dropdown-menu-options",
19358
+ className: "border-1 border-secondary",
19359
+ children: [
19360
+ menuLabelText && /*#__PURE__*/ jsxs(React__default.Fragment, {
19361
+ children: [
19362
+ /*#__PURE__*/ jsx(Menu.Label, {
19363
+ className: menuLabelCustomClass ?? 'font-bold',
19364
+ "data-testid": "menu-label",
19365
+ children: menuLabelText
19366
+ }),
19367
+ /*#__PURE__*/ jsx(Menu.Divider, {})
19368
+ ]
19369
+ }),
19370
+ dropdownElements?.map(({ title, onClick, icon, disabled }, idx)=>/*#__PURE__*/ jsx(Menu.Item, {
19371
+ onClick: ()=>{
19372
+ if (onClick) onClick();
19373
+ },
19374
+ "data-testid": `${title}-${idx}`,
19375
+ leftSection: icon && icon,
19376
+ disabled: disabled,
19377
+ children: title
19378
+ }, `${title}-${idx}`))
19379
+ ]
19380
+ })
19381
+ ]
19382
+ });
19383
+ };
19384
+
19091
19385
  const ActionButton = ({ title, enabled, type, leftIcon, rightIcon, tooltipText })=>{
19092
19386
  return /*#__PURE__*/ jsx(Tooltip, {
19093
19387
  label: tooltipText,
@@ -25061,8 +25355,26 @@ const TabbedCohortBuilderPage = ({ headerProps, footerProps, configuration })=>{
25061
25355
  content: 'Tabbed Cohort Builder Page',
25062
25356
  key: 'gen3-tabbed-cohort-builder-page'
25063
25357
  },
25064
- children: /*#__PURE__*/ jsx(TabbedCohortBuilder, {
25065
- ...configuration
25358
+ children: /*#__PURE__*/ jsxs(Stack, {
25359
+ align: "stretch",
25360
+ classNames: {
25361
+ root: 'w-full'
25362
+ },
25363
+ children: [
25364
+ /*#__PURE__*/ jsx("div", {
25365
+ className: "w-full flex-col flex gap-4 fixed bg-white z-10",
25366
+ children: /*#__PURE__*/ jsx(CohortManager$1, {
25367
+ index: configuration.index
25368
+ })
25369
+ }),
25370
+ /*#__PURE__*/ jsx("div", {
25371
+ className: "w-full mt-40 mr-4",
25372
+ children: /*#__PURE__*/ jsx(TabbedCohortBuilder, {
25373
+ ...configuration,
25374
+ index: configuration.index
25375
+ })
25376
+ })
25377
+ ]
25066
25378
  })
25067
25379
  });
25068
25380
  };
@@ -25529,5 +25841,5 @@ const staticNotebookAPI = async (req, res)=>{
25529
25841
  });
25530
25842
  };
25531
25843
 
25532
- export { AISearchPageGetServerSideProps, AccessLevel, ActionBar, ActionButton, AdminAuthZPageGetServerSideProps, AiSearch, AISearchPage as AiSearchPage, AnalysisCenter, AnalysisCenterWithSections, AnalysisEditorPage, AnalysisEditorPageGetServerSideProps, AnalysisPage, AnalysisPageGetServerSideProps, AuthzPage, BAD_DATA_MESSAGE, Banner, BaseModal, Charts, CohortBuilder, CohortManager$1 as CohortManager, CollapsableCharts, CollapsableSidebar, ColorThemePage, ColorThemePageGetServerSideProps, ContentSource$1 as ContentSource, CreateCredentialsAPIKeyModal, CrosswalkPage, CrosswalkPageGetServerSideProps, Custom404Page, DAYS_IN_YEAR, DEFAULT_MAXIMUM, DEFAULT_MINIMUM, DEFAULT_VISIBLE_ITEMS$1 as DEFAULT_VISIBLE_ITEMS, DataLibraryPage, DataLibraryPageGetServerSideProps, DictionaryPage, DictionaryPageGetServerSideProps, DiscoveryCellRendererFactory, DiscoveryProvider as DiscoveryConfigProvider, DiscoveryIndexPanel, DiscoveryPage, DiscoveryPageGetServerSideProps, DiscoveryRowRendererFactory, DropdownButton, EnumFacet, EnumFacetChart, ErrorCard, ExactValueFacet, ExplorerPage, ExplorerPageGetServerSideProps, ExplorerPageGetServerSidePropsForConfigId, ExplorerTableCellRendererFactory, ExplorerTableDetailsPanelFactory, FacetControlsHeader, FacetExpander, FacetSelector, FacetSortPanel, FacetTabs, FirstTimeModal, Footer, Gen3Button, Gen3ButtonReverse, Gen3Link, Gen3ModalsProvider, Gen3Provider, GqlQueryEditor$1 as GqlQueryEditor, Header$1 as Header, HoverLink, LandingPage, LandingPageGetServerSideProps, LoginButton$1 as LoginButton, LoginPage, LoginPageGetServerSideProps, LoginPanel, LoginProvidersPanel, MinutesToMilliseconds, MultiSelectValueFacet, NavPageLayout, NavigationBar, NavigationButton, NoAccessModal, NotebookLitePage, NotebookLitePageGetStaticProps, ProfilePage, ProfilePageGetServerSideProps, ProfileProvider, ProtectedContent, QueryExpression, QueryExpressionContext, QueryExpressionSection, QueryPage, QueryPageGetServerSideProps, RangeFacet, ReactECharts, ResourcesFilters, SPECIAL_CASE_FIELDS, SessionExpiredModal, SinglePageStudyDetailsPanel, StaticNotebookIFrame, StaticNotebookViewer, StudyDetailsPanel, StudyGroup, StudyGroupPanel, StudyProvider, SubmissionPage, SubmissionPageGetServerSideProps, TabbedCohortBuilder, TabbedCohortBuilderPage, TabbedCohortBuilderPageGetServerSideProps, TagCloud, TailwindConfig, TopBar, UploadJSONButton, User, Workspace, WorkspaceNoAccessPage, WorkspaceNoAccessPageServerSideProps, WorkspacePage, WorkspacePageGetServerSideProps, accessibleFieldName, addIntersectionToIncludes, addUnion, analysisApiCohortDiscovery, buildNested, capitalize, classifyFacets, compareKeysAscending, compareKeysDescending, computeRowSpan, convertMinutesToMilliseconds, convertPathsToTree, convertSecondsToMilliseconds, convertToStringArray, create10ColorAccessibleContrast, create10ColorPallet, createMantineTheme, credentialsLogin, credentialsLogout, extractObjectKey, extractRangeValues, focusStyles, getAllFieldsFromFilterConfigs, getCurrentUnixTimestamp, getNavPageLayoutPropsFromConfig, getParamsValueAsString, getTagInfo, hasOwnProperty, isArrayOfString, isEnumFacetResponse, isHeaderMetadata, isPropertyKey, isTextTransform$1 as isTextTransform, mapFacetSortToSortType, processBucketData, processLabel$1 as processLabel, processRangeData, processRangeKeyLabel, registerCohortBuilderDefaultPreviewRenderers, registerCohortDiscoveryApp, registerCohortSimilarityApp, registerDefaultDiscoveryDataLoaders, registerDiscoveryDefaultCellRenderers, registerDiscoveryDefaultStudyPreviewRenderers, registerExplorerDefaultCellRenderers, registerMetadataSchemaApp, removeIntersectionFromEnum, removeKey$1 as removeKey, removeUnion, resourcePathFromProjectID, sessionLogout, sessionToken, staticNotebookAPI, stripTrailingSlash, toDisplayName, truncateString, unixTimeToString, updateFacetEnum, useClearFilters$1 as useClearFilters, useDiscoveryContext, useExtractEnumFilterValues, useExtractRangeFilterValues, useFieldNameToTitle, useGetFacetFilters$1 as useGetFacetFilters, useUpdateFilters$1 as useUpdateFilters, userHasMethodForServiceOnResource$1 as userHasMethodForServiceOnResource };
25844
+ export { AISearchPageGetServerSideProps, AccessLevel, AccordionPanel, ActionBar, ActionButton, AdminAuthZPageGetServerSideProps, AiSearch, AISearchPage as AiSearchPage, AnalysisCenter, AnalysisCenterWithSections, AnalysisEditorPage, AnalysisEditorPageGetServerSideProps, AnalysisPage, AnalysisPageGetServerSideProps, AuthzPage, BAD_DATA_MESSAGE, Banner, BaseModal, Charts, CohortBuilder, CohortManager$1 as CohortManager, CollapsableCharts, CollapsableSidebar, ColorThemePage, ColorThemePageGetServerSideProps, ContentSource$1 as ContentSource, CreateCredentialsAPIKeyModal, CrosswalkPage, CrosswalkPageGetServerSideProps, Custom404Page, DAYS_IN_YEAR, DEFAULT_MAXIMUM, DEFAULT_MINIMUM, DEFAULT_VISIBLE_ITEMS$1 as DEFAULT_VISIBLE_ITEMS, DataLibraryPage, DataLibraryPageGetServerSideProps, DictionaryPage, DictionaryPageGetServerSideProps, DiscoveryCellRendererFactory, DiscoveryProvider as DiscoveryConfigProvider, DiscoveryIndexPanel, DiscoveryPage, DiscoveryPageGetServerSideProps, DiscoveryRowRendererFactory, DropdownButton, DropdownPanel, DropdownWithIcon, EnumFacet, EnumFacetChart, ErrorCard, ExactValueFacet, ExplorerPage, ExplorerPageGetServerSideProps, ExplorerPageGetServerSidePropsForConfigId, ExplorerTableCellRendererFactory, ExplorerTableDetailsPanelFactory, FacetControlsHeader, FacetExpander, FacetSelector, FacetSortPanel, FacetTabs, FiltersPanel, FirstTimeModal, Footer, Gen3Button, Gen3ButtonReverse, Gen3Link, Gen3ModalsProvider, Gen3Provider, GqlQueryEditor$1 as GqlQueryEditor, Header$1 as Header, HoverLink, LandingPage, LandingPageGetServerSideProps, LoginButton$1 as LoginButton, LoginPage, LoginPageGetServerSideProps, LoginPanel, LoginProvidersPanel, MinutesToMilliseconds, MultiSelectValueFacet, NavPageLayout, NavigationBar, NavigationButton, NoAccessModal, NotebookLitePage, NotebookLitePageGetStaticProps, ProfilePage, ProfilePageGetServerSideProps, ProfileProvider, ProtectedContent, QueryExpression, QueryExpressionContext, QueryExpressionSection, QueryPage, QueryPageGetServerSideProps, RangeFacet, ReactECharts, ResourcesFilters, SPECIAL_CASE_FIELDS, SegmentedControl, SessionExpiredModal, SinglePageStudyDetailsPanel, StaticNotebookIFrame, StaticNotebookViewer, StudyDetailsPanel, StudyGroup, StudyGroupPanel, StudyProvider, SubmissionPage, SubmissionPageGetServerSideProps, TabbedCohortBuilder, TabbedCohortBuilderPage, TabbedCohortBuilderPageGetServerSideProps, TabbedPanel, TagCloud, TailwindConfig, TopBar, UploadJSONButton, User, Workspace, WorkspaceNoAccessPage, WorkspaceNoAccessPageServerSideProps, WorkspacePage, WorkspacePageGetServerSideProps, accessibleFieldName, addIntersectionToIncludes, addUnion, analysisApiCohortDiscovery, buildNested, capitalize, classifyFacets, compareKeysAscending, compareKeysDescending, computeRowSpan, convertMinutesToMilliseconds, convertPathsToTree, convertSecondsToMilliseconds, convertToStringArray, create10ColorAccessibleContrast, create10ColorPallet, createMantineTheme, credentialsLogin, credentialsLogout, extractObjectKey, extractRangeValues, focusStyles, getAllFieldsFromFilterConfigs, getCurrentUnixTimestamp, getNavPageLayoutPropsFromConfig, getParamsValueAsString, getTagInfo, hasOwnProperty, isArrayOfString, isEnumFacetResponse, isHeaderMetadata, isPropertyKey, isTextTransform$1 as isTextTransform, mapFacetSortToSortType, processBucketData, processLabel$1 as processLabel, processRangeData, processRangeKeyLabel, registerCohortBuilderDefaultPreviewRenderers, registerCohortDiscoveryApp, registerCohortSimilarityApp, registerDefaultDiscoveryDataLoaders, registerDiscoveryDefaultCellRenderers, registerDiscoveryDefaultStudyPreviewRenderers, registerExplorerDefaultCellRenderers, registerMetadataSchemaApp, removeIntersectionFromEnum, removeKey$1 as removeKey, removeUnion, resourcePathFromProjectID, sessionLogout, sessionToken, staticNotebookAPI, stripTrailingSlash, toCountsString, toDisplayName, truncateString, unixTimeToString, updateFacetEnum, useClearFilters$1 as useClearFilters, useDiscoveryContext, useExtractEnumFilterValues, useExtractRangeFilterValues, useFieldNameToTitle, useGetFacetFilters$1 as useGetFacetFilters, useUpdateFilters$1 as useUpdateFilters, userHasMethodForServiceOnResource$1 as userHasMethodForServiceOnResource };
25533
25845
  //# sourceMappingURL=index.js.map