@gen3/frontend 0.10.73 → 0.10.75

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 (250) hide show
  1. package/dist/cjs/index.js +229 -173
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.d.ts +1 -0
  4. package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.d.ts.map +1 -1
  5. package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.js +3 -3
  6. package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.js.map +1 -1
  7. package/dist/dts/components/Buttons/UploadJSONButton.js +1 -1
  8. package/dist/dts/components/Buttons/UploadJSONButton.js.map +1 -1
  9. package/dist/dts/components/Content/TextContent.d.ts +1 -2
  10. package/dist/dts/components/Content/TextContent.d.ts.map +1 -1
  11. package/dist/dts/components/Content/TextContent.js +5 -8
  12. package/dist/dts/components/Content/TextContent.js.map +1 -1
  13. package/dist/dts/components/CountButton/CountButton.d.ts +19 -0
  14. package/dist/dts/components/CountButton/CountButton.d.ts.map +1 -0
  15. package/dist/dts/components/CountButton/CountButton.js +18 -0
  16. package/dist/dts/components/CountButton/CountButton.js.map +1 -0
  17. package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.d.ts +8 -12
  18. package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.d.ts.map +1 -1
  19. package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.js +17 -11
  20. package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.js.map +1 -1
  21. package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.unit.test.js +18 -4
  22. package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.unit.test.js.map +1 -1
  23. package/dist/dts/components/ErrorMessage.d.ts +6 -0
  24. package/dist/dts/components/ErrorMessage.d.ts.map +1 -0
  25. package/dist/dts/components/ErrorMessage.js +8 -0
  26. package/dist/dts/components/ErrorMessage.js.map +1 -0
  27. package/dist/dts/components/Login/LoginProvidersPanel.d.ts.map +1 -1
  28. package/dist/dts/components/Login/LoginProvidersPanel.js +5 -8
  29. package/dist/dts/components/Login/LoginProvidersPanel.js.map +1 -1
  30. package/dist/dts/components/MessageCards/ErrorCard.js +1 -1
  31. package/dist/dts/components/MessageCards/ErrorCard.js.map +1 -1
  32. package/dist/dts/components/MessageCards/WarningCard.js +1 -1
  33. package/dist/dts/components/MessageCards/WarningCard.js.map +1 -1
  34. package/dist/dts/components/MessagePanel.d.ts.map +1 -1
  35. package/dist/dts/components/MessagePanel.js +1 -1
  36. package/dist/dts/components/MessagePanel.js.map +1 -1
  37. package/dist/dts/components/Providers/Gen3Provider.d.ts +3 -2
  38. package/dist/dts/components/Providers/Gen3Provider.d.ts.map +1 -1
  39. package/dist/dts/components/Providers/Gen3Provider.js +8 -4
  40. package/dist/dts/components/Providers/Gen3Provider.js.map +1 -1
  41. package/dist/dts/components/Providers/ResourceMonitor.d.ts +1 -1
  42. package/dist/dts/components/Providers/ResourceMonitor.d.ts.map +1 -1
  43. package/dist/dts/components/Providers/ResourceMonitor.js +48 -131
  44. package/dist/dts/components/Providers/ResourceMonitor.js.map +1 -1
  45. package/dist/dts/components/charts/echarts/BarChart.d.ts.map +1 -1
  46. package/dist/dts/components/charts/echarts/BarChart.js +28 -4
  47. package/dist/dts/components/charts/echarts/BarChart.js.map +1 -1
  48. package/dist/dts/components/facets/FacetControlsHeader.d.ts.map +1 -1
  49. package/dist/dts/components/facets/FacetControlsHeader.js +0 -1
  50. package/dist/dts/components/facets/FacetControlsHeader.js.map +1 -1
  51. package/dist/dts/features/CohortBuilder/CohortBuilder.d.ts +1 -0
  52. package/dist/dts/features/CohortBuilder/CohortBuilder.d.ts.map +1 -1
  53. package/dist/dts/features/CohortBuilder/CohortBuilder.js +13 -1
  54. package/dist/dts/features/CohortBuilder/CohortBuilder.js.map +1 -1
  55. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.d.ts +10 -0
  56. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.d.ts.map +1 -0
  57. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.js +53 -0
  58. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.js.map +1 -0
  59. package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.d.ts +7 -0
  60. package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.d.ts.map +1 -0
  61. package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.js +38 -0
  62. package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.js.map +1 -0
  63. package/dist/dts/features/CohortBuilder/{CohortSelector.d.ts → CohortManager/CohortSelector.d.ts} +4 -1
  64. package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.d.ts.map +1 -0
  65. package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.js +56 -0
  66. package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.js.map +1 -0
  67. package/dist/dts/features/CohortBuilder/CohortManager/cohortUtils.d.ts +4 -0
  68. package/dist/dts/features/CohortBuilder/CohortManager/cohortUtils.d.ts.map +1 -0
  69. package/dist/dts/features/CohortBuilder/CohortManager/cohortUtils.js +22 -0
  70. package/dist/dts/features/CohortBuilder/CohortManager/cohortUtils.js.map +1 -0
  71. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.d.ts +1 -0
  72. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.d.ts.map +1 -0
  73. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.js +320 -0
  74. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.js.map +1 -0
  75. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveModal.d.ts +1 -0
  76. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveModal.d.ts.map +1 -0
  77. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveModal.js +2 -0
  78. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveModal.js.map +1 -0
  79. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.d.ts +29 -0
  80. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.d.ts.map +1 -0
  81. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.js +85 -0
  82. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.js.map +1 -0
  83. package/dist/dts/features/CohortBuilder/CohortPanel.d.ts.map +1 -1
  84. package/dist/dts/features/CohortBuilder/CohortPanel.js +3 -2
  85. package/dist/dts/features/CohortBuilder/CohortPanel.js.map +1 -1
  86. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.d.ts +6 -0
  87. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.d.ts.map +1 -0
  88. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.js +55 -0
  89. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.js.map +1 -0
  90. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.d.ts +13 -0
  91. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.d.ts.map +1 -0
  92. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.js +41 -0
  93. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.js.map +1 -0
  94. package/dist/dts/features/CohortBuilder/{QueryExpressionSection.d.ts → QueryExpression/QueryExpressionSection.d.ts} +1 -4
  95. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.d.ts.map +1 -0
  96. package/dist/dts/features/CohortBuilder/{QueryExpressionSection.js → QueryExpression/QueryExpressionSection.js} +36 -28
  97. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.js.map +1 -0
  98. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionsExpandedContext.d.ts.map +1 -0
  99. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionsExpandedContext.js.map +1 -0
  100. package/dist/dts/features/CohortBuilder/{QueryRepresentation.d.ts → QueryExpression/QueryRepresentation.d.ts} +1 -1
  101. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.d.ts.map +1 -0
  102. package/dist/dts/features/CohortBuilder/{QueryRepresentation.js → QueryExpression/QueryRepresentation.js} +23 -30
  103. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.js.map +1 -0
  104. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentationLabel.d.ts.map +1 -0
  105. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentationLabel.js.map +1 -0
  106. package/dist/dts/features/CohortBuilder/cohortUtils.d.ts +4 -0
  107. package/dist/dts/features/CohortBuilder/cohortUtils.d.ts.map +1 -0
  108. package/dist/dts/features/CohortBuilder/cohortUtils.js +23 -0
  109. package/dist/dts/features/CohortBuilder/cohortUtils.js.map +1 -0
  110. package/dist/dts/features/CohortBuilder/hooks.d.ts +1 -0
  111. package/dist/dts/features/CohortBuilder/hooks.d.ts.map +1 -1
  112. package/dist/dts/features/CohortBuilder/hooks.js +52 -1
  113. package/dist/dts/features/CohortBuilder/hooks.js.map +1 -1
  114. package/dist/dts/features/CohortBuilder/style.d.ts +6 -0
  115. package/dist/dts/features/CohortBuilder/style.d.ts.map +1 -1
  116. package/dist/dts/features/CohortBuilder/style.js +11 -0
  117. package/dist/dts/features/CohortBuilder/style.js.map +1 -1
  118. package/dist/dts/features/CohortDiscovery/ChartsAndFacetsPanel.d.ts.map +1 -1
  119. package/dist/dts/features/CohortDiscovery/ChartsAndFacetsPanel.js +6 -4
  120. package/dist/dts/features/CohortDiscovery/ChartsAndFacetsPanel.js.map +1 -1
  121. package/dist/dts/features/CohortDiscovery/CohortManager.d.ts.map +1 -0
  122. package/dist/dts/features/CohortDiscovery/CohortManager.js +57 -0
  123. package/dist/dts/features/CohortDiscovery/CohortManager.js.map +1 -0
  124. package/dist/dts/features/CohortDiscovery/CohortSelectors.d.ts +23 -0
  125. package/dist/dts/features/CohortDiscovery/CohortSelectors.d.ts.map +1 -0
  126. package/dist/dts/features/CohortDiscovery/CohortSelectors.js +35 -0
  127. package/dist/dts/features/CohortDiscovery/CohortSelectors.js.map +1 -0
  128. package/dist/dts/features/CohortDiscovery/CohortSlice.d.ts +91 -0
  129. package/dist/dts/features/CohortDiscovery/CohortSlice.d.ts.map +1 -0
  130. package/dist/dts/features/CohortDiscovery/CohortSlice.js +93 -0
  131. package/dist/dts/features/CohortDiscovery/CohortSlice.js.map +1 -0
  132. package/dist/dts/features/CohortDiscovery/FilterPanels/createFacetPanel.d.ts.map +1 -1
  133. package/dist/dts/features/CohortDiscovery/IndexPanel.d.ts.map +1 -1
  134. package/dist/dts/features/CohortDiscovery/IndexPanel.js +5 -3
  135. package/dist/dts/features/CohortDiscovery/IndexPanel.js.map +1 -1
  136. package/dist/dts/features/CohortDiscovery/appApi.d.ts +2 -0
  137. package/dist/dts/features/CohortDiscovery/appApi.d.ts.map +1 -1
  138. package/dist/dts/features/CohortDiscovery/appApi.js +2 -0
  139. package/dist/dts/features/CohortDiscovery/appApi.js.map +1 -1
  140. package/dist/dts/features/CohortDiscovery/hooks.d.ts +10 -0
  141. package/dist/dts/features/CohortDiscovery/hooks.d.ts.map +1 -1
  142. package/dist/dts/features/CohortDiscovery/hooks.js +38 -1
  143. package/dist/dts/features/CohortDiscovery/hooks.js.map +1 -1
  144. package/dist/dts/features/CohortDiversity/diversityApi.d.ts +12 -12
  145. package/dist/dts/features/DataLibrary/QueryDetails.d.ts.map +1 -1
  146. package/dist/dts/features/DataLibrary/QueryDetails.js +2 -2
  147. package/dist/dts/features/DataLibrary/QueryDetails.js.map +1 -1
  148. package/dist/dts/features/Dictionary/Dictionary.d.ts.map +1 -1
  149. package/dist/dts/features/Dictionary/Dictionary.js +0 -1
  150. package/dist/dts/features/Dictionary/Dictionary.js.map +1 -1
  151. package/dist/dts/features/Dictionary/index.d.ts +1 -3
  152. package/dist/dts/features/Dictionary/index.d.ts.map +1 -1
  153. package/dist/dts/features/Dictionary/index.js +1 -3
  154. package/dist/dts/features/Dictionary/index.js.map +1 -1
  155. package/dist/dts/features/Workspace/ExternalLogins/ExternalLoginsStatus.d.ts.map +1 -1
  156. package/dist/dts/features/Workspace/ExternalLogins/ExternalLoginsStatus.js +1 -1
  157. package/dist/dts/features/Workspace/ExternalLogins/ExternalLoginsStatus.js.map +1 -1
  158. package/dist/dts/features/Workspace/NotebookCard.d.ts.map +1 -1
  159. package/dist/dts/features/Workspace/NotebookCard.js +8 -30
  160. package/dist/dts/features/Workspace/NotebookCard.js.map +1 -1
  161. package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.d.ts.map +1 -1
  162. package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.js +3 -3
  163. package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.js.map +1 -1
  164. package/dist/dts/features/Workspace/StatusAndControls.d.ts.map +1 -1
  165. package/dist/dts/features/Workspace/StatusAndControls.js +2 -2
  166. package/dist/dts/features/Workspace/StatusAndControls.js.map +1 -1
  167. package/dist/dts/features/Workspace/Workspace.d.ts.map +1 -1
  168. package/dist/dts/features/Workspace/Workspace.js +1 -0
  169. package/dist/dts/features/Workspace/Workspace.js.map +1 -1
  170. package/dist/dts/features/Workspace/WorkspaceNotebookPanelWithControls.d.ts.map +1 -1
  171. package/dist/dts/features/Workspace/WorkspaceNotebookPanelWithControls.js +1 -3
  172. package/dist/dts/features/Workspace/WorkspaceNotebookPanelWithControls.js.map +1 -1
  173. package/dist/dts/features/Workspace/WorkspacePanel.d.ts.map +1 -1
  174. package/dist/dts/features/Workspace/WorkspacePanel.js +9 -10
  175. package/dist/dts/features/Workspace/WorkspacePanel.js.map +1 -1
  176. package/dist/dts/features/Workspace/WorkspaceProvider.d.ts.map +1 -1
  177. package/dist/dts/features/Workspace/WorkspaceProvider.js +0 -1
  178. package/dist/dts/features/Workspace/WorkspaceProvider.js.map +1 -1
  179. package/dist/dts/features/Workspace/WorkspaceStatusProvider.d.ts +1 -2
  180. package/dist/dts/features/Workspace/WorkspaceStatusProvider.d.ts.map +1 -1
  181. package/dist/dts/features/Workspace/WorkspaceStatusProvider.js +27 -56
  182. package/dist/dts/features/Workspace/WorkspaceStatusProvider.js.map +1 -1
  183. package/dist/dts/features/Workspace/types.d.ts +0 -10
  184. package/dist/dts/features/Workspace/types.d.ts.map +1 -1
  185. package/dist/dts/features/Workspace/types.js +1 -10
  186. package/dist/dts/features/Workspace/types.js.map +1 -1
  187. package/dist/dts/index.d.ts +2 -3
  188. package/dist/dts/index.d.ts.map +1 -1
  189. package/dist/dts/index.js +2 -3
  190. package/dist/dts/index.js.map +1 -1
  191. package/dist/dts/lib/session/session.d.ts.map +1 -1
  192. package/dist/dts/lib/session/session.js +7 -7
  193. package/dist/dts/lib/session/session.js.map +1 -1
  194. package/dist/dts/pages/Theme/index.d.ts.map +1 -1
  195. package/dist/dts/utils/date.d.ts +6 -0
  196. package/dist/dts/utils/date.d.ts.map +1 -1
  197. package/dist/dts/utils/date.js +12 -0
  198. package/dist/dts/utils/date.js.map +1 -1
  199. package/dist/dts/utils/icons.d.ts +18 -0
  200. package/dist/dts/utils/icons.d.ts.map +1 -0
  201. package/dist/dts/utils/icons.js +18 -0
  202. package/dist/dts/utils/icons.js.map +1 -0
  203. package/dist/dts/utils/index.d.ts +0 -1
  204. package/dist/dts/utils/index.d.ts.map +1 -1
  205. package/dist/dts/utils/index.js +0 -1
  206. package/dist/dts/utils/index.js.map +1 -1
  207. package/dist/dts/utils/time.d.ts +0 -15
  208. package/dist/dts/utils/time.d.ts.map +1 -1
  209. package/dist/dts/utils/time.js +0 -105
  210. package/dist/dts/utils/time.js.map +1 -1
  211. package/dist/esm/index.js +231 -175
  212. package/dist/esm/index.js.map +1 -1
  213. package/dist/index.d.ts +15 -45
  214. package/dist/tsconfig.tsbuildinfo +1 -1
  215. package/package.json +3 -3
  216. package/dist/dts/features/CohortBuilder/CohortManager.d.ts.map +0 -1
  217. package/dist/dts/features/CohortBuilder/CohortManager.js +0 -17
  218. package/dist/dts/features/CohortBuilder/CohortManager.js.map +0 -1
  219. package/dist/dts/features/CohortBuilder/CohortSelector.d.ts.map +0 -1
  220. package/dist/dts/features/CohortBuilder/CohortSelector.js +0 -20
  221. package/dist/dts/features/CohortBuilder/CohortSelector.js.map +0 -1
  222. package/dist/dts/features/CohortBuilder/QueryExpressionSection.d.ts.map +0 -1
  223. package/dist/dts/features/CohortBuilder/QueryExpressionSection.js.map +0 -1
  224. package/dist/dts/features/CohortBuilder/QueryExpressionsExpandedContext.d.ts.map +0 -1
  225. package/dist/dts/features/CohortBuilder/QueryExpressionsExpandedContext.js.map +0 -1
  226. package/dist/dts/features/CohortBuilder/QueryRepresentation.d.ts.map +0 -1
  227. package/dist/dts/features/CohortBuilder/QueryRepresentation.js.map +0 -1
  228. package/dist/dts/features/CohortBuilder/QueryRepresentationLabel.d.ts.map +0 -1
  229. package/dist/dts/features/CohortBuilder/QueryRepresentationLabel.js.map +0 -1
  230. package/dist/dts/features/Dictionary/metadata/MetadataDictionary.d.ts +0 -7
  231. package/dist/dts/features/Dictionary/metadata/MetadataDictionary.d.ts.map +0 -1
  232. package/dist/dts/features/Dictionary/metadata/MetadataDictionary.js +0 -39
  233. package/dist/dts/features/Dictionary/metadata/MetadataDictionary.js.map +0 -1
  234. package/dist/dts/features/Dictionary/metadata/MetadataPropertiesTable.d.ts +0 -9
  235. package/dist/dts/features/Dictionary/metadata/MetadataPropertiesTable.d.ts.map +0 -1
  236. package/dist/dts/features/Dictionary/metadata/MetadataPropertiesTable.js +0 -113
  237. package/dist/dts/features/Dictionary/metadata/MetadataPropertiesTable.js.map +0 -1
  238. package/dist/dts/features/Dictionary/metadata/registerApp.d.ts +0 -3
  239. package/dist/dts/features/Dictionary/metadata/registerApp.d.ts.map +0 -1
  240. package/dist/dts/features/Dictionary/metadata/registerApp.js +0 -13
  241. package/dist/dts/features/Dictionary/metadata/registerApp.js.map +0 -1
  242. package/dist/dts/features/Dictionary/metadata/types.d.ts +0 -17
  243. package/dist/dts/features/Dictionary/metadata/types.d.ts.map +0 -1
  244. package/dist/dts/features/Dictionary/metadata/types.js +0 -2
  245. package/dist/dts/features/Dictionary/metadata/types.js.map +0 -1
  246. /package/dist/dts/features/CohortBuilder/{QueryExpressionsExpandedContext.d.ts → QueryExpression/QueryExpressionsExpandedContext.d.ts} +0 -0
  247. /package/dist/dts/features/CohortBuilder/{QueryExpressionsExpandedContext.js → QueryExpression/QueryExpressionsExpandedContext.js} +0 -0
  248. /package/dist/dts/features/CohortBuilder/{QueryRepresentationLabel.d.ts → QueryExpression/QueryRepresentationLabel.d.ts} +0 -0
  249. /package/dist/dts/features/CohortBuilder/{QueryRepresentationLabel.js → QueryExpression/QueryRepresentationLabel.js} +0 -0
  250. /package/dist/dts/features/{CohortBuilder → CohortDiscovery}/CohortManager.d.ts +0 -0
@@ -1,4 +1,55 @@
1
- import { useCoreSelector, selectCohortFilters } from '@gen3/core';
1
+ import { useCoreSelector, selectCohortFilters, useCoreDispatch, selectAvailableCohorts, setActiveCohortList, } from '@gen3/core';
2
+ export var useSetupInitialCohorts = function () {
3
+ // const [fetched, setFetched] = useState(false);
4
+ // const cohortsListData = undefined;
5
+ // const isSuccess = true;
6
+ // const isError = false;
7
+ // TODO: load cohorts from DataLibrary
8
+ // const {
9
+ // data: cohortsListData,
10
+ // isSuccess,
11
+ // isError,
12
+ // } = useGetCohortsByContextIdQuery(null, { skip: fetched });
13
+ var coreDispatch = useCoreDispatch();
14
+ var cohorts = useCoreSelector(function (state) { return selectAvailableCohorts(state); });
15
+ if (cohorts.length === 0) {
16
+ coreDispatch(setActiveCohortList([])); // will create caseSet if needed
17
+ }
18
+ return true;
19
+ // const updatedCohortIds = (cohortsListData || []).map(
20
+ // (cohort: Cohort) => cohort.id,
21
+ // );
22
+ // const outdatedCohortsIds = cohorts
23
+ // .filter((c) => c.saved && !updatedCohortIds.includes(c.id))
24
+ // .map((c) => c.id);
25
+ //
26
+ // useDeepCompareEffect(() => {
27
+ // if ((isSuccess || isError) && !fetched) {
28
+ // const updatedList: Cohort[] = (cohortsListData || []).map(
29
+ // (data: Cohort) => {
30
+ // const existingCohort = cohorts.find((c) => c.id === data.id);
31
+ // return existingCohort?.modified
32
+ // ? existingCohort
33
+ // : {
34
+ // id: data.id,
35
+ // name: data.name,
36
+ // filters: buildGqlOperationToFilterSet(data.filters),
37
+ // modified_datetime: data.modified_datetime,
38
+ // saved: true,
39
+ // modified: false,
40
+ // };
41
+ // },
42
+ // );
43
+ //
44
+ // coreDispatch(setActiveCohortList(updatedList)); // will create caseSet if needed
45
+ // // A saved cohort that's not present in the API response has been deleted in another session
46
+ // for (const id of outdatedCohortsIds) {
47
+ // coreDispatch(removeCohort({ id }));
48
+ // }
49
+ // setFetched(true);
50
+ // }, []);
51
+ // return fetched;
52
+ };
2
53
  export var useCohortFacetFilters = function (index) {
3
54
  return useCoreSelector(function (state) { return selectCohortFilters(state)[index]; });
4
55
  };
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../src/features/CohortBuilder/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAa,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE7E,MAAM,CAAC,IAAM,qBAAqB,GAAG,UAAC,KAAY;IAChD,OAAO,eAAe,CAAC,UAAC,KAAK,IAAK,OAAA,mBAAmB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAjC,CAAiC,CAAC,CAAC;AACvE,CAAC,CAAC"}
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../src/features/CohortBuilder/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,GAGpB,MAAM,YAAY,CAAC;AAKpB,MAAM,CAAC,IAAM,sBAAsB,GAAG;IACpC,iDAAiD;IACjD,qCAAqC;IACrC,0BAA0B;IAC1B,yBAAyB;IAEzB,sCAAsC;IACtC,UAAU;IACV,2BAA2B;IAC3B,eAAe;IACf,aAAa;IACb,8DAA8D;IAE9D,IAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,IAAM,OAAO,GAAG,eAAe,CAAC,UAAC,KAAK,IAAK,OAAA,sBAAsB,CAAC,KAAK,CAAC,EAA7B,CAA6B,CAAC,CAAC;IAE1E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,YAAY,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,gCAAgC;IACzE,CAAC;IAED,OAAO,IAAI,CAAC;IAEZ,wDAAwD;IACxD,mCAAmC;IACnC,KAAK;IACL,qCAAqC;IACrC,gEAAgE;IAChE,uBAAuB;IACvB,EAAE;IACF,+BAA+B;IAC/B,8CAA8C;IAC9C,iEAAiE;IACjE,4BAA4B;IAC5B,wEAAwE;IACxE,0CAA0C;IAC1C,6BAA6B;IAC7B,gBAAgB;IAChB,6BAA6B;IAC7B,iCAAiC;IACjC,qEAAqE;IACrE,2DAA2D;IAC3D,6BAA6B;IAC7B,iCAAiC;IACjC,iBAAiB;IACjB,WAAW;IACX,SAAS;IACT,EAAE;IACF,uFAAuF;IACvF,mGAAmG;IACnG,6CAA6C;IAC7C,4CAA4C;IAC5C,QAAQ;IAER,sBAAsB;IACtB,UAAU;IAEV,kBAAkB;AACpB,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,qBAAqB,GAAG,UAAC,KAAa;IACjD,OAAO,eAAe,CAAC,UAAC,KAAK,IAAK,OAAA,mBAAmB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAjC,CAAiC,CAAC,CAAC;AACvE,CAAC,CAAC"}
@@ -1,4 +1,10 @@
1
1
  export declare const SecondaryTabStyle: string;
2
2
  export declare const getCombinedClassesExpandCollapseQuery: (allQueryExpressionsCollapsed: boolean) => string;
3
3
  export declare const getCombinedClassesForRowCollapse: (filtersSectionCollapsed: boolean) => string;
4
+ interface CohortGroupButtonProps {
5
+ disabled?: boolean;
6
+ $isDiscard?: boolean;
7
+ }
8
+ export declare const CohortGroupButton: import("tailwind-styled-components/dist/tailwind").TailwindComponent<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, CohortGroupButtonProps>;
9
+ export {};
4
10
  //# sourceMappingURL=style.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortBuilder/style.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,QAMY,CAAC;AAE3C,eAAO,MAAM,qCAAqC,iCAClB,OAAO,WAWtC,CAAC;AAEF,eAAO,MAAM,gCAAgC,4BAClB,OAAO,WAWjC,CAAC"}
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortBuilder/style.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,QAMY,CAAC;AAE3C,eAAO,MAAM,qCAAqC,iCAClB,OAAO,WAWtC,CAAC;AAEF,eAAO,MAAM,gCAAgC,4BAClB,OAAO,WAWjC,CAAC;AAEF,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,6MAiB7B,CAAC"}
@@ -1,3 +1,8 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import tw from 'tailwind-styled-components';
1
6
  export var SecondaryTabStyle = 'flex flex-row items-center bg-base-max text-primary border font-medium ' +
2
7
  'border-solid border-primary hover:bg-secondary-darker ' +
3
8
  'hover:text-secondary-content-lightest rounded-md first:border-r-0 ' +
@@ -22,4 +27,10 @@ export var getCombinedClassesForRowCollapse = function (filtersSectionCollapsed)
22
27
  var enabledHoverClasses = 'enabled:hover:bg-primary-darkest enabled:hover:text-primary-content-lightest enabled:hover:border-primary-darkest';
23
28
  return "".concat(disabledClasses, " ").concat(enabledHoverClasses, " ").concat(baseClasses, " ").concat(dynamicClasses);
24
29
  };
30
+ export var CohortGroupButton = tw.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n", "\n", "\nh-12\nw-12\nflex\njustify-center\nitems-center\ntransition-colors\nfocus-visible:outline-none\nfocus-visible:ring-offset-2\nfocus-visible:ring-inset\nfocus-visible:ring-2\nfocus-visible:ring-focusColor\n"], ["\n", "\n", "\nh-12\nw-12\nflex\njustify-center\nitems-center\ntransition-colors\nfocus-visible:outline-none\nfocus-visible:ring-offset-2\nfocus-visible:ring-inset\nfocus-visible:ring-2\nfocus-visible:ring-focusColor\n"])), function (p) {
31
+ return p.disabled
32
+ ? 'opacity-50 bg-base-max text-primary'
33
+ : 'text-primary hover:bg-primary-darkest hover:text-primary-content-lightest bg-base-max';
34
+ }, function (p) { return (p.$isDiscard ? 'rounded-l' : 'rounded'); });
35
+ var templateObject_1;
25
36
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sourceRoot":"","sources":["../../../../src/features/CohortBuilder/style.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,iBAAiB,GAC5B,yEAAyE;IACzE,wDAAwD;IACxD,oEAAoE;IACpE,2DAA2D;IAC3D,kDAAkD;IAClD,wCAAwC,CAAC;AAE3C,MAAM,CAAC,IAAM,qCAAqC,GAAG,UACnD,4BAAqC;IAErC,IAAM,WAAW,GACf,6DAA6D,CAAC;IAChE,IAAM,cAAc,GAAG,4BAA4B;QACjD,CAAC,CAAC,0BAA0B;QAC5B,CAAC,CAAC,8BAA8B,CAAC;IACnC,IAAM,eAAe,GAAG,qBAAqB,CAAC;IAC9C,IAAM,mBAAmB,GACvB,mHAAmH,CAAC;I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CAAC,CAAC,8BAA8B,CAAC;IACnC,IAAM,eAAe,GACnB,gEAAgE,CAAC;IACnE,IAAM,mBAAmB,GACvB,mHAAmH,CAAC;IACtH,OAAO,UAAG,eAAe,cAAI,mBAAmB,cAAI,WAAW,cAAI,cAAc,CAAE,CAAC;AACtF,CAAC,CAAC;AAOF,MAAM,CAAC,IAAM,iBAAiB,GAAG,EAAE,CAAC,MAAM,8RAAwB,IAChE,EAG2F,IAC3F,EAAuE,+MAYxE,KAhBC,UAAC,CAAyB;IAC1B,OAAA,CAAC,CAAC,QAAQ;QACR,CAAC,CAAC,qCAAqC;QACvC,CAAC,CAAC,uFAAuF;AAF3F,CAE2F,EAC3F,UAAC,CAAyB,IAAK,OAAA,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,EAAxC,CAAwC,CAYxE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChartsAndFacetsPanel.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/ChartsAndFacetsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EAGL,eAAe,EAOhB,MAAM,YAAY,CAAC;AAiBpB,UAAU,yBAAyB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;CAChC;AAED;;;;;;GAMG;AACH,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAmF7D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"ChartsAndFacetsPanel.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/ChartsAndFacetsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEL,eAAe,EAGhB,MAAM,YAAY,CAAC;AAgBpB,UAAU,yBAAyB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;CAChC;AAED;;;;;;GAMG;AACH,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAmF7D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1,12 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Grid } from '@mantine/core';
3
- import { extractEnumFilterValue, fieldNameToTitle, selectIndexFilters, useCoreSelector, useGetAggsQuery, } from '@gen3/core';
3
+ import { extractEnumFilterValue, fieldNameToTitle, useGetAggsQuery, } from '@gen3/core';
4
+ import { useAppSelector } from './appApi';
4
5
  import { useDeepCompareCallback, useDeepCompareMemo } from 'use-deep-compare';
5
- import { extractRangeValues, processBucketData, processRangeData, useGetFacetFilters, useUpdateFilters, } from '../../components/facets';
6
+ import { extractRangeValues, processBucketData, processRangeData, } from '../../components/facets';
6
7
  import { partial } from 'lodash';
7
- import { useClearFilters } from '../../components/facets/hooks';
8
8
  import { createFacetPanel } from './FilterPanels/createFacetPanel';
9
9
  import { computeRowSpan } from '../../components/charts';
10
+ import { selectIndexFilters } from './CohortSelectors';
11
+ import { useClearFilters, useGetFacetFilters, useUpdateFilters } from './hooks';
10
12
  /**
11
13
  * CartsAndFacetsPanel component
12
14
  *
@@ -16,7 +18,7 @@ import { computeRowSpan } from '../../components/charts';
16
18
  */
17
19
  var ChartsAndFacetsPanel = function (_a) {
18
20
  var index = _a.index, facets = _a.facets;
19
- var cohortFilters = useCoreSelector(function (state) {
21
+ var cohortFilters = useAppSelector(function (state) {
20
22
  return selectIndexFilters(state, index);
21
23
  });
22
24
  var _b = useGetAggsQuery({
@@ -1 +1 @@
1
- {"version":3,"file":"ChartsAndFacetsPanel.js","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/ChartsAndFacetsPanel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAc,MAAM,eAAe,C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ACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CohortManager.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/CohortManager.tsx"],"names":[],"mappings":"AAgBA,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,QAAA,MAAM,aAAa,cAAe,kBAAkB,4CA0DnD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCohortFacetFilters } from './hooks';
3
+ import QueryExpressionSection from '../CohortBuilder/QueryExpression/QueryExpressionSection';
4
+ import { QueryExpressionContext } from '../CohortBuilder/QueryExpression/QueryExpressionContext';
5
+ import { useAppSelector, useAppDispatch } from './appApi';
6
+ import { selectCurrentCohortId, selectCurrentCohortName, } from './CohortSelectors';
7
+ import { clearCohortFilters, removeCohortFilter, updateCohortFilter, setCohortFilter, } from './CohortSlice';
8
+ var CohortManager = function (_a) {
9
+ var index = _a.index;
10
+ var currentCohortId = useAppSelector(function (state) {
11
+ return selectCurrentCohortId(state);
12
+ });
13
+ var currentCohortName = useAppSelector(function (state) {
14
+ return selectCurrentCohortName(state);
15
+ });
16
+ var filters = useCohortFacetFilters(index);
17
+ return (_jsx("div", { className: "flex flex-col mb-2", children: _jsx(QueryExpressionContext.Provider, { value: {
18
+ cohortName: currentCohortName,
19
+ cohortId: currentCohortId,
20
+ filters: filters,
21
+ displayOnly: false,
22
+ useClearCohortFilters: function () {
23
+ var dispatch = useAppDispatch();
24
+ return function (index) { return dispatch(clearCohortFilters({ index: index })); };
25
+ },
26
+ useRemoveFilter: function () {
27
+ var dispatch = useAppDispatch();
28
+ return function (index, field) {
29
+ return dispatch(removeCohortFilter({
30
+ index: index,
31
+ field: field,
32
+ }));
33
+ };
34
+ },
35
+ useUpdateFilters: function () {
36
+ var dispatch = useAppDispatch();
37
+ return function (index, field, filter) {
38
+ return dispatch(updateCohortFilter({
39
+ index: index,
40
+ field: field,
41
+ filter: filter,
42
+ }));
43
+ };
44
+ },
45
+ useSetCohortFilters: function () {
46
+ var dispatch = useAppDispatch();
47
+ return function (index, filters) {
48
+ return dispatch(setCohortFilter({
49
+ index: index,
50
+ filters: filters,
51
+ }));
52
+ };
53
+ },
54
+ }, children: _jsx(QueryExpressionSection, { index: index }) }) }));
55
+ };
56
+ export default CohortManager;
57
+ //# sourceMappingURL=CohortManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CohortManager.js","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/CohortManager.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,sBAAsB,MAAM,yDAAyD,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,yDAAyD,CAAC;AACjG,OAAO,EAAE,cAAc,EAAY,cAAc,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EACL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,GAChB,MAAM,eAAe,CAAC;AAMvB,IAAM,aAAa,GAAG,UAAC,EAA6B;QAA3B,KAAK,WAAA;IAC5B,IAAM,eAAe,GAAG,cAAc,CAAC,UAAC,KAAe;QACrD,OAAA,qBAAqB,CAAC,KAAK,CAAC;IAA5B,CAA4B,CAC7B,CAAC;IACF,IAAM,iBAAiB,GAAG,cAAc,CAAC,UAAC,KAAe;QACvD,OAAA,uBAAuB,CAAC,KAAK,CAAC;IAA9B,CAA8B,CAC/B,CAAC;IACF,IAAM,OAAO,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAE7C,OAAO,CACL,cAAK,SAAS,EAAC,oBAAoB,YACjC,KAAC,sBAAsB,CAAC,QAAQ,IAC9B,KAAK,EAAE;gBACL,UAAU,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ohortSlice';
3
+ import { AppState } from './appApi';
4
+ export declare const selectCohortFilters: (state: AppState) => IndexedFilterSet;
5
+ export declare const selectCurrentCohortId: (state: AppState) => string;
6
+ export declare const selectCurrentCohort: (state: AppState) => Cohort;
7
+ export declare const selectCurrentCohortName: (state: AppState) => string;
8
+ /**
9
+ * Select a filter by its name from the current cohort. If the filter is not found
10
+ * returns undefined.
11
+ * @param state - Core
12
+ * @param index which cohort index to select from
13
+ * @param name name of the filter to select
14
+ */
15
+ export declare const selectIndexedFilterByName: (state: AppState, index: string, name: string) => Operation | undefined;
16
+ /**
17
+ * Select a filter from the index.
18
+ * returns undefined.
19
+ * @param state - Core
20
+ * @param index which cohort index to select from
21
+ */
22
+ export declare const selectIndexFilters: (state: AppState, index: string) => FilterSet;
23
+ //# sourceMappingURL=CohortSelectors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CohortSelectors.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/CohortSelectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,eAAO,MAAM,mBAAmB,UAAW,QAAQ,KAAG,gBACxB,CAAC;AAC/B,eAAO,MAAM,qBAAqB,UAAW,QAAQ,KAAG,MAC/B,CAAC;AAC1B,eAAO,MAAM,mBAAmB,UAAW,QAAQ,KAAG,MAChC,CAAC;AACvB,eAAO,MAAM,uBAAuB,UAAW,QAAQ,KAAG,MAC/B,CAAC;AAC5B;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,UAC7B,QAAQ,SACR,MAAM,QACP,MAAM,KACX,SAAS,GAAG,SAEd,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,UACtB,QAAQ,SACR,MAAM,KACZ,SAEF,CAAC"}
@@ -0,0 +1,35 @@
1
+ export var selectCohortFilters = function (state) {
2
+ return state.cohorts.cohort.filters;
3
+ };
4
+ export var selectCurrentCohortId = function (state) {
5
+ return state.cohorts.cohort.id;
6
+ };
7
+ export var selectCurrentCohort = function (state) {
8
+ return state.cohorts.cohort;
9
+ };
10
+ export var selectCurrentCohortName = function (state) {
11
+ return state.cohorts.cohort.name;
12
+ };
13
+ /**
14
+ * Select a filter by its name from the current cohort. If the filter is not found
15
+ * returns undefined.
16
+ * @param state - Core
17
+ * @param index which cohort index to select from
18
+ * @param name name of the filter to select
19
+ */
20
+ export var selectIndexedFilterByName = function (state, index, name) {
21
+ var _a;
22
+ return (_a = state.cohorts.cohort.filters[index]) === null || _a === void 0 ? void 0 : _a.root[name];
23
+ };
24
+ var EmptyFilterSet = { mode: 'and', root: {} };
25
+ /**
26
+ * Select a filter from the index.
27
+ * returns undefined.
28
+ * @param state - Core
29
+ * @param index which cohort index to select from
30
+ */
31
+ export var selectIndexFilters = function (state, index) {
32
+ var _a, _b;
33
+ return (_b = (_a = state.cohorts.cohort.filters) === null || _a === void 0 ? void 0 : _a[index]) !== null && _b !== void 0 ? _b : EmptyFilterSet; // TODO: check if this is undefined
34
+ };
35
+ //# sourceMappingURL=CohortSelectors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CohortSelectors.js","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/CohortSelectors.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,KAAe;IACjD,OAAA,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO;AAA5B,CAA4B,CAAC;AAC/B,MAAM,CAAC,IAAM,qBAAqB,GAAG,UAAC,KAAe;IACnD,OAAA,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AAAvB,CAAuB,CAAC;AAC1B,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,KAAe;IACjD,OAAA,KAAK,CAAC,OAAO,CAAC,MAAM;AAApB,CAAoB,CAAC;AACvB,MAAM,CAAC,IAAM,uBAAuB,GAAG,UAAC,KAAe;IACrD,OAAA,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI;AAAzB,CAAyB,CAAC;AAC5B;;;;;;GAMG;AACH,MAAM,CAAC,IAAM,yBAAyB,GAAG,UACvC,KAAe,EACf,KAAa,EACb,IAAY;;IAEZ,OAAO,MAAA,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,0CAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AACzD,CAAC,CAAC;AACF,IAAM,cAAc,GAAc,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AAC5D;;;;;GAKG;AACH,MAAM,CAAC,IAAM,kBAAkB,GAAG,UAChC,KAAe,EACf,KAAa;;IAEb,OAAO,MAAA,MAAA,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,0CAAG,KAAK,CAAC,mCAAI,cAAc,CAAC,CAAC,mCAAmC;AACrG,CAAC,CAAC"}
@@ -0,0 +1,91 @@
1
+ import { Draft, type PayloadAction } from '@reduxjs/toolkit';
2
+ import { FilterSet, IndexedFilterSet, Operation } from '@gen3/core';
3
+ export interface Cohort {
4
+ readonly id: string;
5
+ readonly name: string;
6
+ readonly filters: IndexedFilterSet;
7
+ readonly modified?: boolean;
8
+ readonly modified_datetime: string;
9
+ }
10
+ export interface CohortState {
11
+ cohort: Cohort;
12
+ }
13
+ interface UpdateFilterParams {
14
+ index: string;
15
+ field: string;
16
+ filter: Operation;
17
+ }
18
+ interface SetFilterParams {
19
+ index: string;
20
+ filters: FilterSet;
21
+ }
22
+ interface RemoveFilterParams {
23
+ index: string;
24
+ field: string;
25
+ }
26
+ interface ClearAllFilterParams {
27
+ index: string;
28
+ }
29
+ /**
30
+ * Redux slice for cohort filters
31
+ */
32
+ export declare const cohortSlice: import("@reduxjs/toolkit").Slice<CohortState, {
33
+ updateCohortFilter: (state: Draft<CohortState>, action: PayloadAction<UpdateFilterParams>) => {
34
+ cohort: {
35
+ filters: {
36
+ [x: string]: import("immer").WritableDraft<FilterSet> | {
37
+ mode: "and" | "or";
38
+ root: {
39
+ [x: string]: Operation | import("immer").WritableDraft<import("@gen3/core").Intersection> | import("immer").WritableDraft<import("@gen3/core").Union> | import("immer").WritableDraft<import("@gen3/core").Includes> | import("immer").WritableDraft<import("@gen3/core").Equals> | import("immer").WritableDraft<import("@gen3/core").NotEquals> | import("immer").WritableDraft<import("@gen3/core").LessThan> | import("immer").WritableDraft<import("@gen3/core").LessThanOrEquals> | import("immer").WritableDraft<import("@gen3/core").GreaterThan> | import("immer").WritableDraft<import("@gen3/core").GreaterThanOrEquals> | import("immer").WritableDraft<import("@gen3/core").NestedFilter> | import("immer").WritableDraft<import("@gen3/core").ExcludeIfAny> | import("immer").WritableDraft<import("@gen3/core").Excludes>;
40
+ };
41
+ };
42
+ };
43
+ id: string;
44
+ name: string;
45
+ modified?: boolean | undefined;
46
+ modified_datetime: string;
47
+ };
48
+ };
49
+ setCohortFilter: (state: Draft<CohortState>, action: PayloadAction<SetFilterParams>) => {
50
+ cohort: {
51
+ filters: {
52
+ [x: string]: FilterSet | import("immer").WritableDraft<FilterSet>;
53
+ };
54
+ id: string;
55
+ name: string;
56
+ modified?: boolean | undefined;
57
+ modified_datetime: string;
58
+ };
59
+ };
60
+ removeCohortFilter: (state: Draft<CohortState>, action: PayloadAction<RemoveFilterParams>) => {
61
+ cohort: {
62
+ filters: {
63
+ [x: string]: import("immer").WritableDraft<FilterSet> | {
64
+ mode: "and" | "or";
65
+ root: {
66
+ [x: string]: import("immer").WritableDraft<import("@gen3/core").Intersection> | import("immer").WritableDraft<import("@gen3/core").Union> | import("immer").WritableDraft<import("@gen3/core").Includes> | import("immer").WritableDraft<import("@gen3/core").Equals> | import("immer").WritableDraft<import("@gen3/core").NotEquals> | import("immer").WritableDraft<import("@gen3/core").LessThan> | import("immer").WritableDraft<import("@gen3/core").LessThanOrEquals> | import("immer").WritableDraft<import("@gen3/core").GreaterThan> | import("immer").WritableDraft<import("@gen3/core").GreaterThanOrEquals> | import("immer").WritableDraft<import("@gen3/core").NestedFilter> | import("immer").WritableDraft<import("@gen3/core").ExcludeIfAny> | import("immer").WritableDraft<import("@gen3/core").Excludes>;
67
+ };
68
+ };
69
+ };
70
+ id: string;
71
+ name: string;
72
+ modified?: boolean | undefined;
73
+ modified_datetime: string;
74
+ };
75
+ } | undefined;
76
+ clearCohortFilters: (state: Draft<CohortState>, action: PayloadAction<ClearAllFilterParams>) => {
77
+ cohort: {
78
+ filters: {
79
+ [x: string]: FilterSet | import("immer").WritableDraft<FilterSet>;
80
+ };
81
+ id: string;
82
+ name: string;
83
+ modified?: boolean | undefined;
84
+ modified_datetime: string;
85
+ };
86
+ };
87
+ }, "cohort", "cohort", import("@reduxjs/toolkit").SliceSelectors<CohortState>>;
88
+ export declare const updateCohortFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<UpdateFilterParams, "cohort/updateCohortFilter">, setCohortFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<SetFilterParams, "cohort/setCohortFilter">, removeCohortFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<RemoveFilterParams, "cohort/removeCohortFilter">, clearCohortFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<ClearAllFilterParams, "cohort/clearCohortFilters">;
89
+ export declare const cohortReducer: import("redux").Reducer<CohortState>;
90
+ export {};
91
+ //# sourceMappingURL=CohortSlice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CohortSlice.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/CohortSlice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEpE,MAAM,WA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wGAClB,eAAe,kGACf,kBAAkB,wGAClB,kBAAkB,wGACG,CAAC;AAExB,eAAO,MAAM,aAAa,sCAAsB,CAAC"}
@@ -0,0 +1,93 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ var _b;
24
+ import { createSlice } from '@reduxjs/toolkit';
25
+ var initialCohortState = {
26
+ cohort: {
27
+ id: 'default',
28
+ name: 'Filters',
29
+ filters: {},
30
+ modified_datetime: new Date().toISOString(),
31
+ },
32
+ };
33
+ /**
34
+ * Redux slice for cohort filters
35
+ */
36
+ export var cohortSlice = createSlice({
37
+ name: 'cohort',
38
+ initialState: initialCohortState,
39
+ reducers: {
40
+ // adds a filter to the cohort filter set at the given index
41
+ updateCohortFilter: function (state, action) {
42
+ var _b, _c;
43
+ var _d, _e, _f, _g, _h, _j;
44
+ var _k = action.payload, index = _k.index, field = _k.field, filter = _k.filter;
45
+ return {
46
+ cohort: __assign(__assign({}, state.cohort), { filters: __assign(__assign({}, state.cohort.filters), (_b = {}, _b[index] = {
47
+ mode: (_f = (_e = (_d = state.cohort.filters) === null || _d === void 0 ? void 0 : _d[index]) === null || _e === void 0 ? void 0 : _e.mode) !== null && _f !== void 0 ? _f : 'and',
48
+ root: __assign(__assign({}, ((_j = (_h = (_g = state.cohort.filters) === null || _g === void 0 ? void 0 : _g[index]) === null || _h === void 0 ? void 0 : _h.root) !== null && _j !== void 0 ? _j : {})), (_c = {}, _c[field] = filter, _c)),
49
+ }, _b)) }),
50
+ };
51
+ },
52
+ setCohortFilter: function (state, action) {
53
+ var _b;
54
+ var _c = action.payload, index = _c.index, filters = _c.filters;
55
+ return {
56
+ cohort: __assign(__assign({}, state.cohort), { filters: __assign(__assign({}, state.cohort.filters), (_b = {}, _b[index] = filters, _b)) }),
57
+ };
58
+ },
59
+ // removes a filter to the cohort filter set at the given index
60
+ removeCohortFilter: function (state, action) {
61
+ var _b;
62
+ var _c, _d, _e;
63
+ var _f = action.payload, index = _f.index, field = _f.field;
64
+ var filters = (_e = (_d = (_c = state.cohort) === null || _c === void 0 ? void 0 : _c.filters) === null || _d === void 0 ? void 0 : _d[index]) === null || _e === void 0 ? void 0 : _e.root;
65
+ if (!filters) {
66
+ return;
67
+ }
68
+ var _g = filters, _h = field, _a = _g[_h], updated = __rest(_g, [typeof _h === "symbol" ? _h : _h + ""]);
69
+ return {
70
+ cohort: __assign(__assign({}, state.cohort), { filters: __assign(__assign({}, state.cohort.filters), (_b = {}, _b[index] = {
71
+ mode: state.cohort.filters[index].mode,
72
+ root: updated,
73
+ }, _b)) }),
74
+ };
75
+ },
76
+ // removes all filters from the cohort filter set at the given index
77
+ clearCohortFilters: function (state, action) {
78
+ var _b;
79
+ var index = action.payload.index;
80
+ return {
81
+ cohort: __assign(__assign({}, state.cohort), { filters: __assign(__assign({}, state.cohort.filters), (_b = {}, _b[index] = {
82
+ // empty filter set
83
+ mode: 'and',
84
+ root: {},
85
+ }, _b)) }),
86
+ };
87
+ },
88
+ },
89
+ });
90
+ // Filter actions: addFilter, removeFilter, updateFilter
91
+ export var updateCohortFilter = (_b = cohortSlice.actions, _b.updateCohortFilter), setCohortFilter = _b.setCohortFilter, removeCohortFilter = _b.removeCohortFilter, clearCohortFilters = _b.clearCohortFilters;
92
+ export var cohortReducer = cohortSlice.reducer;
93
+ //# sourceMappingURL=CohortSlice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CohortSlice.js","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/CohortSlice.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAA6B,MAAM,kBAAkB,CAAC;AAe1E,IAAM,kBAAkB,GAAgB;IACtC,MAAM,EAAE;QACN,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,EAAE;QACX,iBAAiB,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KAC5C;CACF,CAAC;AAsBF;;GAEG;AAEH,MAAM,CAAC,IAAM,WAAW,GAAG,WAAW,CAAC;IACrC,IAAI,EAAE,QAAQ;IACd,YAAY,EAAE,kBAAkB;IAChC,QAAQ,EAAE;QACR,4DAA4D;QAC5D,kBAAkB,EAAE,UAClB,KAAyB,EACzB,MAAyC;;;YAEnC,IAAA,KAA2B,MAAM,CAAC,OAAO,EAAvC,KAAK,WAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAmB,CAAC;YAChD,OAAO;gBACL,MAAM,wBACD,KAAK,CAAC,MAAM,KACf,OAAO,wBACF,KAAK,CAAC,MAAM,CAAC,OAAO,gBACtB,KAAK,IAAG;wBACP,IAAI,EAAE,MAAA,MAAA,MAAA,KAAK,CAAC,MAAM,CAAC,OAAO,0CAAG,KAAK,CAAC,0CAAE,IAAI,mCAAI,KAAK;wBAClD,IAAI,wBACC,CAAC,MAAA,MAAA,MAAA,KAAK,CAAC,MAAM,CAAC,OAAO,0CAAG,KAAK,CAAC,0CAAE,IAAI,mCAAI,EAAE,CAAC,gBAC7C,KAAK,IAAG,MAAM,MAChB;qBACF,SAEJ;aACF,CAAC;QACJ,CAAC;QACD,eAAe,EAAE,UACf,KAAyB,EACzB,MAAsC;;Y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,CAAC;KACF;CACF,CAAC,CAAC;AAEH,wDAAwD;AACxD,MAAM,CACJ,IAAA,kBAAkB,IADP,KAKT,WAAW,CAAC,OAAO,wBAJH,EAClB,eAAe,qBAAA,EACf,kBAAkB,wBAAA,EAClB,kBAAkB,wBAAA,CACI;AAExB,MAAM,CAAC,IAAM,aAAa,GAAG,WAAW,CAAC,OAAO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createFacetPanel.d.ts","sourceRoot":"","sources":["../../../../../src/features/CohortDiscovery/FilterPanels/createFacetPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,eAAe,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAuB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,eAAO,MAAM,gBAAgB,UACpB,eAAe,aACX,MAAM,cACL,MAAM,SACX,uBAAuB,KAC7B,YAAY,GAAG,IAajB,CAAC"}
1
+ {"version":3,"file":"createFacetPanel.d.ts","sourceRoot":"","sources":["../../../../../src/features/CohortDiscovery/FilterPanels/createFacetPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAuB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,eAAO,MAAM,gBAAgB,UACpB,eAAe,aACX,MAAM,cACL,MAAM,SACX,uBAAuB,KAC7B,YAAY,GAAG,IAajB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"IndexPanel.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/IndexPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAW/C,QAAA,MAAM,UAAU,mCAAoC,oBAAoB,4CAgHvE,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"IndexPanel.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/IndexPanel.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAY/C,QAAA,MAAM,UAAU,mCAAoC,oBAAoB,4CAgHvE,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -24,12 +24,14 @@ import { useDeepCompareCallback, useDeepCompareEffect } from 'use-deep-compare';
24
24
  import { Flex, Stack } from '@mantine/core';
25
25
  import FacetSelectionPanel from './FacetSelectionPanel';
26
26
  import { useFilterExpandedState, useToggleExpandFilter } from './hooks';
27
- import { selectIndexFilters, useCoreSelector, useGetAggsQuery, } from '@gen3/core';
27
+ import { useGetAggsQuery } from '@gen3/core';
28
+ import { selectIndexFilters } from './CohortSelectors';
28
29
  import { getAllFieldsFromFilterConfigs, classifyFacets, } from '../../components/facets';
29
30
  import { ErrorCard } from '../../components/MessageCards';
30
31
  import ChartsAndFacetsPanel from './ChartsAndFacetsPanel';
31
32
  import ActionButtonGroup from './ActionButtonGroup';
32
- import CohortManager from '../CohortBuilder/CohortManager';
33
+ import CohortManager from '../CohortBuilder/CohortManager/CohortManager';
34
+ import { useAppSelector } from './appApi';
33
35
  var IndexPanel = function (_a) {
34
36
  var dataConfig = _a.dataConfig, tabs = _a.tabs, tabTitle = _a.tabTitle;
35
37
  var _b = useState([]), activeFieldDefinitions = _b[0], setActiveFieldDefinitions = _b[1];
@@ -37,7 +39,7 @@ var IndexPanel = function (_a) {
37
39
  var fields = useMemo(function () { return getAllFieldsFromFilterConfigs(tabs !== null && tabs !== void 0 ? tabs : []); }, [tabs]);
38
40
  var _c = useState({}), facetDefinitions = _c[0], setFacetDefinitions = _c[1];
39
41
  var _d = useState([]), categories = _d[0], setCategories = _d[1];
40
- var cohortFilters = useCoreSelector(function (state) {
42
+ var cohortFilters = useAppSelector(function (state) {
41
43
  return selectIndexFilters(state, index);
42
44
  });
43
45
  var queryFields = categories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E,cAAM,OAAA,UAAC,KAAa,IAAK,OAAA,IAAI,EAAJ,CAAI,EAAvB,CAAuB;4BAC7C,qBAAqB,EAAE,qBAAqB;4BAC5C,iBAAiB,EAAE,sBAAsB;yBAC1C,GACD,EACF,MAAC,KAAK,IAAC,SAAS,EAAC,QAAQ,aACvB,KAAC,iBAAiB,KAAG,EACrB,KAAC,oBAAoB,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,sBAAsB,GAAI,IAChE,IACH,IACD,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -5,6 +5,7 @@ declare const reducers: import("redux").Reducer<{
5
5
  filtersExpandedState: {
6
6
  [x: string]: boolean;
7
7
  };
8
+ cohorts: import("./CohortSlice").CohortState;
8
9
  }, import("redux").UnknownAction, Partial<{
9
10
  selectedIndexFacets: {
10
11
  [x: string]: string[];
@@ -12,6 +13,7 @@ declare const reducers: import("redux").Reducer<{
12
13
  filtersExpandedState: {
13
14
  [x: string]: boolean;
14
15
  } | undefined;
16
+ cohorts: import("./CohortSlice").CohortState | undefined;
15
17
  }>>;
16
18
  export declare const id: any, AppStore: any, AppContext: any, useAppSelector: any, useAppDispatch: any;
17
19
  export type AppState = ReturnType<typeof reducers>;
@@ -1 +1 @@
1
- {"version":3,"file":"appApi.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/appApi.ts"],"names":[],"mappings":"AAoBA,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;GAGZ,CAAC;AAEH,eAAO,MAAQ,EAAE,OAAE,QAAQ,OAAE,UAAU,OAAE,cAAc,OAAE,cAAc,KAKnE,CAAC;AAEL,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"appApi.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/appApi.ts"],"names":[],"mappings":"AAqBA,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;GAIZ,CAAC;AAEH,eAAO,MAAQ,EAAE,OAAE,QAAQ,OAAE,UAAU,OAAE,cAAc,OAAE,cAAc,KAKnE,CAAC;AAEL,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC"}
@@ -5,6 +5,7 @@ import storage from 'redux-persist/lib/storage';
5
5
  import { createAppStore } from '@gen3/core';
6
6
  import { filtersExpandedReducer } from './FilterExpandSlice';
7
7
  import { selectedFacetsReducer } from './SelectedFacetsSlice';
8
+ import { cohortReducer } from './CohortSlice';
8
9
  var _APP_NAME = 'CohortDiscovery';
9
10
  var persistConfig = {
10
11
  key: _APP_NAME,
@@ -18,6 +19,7 @@ var persistConfig = {
18
19
  var reducers = combineReducers({
19
20
  selectedIndexFacets: selectedFacetsReducer,
20
21
  filtersExpandedState: filtersExpandedReducer,
22
+ cohorts: cohortReducer,
21
23
  });
22
24
  export var id = (_a = createAppStore({
23
25
  reducers: persistReducer(persistConfig, reducers),
@@ -1 +1 @@
1
- {"version":3,"file":"appApi.js","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/appApi.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,OAAO,MAAM,2BAA2B,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,IAAM,SAAS,GAAG,iBAAiB,CAAC;AAEpC,IAAM,aAAa,GAAG;IACpB,GAAG,EAAE,SAAS;IACd,OAAO,EAAE,CAAC;IACV,OAAO,SAAA;IACP,SAAS,EAAE,CAAC,mBAAmB,CAAC;CACjC,CAAC;AAEF,gEAAgE;AAChE,oEAAoE;AACpE,2CAA2C;AAE3C,IAAM,Q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AC,aAAa,EAAE,QAAQ,CAAC;IACjD,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,OAAO;CACjB,CAAC,QALa,EAAE,QAAQ,cAAA,EAAE,UAAU,gBAAA,EAAE,cAAc,oBAAA,EAAE,cAAc,oBAAA,CAKlE"}
@@ -1,4 +1,14 @@
1
+ import { FilterSet, Operation } from '@gen3/core';
1
2
  export declare const useToggleExpandFilter: () => (field: string, expanded: boolean) => void;
2
3
  export declare const useFilterExpandedState: (field: string) => any;
3
4
  export declare const useAllFiltersCollapsed: () => any;
5
+ export declare const useCohortFacetFilters: (index: string) => FilterSet;
6
+ export declare const useClearFilters: (index: string) => (field: string) => void;
7
+ /**
8
+ * Update Guppy filters: process nested fields and have the final
9
+ * leaf be filtered
10
+ * @param index
11
+ */
12
+ export declare const useUpdateFilters: (index: string) => (field: string, filter: Operation) => void;
13
+ export declare const useGetFacetFilters: (index: string, field: string) => Operation;
4
14
  //# sourceMappingURL=hooks.d.ts.map